Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: Add missing #include directives

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>

authored by

Ben Hutchings and committed by
Shuah Khan
c1ee4831 fd88d16c

+4
+1
tools/testing/selftests/memfd/memfd_test.c
··· 15 15 #include <sys/mman.h> 16 16 #include <sys/stat.h> 17 17 #include <sys/syscall.h> 18 + #include <sys/wait.h> 18 19 #include <unistd.h> 19 20 20 21 #define MFD_DEF_SIZE 8192
+1
tools/testing/selftests/mqueue/mq_open_tests.c
··· 31 31 #include <sys/resource.h> 32 32 #include <sys/stat.h> 33 33 #include <mqueue.h> 34 + #include <error.h> 34 35 35 36 static char *usage = 36 37 "Usage:\n"
+1
tools/testing/selftests/mqueue/mq_perf_tests.c
··· 37 37 #include <sys/stat.h> 38 38 #include <mqueue.h> 39 39 #include <popt.h> 40 + #include <error.h> 40 41 41 42 static char *usage = 42 43 "Usage:\n"
+1
tools/testing/selftests/timers/nanosleep.c
··· 19 19 * GNU General Public License for more details. 20 20 */ 21 21 22 + #include <errno.h> 22 23 #include <stdio.h> 23 24 #include <stdlib.h> 24 25 #include <time.h>