[Info-vax] Problem with sem_open() call

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Wed Sep 21 14:11:08 EDT 2016


On 2016-09-21 17:56:14 +0000, John Reagan said:

> I hadn't used these before...  and I must be doing something wrong...  
> What file isn't being found?

On little evidence beyond the XQP trace, I might suspect the sem_open 
is getting confused about the lack of flags.

The "file" specified here intended to be functionally analogous to an 
OpenVMS lock manager resource name.

The underlying semaphore may or may not be implemented as a file.    
OpenVMS pretty clearly uses a file, though.   (Not sure why, given the 
availability of the DLM, but...)

Quoth the The Open Group Base Specifications IEEE Std 1003.1, 2004 edition:

"The name argument points to a string naming a semaphore object. It is 
unspecified whether the name appears in the file system and is visible 
to functions that take pathnames as arguments. The name argument 
conforms to the construction rules for a pathname. If name begins with 
the slash character, then processes calling sem_open() with the same 
value of name shall refer to the same semaphore object, as long as that 
name has not been removed. If name does not begin with the slash 
character, the effect is implementation-defined. The interpretation of 
slash characters other than the leading slash character in name is 
implementation-defined."


$ set watch/class=major file
$ r sem_create
%XQP, Thread #0, Access sem_create.EXE;3 (150467,3,0) Status: 00000001
%XQP, Thread #0, Lookup  (161067,1,0) Status: 00000001
%XQP, Thread #0, Access DECC$SHRP.EXE;1 (161067,1,0) Status: 00000001
%XQP, Thread #0, Control function  (161067,1,0) Status: 00000001
%XQP, Thread #0, Deaccess (161067,1,0) Reads: 2, Writes: 0, Status: 00000001
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup PSX$SEMAPHORES.DIR;1 (6895,15,0) Status: 00000001
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Access  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup PSX$SEMAPHORES.DIR;1 (6895,15,0) Status: 00000001
%XQP, Thread #0, Access PSX$SEMAPHORES.DIR;1 (6895,15,0) Status: 00000001
%XQP, Thread #0, Deaccess (6895,15,0) Reads: 0, Writes: 0, Status: 00000001
%XQP, Thread #0, Lookup PSX$SEMAPHORES.DIR;1 (6895,15,0) Status: 00000001
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Access  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Access  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Create/Access mysemaphore.;1 (6943,959,0) Status: 00000001
%XQP, Thread #0, Control function  (6943,959,0) Status: 00000001
%XQP, Thread #0, Final status: 00000870
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Lookup  (6943,959,0) Status: 00000001
%XQP, Thread #0, Access mysemaphore.;1 (6943,959,0) Status: 00000800
%XQP, Thread #0, Lookup mysemaphore.;1 (6943,959,0) Status: 00000001
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Access EASTERN.;1 (852,5,0) Status: 00000001
%XQP, Thread #0, Control function  (852,5,0) Status: 00000001
%XQP, Thread #0, Final status: 00000870
%XQP, Thread #0, Deaccess (852,5,0) Reads: 1, Writes: 0, Status: 00000001
%XQP, Thread #0, Modify mysemaphore.;1 (6943,959,0) Status: 00000001
%XQP, Thread #0, Deaccess (6943,959,0) Reads: 1, Writes: 2, Status: 00000001
%XQP, Thread #0, Lookup  (0,0,0) Status: 00000910
%XQP, Thread #0, Access mysemaphore.;1 (6943,959,0) Status: 00000001
%XQP, Thread #0, Control function  (6943,959,0) Status: 00000001
[OK] Semaphore created
%XQP, Thread #0, Deaccess (6943,959,0) Reads: 0, Writes: 0, Status: 00000001
%XQP, Thread #0, Deaccess (150467,3,0) Reads: 5, Writes: 0, Status: 00000001
$ r sem_open
%XQP, Thread #0, Access sem_open.EXE;3 (150468,3,0) Status: 00000001
[FAIL] Error code: 2
%XQP, Thread #0, Deaccess (150468,3,0) Reads: 5, Writes: 0, Status: 00000001
$



-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list