2 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH sem_post 3 (date) "Linux man-pages (unreleased)"
8 sem_post \- unlock a semaphore
11 .RI ( libpthread ", " \-lpthread )
14 .B #include <semaphore.h>
16 .BI "int sem_post(sem_t *" sem );
20 increments (unlocks) the semaphore pointed to by
22 If the semaphore's value consequently becomes greater than zero,
23 then another process or thread blocked in a
25 call will be woken up and proceed to lock the semaphore.
29 on error, the value of the semaphore is left unchanged,
32 is set to indicate the error.
37 is not a valid semaphore.
40 .\" Added in POSIX.1-2008 TC1 (Austin Interpretation 213)
41 The maximum allowable value for a semaphore would be exceeded.
43 For an explanation of the terms used in this section, see
51 Interface Attribute Value
54 T} Thread safety MT-Safe
64 it may be safely called within a signal handler.
74 .BR signal\-safety (7)