Skip to content

Commit

Permalink
Fix build errors with newer glibc versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt A. Tobin committed Oct 16, 2019
1 parent 3ae8f13 commit e31d79e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
6 changes: 1 addition & 5 deletions js/src/jsnativestack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@
# include <sys/syscall.h>
# include <sys/types.h>
# include <unistd.h>
static pid_t
gettid()
{
return syscall(__NR_gettid);
}
# define gettid() static_cast<pid_t>(syscall(SYS_gettid))
# endif

#else
Expand Down
12 changes: 3 additions & 9 deletions tools/profiler/tasktracer/GeckoTaskTracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,16 @@

#include <stdarg.h>

// We need a definition of gettid(), but glibc doesn't provide a
// We need a definition of gettid(), but older glibc versions don't provide a
// wrapper for it.
#if defined(__GLIBC__)
#include <unistd.h>
#include <sys/syscall.h>
static inline pid_t gettid()
{
return (pid_t) syscall(SYS_gettid);
}
#define gettid() static_cast<pid_t>(syscall(SYS_gettid))
#elif defined(XP_MACOSX)
#include <unistd.h>
#include <sys/syscall.h>
static inline pid_t gettid()
{
return (pid_t) syscall(SYS_thread_selfid);
}
#define gettid() static_cast<pid_t>(syscall(SYS_thread_selfid))
#elif defined(LINUX)
#include <sys/types.h>
pid_t gettid();
Expand Down

0 comments on commit e31d79e

Please sign in to comment.