Skip to contentSkip to conversation

quotactl07: add _GNU_SOURCE define

PATCH In review Li Wang 3 participants 3 messages Jun 17, 2024 – Jun 19, 2024

lore
Share & tools
lore

Li Wang

author
#0 lore raw

PATCH 1/1 quotactl07: add _GNU_SOURCE define

To get rid of error on implicit declaration (glibc-2.39):

/usr/include/xfs/linux.h:188:15: error: implicit declaration of function ‘fallocate’; did you mean ‘alloca’? [-Wimplicit-function-declaration]

 188 |         ret = fallocate(fd, FALLOC_FL_ZERO_RANGE, start, len);
     |               ^~~~~~~~~
     |               alloca

make: *** [../../../../include/mk/rules.mk:45: quotactl07] Error 1

---
 testcases/kernel/syscalls/quotactl/quotactl07.c | 2 ++
 1 file changed, 2 insertions(+)
testcases/kernel/syscalls/quotactl/quotactl07.c +2 -0
index 34ff2705d..d8ad3760a 100644
@@ -13,6 +13,8 @@
  * ("xfs: Sanity check flags of Q_XQUOTARM call").
  */
 
+#define _GNU_SOURCE
+#include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
Signature · 5 lines
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Reviewed-by Wei Gao on v1 1/1
#1 lore raw
Quoted 34 lines · Li Wang

To get rid of error on implicit declaration (glibc-2.39):

/usr/include/xfs/linux.h:188:15: error: implicit declaration of function ‘fallocate’; did you mean ‘alloca’? [-Wimplicit-function-declaration]

 188 |         ret = fallocate(fd, FALLOC_FL_ZERO_RANGE, start, len);
     |               ^~~~~~~~~
     |               alloca

make: *** [../../../../include/mk/rules.mk:45: quotactl07] Error 1

---
 testcases/kernel/syscalls/quotactl/quotactl07.c | 2 ++
 1 file changed, 2 insertions(+)
testcases/kernel/syscalls/quotactl/quotactl07.c +2 -0
index 34ff2705d..d8ad3760a 100644
@@ -13,6 +13,8 @@
  * ("xfs: Sanity check flags of Q_XQUOTARM call").
  */
 
+#define _GNU_SOURCE
+#include <fcntl.h>
 #include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
Signature · 5 lines
2.45.2


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
#2 lore raw

Hi all,

workaround merged, thanks!

Kind regards,
Petr

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp