From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078608810501.tru64-unix-managers.marc@archive.invalid> From: Philippe Benard Date: Tue, 25 Feb 1997 14:57:21 +0000 To: tru64-unix-managers Subject: msem_lock() X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078608810501 Hi OSF/1 team I'd like to know what is the expected behavior of OSF/1 regarding a double msem_lock() by the same process. 1) Suspend Does the process suspend on the second msem_lock() since it already owns it. Then waiting an another process to unlock it or waiting to be killed. 2) EDEADLK Does the second msem_lock() return immediatly with -1 and errno set to EDEADLK, since the process owns the lock and want the lock? In case it helps here is a little prg to run on an OSF/1 (preferaply dec apha) #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);perror("msem"); } If sysconf() is a problem replace it by 4096 If MAP_ANONYMOUS | MAP_VARIABLE is a problem just remove them... Thanx in advance. Phi -- Philippe BENARD mailto:phi@hpfrcu03.france.hp.com