From: Christian Brauner Date: Wed, 3 Oct 2018 11:10:55 +0000 (+0200) Subject: raw_syscalls: move lxc_raw_gettid() X-Git-Tag: lxc-3.1.0~65^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2671%2Fhead;p=thirdparty%2Flxc.git raw_syscalls: move lxc_raw_gettid() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/raw_syscalls.h b/src/lxc/raw_syscalls.h index 513089649..224cf92fc 100644 --- a/src/lxc/raw_syscalls.h +++ b/src/lxc/raw_syscalls.h @@ -83,4 +83,13 @@ static inline pid_t lxc_raw_getpid(void) return (pid_t)syscall(SYS_getpid); } +static inline pid_t lxc_raw_gettid(void) +{ +#ifdef __NR_gettid + return syscall(__NR_gettid); +#else + return lxc_raw_getpid(); +#endif +} + #endif /* __LXC_RAW_SYSCALL_H */ diff --git a/src/lxc/utils.h b/src/lxc/utils.h index f7247a2d8..bc298acc8 100644 --- a/src/lxc/utils.h +++ b/src/lxc/utils.h @@ -237,15 +237,6 @@ static inline uint64_t lxc_getpagesize(void) */ extern uint64_t lxc_find_next_power2(uint64_t n); -static inline pid_t lxc_raw_gettid(void) -{ -#ifdef SYS_gettid - return syscall(SYS_gettid); -#else - return lxc_raw_getpid(); -#endif -} - /* Set a signal the child process will receive after the parent has died. */ extern int lxc_set_death_signal(int signal, pid_t parent); extern int fd_cloexec(int fd, bool cloexec);