Commit 31db9984 by Christian Brauner Committed by Stéphane Graber

configure: check whether gettid() is declared

parent 5b3214ca
...@@ -620,7 +620,7 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>]) ...@@ -620,7 +620,7 @@ AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h]) AC_CHECK_HEADERS([sys/signalfd.h pty.h ifaddrs.h sys/capability.h sys/personality.h utmpx.h sys/timerfd.h])
# Check for some syscalls functions # Check for some syscalls functions
AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat]) AC_CHECK_FUNCS([setns pivot_root sethostname unshare rand_r confstr faccessat gettid])
# Check for some functions # Check for some functions
AC_CHECK_LIB(pthread, main) AC_CHECK_LIB(pthread, main)
......
...@@ -42,6 +42,20 @@ ...@@ -42,6 +42,20 @@
#define LXC_LOG_DATEFOMAT_SIZE 15 #define LXC_LOG_DATEFOMAT_SIZE 15
#ifndef HAVE_GETTID
static inline pid_t gettid(void)
{
#ifdef __NR_gettid
return (pid_t)syscall(SYS_gettid);
#else
errno = ENOSYS;
return -1;
#endif
}
#else
extern pid_t gettid(void);
#endif
int lxc_log_fd = -1; int lxc_log_fd = -1;
int lxc_quiet_specified; int lxc_quiet_specified;
int lxc_log_use_global_fd; int lxc_log_use_global_fd;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment