]> git.saurik.com Git - apple/libc.git/blame - sys.subproj/sem_close.2
Libc-166.tar.gz
[apple/libc.git] / sys.subproj / sem_close.2
CommitLineData
e9ce8d39
A
1.\" $Darwin$
2.\"
3.\" Wilfredo Sanchez, wsanchez@apple.com
4.\" Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
5.\"
6.\" @APPLE_LICENSE_HEADER_START@
7.\"
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.
13.\"
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.
21.\"
22.\" @APPLE_LICENSE_HEADER_END@
23.\"
24.Dd June 8, 2000
25.Dt SEM_CLOSE 2
26.Os Darwin
27.Sh NAME
28.Nm sem_close
29.Nd close a named semaphore
30.Sh SYNOPSIS
31.Fd #include <semaphore.h>
32.Ft int
33.Fn sem_close "sem_t *sem"
34.Sh DESCRIPTION
35The system resources associated with the named semaphore referenced by
36.Fa sem
37are deallocated and the descriptor is invalidated.
38.Pp
39If successful,
40.Fn sem_close
41will return 0. Otherwise, -1 is returned and
42.Va errno
43is set.
44.Sh ERRORS
45.Fn sem_close
46succeeds unless:
47.Bl -tag -width Er
48.It Bq Er EINVAL
49.Fa sem
50is not a valid semaphore descriptor.
51.El
52.Sh SEE ALSO
53.Xr semctl 2 ,
54.Xr semget 2 ,
55.Xr semop 2 ,
56.Xr sem_init 2 ,
57.Xr sem_open 2 ,
58.Xr sem_unlink 2
59.Sh HISTORY
60.Fn sem_close
61is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).