Add missing headers for compilation on x86 targets

Change-Id: I5f4dc797b353a0f01fa00d38375ec303bf863254
diff --git a/init/devices.c b/init/devices.c
index db229d3..036b8f7 100644
--- a/init/devices.c
+++ b/init/devices.c
@@ -15,6 +15,7 @@
  */
 
 #include <errno.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
diff --git a/init/keychords.c b/init/keychords.c
index 53ab391..892cbdf 100644
--- a/init/keychords.c
+++ b/init/keychords.c
@@ -17,9 +17,11 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <stdlib.h>
+#include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <linux/keychord.h>
+#include <unistd.h>
 
 #include "init.h"
 #include "log.h"
diff --git a/init/list.h b/init/list.h
index 0a7b28c..7b9ef32 100644
--- a/init/list.h
+++ b/init/list.h
@@ -17,6 +17,8 @@
 #ifndef _INIT_LIST_H_
 #define _INIT_LIST_H_
 
+#include <stddef.h>
+
 struct listnode
 {
     struct listnode *next;
diff --git a/libnetutils/dhcp_utils.c b/libnetutils/dhcp_utils.c
index cb0960f..f02a44a 100644
--- a/libnetutils/dhcp_utils.c
+++ b/libnetutils/dhcp_utils.c
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 #include <arpa/inet.h>
 #include <netinet/in.h>
diff --git a/libsysutils/src/FrameworkListener.cpp b/libsysutils/src/FrameworkListener.cpp
index 640b6df..4da8eb6 100644
--- a/libsysutils/src/FrameworkListener.cpp
+++ b/libsysutils/src/FrameworkListener.cpp
@@ -15,6 +15,7 @@
  */
 #include <errno.h>
 #include <string.h>
+#include <stdlib.h>
 
 #define LOG_TAG "FrameworkListener"
 
diff --git a/libsysutils/src/ServiceManager.cpp b/libsysutils/src/ServiceManager.cpp
index 60b161a..1ba6ef0 100644
--- a/libsysutils/src/ServiceManager.cpp
+++ b/libsysutils/src/ServiceManager.cpp
@@ -1,4 +1,5 @@
 #include <errno.h>
+#include <string.h>
 
 #include <sysutils/ServiceManager.h>
 
diff --git a/toolbox/cmp.c b/toolbox/cmp.c
index 9bd2e19..80635ad 100644
--- a/toolbox/cmp.c
+++ b/toolbox/cmp.c
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
diff --git a/toolbox/date.c b/toolbox/date.c
index 13b5210..35ef846 100644
--- a/toolbox/date.c
+++ b/toolbox/date.c
@@ -1,10 +1,12 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
 #include <time.h>
 #include <linux/android_alarm.h>
+#include <sys/ioctl.h>
 
 static void settime(char *s) {
     struct tm tm;
diff --git a/toolbox/dd.h b/toolbox/dd.h
index 794a464..cca1024 100644
--- a/toolbox/dd.h
+++ b/toolbox/dd.h
@@ -35,6 +35,8 @@
  *	@(#)dd.h	8.3 (Berkeley) 4/2/94
  */
 
+#include <stdint.h>
+
 /* Input/output stream state. */
 typedef struct {
 	u_char		*db;		/* buffer address */
diff --git a/toolbox/hd.c b/toolbox/hd.c
index 1f7d179..da31245 100644
--- a/toolbox/hd.c
+++ b/toolbox/hd.c
@@ -2,6 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdint.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <errno.h>
diff --git a/toolbox/ioctl.c b/toolbox/ioctl.c
index e28f2a4..fb555d2 100644
--- a/toolbox/ioctl.c
+++ b/toolbox/ioctl.c
@@ -1,11 +1,14 @@
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <fcntl.h>
+#include <getopt.h>
 #include <string.h>
 #include <linux/kd.h>
 #include <linux/vt.h>
 #include <errno.h>
 #include <pthread.h>
+#include <sys/ioctl.h>
 
 int ioctl_main(int argc, char *argv[])
 {
diff --git a/toolbox/nandread.c b/toolbox/nandread.c
index 9644973..b124731 100644
--- a/toolbox/nandread.c
+++ b/toolbox/nandread.c
@@ -4,6 +4,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <unistd.h>
 
 #include <mtd/mtd-user.h>
 #include <sys/ioctl.h>
@@ -283,4 +284,3 @@
 
     return 0;
 }
-
diff --git a/toolbox/notify.c b/toolbox/notify.c
index b1761d2..c983ed5 100644
--- a/toolbox/notify.c
+++ b/toolbox/notify.c
@@ -3,6 +3,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <fcntl.h>
+#include <unistd.h>
 #include <sys/ioctl.h>
 #include <sys/inotify.h>
 #include <errno.h>
diff --git a/toolbox/schedtop.c b/toolbox/schedtop.c
index c0e0141..6859b50 100644
--- a/toolbox/schedtop.c
+++ b/toolbox/schedtop.c
@@ -2,7 +2,9 @@
 #include <stdlib.h>
 #include <ctype.h>
 #include <fcntl.h>
+#include <unistd.h>
 
+#include <stdint.h>
 #include <string.h>
 
 #include <sys/stat.h>
@@ -332,4 +334,3 @@
     closedir(d);
     return 0;
 }
-
diff --git a/toolbox/setconsole.c b/toolbox/setconsole.c
index b0ce13f..0159c07 100644
--- a/toolbox/setconsole.c
+++ b/toolbox/setconsole.c
@@ -6,6 +6,8 @@
 #include <linux/vt.h>
 #include <errno.h>
 #include <pthread.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
 
 static int activate_thread_switch_vc;
 static void *activate_thread(void *arg)