From 189d09a42e054bebd91ea9690fede33b41996260 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sun, 18 Nov 2012 15:55:33 -0500 Subject: Define unshare() macro to avoid dependence on __GNU_SOURCE unshare() is a linux syscall that we need. Unfortunately, access to it depends on __GNU_SOURCE, which we would like to avoid. As such, we define a macro to invoke it by its syscall code. This is necessary to avoid the following warning from Clang: implicit declaration of function 'unshare' is invalid in C99 [-Wimplicit-function-declaration] Signed-off-by: Richard Yao --- src/test/test-udev.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/test/test-udev.c b/src/test/test-udev.c index 2a25f2d9b0..4f21e6c2dd 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -34,6 +34,14 @@ #include "udev.h" +#ifndef SYS_unshare +#error "libc fails to set SYS_unshare: please file a bug report with eudev" +#endif + +#ifndef unshare +#define unshare(__X) syscall(SYS_unshare, __X) +#endif + void udev_main_log(struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args) {} -- cgit v1.2.3-54-g00ecf