Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!unido!mikros!mwtech!mecky!walter From: walter@mecky.UUCP (Walter Mecky) Newsgroups: comp.unix.questions Subject: Re: initial value of semaphores Message-ID: <682@mecky.UUCP> Date: 8 Jul 90 00:57:55 GMT References: <1990Jun30.221024.2060@indetech.com> Reply-To: walter@mecky.UUCP (Walter Mecky) Organization: MIKROS Systemware, Buettelborn/W-Germany Lines: 20 In article <1990Jun30.221024.2060@indetech.com> schmidt@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@mecky or ...uunet!unido!mecky!walter ]