mirror of
https://github.com/Zygo/bees.git
synced 2025-06-16 17:46:16 +02:00
process: replace crucible::gettid() with a weak symbol
Since we're now using weak symbols for dodgy libc functions, we might as well do it for gettid() too. Use the ::gettid() global namespace and let libc override it. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -7,13 +7,18 @@
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
|
||||
// for gettid()
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
extern "C" {
|
||||
pid_t
|
||||
__attribute__((weak))
|
||||
gettid() throw()
|
||||
{
|
||||
return syscall(SYS_gettid);
|
||||
}
|
||||
};
|
||||
|
||||
namespace crucible {
|
||||
using namespace std;
|
||||
|
||||
@ -111,12 +116,6 @@ namespace crucible {
|
||||
}
|
||||
}
|
||||
|
||||
pid_t
|
||||
gettid()
|
||||
{
|
||||
return syscall(SYS_gettid);
|
||||
}
|
||||
|
||||
double
|
||||
getloadavg1()
|
||||
{
|
||||
|
Reference in New Issue
Block a user