GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
THR_SELF(2) FreeBSD System Calls Manual THR_SELF(2)

thr_self
return thread identifier for the calling thread

Standard C Library (libc, -lc)

#include <sys/thr.h>

int
thr_self(long *id);

The thr_self() system call stores the system-wide thread identifier for the current kernel-scheduled thread in the variable pointed by the argument id.

The thread identifier is an integer in the range from PID_MAX + 2 (100001) to INT_MAX. The thread identifier is guaranteed to be unique at any given time, for each running thread in the system. After the thread exits, the identifier may be reused.

If successful, thr_self() will return zero, otherwise -1 is returned, and errno is set to indicate the error.

The thr_self() operation may return the following errors:
[]
The memory pointed to by the id argument is not valid.

_umtx_op(2), thr_exit(2), thr_kill(2), thr_kill2(2), thr_new(2), thr_set_name(2), pthread_getthreadid_np(3), pthread_self(3)

The thr_self() system call is non-standard and is used by 1:1 Threading Library (libthr, -lthr) to implement IEEE Std 1003.1-2001 (“POSIX.1”) pthread(3) functionality.

The thr_self() system call first appeared in FreeBSD 5.2.
May 5, 2020 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 2 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.