selftests: Add missing #include directives
authorBen Hutchings <ben@decadent.org.uk>
Mon, 2 Nov 2015 12:21:46 +0000 (12:21 +0000)
committerShuah Khan <shuahkh@osg.samsung.com>
Tue, 3 Nov 2015 23:53:53 +0000 (16:53 -0700)
Several C programs fail to include the headers declaring all the
functions they call, resulting in warnings or errors.

After this, memfd_test.c is still missing some function declarations
but can't easily get them because of a conflict between
<linux/fcntl.h> and <sys/fcntl.h>.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/memfd/memfd_test.c
tools/testing/selftests/mqueue/mq_open_tests.c
tools/testing/selftests/mqueue/mq_perf_tests.c
tools/testing/selftests/timers/nanosleep.c

index aa5d3ebbd760058bb206eca9f88206ce52898cd7..26546892cd545e954a559ade36cba823ac0bff18 100644 (file)
@@ -15,6 +15,7 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/syscall.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 #define MFD_DEF_SIZE 8192
index 9c1a5d359055f475b00cef6d053d14a2ab22c8aa..e0a74bd207a547c865f2e352f186a5b4cdf14da6 100644 (file)
@@ -31,6 +31,7 @@
 #include <sys/resource.h>
 #include <sys/stat.h>
 #include <mqueue.h>
+#include <error.h>
 
 static char *usage =
 "Usage:\n"
index 8519e9ee97e3d3e4a344e798cabf5b38edfff602..8188f72de93c2ae35884a0d2a3cebc9c7a3c1bf5 100644 (file)
@@ -37,6 +37,7 @@
 #include <sys/stat.h>
 #include <mqueue.h>
 #include <popt.h>
+#include <error.h>
 
 static char *usage =
 "Usage:\n"
index 8a3c29de7d49483a7a6aaa4e181b556a63a215a3..ff942ff7c9b367e8e306d6730c01fe92b1abd882 100644 (file)
@@ -19,6 +19,7 @@
  *   GNU General Public License for more details.
  */
 
+#include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>