From owner-freebsd-stable Sat Jan 1 16:53: 1 2000 Delivered-To: freebsd-stable@freebsd.org Received: from orion.ac.hmc.edu (Orion.AC.HMC.Edu [134.173.32.20]) by hub.freebsd.org (Postfix) with ESMTP id 8310214D93 for ; Sat, 1 Jan 2000 16:52:50 -0800 (PST) (envelope-from brdavis@orion.ac.hmc.edu) Received: (from brdavis@localhost) by orion.ac.hmc.edu (8.8.8/8.8.8) id QAA04335; Sat, 1 Jan 2000 16:49:21 -0800 (PST) Date: Sat, 1 Jan 2000 16:49:21 -0800 From: Brooks Davis To: Tony Rentschler Cc: freebsd-stable@FreeBSD.ORG Subject: Re: sem_otime not updated? Message-ID: <20000101164921.A2047@orion.ac.hmc.edu> References: <386E0EB2.C4C45660@bellatlantic.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre4i In-Reply-To: <386E0EB2.C4C45660@bellatlantic.net>; from walterr@bellatlantic.net on Sat, Jan 01, 2000 at 09:26:58AM -0500 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, Jan 01, 2000 at 09:26:58AM -0500, Tony Rentschler wrote: > I'm writing a program that uses a SysV semaphore, and it seems that the > sem_otime field of the semid_ds struct is not updated after a call to > semop. According to Steven's Unix Network Programming V2, the sem_otime > field is set to zero when the semaphore is created, then is updated with > the current time when semop is called. > > In /usr/sys/kern/sysv_sem.c on my 3.4 STABLE, I see that the sem_otime > field is set to zero in the semget call, but is never referred to > anyplace else. So, it looks like the source confirms my experiences. > > In a search of deja.com for sem_otime, I found a patch posted by Peter > Jeremy on 6/4/99, but, as far as I can tell, that's for CURRENT. > > I've never worked with FreeBSD at this (low) level, but I wonder if the > patch could be applied to STABLE? I'd prefer not to move to CURRENT, nor > to apply the patch myself (because I'll forget about it a couple of > months from now when I do a buildworld!). I took a look the history of /usr/sys/kern/sysv_sem.c using cvsweb and it looks like there was a change which may cause problem with using patch(1) to apply to patch, but the diffs were pretty straight forward (this was the suser change for jail) so you should be able to apply the patch by hand. That appears to have been the only real change to the file since some time around the fork off of 4.0. -- Brooks -- "Those who desire to give up freedom in order to gain security, will not have, nor do they deserve, either one" --Thomas Jefferson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message