process shared semaphores?

From: Andrew Gallatin <gallatin_at_cs.duke.edu>
Date: Wed, 02 Dec 2009 16:11:30 -0500
The man page for sem_init(3) says:

      A non-zero value for pshared specifies a
      shared semaphore that can be used by multiple processes, which this
      implementation is not capable of.

Is this still correct?   I'm asking, both because it seems strange to
not return an error if the implementation does not support pshared
semaphores, and because the threads library seems to expect
it to work.  Eg:

int
_sem_init(sem_t *sem, int pshared, unsigned int value)
{
         semid_t semid;

         semid = (semid_t)SEM_USER;
         if ((pshared != 0) && (ksem_init(&semid, value) != 0))
                 return (-1);
<....


So is the man page out of date, or is the userspace code future-proof
for when the kernel catches up?

Thanks,

Drew
Received on Wed Dec 02 2009 - 20:11:40 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC