Skip to contentSkip to conversation

syscalls/statx*: Fix compiler errors on old distros

PATCH New Xiao Yang 2 participants 2 messages Sep 12, 2018 – Sep 13, 2018

lore
Share & tools
lore

Xiao Yang

author
#0 lore raw

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>.

---
 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
index 574560b..23ea99b 100644
@@ -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
index f21abf2..08ea940 100644
@@ -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
index 4dc1cd0..c72d7fe 100644
@@ -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
index f27cec7..8caf092 100644
@@ -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
index 1a890cf..130e5bc 100644
@@ -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
#1 lore raw

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]