Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* msem_lock on alpha (osf and/or digital unix)
@ 1997-02-21  5:00 Philippe Benard
  0 siblings, 0 replies; only message in thread
From: Philippe Benard @ 1997-02-21  5:00 UTC (permalink / raw)



Hi All,

I'm looking for msem_lock() semantic. My guess is that msem_lock()
doesn't exist on Digital unix, since it is an OSF feature.

So I'd like an OSF guru out there (or at least someone having access to
an OSF machine) to test this little prog.


p.c:
#include <unistd.h>
#include <sys/mman.h>

main()
{ char *p;
  int sts;
  p = (char*) mmap(NULL, (1)*sysconf(_SC_PAGE_SIZE),
                   PROT_READ | PROT_WRITE,
                   MAP_ANONYMOUS | MAP_VARIABLE | MAP_SHARED, -1, 0 );

  printf("#1\n");
  sts = msem_init(p,0);
  printf("#2 sts=0x%08x\n",sts);
  sts = msem_lock(p,0);
  printf("#3 sts=%d\n",sts);
  sts = msem_lock(p,0);
  printf("#4 sts=%d\n",sts);
}

The prog will just try to acquire a lock twice that is a deadlock
condition, I'd like to know if OSF will suspend the prog or reject the
2nd lock with -1 errno set to EDEADLK

Note: If Digital Unix did have msem_lock() feature,I'd like to have the
answer too.

Note2: If it doesn't compiler due to lack of MAP_ANONYMOUS or
MAP_VARIABLE, just remove them and keep MAP_SHARED.

So just compile, run it, and send me the output.

If the prog just hang, ^c it then let me know you did stop it.

Thanx in advance.

Please email me since I don't have a regular access to the news.

Phi

--
Philippe BENARD 
mailto:phi@hpfrcu03.france.hp.com



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-02-21  5:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-02-21  5:00 msem_lock on alpha (osf and/or digital unix) Philippe Benard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox