From owner-freebsd-emulation@FreeBSD.ORG Fri Nov 7 11:34:37 2008 Return-Path: Delivered-To: emulation@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C122106564A for ; Fri, 7 Nov 2008 11:34:37 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1A1E98FC12 for ; Fri, 7 Nov 2008 11:34:37 +0000 (UTC) (envelope-from rdivacky@lev.vlakno.cz) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 53BF29CB13B; Fri, 7 Nov 2008 12:13:08 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id j6RpKGIvzsIK; Fri, 7 Nov 2008 12:13:05 +0100 (CET) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id B26C99CB455; Fri, 7 Nov 2008 12:13:05 +0100 (CET) Received: (from rdivacky@localhost) by lev.vlakno.cz (8.14.2/8.14.2/Submit) id mA7BD5bG072062; Fri, 7 Nov 2008 12:13:05 +0100 (CET) (envelope-from rdivacky) Date: Fri, 7 Nov 2008 12:13:05 +0100 From: Roman Divacky To: Ed Schouten Message-ID: <20081107111305.GA71431@freebsd.org> References: <20081107111201.GH1165@hoeg.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081107111201.GH1165@hoeg.nl> User-Agent: Mutt/1.4.2.3i Cc: emulation@FreeBSD.org, current@FreeBSD.org Subject: Re: Request for review: uname(), setdomainname(), getdomainname() cleanups X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2008 11:34:37 -0000 On Fri, Nov 07, 2008 at 12:12:01PM +0100, Ed Schouten wrote: > Hello all, > > I just wrote this patch and I thought I'd better send it to the lists, > because it affects a lot of random things (Linux emulation, priv(9) > flags, etc). > > Looking at kern_xxx.c, I see we've got a couple of functions there that > actually have to be #ifdef'd with COMPAT_*, while they aren't. Looking > at our CVS repository I can already confirm we don't need to implement > uname(), setdomainname() and getdomainname() on RELENG_5 and later, so I > put them in COMPAT_FREEBSD4. They are implemented as library routines > nowdays. I think they could even be marked as COMPAT_43, but just to be > sure I picked COMPAT_FREEBSD4. > > Below is a list of things of interest: > > - I noticed we have a PRIV_SETDOMAINNAME, but we don't use it inside > sysctl_domainname(). This means that you can bypass PRIV_SETDOMAINNAME > anyway, so remove it. > > - I think it's better if we just implement getdomainname() and > setdomainname() by calling userland_sysctl(). This makes it less > likely to break if we would ever change sysctl_domainname() in > kern_mib.c. > > - To make the linuxolator compile without enabling COMPAT_FREEBSD4, I > added a linux_setdomainname(). I also noticed linux_sethostname() > called userland_sysctl() without holding Giant. > > - It wasn't easy to make uname(), setdomainname() and getdomainname() > work in COMPAT_FREEBSD32, because we would actually need a > "COMPAT4+NOPROTO" option for syscalls.master. Because these system > calls aren't likely to be used, I just disabled them. If it turns out > we really need them, we could reintroduce them. > > Any comments? If not, I'll commit it to SVN in a day or two. Thanks! I just quickly looked at it but I think it's correct and I like the patch. OK from me