mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-27 12:37:35 +00:00
configure: check whether gettid() is declared
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
b5e3950161
commit
6a22e86258
@ -628,7 +628,7 @@ AC_CHECK_DECLS([PR_GET_NO_NEW_PRIVS], [], [], [#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])
|
||||
|
||||
# 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
|
||||
AC_CHECK_LIB(pthread, main)
|
||||
|
@ -45,6 +45,20 @@
|
||||
|
||||
#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;
|
||||
static int syslog_enable = 0;
|
||||
int lxc_quiet_specified;
|
||||
|
Loading…
Reference in New Issue
Block a user