From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,cce3c893914c2107,start X-Google-Attributes: gid1164f8,public From: Philippe Benard Subject: msem_lock on alpha (osf and/or digital unix) Date: 1997/02/21 Message-ID: <330DCC84.4027@hpfrcu03.france.hp.com>#1/1 X-Deja-AN: 220444223 Content-Type: text/plain; charset=us-ascii Organization: WTEC Mime-Version: 1.0 Newsgroups: comp.sys.dec X-Mailer: Mozilla 3.01Gold (X11; I; HP-UX B.10.20 9000/712) 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 #include 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