66 lines
1.8 KiB
Groff
66 lines
1.8 KiB
Groff
|
.\" $Darwin$
|
||
|
.\"
|
||
|
.\" Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
|
||
|
.\"
|
||
|
.\" @APPLE_LICENSE_HEADER_START@
|
||
|
.\"
|
||
|
.\" The contents of this file constitute Original Code as defined in and
|
||
|
.\" are subject to the Apple Public Source License Version 1.1 (the
|
||
|
.\" "License"). You may not use this file except in compliance with the
|
||
|
.\" License. Please obtain a copy of the License at
|
||
|
.\" http://www.apple.com/publicsource and read it before using this file.
|
||
|
.\"
|
||
|
.\" This Original Code and all software distributed under the License are
|
||
|
.\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
|
||
|
.\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
|
||
|
.\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
|
||
|
.\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
|
||
|
.\" License for the specific language governing rights and limitations
|
||
|
.\" under the License.
|
||
|
.\"
|
||
|
.\" @APPLE_LICENSE_HEADER_END@
|
||
|
.\"
|
||
|
.Dd June 8, 2000
|
||
|
.Dt SEM_POST 2
|
||
|
.Os Darwin
|
||
|
.Sh NAME
|
||
|
.Nm sem_post
|
||
|
.Nd unlock a semaphore
|
||
|
.Sh SYNOPSIS
|
||
|
.Fd #include <semaphore.h>
|
||
|
.Ft int
|
||
|
.Fn sem_post "sem_t *sem"
|
||
|
.Sh DESCRIPTION
|
||
|
The semaphore referenced by
|
||
|
.Fa sem
|
||
|
is unlocked, the value of the semaphore is incremented, and all
|
||
|
threads which are waiting on the semaphore are awakened.
|
||
|
.Pp
|
||
|
.Fn sem_post
|
||
|
is reentrant with respect to signals and may be called from within a
|
||
|
signal hanlder.
|
||
|
.Pp
|
||
|
If successful,
|
||
|
.Fn sem_post
|
||
|
will return 0. Otherwise, -1 is returned and
|
||
|
.Va errno
|
||
|
is set.
|
||
|
.Sh ERRORS
|
||
|
.Fn sem_post
|
||
|
succeeds unless:
|
||
|
.Bl -tag -width Er
|
||
|
.It Bq Er EINVAL
|
||
|
.Fa sem
|
||
|
is not a valid semaphore descriptor.
|
||
|
.El
|
||
|
.Sh SEE ALSO
|
||
|
.Xr sem_open 2 ,
|
||
|
.Xr sem_trywait 2 ,
|
||
|
.Xr sem_wait 2 ,
|
||
|
.Xr semctl 2 ,
|
||
|
.Xr semget 2 ,
|
||
|
.Xr semop 2
|
||
|
.Sh HISTORY
|
||
|
.Fn sem_post
|
||
|
is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).
|