There are some Linux system calls (e.g., gettid
) which have no glibc wrapper and thus must be invoked via the syscall
function.
Looking in /usr/include/x86_64-linux-gnu/bits/syscall.h
, I see definitions like
#ifdef __NR_gettid
# define SYS_gettid __NR_gettid
#endif
What is the reason for two aliases for the same system call number? Is one more portable/stable? I guess my question boils down to: Which macro should I be using in my code?