🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #8789

Fourth argument to semctl when third argument is GETVAL

#8789
From: James Sim
Date: Thu, 27 Jun 1991 20:22
17 lines
1637 bytes
The man page for semctl on SunOS identifies what the fourth argument to the 
semctl call needs to be when the third argument is SETVAL, GETALL, 
SETALL, IPC_STAT, IPC_SET.  For the remaining values of the third argument,
GETVAL, GETPID, GETNCNT, and GETZCNT, the man page does not identify what
should be passed for the fourth argument.  I inferred from this that I could
pass 0 as the fourth argument when passing GETVAL as the third argument, and 
in fact, on another flavor of Unix (Concurrent RTU), such a calling sequence 
works.  However, on SunOS 4.1.1, it does not work -- it results in a
segmentation fault and core dump.  Passing 1 for the fourth argument also 
produces a segmentation fault.  I would not expect semctl to use the fourth
argument when the third argument is GETVAL, since the fourth argument appears
to serve the function of passing additional information that is dependent on 
what the third argument is, and for GETVAL, semid and semnum are the only 
items of information needed to return the semaphore value.

Does anyone know what the fourth argument to semctl should be when the third
argument is GETVAL?
Technical Details
Message-ID: <4205@brchh104.bnr.ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!bnrgate!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request
From: sim@mdtf11.fnal.gov (James Sim)
Newsgroups: comp.sys.sun
Subject: Fourth argument to semctl when third argument is GETVAL
Keywords: No Digest Subjects during Flush
Message-ID: <4205@brchh104.bnr.ca>
Date: 27 Jun 91 20:22:00 GMT
Sender: news@brchh104.bnr.ca
Organization: Sunspots, Flush Mode
Lines: 18
Approved: sun-spots@rice.edu
X-Original-Date:    Wed, 26 Jun 1991 15:49:54 GMT