Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: gregor@cip-s01.informatik.rwth-aachen.de (Gregor Bautz) Newsgroups: comp.sys.sun Subject: Problems with semaphores under SunOS4.1 Keywords: SunOS Message-ID: <1386@brchh104.bnr.ca> Date: 23 Jan 91 23:19:48 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 22 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 10, Issue 12, message 18 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu Has anybody experience using semaphores with SunOS 4.1. I've got the following problems: First, I create the semaphore using the semget() function with flag = IPC_CREAT|IPC_EXCL|0666 in process, let's call it proc1. After that the semaphore is initialised with the value 1 by semctl(); the value is set correctly, showed by a following semctl(GETVAL); Then, in a second process (proc2) I tried to access the semaphores with 'sem_id = semget(key,1,0);' No error occurs, even the shell command ipcs shows the semaphore. But, and that's the question the value of the semaphore is zero, although it has been initialised with 1. Could anybody explain this behaviour or could show me a way to get rid of this problem. Thanx! Gregor P.S. If you can help me, please Re, or send a mail to: gregor@cip-s01.informatik.rwth-aachen.de