]> git.saurik.com Git - apple/libc.git/blob - sys.subproj/sem_unlink.2
Libc-186.tar.gz
[apple/libc.git] / sys.subproj / sem_unlink.2
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_UNLINK 2
26 .Os Darwin
27 .Sh NAME
28 .Nm sem_unlink
29 .Nd remove a named semaphore
30 .Sh SYNOPSIS
31 .Fd #include <semaphore.h>
32 .Ft int
33 .Fn sem_unlink "const char *name"
34 .Sh DESCRIPTION
35 The named semaphore named
36 .Fa name
37 is removed. If the semaphore is in use my other processes, then
38 .Fa name
39 is immeditately dissasociated with the semaphore, but the semaphore
40 itself will not be removed until all references to it have been
41 closed. Subsequent calls to
42 .Fn sem_open
43 using
44 .Fa name
45 will refer to or create a new semaphore named
46 .Fa name .
47 .Pp
48 If successful,
49 .Fn sem_close
50 will return 0. Otherwise, -1 is returned and
51 .Va errno
52 is set, and the state of the semaphore is unchanged.
53 .Sh ERRORS
54 .Fn sem_unlink
55 succeeds unless:
56 .Bl -tag -width Er
57 .It Bq Er EACCES
58 Permission is denied to be remove the semaphore.
59 .It Bq Er ENAMETOOLONG
60 .Fa name
61 exceeded
62 .Dv SEM_NAME_LEN
63 characters.
64 .It Bq Er ENOENT
65 The named semaphore does not exist.
66 .El
67 .Sh SEE ALSO
68 .Xr semctl 2 ,
69 .Xr semget 2 ,
70 .Xr semop 2 ,
71 .Xr sem_close 2 ,
72 .Xr sem_open 2
73 .Sh HISTORY
74 .Fn sem_unlink
75 is specified in the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995).