SEM_POST
NAMESYNOPSIS
DESCRIPTION
RETURN VALUE
ERRORS
ATTRIBUTES
CONFORMING TO
NOTES
EXAMPLE
SEE ALSO
COLOPHON
NAME
sem_post − unlock a semaphore
SYNOPSIS
#include <semaphore.h>
int sem_post(sem_t *sem);
Link with −pthread.
DESCRIPTION
sem_post() increments (unlocks) the semaphore pointed to by sem. If the semaphore’s value consequently becomes greater than zero, then another process or thread blocked in a sem_wait(3) call will be woken up and proceed to lock the semaphore.
RETURN VALUE
sem_post() returns 0 on success; on error, the value of the semaphore is left unchanged, −1 is returned, and errno is set to indicate the error.
ERRORS
EINVAL |
sem is not a valid semaphore. |
EOVERFLOW
The maximum allowable value for a semaphore would be exceeded.
ATTRIBUTES
Multithreading
(see pthreads(7))
The sem_post() function is thread-safe.
CONFORMING TO
POSIX.1-2001.
NOTES
sem_post() is async-signal-safe: it may be safely called within a signal handler.
EXAMPLE
See sem_wait(3).
SEE ALSO
sem_getvalue(3), sem_wait(3), sem_overview(7)
COLOPHON
This page is part of release 3.69 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at http://www.kernel.org/doc/man−pages/.
More Linux Commands
manpages/gnutls_dh_params_import_raw.3.html
gnutls_dh_params_import_raw(3) - API function (Man Page)....
This function will replace the pair of prime and generator for use in the Diffie-Hellman key exchange. The new parameters should be stored in the appropriate gn
manpages/sane-canon.5.html
sane-canon(5) - SANE backend for Canon SCSI scanners........
The sane-canon library implements a SANE (Scanner Access Now Easy) backend that provides access to the following Canon flatbed and film scanners: CanoScan 300 C
manpages/bznew.1.html
bznew(1) - recompress .gz or .tgz files to .bz2 files.......
Bznew recompresses files from .gz (gzip) format to .bz2 (bzip2) format. If you want to recompress a file already in bzip2 format, rename the file to force a .bz
manpages/xdg-su.1.html
xdg-su(1) - run a GUI program as root after prompting for th
xdg-su provides a graphical dialog that prompts the user for a password to run command as user or as root if no user was specified. xdg-su is for use inside a d
manpages/passwd.nntp.5.html
passwd.nntp(5) - Passwords for connecting to remote NNTP ser
The file pathetc/passwd.nntp contains host / name / password triplets for use when authenticating client programs to NNTP servers. This file is normally interpr
manpages/Tk_FreeBitmapFromObj.3.html
Tk_FreeBitmapFromObj(3) - maintain database of single-plane
These procedures manage a collection of bitmaps (one-plane pixmaps) being used by an application. The procedures allow bitmaps to be re-used efficiently, thereb
manpages/ExtUtils::Miniperl.3pm.html
ExtUtils::Miniperl(3pm) - write the C code for perlmain.c...
This whole module is written when perl itself is built from a script called minimod.PL. In case you want to patch it, please patch minimod.PL in the perl distri
manpages/git-receive-pack.1.html
git-receive-pack(1) - Receive what is pushed into the reposi
Invoked by git send-pack and updates the repository with the information fed from the remote end. This command is usually not invoked directly by the end user.
manpages/extendedopacity.5.html
extendedopacity(5) - theory of netpbm interpolation and extr
This page is a copy of http://www.sgi.com/misc/grafica/interp/ on April 17, 2003, with some slight formatting changes, included in the Netpbm documentation for
manpages/disable.8.html
disable(8) disable an AppArmor security profile (Man Page)
aa-disable is used to disable one or more profiles. This command will unload the profile from the kernel and prevent the profile from being loaded on AppArmor s
manpages/XDrawLine.3.html
XDrawLine(3) - draw lines, polygons, and line structure.....
The XDrawLine function uses the components of the specified GC to draw a line between the specified set of points (x1, y1) and (x2, y2). It does not perform joi
manpages/mountd.8.html
mountd(8) - NFS mount daemon (Admin - Linux man page).......
The rpc.mountd daemon implements the server side of the NFS MOUNT protocol, an NFS side protocol used by NFS version 2 [RFC1094] and NFS version 3 [RFC1813]. An
