🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #1048

semget(2) - value of newly created semaphores?

#1048
From: Johannes Sjogren
Date: Wed, 17 Oct 1990 23:00
19 lines
1124 bytes
I have a question about the behaviour of the semget(2) system call.

If I do

	semid = semget(SEMKEY, 1, 0777|IPC_CREAT);

and a new semaphore is created, is the value  of a newly created
semaphore guaranteed to be initialized to 0?

On DG/UX 4.30 the manual page for semget says this is the case.
On most other systems however the manual page says the value is undefined.
Is there any reason why the semaphore value shouldn't be reset to 0 
on creation? 
Maybe the (I suppose) system V derived "normal" manual pages are wrong?

-- 
  Johannes Sjogren				sgren@dynas.se
  DynaSoft, Dynamic Software AB			Phone: +46-8-726 85 60
  Liljeholmsv 10, S-117 43 STOCKHOLM, SWEDEN	Fax: +46-8-18 11 45
Technical Details
Message-ID: <1990Oct17.230025.16411@dynas.se>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!njin!uupsi!sunic!dynas!sgren

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!wuarchive!udel!princeton!njin!uupsi!sunic!dynas!sgren
From: sgren@dynas.se (Johannes Sjogren)
Newsgroups: comp.unix.programmer
Subject: semget(2) - value of newly created semaphores?
Message-ID: <1990Oct17.230025.16411@dynas.se>
Date: 17 Oct 90 23:00:25 GMT
Organization: DynaSoft, Dynamic Software AB
Lines: 19