3 .\" Wilfredo Sanchez, wsanchez@apple.com
4 .\" Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
6 .\" @APPLE_LICENSE_HEADER_START@
8 .\" The contents of this file constitute Original Code as defined in and
9 .\" are subject to the Apple Public Source License Version 1.1 (the
10 .\" "License"). You may not use this file except in compliance with the
11 .\" License. Please obtain a copy of the License at
12 .\" http://www.apple.com/publicsource and read it before using this file.
14 .\" This Original Code and all software distributed under the License are
15 .\" distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 .\" FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 .\" License for the specific language governing rights and limitations
20 .\" under the License.
22 .\" @APPLE_LICENSE_HEADER_END@
29 .Nd unlock a semaphore
31 .Fd #include <semaphore.h>
33 .Fn sem_post "sem_t *sem"
35 The the semaphore referenced by
37 is unlocked, the value of the semaphore is incremented, and all
38 threads which are waiting on the semaphore are awakened.
41 is reentrant with respect to signals and may be called from within a
46 will return 0. Otherwise, -1 is returned and
55 is not a valid semaphore descriptor.
66 is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).