initial value of semaphores

Walter Mecky walter at mecky.UUCP
Sun Jul 8 10:57:55 AEST 1990


In article <1990Jun30.221024.2060 at indetech.com> schmidt at indetech.UUCP (Doug Schmidt) writes:
+ After a successful system call to
+ 
+ 	sem_id = semget (SEMKEY, 1, 0777 | IPC_CREAT);
+ 
+ is the result of 
+ 
+ 	semctl (sem_id, 0, GETVAL, 0);
+ 
+ guaranteed to be 0? (assuming there are no errors, etc.).  In otherwords,
+ what is the semval field of semaphores initialized to?  TFM doesn't 
+ seem to indicate this, and neither do Bach's or Rochkind's books.

My FM seems to indicate this (it's SCO UNIX):

	  The data structure associated	with each semaphore in the set
	  is not initialized.  The function semctl with	the command
	  setval or setall can be used to initialize each semaphore.
-- 
Walter Mecky	[ walter at mecky	or  ...uunet!unido!mecky!walter ]



More information about the Comp.unix.questions mailing list