Index: lib/libc/gen/sem_open.3 =================================================================== --- lib/libc/gen/sem_open.3 (revision 201715) +++ lib/libc/gen/sem_open.3 (working copy) @@ -58,6 +58,12 @@ and .Fn sem_close . .Pp +This implementation places strict requirements on the value of +.Fa name : +it must begin with a slash +.Pq Ql / , +contain no other slash characters. +.Pp The following bits may be set in the .Fa oflag argument: @@ -217,11 +223,3 @@ .Sh HISTORY Support for named semaphores first appeared in .Fx 5.0 . -.Sh BUGS -This implementation places strict requirements on the value of -.Fa name : -it must begin with a slash -.Pq Ql / , -contain no other slash characters, -and be less than 14 characters in length -not including the terminating null character. Index: lib/libc/gen/sem_init.3 =================================================================== --- lib/libc/gen/sem_init.3 (revision 201714) +++ lib/libc/gen/sem_init.3 (working copy) @@ -46,9 +46,19 @@ .Fa sem to have the value .Fa value . +.Pp A non-zero value for .Fa pshared -specifies a shared semaphore that can be used by multiple processes. +specifies a shared semaphore that can be used by multiple processes, +the semaphore should be located in shared memory region (see +.Xr mmap 2 , +.Xr shm_open 2 , +and +.Xr shmget 2 ) , +any process having read and write access to address +.Fa sem +can perform semaphore operations on +.Fa sem . .Pp Following a successful call to .Fn sem_init , @@ -90,10 +100,3 @@ .Fn sem_init function conforms to .St -p1003.1-96 . -.Sh BUGS -A sem_t is a pointer to a separately allocated structure, -therefore process shared semaphores only work between related processes -and do not perform very well -(each operation is a system call, -while single-process semaphores only do a system call -if they need to block or wake up a thread).