Deleted Added
full compact
semget.2 (84306) semget.2 (108028)
1.\"
2.\" Copyright (c) 1995 David Hovemeyer <daveho@infocom.com>
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 9 unchanged lines hidden (view full) ---

18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
1.\"
2.\" Copyright (c) 1995 David Hovemeyer <daveho@infocom.com>
3.\"
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:

--- 9 unchanged lines hidden (view full) ---

18.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
19.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25.\"
26.\" $FreeBSD: head/lib/libc/sys/semget.2 84306 2001-10-01 16:09:29Z ru $
26.\" $FreeBSD: head/lib/libc/sys/semget.2 108028 2002-12-18 09:22:32Z ru $
27.\"
28.Dd September 12, 1995
29.Dt SEMGET 2
30.Os
31.Sh NAME
32.Nm semget
33.Nd obtain a semaphore id
34.Sh LIBRARY

--- 26 unchanged lines hidden (view full) ---

61.It
62An integer constant may be specified. If no IPC object corresponding
63to
64.Fa key
65is specified and the IPC_CREAT bit is set in
66.Fa flag ,
67a new one will be created.
68.It
27.\"
28.Dd September 12, 1995
29.Dt SEMGET 2
30.Os
31.Sh NAME
32.Nm semget
33.Nd obtain a semaphore id
34.Sh LIBRARY

--- 26 unchanged lines hidden (view full) ---

61.It
62An integer constant may be specified. If no IPC object corresponding
63to
64.Fa key
65is specified and the IPC_CREAT bit is set in
66.Fa flag ,
67a new one will be created.
68.It
69.Fn ftok
70may be used to generate a key from a pathname. See
71.Xr ftok 3 .
69The
70.Xr ftok 3
71function
72may be used to generate a key from a pathname.
72.El
73.\"
74.\" Likewise for this section, except SHM_* becomes SEM_*.
75.\"
76.Pp
77The mode of a newly created IPC object is determined by
78.Em OR Ns 'ing
79the following constants into the

--- 16 unchanged lines hidden (view full) ---

96.Pp
97If a new set of semaphores is being created,
98.Fa nsems
99is used to indicate the number of semaphores the set should contain.
100Otherwise,
101.Fa nsems
102may be specified as 0.
103.Sh RETURN VALUES
73.El
74.\"
75.\" Likewise for this section, except SHM_* becomes SEM_*.
76.\"
77.Pp
78The mode of a newly created IPC object is determined by
79.Em OR Ns 'ing
80the following constants into the

--- 16 unchanged lines hidden (view full) ---

97.Pp
98If a new set of semaphores is being created,
99.Fa nsems
100is used to indicate the number of semaphores the set should contain.
101Otherwise,
102.Fa nsems
103may be specified as 0.
104.Sh RETURN VALUES
104.Fn Semget
105The
106.Fn semget
107system call
105returns the id of a semaphore set if successful; otherwise, -1
106is returned and
107.Va errno
108is set to indicate the error.
109.Sh ERRORS
108returns the id of a semaphore set if successful; otherwise, -1
109is returned and
110.Va errno
111is set to indicate the error.
112.Sh ERRORS
110.Fn Semget
113The
114.Fn semget
115system call
111will fail if:
112.Bl -tag -width Er
113.\" ipcperm could fail (we're opening to read and write, as it were)
114.It Bq Er EACCES
115Access permission failure.
116.\"
117.\" sysv_sem.c is quite explicit about these, so I'm pretty sure
118.\" this is accurate

--- 23 unchanged lines hidden ---
116will fail if:
117.Bl -tag -width Er
118.\" ipcperm could fail (we're opening to read and write, as it were)
119.It Bq Er EACCES
120Access permission failure.
121.\"
122.\" sysv_sem.c is quite explicit about these, so I'm pretty sure
123.\" this is accurate

--- 23 unchanged lines hidden ---