Deleted Added
full compact
a.t (1639) a.t (18715)
1.\" Copyright (c) 1986 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

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

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)a.t 5.1 (Berkeley) 4/16/91
1.\" Copyright (c) 1986 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.

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

25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.\" @(#)a.t 5.1 (Berkeley) 4/16/91
33.\" $Id$
33.\"
34.sp 2
35.ne 2i
36.NH
37Appendix A \- Virtual Memory Interface
38.SH
39Mapping pages
40.PP

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

195PROT_READ and PROT_WRITE.
196The MAP_HASSEMAPHORE flag must have been specified when the region was created.
197To acquire a lock a process calls:
198.DS
199value = mset(sem, wait)
200result int value; semaphore *sem; int wait;
201.DE
202\fIMset\fP indivisibly tests and sets the semaphore \fIsem\fP.
34.\"
35.sp 2
36.ne 2i
37.NH
38Appendix A \- Virtual Memory Interface
39.SH
40Mapping pages
41.PP

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

196PROT_READ and PROT_WRITE.
197The MAP_HASSEMAPHORE flag must have been specified when the region was created.
198To acquire a lock a process calls:
199.DS
200value = mset(sem, wait)
201result int value; semaphore *sem; int wait;
202.DE
203\fIMset\fP indivisibly tests and sets the semaphore \fIsem\fP.
203If the the previous value is zero, the process has acquired the lock
204If the previous value is zero, the process has acquired the lock
204and \fImset\fP returns true immediately.
205Otherwise, if the \fIwait\fP flag is zero,
206failure is returned.
207If \fIwait\fP is true and the previous value is non-zero,
208\fImset\fP relinquishes the processor until notified that it should retry.
209.LP
210To release a lock a process calls:
211.DS

--- 28 unchanged lines hidden ---
205and \fImset\fP returns true immediately.
206Otherwise, if the \fIwait\fP flag is zero,
207failure is returned.
208If \fIwait\fP is true and the previous value is non-zero,
209\fImset\fP relinquishes the processor until notified that it should retry.
210.LP
211To release a lock a process calls:
212.DS

--- 28 unchanged lines hidden ---