fix: dragonfly compilation failure due to glibc version less than 2.30
Signed-off-by: Super-long [email protected]
This is a problem to be solved, but not necessarily the final version. I encountered the following problem when compiling dragonfly:
In the man documentation I found this description:

You can check the glibc version by running ldd --version, and on my machine I have the following output:

This is an issue that needs to be fixed in order to compile dragonfly more robustly. Currently gettid appears in helio/util/uring/proactor_test.cc and src/server/main_service.cc, and in proactor_test.cc because of third_party/gperf/src/stacktrace_ instrument-inl.h(#include <gperftools/profiler.h>) defines #define gettid() syscall(__NR_gettid), so it compiles without error on my machine.
It looks like there are several fixes like this
- Create a public file in helio where gettid is defined and dragonfly uses the definition in helio.
- Define it directly in main_service.cc, like this PR.
@Super-long thanks for fixing this. Can you tell, for the protocol, what Linux OS you are building on?
@romange The Linux OS and Version is this: uname-a -> Linux VM-9-54-centos 5.4.119-1-tlinux4-0008 #1 SMP Fri Nov 26 11:17:45 CST 2021 x86_64 x86_64 x86_64 GNU/Linux