From owner-cvs-src@FreeBSD.ORG Mon May 5 10:05:12 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8AB7A37B40B; Mon, 5 May 2003 10:05:12 -0700 (PDT) Received: from mail.imp.ch (mail.imp.ch [157.161.1.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41D9843F75; Mon, 5 May 2003 10:05:11 -0700 (PDT) (envelope-from mb@imp.ch) Received: from cvs.imp.ch (cvs.imp.ch [157.161.4.9]) by mail.imp.ch (8.12.6p2/8.12.3) with ESMTP id h45H583g020982; Mon, 5 May 2003 19:05:09 +0200 (CEST) (envelope-from Martin.Blapp@imp.ch) Date: Mon, 5 May 2003 19:05:08 +0200 (CEST) From: Martin Blapp To: Ian Dowse In-Reply-To: <200305051653.aa98706@salmon.maths.tcd.ie> Message-ID: <20030505190401.V2898@cvs.imp.ch> References: <200305051653.aa98706@salmon.maths.tcd.ie> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: Martin Blapp cc: cvs-all@FreeBSD.org cc: src-committers@FreeBSD.org Subject: Re: cvs commit: src/sys/compat/linux linux_ipc.c src/sys/sys syscallsubr.h src/sys/kern sysv_shm.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 May 2003 17:05:13 -0000 Hi Ian, > I had a few incomplete stack-gap patches in this area, so I was > just looking over this change while merging. The shmctl() system > call is unfortunately quite messy to deal with, since its `struct > shmid_ds *buf' argument can point at a different type of structure > (struct shm_info) for some commands. BTW, it seems that these > additional commands (IPC_INFO, SHM_INFO) and also SHM_STAT are not > documented in shmctl(2) so they really only exist for use by the > Linux emulator. > > A few comments about these changes: > - shmctl() now assumes that it can fit a `struct shm_info' into > `struct shmid_ds buf'. While it does fit now, it would be much > better to use a union so as not to need this assumption. > > - The `bufsz' argument to kern_shmctl() seems to be unnecessary, > since callers are required to know already how much space is > required - they supplied that space. It would be better just to > have shmctl() switch on the command code and then copyout > sizeof(struct shm_info) or sizeof(struct shm_info) accordingly. > > - Is the 'if (error) {td->td_retval[0] = -1;}' at the end of shmctl() > really necessary? The syscall() code should ignore td->td_retval[0] > in the error case. Ok, I'll discuss these changes with Orlando and come up with a fix. Thanks for looking at the change ! Martin