Fix compile gettid on older Linux (#11184)

Summary:
Seen only in post-PR CI job benchmark-linux. Some context: https://stackoverflow.com/questions/30680550/c-gettid-was-not-declared-in-this-scope

Pull Request resolved: https://github.com/facebook/rocksdb/pull/11184

Test Plan: watch CI

Reviewed By: cbi42

Differential Revision: D43013891

Pulled By: pdillinger

fbshipit-source-id: 48b3b7231080a0f803fdc36d13946d5524770302
oxigraph-8.1.1
Peter Dillinger 2 years ago committed by Facebook GitHub Bot
parent cf756ed916
commit 27cf09172c
  1. 10
      port/stack_trace.cc

@ -31,14 +31,18 @@ void* SaveStack(int* /*num_frames*/, int /*first_frames_to_skip*/) {
#include <string.h>
#include <unistd.h>
#if defined(OS_FREEBSD)
#ifdef OS_FREEBSD
#include <sys/sysctl.h>
#endif
#endif // OS_FREEBSD
#ifdef OS_LINUX
#include <sys/prctl.h>
#include <sys/types.h>
#include <sys/wait.h>
#endif
#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 30)
#include <sys/syscall.h>
#define gettid() syscall(SYS_gettid)
#endif // GLIBC version
#endif // OS_LINUX
#include "port/lang.h"

Loading…
Cancel
Save