Manual Pages for Linux CentOS command on man set_tid_address
MyWebUniversity

Manual Pages for Linux CentOS command on man set_tid_address

SETTIDADDRESS(2) Linux Programmer's Manual SETTIDADDRESS(2)

NAME

settidaddress - set pointer to thread ID SYNOPSIS

#include long settidaddress(int *tidptr); DESCRIPTION For each process, the kernel maintains two attributes (addresses) called setchildtid and clearchildtid. These two attributes contain the value NULL by default. setchildtid If a process is started using clone(2) with the CLONECHILDSET‐ TID flag, setchildtid is set to the value passed in the ctid argument of that system call. When setchildtid is set, the very first thing the new process does is writing its PID at this address. clearchildtid If a process is started using clone(2) with the CLONECHILDCLEARTID flag, clearchildtid is set to the value passed in the ctid argument of that system call. The system call settidaddress() sets the clearchildtid value for the calling process to tidptr. When a process whose clearchildtid is not NULL terminates, then, if the process is sharing memory with other processes or threads, then 0 is written at the address specified in clearchildtid and the kernel performs the following operation: futex(clearchildtid, FUTEXWAKE, 1, NULL, NULL, 0); The effect of this operation is to wake a single process that is per‐ forming a futex wait on the memory location. Errors from the futex wake operation are ignored. RETURN VALUE settidaddress() always returns the PID of the calling process. ERRORS settidaddress() always succeeds. VERSIONS This call is present since Linux 2.5.48. Details as given here are valid since Linux 2.5.49. CONFORMING TO

This system call is Linux-specific. SEE ALSO clone(2), futex(2) COLOPHON

This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can

be found at http://www.kernel.org/doc/man-pages/.

Linux 2012-07-19 SETTIDADDRESS(2)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™