meson: define _GNU_SOURCE to detect copy_file_range() (#7734)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 25 Dec 2017 10:42:42 +0000 (19:42 +0900)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Dec 2017 10:42:42 +0000 (11:42 +0100)
Follow-up for bad7a0c81f501fbbcc79af9eaa4b8254441c4a1f of git
repository for glibc.

Recently glibc added `copy_file_range()`, but to use it,
`_GNU_SOURCE` needs to be defined. This adds the flag in
meson.build to detect the function by meson correctly.

meson.build

index be8e610..f3a65b3 100644 (file)
@@ -468,7 +468,8 @@ foreach ident : [
         ['kcmp',              '''#include <linux/kcmp.h>'''],
         ['keyctl',            '''#include <sys/types.h>
                                  #include <keyutils.h>'''],
-        ['copy_file_range',   '''#include <sys/syscall.h>
+        ['copy_file_range',   '''#define _GNU_SOURCE
+                                 #include <sys/syscall.h>
                                  #include <unistd.h>'''],
         ['bpf',               '''#include <sys/syscall.h>
                                  #include <unistd.h>'''],