<Print tid out of pthread_t in C on Linux> I know ...
# community-feeds
r
Print tid out of pthread_t in C on Linux I know from this answer that pthread_t is struct pthread* on Linux. But I get the error: a.c3560: error: invalid use of undefined type ‘struct pthread’ 35 | printf("%ld: %ld\n", e, ((struct pthread*)(newthread))->tid); While in gdb I can do p ((struct pthread*)(newthread))->tid and it works well. How can I do it in code?