#976842 sem_init(3): misleading documentation of the pshared argument

#976842#5
Date:
2020-12-08 13:42:02 UTC
From:
To:
Hello,

the manpage of sem_init(3) reads:

   The pshared argument indicates whether this semaphore is to be shared
   between the threads of a process, or between processes.

but in fact, this is exactly the opposite (as the name implies). This argument
indicates whether the semaphore is to be shared between several processes, or
to be private to the current process and shared only between threads of that
process.

This is confirmed for example by the Open Group version of the same
documentation:
https://pubs.opengroup.org/onlinepubs/007908799/xsh/sem_init.html

Also in the same line: the solaris documentation:
https://docs.oracle.com/cd/E19120-01/open.solaris/816-5137/sync-19683/index.html

Thanks for packaging this documentation and for centralizing all this work.
Mt