I want to get the task ID from the syscall function defined in libc as the function gettid() cannot be directly called in the same manner as getpid(). In C, it should be called from syscall function as
tid = syscall(SYS_gettid)
where SYS_gettid is defined as __NR_getid in the header bits/syscall.h with the type of long number.
__NR_getid isn’t a string, it’s a C preprocessor constant holding an integer. So you need to pass that integer. Unfortunately it seems to change depending on the platform: