syscalls/statx*: Fix compiler errors on old distros
PATCH 1/1 syscalls/statx*: Fix compiler errors on old distros
With glibc-2.5 on RHEL5, compilation failed because of undefined AT_FDCWD, O_DIRECTORY or WEXITSTATUS().
1) Fix undefined AT_FDCWD and O_DIRECTORY by defining _GNU_SOURCE.
2) Fix undefined WEXITSTATUS() by including <sys/wait.h>.
Signed-off-by Xiao Yang <[email protected]>
--- testcases/kernel/syscalls/statx/statx01.c | 2 ++ testcases/kernel/syscalls/statx/statx02.c | 1 + testcases/kernel/syscalls/statx/statx03.c | 2 ++ testcases/kernel/syscalls/statx/statx04.c | 1 + testcases/kernel/syscalls/statx/statx05.c | 3 +++ 5 files changed, 9 insertions(+)
testcases/kernel/syscalls/statx/statx01.c +2 -0
@@ -33,6 +33,8 @@* predefined values. * Minimum kernel version required is 4.11. */ + +#define _GNU_SOURCE#include <stdio.h> #include <sys/types.h> #include <sys/sysmacros.h>
testcases/kernel/syscalls/statx/statx02.c +1 -0
@@ -22,6 +22,7 @@* Minimum kernel version required is 4.11. */ +#define _GNU_SOURCE#include <stdio.h> #include <inttypes.h> #include "tst_test.h"
testcases/kernel/syscalls/statx/statx03.c +2 -0
@@ -26,6 +26,8 @@* * Minimum Kernel version required is 4.11. */ + +#define _GNU_SOURCE#include <stdio.h> #include <string.h> #include "tst_test.h"
testcases/kernel/syscalls/statx/statx04.c +1 -0
@@ -23,6 +23,7 @@* Minimum kernel version required is 4.11. */ +#define _GNU_SOURCE#include "tst_test.h" #include "lapi/fs.h" #include <stdlib.h>
testcases/kernel/syscalls/statx/statx05.c +3 -0
@@ -19,9 +19,12 @@* Minimum kernel version required is 4.11. */ +#define _GNU_SOURCE#include "tst_test.h" #include "lapi/fs.h" #include <stdlib.h> +#include <sys/types.h> +#include <sys/wait.h> #include "lapi/stat.h" #define MOUNT_POINT "mnt_point"
Signature · 1 line
1.7.11.rc0
PATCH 1/1 syscalls/statx*: Fix compiler errors on old distros
Hi!
I've rebased this to apply on the top of my statx05 fixes I've commited recently and pushed, thanks.
Signature · 2 lines
Cyril Hrubis [email protected]