unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Page:
Section:
Apropos / Subsearch:
optional field

GETTHRID(2)                 BSD System Calls Manual                GETTHRID(2)

NAME
     getthrid -- get thread identifier

SYNOPSIS
     #include <&lt;unistd.h>&gt;

     pid_t
     getthrid(void);

DESCRIPTION
     getthrid returns the thread ID of the calling thread.  This is used in
     the implementation of the thread library (-lpthread) and can appear in
     the output of system utilities such as ps(1) and kdump(1).

     Thread IDs are not a stable interface and should not be used directly by
     applications except for correlation with system utility output.  Applica-
     tions should use the pthread_t values from pthread_self(3) and
     pthread_create(3) to identify threads within the process itself.

RETURN VALUES
     This function is always successful, and no return value is reserved to
     indicate an error.

SEE ALSO
     __tfork(2), getpid(2), pthread_create(3), pthread_self(3)

STANDARDS
     The getthrid syscall is specific to OpenBSD and should not be used in
     portable applications.

HISTORY
     The getthrid syscall appeared in OpenBSD 3.9.

BSD                             March 30, 2017                             BSD