# PROCESS - [Overview](#section2028654109165622) - [Summary](#section1425157668165622) - [Files](#files) - [Data Structures](#nested-classes) - [Macros](#define-members) - [Typedefs](#typedef-members) - [Functions](#func-members) - [Details](#section2053292651165622) - [Function](#section1655463262165622) - [capget\(\)](#gaa284eba1654e9fc0672aca2a6d2cd0ce) - [capset\(\)](#gaaa15be01b20aff9efb09de5a8ead207e) - [getpriority\(\)](#gac2ee4921a8961060b4c7fcad8bf2b4e2) - [ohos\_capget\(\)](#gaf254b29504e9733ff55014acdf5fbcc7) - [ohos\_capset\(\)](#ga77ad7758babf522e7ffb28551332a659) - [pthread\_atfork\(\)](#ga80008474c3d68e9880da960a53d2f430) - [pthread\_attr\_destroy\(\)](#ga4bcdbf47c17c7dcc51e9f05f5cb56d81) - [pthread\_attr\_getdetachstate\(\)](#ga391c34da42e68ddd24f5ee0c070d5c4f) - [pthread\_attr\_getguardsize\(\)](#gaa8b692ecc3880fdd49a4d423ba1ce91e) - [pthread\_attr\_getinheritsched\(\)](#ga79a77b688c30213e5e52e6be178cde4e) - [pthread\_attr\_getschedparam\(\)](#gafd3d272d702481044f8a8cd253fd9b47) - [pthread\_attr\_getschedpolicy\(\)](#gaec4d8127833d1a573aa82539f898a8ed) - [pthread\_attr\_getscope\(\)](#gabfd252cd45081231018030e3878efa06) - [pthread\_attr\_getstack\(\)](#gaec19ad460995a9fe8aeb4eaf2bb1ed1d) - [pthread\_attr\_getstacksize\(\)](#gae23600d4670359ab12bfba20db2c9a37) - [pthread\_attr\_init\(\)](#ga0b85ebb1e3aac081a4c0a5e85ae3cbe9) - [pthread\_attr\_setdetachstate\(\)](#gae6ee78c307d8467b34a9b0c330993a54) - [pthread\_attr\_setguardsize\(\)](#ga532b31c11a9d87663053c5342400758c) - [pthread\_attr\_setinheritsched\(\)](#gad437fe8caa3ef9f0cb7d69f6f6479df9) - [pthread\_attr\_setschedparam\(\)](#ga579e6529f0ce482312a5e77ac61cb4d5) - [pthread\_attr\_setschedpolicy\(\)](#gab6cb2eb73f04abf328b2f39777c35dca) - [pthread\_attr\_setscope\(\)](#ga294aaacf59f34effeef978242cf08cbe) - [pthread\_attr\_setstack\(\)](#ga94ede89b99a3a4fa17e516d30aaf3409) - [pthread\_attr\_setstacksize\(\)](#ga812a9a455ae2ef2bb0dca4fff201a281) - [pthread\_barrier\_destroy\(\)](#gab05ae13769e61dea9c53ca7894743c8f) - [pthread\_barrier\_init\(\)](#ga4a324cd758cae702213ea41882f4cf41) - [pthread\_barrier\_wait\(\)](#gaf786372165ba080986ae4143928c5436) - [pthread\_barrierattr\_destroy\(\)](#ga3bd99d89e352ccc51d5b94d157f1218b) - [pthread\_barrierattr\_init\(\)](#ga2ff720e06488668dc0ae6779755946e6) - [pthread\_cancel\(\)](#ga9e77a80c073787bf9a593e9c619dce27) - [pthread\_cleanup\_pop\(\)](#gafbe33fb00cd24693796a0870a3374631) - [pthread\_cleanup\_push\(\)](#ga68bc26522daf418f3cc78360925374ef) - [pthread\_cond\_broadcast\(\)](#ga1c1ac7c8faaf8ad63e12bc3717f430f3) - [pthread\_cond\_destroy\(\)](#ga7f2a7328ee3a7743686adcd2d51771c4) - [pthread\_cond\_init\(\)](#gabdf02ed57b055f1920991e96e7d67043) - [pthread\_cond\_signal\(\)](#ga9b0f2c7dead8c628e081d76c86a1addc) - [pthread\_cond\_timedwait\(\)](#ga506c0350d597721ab24bba7129e8e0df) - [pthread\_cond\_wait\(\)](#gaea601b8ce596a5c54fb12758c56b10a1) - [pthread\_condattr\_destroy\(\)](#ga8ab009937339c899a5197eea2e48e6a1) - [pthread\_condattr\_getclock\(\)](#gadcf908971c2ea15ced780025772084e3) - [pthread\_condattr\_init\(\)](#ga487a919ab54fd47c8464507031957df0) - [pthread\_condattr\_setclock\(\)](#gaaf7ac0f85233c0effaf850a9c65b6d68) - [pthread\_create\(\)](#gae5d18438d4d20c8a2e42cd2500578d79) - [pthread\_detach\(\)](#ga7c275c509c26566b6dd95a2de1668a2f) - [pthread\_equal\(\)](#ga98ec817164a6641eda2341de473b659d) - [pthread\_exit\(\)](#gaadfb4e5de5a20880c6a40d4e73ce2597) - [pthread\_getaffinity\_np\(\)](#ga051df55ea1131f70f6f9356865a36798) - [pthread\_getattr\_np\(\)](#ga6bdca4b2c8a436c4651fb5e8d462408b) - [pthread\_getschedparam\(\)](#gaae9850b3759769c748727e171c4c6e61) - [pthread\_getspecific\(\)](#ga31469375891078185bda93f0e4411a2c) - [pthread\_join\(\)](#ga28a15bba47cab57cbc9f5dac9af99c8b) - [pthread\_key\_create\(\)](#gaf4b7ced8ecff505380fe8216244a3764) - [pthread\_key\_delete\(\)](#gaee96306dc79294927ee840bb4de2244b) - [pthread\_kill\(\)](#ga5aafacc071cdfafd0eb992004dee3e62) - [pthread\_mutex\_destroy\(\)](#gaf89d9cfa300f33b46720a96eac83d175) - [pthread\_mutex\_init\(\)](#gadd99221596e95a55f70c59c1c712bbde) - [pthread\_mutex\_lock\(\)](#gafd70d6f2c50e22b996c926fb9d6ad291) - [pthread\_mutex\_timedlock\(\)](#gabc6a044b418e942b91121b1babb61708) - [pthread\_mutex\_trylock\(\)](#gacc1ccbaf3d76572da85a8030bba1ede4) - [pthread\_mutex\_unlock\(\)](#ga02a3c64dac70730e226c31c0e7dbb45c) - [pthread\_mutexattr\_destroy\(\)](#ga2321aabf58224b06021185708d0f9658) - [pthread\_mutexattr\_gettype\(\)](#ga4789e2d3ada7aab2af1458bfec53ee3c) - [pthread\_mutexattr\_init\(\)](#gaf98f6b6c483077a39d1400b1de1577b8) - [pthread\_mutexattr\_settype\(\)](#ga8387c80e660e9426f801ac0217ecfae5) - [pthread\_once\(\)](#ga196103ac97710dad7a93fd6c188cc999) - [pthread\_rwlock\_destroy\(\)](#gaa106bb55bdd0e120519d5412823f8b29) - [pthread\_rwlock\_init\(\)](#ga1cf4bc49696c1a30db31219aef994401) - [pthread\_rwlock\_rdlock\(\)](#ga6153aca32112735053e6cc4a2a290feb) - [pthread\_rwlock\_timedrdlock\(\)](#ga8edbe14731fd79a80f72384334266715) - [pthread\_rwlock\_timedwrlock\(\)](#ga3fb8fb33e16653c5ad7b7f092959738e) - [pthread\_rwlock\_tryrdlock\(\)](#ga3ba2170f06184d12543c4a5b78715fa7) - [pthread\_rwlock\_trywrlock\(\)](#ga2b5044e2da304ae9666fdd4e05479905) - [pthread\_rwlock\_unlock\(\)](#gaffd8a19e83fc87d865d103d6fbce8c4f) - [pthread\_rwlock\_wrlock\(\)](#gaf2ca5563676ae3ac35d3bc7b3547e7f7) - [pthread\_rwlockattr\_destroy\(\)](#ga78a54e67f0afe2601dbda0a904fa0bdf) - [pthread\_rwlockattr\_init\(\)](#ga9d831af0179ed16d1b6cbeba0304810b) - [pthread\_self\(\)](#ga4c4f5f3b4f8f45d9d897847d53b11aaa) - [pthread\_setaffinity\_np\(\)](#ga217f60f9431c453c74b675e72bba307d) - [pthread\_setcancelstate\(\)](#ga37075410fbbaad7ee93c95375fc86e0e) - [pthread\_setcanceltype\(\)](#gaab579bcfcf0662a0c1e35fd82162e61d) - [pthread\_setname\_np\(\)](#ga185584d77295432838d8b839d916f160) - [pthread\_setschedparam\(\)](#ga14f50e1f5d815c90f1f4225eca5d3a8c) - [pthread\_setschedprio\(\)](#ga7a23cbcfc21a4e3edf531ed65f022370) - [pthread\_setspecific\(\)](#ga2187333dd46ce08d9d2e044f79fad705) - [pthread\_spin\_destroy\(\)](#ga822c2ff425ddad4c25b6a6092c6effff) - [pthread\_spin\_init\(\)](#ga665a56a7bed60c8eaa6c28af40d13cd4) - [pthread\_spin\_lock\(\)](#ga62cfd14d1f937a6e8f966e3a331bcf94) - [pthread\_spin\_trylock\(\)](#ga084834fa2d06f173f086ce23ec1ea5d9) - [pthread\_spin\_unlock\(\)](#ga3fe246007a85cee9d5f7af9b7d592b54) - [pthread\_testcancel\(\)](#gaf1c95282ab2bea25f0888a19652cd41f) - [sched\_get\_priority\_max\(\)](#gafaebd1698caeb9b9b9e614ad84edd609) - [sched\_get\_priority\_min\(\)](#gaf1f370fc36ea6b22ed42b5ee3cf82a81) - [sched\_getparam\(\)](#ga563c7ac53bac2c1b51379147e66c44ec) - [sched\_getscheduler\(\)](#ga99fcb2532b1482d236dc04495a3f194d) - [sched\_rr\_get\_interval\(\)](#ga484f0eb93529d29a66e24485725c4c7b) - [sched\_setparam\(\)](#ga06b497c4ea6bbabd2b62ba1a8a848a1b) - [sched\_setscheduler\(\)](#ga84ad29a6f2ad27370df09c664ac65eac) - [sched\_yield\(\)](#ga357cd4b34c13011749dfffb42b489f09) - [setpriority\(\)](#ga0a8d4c8043a7748c25dd551dc69dcad2) - [wait\(\)](#gabf2fbcf6df59fd5234e9eed4db1a1804) - [waitpid\(\)](#ga77de8005691d1f125540d66032a3cc62) - [Variable](#section1588843235165622) - [effective](#ga355bca6f4ddbe05cb7225ce1d7272ddd) - [inheritable](#ga22c2f1389233789296db2b270b98b79a) - [permitted](#ga39e42efd1f293a6c8cd0227cff1e7bb8) - [pid](#ga7d063c33a2986f7351ce84e033e63765) - [version](#ga75de99b99ceca627d834db0db344b609) ## **Overview** **Description:** Provides process- and thread-related structures and functions. You can perform process- and thread-related operations, including creating and terminating a process, obtaining a process ID, creating or destroying a thread, and obtaining or modifying thread attributes, priorities, and scheduling policies. **Since:** 1.0 **Version:** 1.0 **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files
Indicates the capability of ignoring discretionary access control (DAC) restrictions on files. |
|
Indicates the capability of ignoring DAC restrictions on file read and search. |
|
Indicates the capability of ignoring the restrictions on the matching between the user ID of the file owner and process ID. |
|
Indicates the capability of ignoring the restrictions on sending signals to processes that do not belong to themselves. |
|
Indicates the capability of changing the group ID of a process. |
|
Indicates the capability of changing the user ID of a process. |
|
Indicates the capability of transferring capabilities to other processes and deleting capabilities. |
|
Indicates the capability of network broadcasting or multicasting. |
|
Indicates the capability of executing network management tasks. |
|
Indicates the capability of executing system management tasks. |
|
Indicates the capability of changing the file ownership. This macro is used by ohos_capset. |
|
Indicates the capability of ignoring DAC restrictions on file execution. This macro is used by ohos_capset. |
|
Indicates the capability of ignoring DAC restrictions on file write. This macro is used by ohos_capset. |
|
Indicates the capability of ignoring DAC restrictions on file read and search. This macro is used by ohos_capset. |
|
Indicates the capability of ignoring the restrictions on the matching between the user ID of the file owner and process ID. This macro is used by ohos_capset. |
|
Indicates the capability of ignoring the restrictions on sending signals to processes that do not belong to themselves. This macro is used by ohos_capset. |
|
Indicates the capability of changing the group ID of a process. This macro is used by ohos_capset. |
|
Indicates the capability of changing the user ID of a process. This macro is used by ohos_capset. |
|
Indicates the capability of binding a port. This macro is used by ohos_capset. |
|
Indicates the capability of network broadcasting or multicasting. This macro is used by ohos_capset. |
|
Indicates the capability of executing network management tasks. This macro is used by ohos_capset. |
|
Indicates the capability of using raw sockets. This macro is used by ohos_capset. |
|
Indicates the capability of mounting the file system. This macro is used by ohos_capset. |
|
Indicates the capability of formatting the file system. This macro is used by ohos_capset. |
|
Indicates the capability of setting the scheduling priority. This macro is used by ohos_capset. |
|
Indicates the capability of setting the date. This macro is used by ohos_capset. |
|
Indicates the capability of setting the clock. This macro is used by ohos_capset. |
|
Indicates the capability of setting the capabilities. This macro is used by ohos_capset. |
|
Indicates the capability of rebooting system. This macro is used by ohos_capset. |
|
Indicates the capability of calling shell. This macro is used by ohos_capset. |
|
typedef struct __user_cap_header_struct * |
|
typedef struct __user_cap_data_struct * |
pthread_create (pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg) |
|
pthread_detach (pthread_t thread) |
|
pthread_exit (void *retval) |
|
pthread_join (pthread_t thread, void **retval) |
|
pthread_self (void) |
|
pthread_equal (pthread_t t1, pthread_t t2) |
|
pthread_setcancelstate (int state, int *oldstate) |
|
pthread_setcanceltype (int type, int *oldtype) |
|
pthread_testcancel (void) |
|
pthread_cancel (pthread_t thread) |
|
pthread_kill (pthread_t thread, int sig) |
|
pthread_getschedparam (pthread_t thread, int *policy, struct sched_param *param) |
|
pthread_setschedparam (pthread_t thread, int policy, const struct sched_param *param) |
|
pthread_setschedprio (pthread_t thread, int prio) |
|
pthread_once (pthread_once_t *once_control, void(*init_routine)(void)) |
|
pthread_mutex_init (pthread_mutex_t *__restrict m, const pthread_mutexattr_t *__restrict a) |
|
pthread_mutex_timedlock (pthread_mutex_t *__restrict m, const struct timespec *__restrict at) |
|
pthread_cond_init (pthread_cond_t *__restrict c, const pthread_condattr_t *__restrict a) |
|
pthread_cond_wait (pthread_cond_t *__restrict c, pthread_mutex_t *__restrict m) |
Blocks the calling thread to wait for the condition set by pthread_con_signal(). |
pthread_cond_timedwait (pthread_cond_t *__restrict c, pthread_mutex_t *__restrict m, const struct timespec *__restrict ts) |
Blocks the calling thread to wait for the condition set by pthread_con_signal() for a period of time specified by ts. |
|
Unblocks all threads that are currently blocked on the condition variable cond. |
|
pthread_rwlock_init (pthread_rwlock_t *__restrict rw, const pthread_rwlockattr_t *__restrict a) |
|
pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict rw, const struct timespec *__restrict at) |
Blocks the calling thread to lock a read-write lock for reading. |
pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict rw, const struct timespec *__restrict at) |
Blocks the calling thread to lock a read-write lock for writing. |
pthread_spin_init (pthread_spinlock_t *s, int shared) |
|
pthread_barrier_init (pthread_barrier_t *__restrict b, const pthread_barrierattr_t *__restrict a, unsigned count) |
|
pthread_key_create (pthread_key_t *key, void(*destructor)(void *)) |
|
pthread_setspecific (pthread_key_t key, const void *value) |
|
pthread_attr_init (pthread_attr_t *attr) |
|
pthread_attr_destroy (pthread_attr_t *attr) |
|
pthread_attr_getguardsize (const pthread_attr_t *attr, size_t *guardsize) |
|
pthread_attr_setguardsize (pthread_attr_t *attr, size_t guardsize) |
|
pthread_attr_getstacksize (const pthread_attr_t *attr, size_t *stacksize) |
|
pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) |
|
pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstate) |
|
pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate) |
|
pthread_attr_getstack (const pthread_attr_t *attr, void **stackaddr, size_t *stacksize) |
|
pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize) |
|
pthread_attr_getscope (const pthread_attr_t *attr, int *scope) |
Obtains contention scope attributes of a thread attribute object. |
pthread_attr_setscope (pthread_attr_t *attr, int scope) |
Sets contention scope attributes for a thread attribute object. |
pthread_attr_getschedpolicy (const pthread_attr_t *attr, int *schedpolicy) |
Obtains scheduling policy attributes of a thread attribute object. |
pthread_attr_setschedpolicy (pthread_attr_t *attr, int schedpolicy) |
Sets scheduling policy attributes for a thread attribute object. |
pthread_attr_getschedparam (const pthread_attr_t *attr, struct sched_param *param) |
Obtains scheduling parameter attributes of a thread attribute object. |
pthread_attr_setschedparam (pthread_attr_t *attr, const struct sched_param *param) |
Sets scheduling parameter attributes for a thread attribute object. |
pthread_attr_getinheritsched (const pthread_attr_t *attr, int *inheritsched) |
Obtains inherit scheduler attributes of a thread attribute object. |
pthread_attr_setinheritsched (pthread_attr_t *attr, int inheritsched) |
Sets inherit scheduler attributes for a thread attribute object. |
pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict attr, int *__restrict type) |
|
pthread_mutexattr_settype (pthread_mutexattr_t *attr, int type) |
|
pthread_condattr_setclock (pthread_condattr_t *a, clockid_t clk) |
|
pthread_condattr_getclock (const pthread_condattr_t *__restrict a, clockid_t *__restrict clk) |
|
pthread_atfork (void(*prepare)(void), void(*parent)(void), void(*child)(void)) |
Registers a fork handler to be called before and after fork(). |
pthread_cleanup_push (void(*routine)(void *), void *arg) |
Pushes the routine to the top of the clean-up handler stack. |
pthread_cleanup_pop (int execute) |
Removes the routine at the top of the clean-up handler stack. |
pthread_getattr_np (pthread_t thread, pthread_attr_t *attr) |
|
pthread_setname_np (pthread_t pthread, const char *name) |
|
pthread_getaffinity_np (pthread_t td, size_t size, cpu_set_t *set) |
|
pthread_setaffinity_np (pthread_t td, size_t size, const cpu_set_t *set) |
|
sched_get_priority_max (int policy) |
Obtains the maximum static priority that can be used for a process. |
sched_get_priority_min (int policy) |
Obtains the minimum static priority that can be used for a process. |
sched_getparam (pid_t pid, struct sched_param *param) |
|
sched_getscheduler (pid_t pid) |
|
sched_rr_get_interval (pid_t pid, struct timespec *interval) |
|
sched_setparam (pid_t pid, const struct sched_param *param) |
Sets scheduling parameters related to a scheduling policy for a process. |
sched_setscheduler (pid_t pid, int policy, const struct sched_param *param) |
|
sched_yield (void) |
|
capget (cap_user_header_t hdr_ptr, cap_user_data_t data_ptr) |
Obtains the capability information of a specified process based on the input parameters (compatible with the Linux API format). |
capset (cap_user_header_t hdr_ptr, const cap_user_data_t data_ptr) |
Sets the capability information for a specified process based on the input parameters (compatible with the Linux API format). |
ohos_capget (pid_t pid, unsigned int *caps) |
Obtains the capability information of the specified process process based on the input parameters. |
ohos_capset (unsigned int caps) |
Sets the capability information of the current process based on the input parameters. |
getpriority (int which, id_t who) |
|
setpriority (int which, id_t who, int value) |
|
wait (int *status) |
Waits for any child process to end and reclaims its resources. |
|
Waits for a specified child process to end and reclaims its resources. |
| hdr_ptr | Indicates the data structure required for this function call, including the API version and the target PID. |
| data_ptr | Indicates the buffer space for storing the process capabilities. |
| which | Indicates a specified value, which can be: |
| who | Indicates the specified ID. |
| pid | Indicates the specified process. |
| caps | Indicates the pointer to the memory address for storing the obtained capability information of a specified process. |
| prepare | Indicates the pointer to the fork handler to be called before fork(). |
| parent | Indicates the pointer to the fork handler to be called after fork() in the parent process. |
| child | Indicates the pointer to the fork handler to be called after fork() in the child process. |
| attr | Indicates the pointer to the thread attribute object to destroy. |
| attr | Indicates the pointer to the target thread attribute object. |
| detachstate | Indicates the pointer to the obtained detach state. |
| attr | Indicates the pointer to the target thread attribute object. |
| guardsize | Indicates the pointer to the obtained guard size. |
| attr | Indicates the pointer to the target thread attribute object. |
| inheritsched | Indicates the pointer to the obtained inherit scheduler attributes. |
| attr | Indicates the pointer to the target thread attribute object. |
| param | Indicates the pointer to the obtained scheduling parameter attributes. Only the thread priority is supported. The priority ranges from 0 (highest priority) to 31 (lowest priority). |
| attr | Indicates the pointer to the target thread attribute object. |
| schedpolicy | Indicates the pointer to the obtained scheduling policy attributes. Only SCHED_FIFO and SCHED_RR are supported. |
| attr | Indicates the pointer to the target thread attribute object. |
| scope | Indicates the pointer to the start address of the buffer that stores the target thread attribute object. |
| attr | Indicates the pointer to the target thread attribute object. |
| stackaddr | Indicates the double pointer to the start address of the buffer that stores the obtained stack attributes. |
| stacksize | Indicates the pointer to the size of the buffer that stores the obtained stack attributes. |
| attr | Indicates the pointer to the target thread attribute object. |
| stacksize | Indicates the pointer to the obtained stack size. |
| attr | Indicates the pointer to the thread attribute object that is successfully initialized. |
| attr | Indicates the pointer to the target thread attribute object. |
| detachstate | Indicates the detach state to set. Available values are as follows: |
| attr | Indicates the pointer to the target thread attribute object. |
| guardsize | Indicates the guard size to set. |
| attr | Indicates the pointer to the target thread attribute object. |
| inheritsched | Indicates the inherit scheduler attributes to set. |
| attr | Indicates the pointer to the target thread attribute object. |
| param | Indicates the pointer to the scheduling parameter attributes to set. Only the thread priority is supported. The priority ranges from 0 (highest priority) to 31 (lowest priority). |
| attr | Indicates the pointer to the target thread attribute object. |
| schedpolicy | Indicates the scheduling policy attributes to set. Only SCHED_FIFO and SCHED_RR are supported. |
| attr | Indicates the pointer to the thread attribute object. |
| stackaddr | Indicates the pointer to the start address of the buffer that stores the stack attributes to set. |
| stacksize | Indicates the size of the buffer that stores the stack attributes to set. |
| attr | Indicates the pointer to the target thread attribute object. |
| stacksize | Indicates the stack size. |
| b | Indicates the pointer to the barrier to destroy. |
| b | Indicates the pointer to the barrier to initialize. |
| a | Indicates the pointer to the barrier attribute object. If this parameter is set to NULL, the default barrier attributes are used. |
| count | Indicates the number of threads that must call pthread_barrier_wait() before any of them successfully returns from the call. |
The value of count is greater than the maximum number of threads to block. |
| b | Indicates the pointer to the barrier to be used for synchronization. |
| a | Indicates the pointer to the barrier attribute object to destroy. |
| a | Indicates the pointer to the barrier attribute object to initialize. |
| thread | Indicates the thread to receive the cancellation request. |
| execute | Specifies whether the routine at the top of the clean-up handler stack should be executed. If this parameter is set to a non-zero value, the routine at the top of the clean-up handler stack must be popped and executed. |
| routine | Indicates the pointer to the routine used to complete the clean-up. |
| arg | Indicates the parameter to be passed to the routine. |
| c | Indicates the pointer to the condition variable to broadcast. |
| c | Indicates the pointer to the condition variable to destroy. |
| c | Indicates the pointer to the condition variable to signal. |
| c | Indicates the pointer to the condition variable to wait for. |
| m | Indicates the pointer to the mutex associated with the condition variable. |
| ts | Indicates the pointer to the absolute system time when the calling thread stops blocking. |
| c | Indicates the pointer to the condition variable to wait for. |
| m | Indicates the pointer to the mutex associated with the condition variable. |
| a | Indicates the pointer to the variable that contains the condition variable attributes. |
| a | Indicates the pointer to the variable that contains the condition variable attributes. |
| clk | Indicates the pointer to the obtained clock ID. |
| a | Indicates the pointer to the variable that contains the condition variable attributes. |
| a | Indicates the pointer to the variable that contains the condition variable attributes. |
| clk | Indicates the ID of the clock to set. |
Insufficient resource, or the maximum number of threads allowed by the system reached. |
| thread | Indicates the ID of the user-level thread to detach. |
| t1 | Indicates the first thread. |
| t2 | Indicates the second thread. |
| retval | Indicates the pointer to the return value after the thread is terminated. |
| td | Indicates the thread whose affinity is to be obtained. |
| size | The size of the cpu_set_t struct. |
| set | The pointer to the cpu_set_t struct recording the getting affinity. |
The size is not equal to the cpu_set_t or the td is invalid. |
| thread | Indicates the thread that has been created. |
| attr | Indicates the pointer to the attribute values that describe the running thread. |
No permission to obtain the specified scheduling policy and parameters. |
| key | Indicates the key bound to the thread data. |
| thread | Indicates the target thread. |
| retval | Indicates the double pointer to the exit or cancellation status of the target thread. This parameter can be NULL. |
The thread is not joinable, or the target thread is the calling thread. |
| key | Indicates the pointer to the key to set for the thread data. |
| destructor | Indicates the pointer to the function to be bound to the key. |
The system lacks the necessary resources to create another thread-specific key, or the number of keys exceeds the limit specified by PTHREAD_KEYS_MAX for each process. |
| key | Indicates the pointer to the key to delete for the thread data. |
| thread | Indicates the thread to receive the signal. |
| sig | Indicates the signal to send. |
| m | Indicates the pointer to the mutex to destroy. |
| m | Indicates the pointer to the mutex to lock. |
The thread attempts to relock the mutex that it has already locked, and the mutex is of the error check mutex type. |
|
The maximum number of recursive locks for the mutex has been exceeded. |
| m | Indicates the pointer to the mutex to lock. |
| at | Indicates the pointer to the maximum duration that the calling thread waits for the mutex. |
The maximum number of recursive locks for the mutex has been exceeded. |
|
The mutex cannot be acquired within the specified period of time. |
| m | Indicates the pointer to the mutex to lock. |
The maximum number of recursive locks for the mutex has been exceeded. |
| m | Indicates the pointer to the mutex to unlock. |
| attr | Indicates the pointer to the target mutex attribute object. |
| attr | Indicates the pointer to the mutex attribute object. |
| type | Indicates the pointer to the obtained mutex type attribute. |
| attr | Indicates the pointer to the target mutex attribute object. |
| attr | Indicates the pointer to the mutex attribute object. |
| type | Indicates the type of the mutex. |
| rw | Indicates the pointer to the read-write lock to destroy. |
| rw | Indicates the pointer to the target read-write lock. |
| rw | Indicates the pointer to the read-write lock to lock. |
| at | Indicates the maximum duration that the calling thread waits for the read-write lock. |
The read-write lock cannot be acquired within the specified period of time. |
| rw | Indicates the pointer to the read-write lock to lock. |
| at | Indicates the pointer to the maximum duration that the calling thread waits for the read-write lock. |
The read-write lock cannot be acquired within the specified period of time. |
| rw | Indicates the pointer to the target read-write lock. |
| rw | Indicates the pointer to the read-write lock to lock. |
| rw | Indicates the pointer to the read-write lock to unlock. |
| rw | Indicates the pointer to the read-write lock to lock. |
| attr | Indicates the pointer to the read-write lock attribute object to destroy. |
| attr | Indicates the pointer to the read-write lock attribute object to initialize. |
| td | Indicates the thread whose affinity is to be changed. |
| size | The size of the cpu_set_t struct. |
| set | The pointer to the cpu_set_t struct recording the setting affinity. |
The size is not equal to the cpu_set_t or the td is invalid. |
| state | Indicates the cancelability state to set. Available values are as follows: |
| oldstate | Indicates the pointer to the previous cancelability state before the setting. |
| type | Indicates the cancelability type to set. Available values are as follows: |
| oldtype | Indicates the pointer to the previous cancelability type before the setting. |
The thread is canceled immediately upon receiving a cancellation request. |
| thread | Indicates the thread whose name is to be changed. |
| name | Indicates the pointer to the thread name to set. The value contains a maximum of 16 characters, including the terminating null byte ('\0'). |
No permission to set the specified scheduling policy and parameters. |
| thread | Indicates the target thread. |
| priority | Indicates the static scheduling priority to set. The value ranges from 0 (highest priority) to 31 (lowest priority). |
No permission to set the specified scheduling policy and parameters. |
| key | Indicates the key bound to the thread data. |
| value | Indicates the pointer to the thread data to be bound to the key. |
| s | Indicates the pointer to the spin lock to destroy. |
| s | Indicates the pointer to the spin lock to initialize. |
| shared | Indicates thread process-shared synchronization, which is not supported. |
| s | Indicates the pointer to the spin lock to lock. |
| s | Indicates the pointer to the spin lock to lock. |
| s | Indicates the pointer to the spin lock to unlock. |
| policy | Indicates the scheduling policy. The value can be SCHED_FIFO or SCHED_RR, but not SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, or SCHED_DEADLINE. |
Invalid parameter. The value of policy is not a defined scheduling policy. |
| policy | Indicates the scheduling policy. The value can be SCHED_FIFO or SCHED_RR, but not SCHED_OTHER, SCHED_BATCH, SCHED_IDLE, or SCHED_DEADLINE. |
Invalid parameter. The value of policy is not a defined scheduling policy. |
| pid | Indicates the ID of the process for which the scheduling policy is to be obtained. If this parameter is set to 0, the scheduling policy of the calling process is to be obtained. |
An error occurred when copying information to the user space. |
|
| which | Indicates a specified value, which can be: |
| who | Indicates the specified ID. |
| value | Indicates the target priority to set. |
| status | Indicates the pointer to the obtained status information. If this parameter is not NULL, the status information is stored in the int value that it points to. You can use the following macros defined in private.h to check the integer (the macro uses the integer as a parameter instead of the pointer that points to it):
|
The child process does not exist, or the specified process group does not exist. |
|
| pid | Indicates the ID of the child process to wait for.
|
| status | Indicates the pointer to the obtained status information. If this parameter is not NULL, the status information is stored in the int value that it points to. You can use the following macros defined in private.h to check the integer (the macro uses the integer as a parameter instead of the pointer that points to it):
|
| options | Provides some options to control the behavior of this function. If you do not want to use these options, set this parameter to 0. WNOHANG: If the child process specified by pid is not ended, this function returns 0 immediately instead of blocking the calling process. If the child process is ended, the process ID of the child process is returned. WUNTRACED, WEXITED, WSTOPPED, WCONTINUED, and WNOWAIT are not supported. |
The child process does not exist, or the specified process group does not exist. |
|