From owner-freebsd-hackers Wed Feb 10 21:44:38 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA26174 for freebsd-hackers-outgoing; Wed, 10 Feb 1999 21:44:38 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA26169 for ; Wed, 10 Feb 1999 21:44:36 -0800 (PST) (envelope-from peter.jeremy@auss2.alcatel.com.au) Received: by border.alcanet.com.au id <40373>; Thu, 11 Feb 1999 16:21:22 +1100 Date: Thu, 11 Feb 1999 16:31:46 +1100 From: Peter Jeremy Subject: Re: portability of shm, mmap, pipes and socket IPC To: tlambert@primenet.com Cc: hackers@FreeBSD.ORG Message-Id: <99Feb11.162122est.40373@border.alcanet.com.au> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Terry Lambert wrote: >If the sem_op is a negative integer, and the absolute value of the >sem_op is larger than the current value of the semaphore, and the >value of (sem_flg&IPC_NOWAIT) is false, then the operation is ignored. As far as I can tell, this is handled correctly. Looking at v 1.22, this is detected at line 690. Then follows a debug statement "can't do it now" and a break. The break exits the inner for loop (ending at line 717) whick is working thru all the semops passed in. Since we haven't made it through all the semops, we fall through lines 725-746, unwinding any partially commited operations. Then there's a tsleep() on semaptr (which is the semaphore descriptor). If the tsleep returns normally, the whole thing is repeated courtesy of the for loop covering lines 671-786. The tsleep is woken up by a semctl() with IPC_RMID, SETVAL, SETALL, or a semop() or semexit() that up's any semaphores in that descriptor. >Oh yeah; while I'm at having to prove someone else's bug report is >a valid bug report, it's supposed to return EIDRM instead of EINVAL; >contrary to the comments at ~ line 770, BSD *does* define this value. >I'm pretty sure no one has bug reported that, though... EIDRM was added (I believe by sos) sometime after 2.2.6. It's only used by sysv_msg.c and sysv_sem.c - and from what I can see, the code is all protected by #ifdef EIDRM's, so the code should work correctly, whether or not EIDRM is defined. Someone with commit priv's just needs to remove the comment saying it doesn't exist. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message