[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#725383: FTBFS on kfreebsd-*: SYS_gettid is Linux-specific

Steven Chamberlain:
> A workaround may be to use pthread_self(), except that the exported
> getCurrentThreadId function has to return 'unsigned int'.  On
> kfreebsd-amd64 a 64-bit pointer to a pthread_t is not absolutely
> guaranteed to be unique if truncated to 32 bits,

I think you can avoid this by using the primitive:

lwpid_t tid;
syscall (SYS_thr_self, &tid);

Robert Millan

Reply to: