POSIX.4 Semaphore questions

POSIX.4 Semaphore questions

Post by Scott Moor » Sat, 15 Nov 1997 04:00:00



Hello-

I am new to using POSIX.4 semaphores, and I can not find any
documentation about how permissions are used.  I know that on the
sem_open(), if the caller has O_CREAT in the flags and a semaphore is
created, permissions are set to the values specified by the mode
parameter.

What I don't get is what the permissions mean.  Is it possible to have
the permissions 0604 or 0602?  In other words, does it make sense to
have Read only (or write only) permissions to a POSIX semaphore?  The
reason I ask this is because System V semaphores this makes sense, but I
am not sure of the POSIX implementation.    

If this is valid input on the sem_open, let's say that user A creates a
named semaphore:

sem_t semPtr = sem_open("/mysem", O_CREATE | O_EXCL, 0604, 0);

And user B accesses the semaphore with:

sem_t semPtr = sem_open("/mysem", 0);

Would this fail for user B?  Do you need both read and write access to
get the semaphore?

Thank you for any input!

Scott

 
 
 

POSIX.4 Semaphore questions

Post by Scott Moor » Thu, 20 Nov 1997 04:00:00


This question has been answered in comp.unix.questions, if anyone is
interested...

Thanks,
Scott

 
 
 

1. POSIX.4 Semaphore questions

Hello-

I am new to using POSIX.4 semaphores, and I can not find any
documentation about how permissions are used.  I know that on the
sem_open(), if the caller has O_CREAT in the flags and a semaphore is
created, permissions are set to the values specified by the mode
parameter.

What I don't get is what the permissions mean.  Is it possible to have
the permissions 0604 or 0602?  In other words, does it make sense to
have Read only (or write only) permissions to a POSIX semaphore?  The
reason I ask this is because System V semaphores this makes sense, but I
am not sure of the POSIX implementation.    

If this is valid input on the sem_open, let's say that user A creates a
named semaphore:

sem_t semPtr = sem_open("/mysem", O_CREATE | O_EXCL, 0604, 0);

And user B accesses the semaphore with:

sem_t semPtr = sem_open("/mysem", 0);

Would this fail for user B?  Do you need both read and write access to
get the semaphore?

Thank you for any input!
Scott

2. exporting displays from one terminal to another

3. Sys V Semaphores vs. POSIX Semaphores??

4. linking solaris objects with 4.1.3 libraries (.a)

5. POSIX Thread Safe Semaphores & FreeBSD questions

6. AVer TV 98 or ASKEY TView 99 under Linux

7. POSIX system call interface and POSIX standard: questions

8. POSIX signal

9. FAQ Question 4.1 in POSIX: How do you get the key value via POSIX?

10. posix named semaphore value not reflected across process

11. %!@# Help Posix semaphores & mmap

12. POSIX Namned Semaphore

13. using Posix/SystemV semaphores under Linux RH 6.2