Skip to content

Commit

Permalink
fix(install): improve gettid definition
Browse files Browse the repository at this point in the history
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
  • Loading branch information
sshedi authored and johannbg committed Aug 9, 2021
1 parent 19537f8 commit ef0f848
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/install/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/syscall.h>

#include "util.h"

static inline pid_t gettid(void)
{
return (pid_t) syscall(SYS_gettid);
}
#if __GLIBC_PREREQ(2, 30) == 0
#include <sys/syscall.h>
#ifndef SYS_gettid
#error "SYS_gettid unavailable on this system"
#endif

#define gettid() ((pid_t) syscall(SYS_gettid))
#endif /*__GLIBC_PREREQ */

size_t page_size(void)
{
Expand Down

0 comments on commit ef0f848

Please sign in to comment.