Relevant manual pages are
   semopen.3, lock.3, locked.3, lockif.3, unlock.3,
   semaphores.5
which will be found in the 'doc' subdirectory.

	This is a small and simple binary semaphore system.
To implement it you must
1.  Include a suitable "semaphore" entry in your
/usr/sys/conf/c.c file; our own c.c file is included as
an example.  Suppose your "semaphores" entry is
line 17 (18th line) of the "cdevsw" table.
2.  Edit /usr/conf/sys/param.h to include a statement
#define NSEM	x
where x is a positive integer.  You then have NSEM*8
semaphores.
3.  Then you must
cc -c $i/semphr.c
ar x /lib/libc.a read.o write.o
ar r /lib/libc.a semphr.o
ar r /lib/libc.a read.o write.o
cd /usr/sys/dmr
cc -c -O $i/sem.c
ar r ../lib2 sem.o
$i/cccasld
cp /unix /unix.b
mv a.out /unix
This macro has not been tested.  Note that ccasld is
a system generation macro.
	To set up a semaphore, with minor device number d,
where  0 <= d < 8*NSEM, if d= 9 :-
/etc/mknod /dev/hooray c 17 9
chown j.bloggs /dev/hooray
chmod 400 /dev/hooray
