Check for unshare on the configure and provide an inline replacement when not available
This commit is contained in:
parent
d68f655644
commit
e0b2bb0a47
10
configure.ac
10
configure.ac
|
@ -187,6 +187,16 @@ fi
|
|||
AC_SUBST(ACL_LIBS)
|
||||
AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
AC_CHECK_DECL([unshare],
|
||||
[AC_DEFINE(HAVE_UNSHARE, 1, [Define if unshare is declared])],
|
||||
[AC_CHECK_DECL([SYS_unshare],
|
||||
[ ] ,
|
||||
[AC_MSG_ERROR([*** unshare nor SYS_unshare found.])],
|
||||
[#include <syscall.h>])],
|
||||
[#include <sched.h>])
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
AC_ARG_WITH(firmware-path,
|
||||
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
|
||||
|
|
|
@ -31,16 +31,13 @@
|
|||
#include <sched.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/signalfd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
#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)
|
||||
#ifndef HAVE_UNSHARE
|
||||
#include <sys/syscall.h>
|
||||
/* Provide our own replacement with local reach*/
|
||||
static inline int unshare (int x) { return syscall(SYS_unshare, x); }
|
||||
#endif
|
||||
|
||||
void udev_main_log(struct udev *udev, int priority,
|
||||
|
|
Loading…
Reference in New Issue