semaphore file location ?

semaphore file location ?

Post by Jaguk K » Sat, 05 Oct 2002 15:10:55



Hi there,

I make a test program which makes a posix named semaphore. but I can not
find the semaphore file in file system.

machine => SunOS 5.8
semaphore => posix named semaphore
name => /test10

source =>
sem_t *sem = sem_open("/test10", O_RDWR | O_CREAT, 0600, 1);

I would like to find a semaphore file in unix file system.

Thanks in advance

Jaguk Ku

 
 
 

semaphore file location ?

Post by Ryan Younc » Sat, 05 Oct 2002 18:00:52


On Fri, 4 Oct 2002 15:10:55 +0900


> Hi there,

> I make a test program which makes a posix named semaphore. but I can
> not find the semaphore file in file system.

> machine => SunOS 5.8
> semaphore => posix named semaphore
> name => /test10

> source =>
> sem_t *sem = sem_open("/test10", O_RDWR | O_CREAT, 0600, 1);

> I would like to find a semaphore file in unix file system.

POSIX named IPC mechanisms are not required to exist in the filesystem,
only that they _might_ exist in the filesystem.

        Ryan

 
 
 

semaphore file location ?

Post by Marc Rochkin » Sat, 05 Oct 2002 22:28:18


Quote:> POSIX named IPC mechanisms are not required to exist in the filesystem,
> only that they _might_ exist in the filesystem.

Right. Furthermore, IF the "file" /test10 were to exist in the file system,
the process would need superuser permission to create it, as it is in the
root directory. (On some systems it DOES exist in the file system, and so
non-privileged processes have to use a path like "/tmp/test10," which is not
portable.)

--Marc

 
 
 

semaphore file location ?

Post by Bill Medlan » Sun, 06 Oct 2002 01:25:30



Quote:> Hi there,

> I make a test program which makes a posix named semaphore. but I can not
> find the semaphore file in file system.

> machine => SunOS 5.8
> semaphore => posix named semaphore
> name => /test10

> source =>
> sem_t *sem = sem_open("/test10", O_RDWR | O_CREAT, 0600, 1);

> I would like to find a semaphore file in unix file system.

Why?  What do you want to do with it?

Quote:

> Thanks in advance

> Jaguk Ku

Bill
 
 
 

semaphore file location ?

Post by Dragan Cvetkovi » Sun, 06 Oct 2002 01:45:51



> Hi there,

> I make a test program which makes a posix named semaphore. but I can not
> find the semaphore file in file system.

> machine => SunOS 5.8
> semaphore => posix named semaphore
> name => /test10

> source =>
> sem_t *sem = sem_open("/test10", O_RDWR | O_CREAT, 0600, 1);

> I would like to find a semaphore file in unix file system.

> Thanks in advance

> Jaguk Ku

OK. On my system (again Sol 8) they are under /var/tmp/.SEM[LD] i.e.:

$ ls -al /var/tmp/.SEM*

/var/tmp/.SEMD:
total 20
drwxrwxrwx   2 dragan   sax          512 Oct  4 12:42 ./
drwxrwxrwt  11 root     sys         8192 Oct  4 12:42 ../
-rw-------   1 dragan   sax           48 Oct  4 12:42 test10

/var/tmp/.SEML:
total 18
drwxrwxrwx   2 dragan   sax          512 Oct  4 12:42 ./
drwxrwxrwt  11 root     sys         8192 Oct  4 12:42 ../
$

HTH, Dragan

P.S. Stevens discusses this issue in his UNP 2e, v2

--
Dragan Cvetkovic,

To be or not to be is true. G. Boole      No it isn't.  L. E. J. Brouwer