1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-21 18:03:41 +03:00

Merge pull request #7742 from poettering/meson-syscall

Meson syscall
This commit is contained in:
Lennart Poettering 2017-12-25 17:21:59 +01:00 committed by GitHub
commit aabe647d20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -454,33 +454,32 @@ foreach ident : ['secure_getenv', '__secure_getenv']
endforeach
foreach ident : [
['memfd_create', '''#define _GNU_SOURCE
#include <sys/mman.h>'''],
['gettid', '''#include <sys/types.h>'''],
['pivot_root', '''#include <stdlib.h>'''], # no known header declares pivot_root
['name_to_handle_at', '''#define _GNU_SOURCE
#include <sys/types.h>
['memfd_create', '''#include <sys/mman.h>'''],
['gettid', '''#include <sys/types.h>
#include <unistd.h>'''],
['pivot_root', '''#include <stdlib.h>
#include <unistd.h>'''], # no known header declares pivot_root
['name_to_handle_at', '''#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>'''],
['setns', '''#define _GNU_SOURCE
#include <sched.h>'''],
['renameat2', '''#include <stdio.h>'''],
['setns', '''#include <sched.h>'''],
['renameat2', '''#include <stdio.h>
#include <fcntl.h>'''],
['kcmp', '''#include <linux/kcmp.h>'''],
['keyctl', '''#include <sys/types.h>
#include <keyutils.h>'''],
['copy_file_range', '''#define _GNU_SOURCE
#include <sys/syscall.h>
['copy_file_range', '''#include <sys/syscall.h>
#include <unistd.h>'''],
['bpf', '''#include <sys/syscall.h>
#include <unistd.h>'''],
['explicit_bzero' , '''#include <string.h>'''],
]
have = cc.has_function(ident[0], prefix : ident[1])
have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
conf.set10('HAVE_' + ident[0].to_upper(), have)
endforeach
if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''')
if cc.has_function('getrandom', prefix : '''#include <sys/random.h>''', args : '-D_GNU_SOURCE')
conf.set10('USE_SYS_RANDOM_H', true)
conf.set10('HAVE_GETRANDOM', true)
else