From owner-freebsd-arch@FreeBSD.ORG Sun Apr 6 11:52:17 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6944D37B401 for ; Sun, 6 Apr 2003 11:52:17 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id CDE0C43FAF for ; Sun, 6 Apr 2003 11:52:16 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 406795308; Sun, 6 Apr 2003 20:52:15 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: arch@freebsd.org From: des@ofug.org (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) Date: Sun, 06 Apr 2003 20:52:14 +0200 Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Subject: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 18:52:17 -0000 --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable The attached patch adds a timecounter option to rc.conf and an rc.d script to handle it. DES --=20 Dag-Erling Sm=F8rgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=timecounter.diff Index: defaults/rc.conf =================================================================== RCS file: /home/ncvs/src/etc/defaults/rc.conf,v retrieving revision 1.171 diff -u -u -r1.171 rc.conf --- defaults/rc.conf 17 Mar 2003 23:15:53 -0000 1.171 +++ defaults/rc.conf 6 Apr 2003 18:35:48 -0000 @@ -426,6 +426,7 @@ harvest_ethernet="YES" # Entropy device harvests ethernet randomness harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot +timecounter="NO" # Timecounter hardware to use (NO for default). ############################################################## ### Define source_rc_confs, the mechanism used by /etc/rc.* ## Index: rc.d/Makefile =================================================================== RCS file: /home/ncvs/src/etc/rc.d/Makefile,v retrieving revision 1.11 diff -u -u -r1.11 Makefile --- rc.d/Makefile 17 Mar 2003 23:20:48 -0000 1.11 +++ rc.d/Makefile 6 Apr 2003 18:36:28 -0000 @@ -14,8 +14,8 @@ ntpdate othermta pccard pcvt ppp-user pppoed pwcheck quota random \ rarpd rcconf.sh root route6d routed rpcbind rtadvd rwho savecore \ securelevel sendmail serial sppp sshd swap1 syscons sysctl \ - syslogd timed ttys usbd vinum virecover ypbind yppasswdd ypserv \ - ypset ypupdated ypxfrd + syslogd timecounter timed ttys usbd vinum virecover ypbind yppasswdd \ + ypserv ypset ypupdated ypxfrd FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} Index: rc.d/timecounter =================================================================== RCS file: rc.d/timecounter diff -N rc.d/timecounter --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ rc.d/timecounter 6 Apr 2003 18:35:00 -0000 @@ -0,0 +1,30 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: timecounter +# BEFORE: securelevel +# KEYWORD: FreeBSD + +. /etc/rc.subr + +name="timecounter" +start_cmd="timecounter_start" +stop_cmd=":" + +dumpon_start() +{ + # Select a timecounter + # + case ${timecounter} in + [Nn][Oo] | '') + ;; + *) + sysctl kern.timecounter.hardware="${timecounter}" + ;; + esac +} + +load_rc_config $name +run_rc_command "$1" --=-=-=-- From owner-freebsd-arch@FreeBSD.ORG Sun Apr 6 12:16:10 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1BDBE37B401 for ; Sun, 6 Apr 2003 12:16:10 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20ECC43F3F for ; Sun, 6 Apr 2003 12:16:09 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h36JG8Ld029168; Sun, 6 Apr 2003 21:16:08 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: des@ofug.org (Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?=) From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 06 Apr 2003 20:52:14 +0200." Date: Sun, 06 Apr 2003 21:16:08 +0200 Message-ID: <29167.1049656568@critter.freebsd.dk> cc: arch@freebsd.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 19:16:10 -0000 In message , Dag-Erling =?iso-8859-1?q?Sm=F8 rgrav?= writes: >--=-=-= >Content-Type: text/plain; charset=iso-8859-1 >Content-Transfer-Encoding: quoted-printable > >The attached patch adds a timecounter option to rc.conf and an rc.d >script to handle it. What's wrong with using /etc/sysctl.conf for this ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Sun Apr 6 13:02:57 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5BACE37B401 for ; Sun, 6 Apr 2003 13:02:57 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 615F243F3F for ; Sun, 6 Apr 2003 13:02:56 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 907435308; Sun, 6 Apr 2003 22:02:54 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: "Poul-Henning Kamp" From: Dag-Erling Smorgrav Date: Sun, 06 Apr 2003 22:02:54 +0200 In-Reply-To: <29167.1049656568@critter.freebsd.dk> ("Poul-Henning Kamp"'s message of "Sun, 06 Apr 2003 21:16:08 +0200") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 References: <29167.1049656568@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: arch@freebsd.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 20:02:57 -0000 "Poul-Henning Kamp" writes: > In message , Dag-Erling Smorgrav writes: > > The attached patch adds a timecounter option to rc.conf and an rc.d > > script to handle it. > What's wrong with using /etc/sysctl.conf for this ? Partly because I believe that the choice of timecounter hardware is sufficiently important to the performance and correct operation of the system to warrant its own rc.conf knob, and partly because I hate the "configuration diaspora" of which sysctl.conf is a prime example. (another such example is ntp.conf - the needs of most ntpd users can be met with an ntp.conf generated automatically from information which is already present in rc.conf) DES -- Dag-Erling Smorgrav - des@ofug.org From owner-freebsd-arch@FreeBSD.ORG Sun Apr 6 14:11:22 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05C2B37B404 for ; Sun, 6 Apr 2003 14:11:22 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEB2843FB1 for ; Sun, 6 Apr 2003 14:11:20 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h36LBILd030341; Sun, 6 Apr 2003 23:11:18 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Dag-Erling Smorgrav From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 06 Apr 2003 22:02:54 +0200." Date: Sun, 06 Apr 2003 23:11:18 +0200 Message-ID: <30340.1049663478@critter.freebsd.dk> cc: arch@freebsd.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 21:11:22 -0000 In message , Dag-Erling Smorgrav writes: >"Poul-Henning Kamp" writes: >> In message , Dag-Erling Smorgrav writes: >> > The attached patch adds a timecounter option to rc.conf and an rc.d >> > script to handle it. >> What's wrong with using /etc/sysctl.conf for this ? > >Partly because I believe that the choice of timecounter hardware is >sufficiently important to the performance and correct operation of the >system to warrant its own rc.conf knob, and partly because I hate the >"configuration diaspora" of which sysctl.conf is a prime example. I on the other hand think that by now /etc/rc.conf has so many knobs and handles that it is practically impossible to figure out how to do anything without resorting to "less /etc/rc.*" to figure it out :-( >(another such example is ntp.conf - the needs of most ntpd users can >be met with an ntp.conf generated automatically from information which >is already present in rc.conf) The new NTP4 automatic configuration stuff is promising in this respect, with a little luck people will need to configure nothing at all. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Sun Apr 6 14:49:53 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3D8537B401 for ; Sun, 6 Apr 2003 14:49:53 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1454E43FB1 for ; Sun, 6 Apr 2003 14:49:53 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 58BB25308; Sun, 6 Apr 2003 23:49:50 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: "Poul-Henning Kamp" From: Dag-Erling Smorgrav Date: Sun, 06 Apr 2003 23:49:50 +0200 In-Reply-To: <30340.1049663478@critter.freebsd.dk> ("Poul-Henning Kamp"'s message of "Sun, 06 Apr 2003 23:11:18 +0200") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 References: <30340.1049663478@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: arch@freebsd.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 21:49:54 -0000 "Poul-Henning Kamp" writes: > I on the other hand think that by now /etc/rc.conf has so many knobs > and handles that it is practically impossible to figure out how to > do anything without resorting to "less /etc/rc.*" to figure it out :-( 'man rc.conf' should hopefully be reasonably up to date, and /etc/defaults/rc.conf briefly documents most of the knobs. The main problem is that there are knobs which aren't listed in either of these and which I suspect even most committers never knew existed, because our rc.d scripts were imported wholesale from NetBSD with some but IMHO not enough adaptation. Differences between NetBSD and FreeBSD should have been viewed as an opportunity to improve both, but instead the scripts were "dumbed down" to provide very little beyond what already existed in FreeBSD. > > (another such example is ntp.conf - the needs of most ntpd users can > > be met with an ntp.conf generated automatically from information which > > is already present in rc.conf) > The new NTP4 automatic configuration stuff is promising in this respect, > with a little luck people will need to configure nothing at all. That would be nice, but we can still do far better than the status quo for the current version. We actually have some of the required knobs (inherited from NetBSD along with the rest of rcNG) but they are not documented and still fall a little short of what I would like to see. I would like to have a single ntp_servers variable listing NTP servers in the host's vicinity; if set, that list would be appended to the ntpdate command line, and used to autogenerate ntp.conf. Of course, if it were empty (the default), any preexisting ntp.conf would be left intact. I also think ntpdate_enable and ntpd_enable should default to YES if ntp_servers is non-empty, but that might be slightly more controversial. Currently, ntpdate gets its server list from the ntpdate_hosts variable, or from ntp.conf if ntpdate_hosts is empty. None of this is documented, because it came from NetBSD with rcNG. Previously, we had to list servers in ntpdate_flags; I bet a lot of people still do, unaware that the servers listed in ntp.conf will be appended to this list. DES -- Dag-Erling Smorgrav - des@ofug.org From owner-freebsd-arch@FreeBSD.ORG Mon Apr 7 01:09:29 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 15D3737B401 for ; Mon, 7 Apr 2003 01:09:29 -0700 (PDT) Received: from park.rambler.ru (park.rambler.ru [81.19.64.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CB1043F85 for ; Mon, 7 Apr 2003 01:09:28 -0700 (PDT) (envelope-from is@rambler-co.ru) Received: from is.park.rambler.ru (is.park.rambler.ru [81.19.64.102]) by park.rambler.ru (8.12.6/8.12.6) with ESMTP id h3789RmF024211; Mon, 7 Apr 2003 12:09:27 +0400 (MSD) Date: Mon, 7 Apr 2003 12:09:26 +0400 (MSD) From: Igor Sysoev X-Sender: is@is To: Terry Lambert In-Reply-To: <3E8CAD52.531E0A9@mindspring.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-arch@freebsd.org Subject: Re: libthr and 1:1 threading. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Apr 2003 08:09:29 -0000 On Thu, 3 Apr 2003, Terry Lambert wrote: > Igor Sysoev wrote: > > So I think programmers never use this flag and select()/etc for disk > > files (because it's useless) and I think supporting this flag for disk > > files should not break existent software. > > But of course it creates portability problems. > > For FreeBSD's libc_r? You have got to be kidding, when you talk > about portability of FreeBSD's libc_r! > > The effect in the old sigsched threads implementation from the > comp.sources.unix archive would merely be to provide a latency > optimization on the OS's which support it. > > I think that there is no portability problem; only that it would > cause some software to run faster on FreeBSD than on other OS's, > were it to be used. No, I do not mean portability of libc_r. I mean that if FreeBSD would support select() for disk files there can be the programs that will use this feature directly without any wrappers and these programs would have the portability problems. It's something like some Linux programs use a specific signal behaviour of Linux clone()d pthreads. Igor Sysoev http://sysoev.ru/en/ From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 00:14:50 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDA4237B401 for ; Tue, 8 Apr 2003 00:14:50 -0700 (PDT) Received: from pop3.psconsult.nl (ps227.psconsult.nl [213.222.19.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 551A643F75 for ; Tue, 8 Apr 2003 00:14:49 -0700 (PDT) (envelope-from paul@pop3.psconsult.nl) Received: (from paul@localhost) by pop3.psconsult.nl (8.9.2/8.9.2) id JAA36643; Tue, 8 Apr 2003 09:14:39 +0200 (CEST) (envelope-from paul) Date: Tue, 8 Apr 2003 09:14:39 +0200 From: Paul Schenkeveld To: Dag-Erling Smorgrav Message-ID: <20030408091439.A36404@psconsult.nl> References: <30340.1049663478@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from des@ofug.org on Sun, Apr 06, 2003 at 11:49:50PM +0200 cc: arch@freebsd.org cc: Poul-Henning Kamp Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 07:14:51 -0000 On Sun, Apr 06, 2003 at 11:49:50PM +0200, Dag-Erling Smorgrav wrote: > > > (another such example is ntp.conf - the needs of most ntpd users can > > > be met with an ntp.conf generated automatically from information which > > > is already present in rc.conf) > > The new NTP4 automatic configuration stuff is promising in this respect, > > with a little luck people will need to configure nothing at all. > > That would be nice, but we can still do far better than the status quo > for the current version. We actually have some of the required knobs > (inherited from NetBSD along with the rest of rcNG) but they are not > documented and still fall a little short of what I would like to see. > > I would like to have a single ntp_servers variable listing NTP servers > in the host's vicinity; if set, that list would be appended to the > ntpdate command line, and used to autogenerate ntp.conf. Of course, > if it were empty (the default), any preexisting ntp.conf would be left > intact. I also think ntpdate_enable and ntpd_enable should default to > YES if ntp_servers is non-empty, but that might be slightly more > controversial. On would expect that changing ntp_servers in rc.conf would be sufficient to change your ntp servers bus if you leave an existing ntp.conf intact only the first values ever put in ntp_servers will be honoured. This might be very confusing for those not familiar with ntp.conf (and ntp_servers in rc.conf does not invite new admins to learn about ntp.conf). Another thing, *if* we want to automatically set up ntp.conf, what about the NTP servers we were informed of by DHCP? > DES > -- > Dag-Erling Smorgrav - des@ofug.org From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 00:36:35 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 48DAD37B401 for ; Tue, 8 Apr 2003 00:36:35 -0700 (PDT) Received: from pop018.verizon.net (pop018pub.verizon.net [206.46.170.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72DA643FA3 for ; Tue, 8 Apr 2003 00:36:34 -0700 (PDT) (envelope-from mtm@identd.net) Received: from kokeb.ambesa.net ([138.88.3.138]) by pop018.verizon.net (InterMail vM.5.01.05.27 201-253-122-126-127-20021220) with ESMTP id <20030408073633.VFPY1699.pop018.verizon.net@kokeb.ambesa.net>; Tue, 8 Apr 2003 02:36:33 -0500 Date: Tue, 8 Apr 2003 03:36:32 -0400 From: Mike Makonnen To: Dag-Erling Smorgrav In-Reply-To: References: <30340.1049663478@critter.freebsd.dk> X-Mailer: Sylpheed version 0.8.10 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at pop018.verizon.net from [138.88.3.138] at Tue, 8 Apr 2003 02:36:33 -0500 Message-Id: <20030408073633.VFPY1699.pop018.verizon.net@kokeb.ambesa.net> cc: arch@FreeBSD.org cc: phk@phk.freebsd.dk Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 07:36:35 -0000 On Sun, 06 Apr 2003 23:49:50 +0200 Dag-Erling Smorgrav wrote: > "Poul-Henning Kamp" writes: > > I on the other hand think that by now /etc/rc.conf has so many knobs > > and handles that it is practically impossible to figure out how to > > do anything without resorting to "less /etc/rc.*" to figure it out :-( > > 'man rc.conf' should hopefully be reasonably up to date, and > /etc/defaults/rc.conf briefly documents most of the knobs. The main > problem is that there are knobs which aren't listed in either of these > and which I suspect even most committers never knew existed, because > our rc.d scripts were imported wholesale from NetBSD with some but > IMHO not enough adaptation. Differences between NetBSD and FreeBSD > should have been viewed as an opportunity to improve both, but instead > the scripts were "dumbed down" to provide very little beyond what > already existed in FreeBSD. Please check the archives for the reasons. Having said that, more work is forthcomming. > Currently, ntpdate gets its server list from the ntpdate_hosts > variable, or from ntp.conf if ntpdate_hosts is empty. None of this is > documented, because it came from NetBSD with rcNG. Previously, we had > to list servers in ntpdate_flags; I bet a lot of people still do, > unaware that the servers listed in ntp.conf will be appended to this > list. They aren't documented because we don't use them. There are two paths in the rc.d/ntpdate script: one for FreeBSD and one for NetBSD. The FreeBSD path is the same as in the old rc. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | D228 1A6F C64E 120A A1C9 A3AA DAE1 E2AF DBCC 68B9 mtm@FreeBSD.Org| FreeBSD - The Power To Serve From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 04:20:04 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8CA4037B401 for ; Tue, 8 Apr 2003 04:20:04 -0700 (PDT) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id E2B5543FA3 for ; Tue, 8 Apr 2003 04:20:03 -0700 (PDT) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 57A1F5308; Tue, 8 Apr 2003 13:20:00 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: Paul Schenkeveld From: Dag-Erling Smorgrav Date: Tue, 08 Apr 2003 13:19:59 +0200 In-Reply-To: <20030408091439.A36404@psconsult.nl> (Paul Schenkeveld's message of "Tue, 8 Apr 2003 09:14:39 +0200") Message-ID: User-Agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 References: <30340.1049663478@critter.freebsd.dk> <20030408091439.A36404@psconsult.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii cc: arch@freebsd.org cc: Poul-Henning Kamp Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 11:20:05 -0000 Paul Schenkeveld writes: > On would expect that changing ntp_servers in rc.conf would be > sufficient to change your ntp servers bus if you leave an existing > ntp.conf intact only the first values ever put in ntp_servers will > be honoured. This might be very confusing for those not familiar > with ntp.conf (and ntp_servers in rc.conf does not invite new admins > to learn about ntp.conf). Yes, ntp.conf should be regenerated at boot if ntp_servers is set, and left alone if it's empty. > Another thing, *if* we want to automatically set up ntp.conf, what > about the NTP servers we were informed of by DHCP? I don't think dhclient honors these, does it? Maybe it should. DES -- Dag-Erling Smorgrav - des@ofug.org From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 09:47:51 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3206B37B401 for ; Tue, 8 Apr 2003 09:47:51 -0700 (PDT) Received: from comp.chem.msu.su (comp-ext.chem.msu.su [158.250.32.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9517A43FAF for ; Tue, 8 Apr 2003 09:47:45 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.12.3p2/8.12.3) with ESMTP id h38GkFhE010798 for ; Tue, 8 Apr 2003 20:47:39 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.12.3p2/8.12.3/Submit) id h38GkFXq010797 for arch@freebsd.org; Tue, 8 Apr 2003 20:46:15 +0400 (MSD) (envelope-from yar) Date: Tue, 8 Apr 2003 20:46:14 +0400 From: Yar Tikhiy To: arch@freebsd.org Message-ID: <20030408164614.GA7236@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.3i Subject: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 16:47:51 -0000 Hello everybody, I was shown a curious feature of FreeBSD. (The source of a test program illustrating it is attached at the the of this message.) Let's consider a non-blocking file descriptor that correspons to a terminal in raw mode. Let's also assume read(2) is issued on it when there is no data to read. If for this terminal MIN > 0 and TIME == 0, read(2) will return -1 and set errno to EAGAIN. OTOH, if MIN == 0 and TIME > 0, read(2) will return 0. While not in disagreement with POSIX[1], such a behaviour has at least one unwelcome consequence: If a program has been compiled with ``-pthread'', the TIME counter won't work on terminal descriptors that are in blocking mode from the program's point of view -- read(2) will instantly return 0 on them. That is because the following scenario will happen: 1) libc_r sets non-blocking mode on a descriptor as soon as a device is opened (that is how i/o in user-land threads work); 2) the program sets the TIME counter through tcsetattr(3); 3) the program issues read(2), which ends up in the actual read() syscall, which in turn returns 0 to libc_r (assuming there is no data to read); 4) libc_r thinks this is the EOF indicator, so it instantly returns 0 to the program; 5) the program breaks. Notice, that MIN works right with libc_r since read() syscall will return -1/EAGAIN, which is correctly understood by libc_r: it will block the current thread until there is data to read. Shouldn't both TIME and MIN cases be uniform in returning -1/EAGAIN on non-blocking descriptors? References: [1] IEEE Std 1003.1, 2003 Edition, General Terminal Interface, Non-Canonical Mode Input Processing. http://www.opengroup.org/onlinepubs/007904975/basedefs/xbd_chap11.html -- Yar =========================== cut here ============================== #include #include #include #include #include #include #include #include #include #include int main(int argc, char **argv) { int c, fd, flags, i, n; int nblock = 0; int vmin = 0, vtime = 0; struct termios ts; char *port = "/dev/cuaa1"; char buf[256]; while ((c = getopt(argc, argv, "f:hm:nt:")) != -1) switch (c) { case 'f': port = optarg; break; case 'm': vmin = atoi(optarg); break; case 'n': nblock = 1; break; case 't': vtime = atoi(optarg); break; default: fprintf(stderr, "usage: termtest [-n] [-f special] [-m MIN] [-t TIME]\n"); fprintf(stderr, "\t-n -- turn on non-blocking mode explicitly\n"); fprintf(stderr, "\t-f -- specify a device to use\n"); fprintf(stderr, "\t-m -- set MIN value\n"); fprintf(stderr, "\t-t -- set TIME value (in 0.1 sec units)\n"); exit(2); } if ((fd = open(port, O_RDWR | O_NOCTTY)) == -1) err(2, "open"); if (nblock) { if ((flags = fcntl(fd, F_GETFL, 0)) == -1) err(2, "getfl"); flags |= O_NONBLOCK; if (fcntl(fd, F_SETFL, flags) == -1) err(2, "setfl"); } if (tcgetattr(fd, &ts) == -1) err(2, "tcgetattr"); cfmakeraw(&ts); if (cfsetspeed(&ts, B9600) == -1) err(2, "cfsetspeed"); ts.c_cflag |= CLOCAL; ts.c_cflag &= ~(PARENB | PARODD); ts.c_cflag &= ~CSIZE; ts.c_cflag |= CS8; ts.c_cflag &= ~CSTOPB; ts.c_cc[VMIN] = vmin; ts.c_cc[VTIME] = vtime; if (tcsetattr(fd, TCSAFLUSH, &ts) == -1) err(2, "tcsetattr"); n = read(fd, buf, sizeof(buf)); if (n == -1) err(2, "read"); else if (n < 1) errx(2, "short read: %d bytes", n); printf("Read %d bytes:\n", n); for (i = 0; i < n; i++) printf("%#04x - %c\n", buf[i], isprint(buf[i]) ? buf[i] : '?'); close(fd); return (0); } From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 11:17:12 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 45D4337B401; Tue, 8 Apr 2003 11:17:12 -0700 (PDT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 865E843FA3; Tue, 8 Apr 2003 11:17:10 -0700 (PDT) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.9/8.12.9) with ESMTP id h38IH90q042817; Tue, 8 Apr 2003 22:17:09 +0400 (MSD) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.9/8.12.9/Submit) id h38IH8Vc042816; Tue, 8 Apr 2003 22:17:08 +0400 (MSD) Date: Tue, 8 Apr 2003 22:17:08 +0400 From: "Andrey A. Chernov" To: Yar Tikhiy Message-ID: <20030408181707.GA42723@nagual.pp.ru> References: <20030408164614.GA7236@comp.chem.msu.su> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030408164614.GA7236@comp.chem.msu.su> User-Agent: Mutt/1.5.4i cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 18:17:12 -0000 On Tue, Apr 08, 2003 at 20:46:14 +0400, Yar Tikhiy wrote: > While not in disagreement with POSIX[1], such a behaviour has at > least one unwelcome consequence: If a program has been compiled > with ``-pthread'', the TIME counter won't work on terminal descriptors > that are in blocking mode from the program's point of view -- read(2) > will instantly return 0 on them. That is because the following > scenario will happen: ... > Shouldn't both TIME and MIN cases be uniform in returning -1/EAGAIN > on non-blocking descriptors? It means that libc_r MIN/TIME handling should be fixed to conform POSIX and not general MIN/TIME handling way. -- Andrey A. Chernov http://ache.pp.ru/ From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 12:13:47 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3467D37B401 for ; Tue, 8 Apr 2003 12:13:47 -0700 (PDT) Received: from wall.polstra.com (wall-gw.polstra.com [206.213.73.130]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5090C43FDD for ; Tue, 8 Apr 2003 12:13:45 -0700 (PDT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (strings.polstra.com [206.213.73.20]) by wall.polstra.com (8.12.3p2/8.12.3) with ESMTP id h38JDidt064878 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 8 Apr 2003 12:13:44 -0700 (PDT) (envelope-from jdp@strings.polstra.com) Received: (from jdp@localhost) by strings.polstra.com (8.12.6/8.12.6/Submit) id h38JDhEE060779; Tue, 8 Apr 2003 12:13:43 -0700 (PDT) (envelope-from jdp) Date: Tue, 8 Apr 2003 12:13:43 -0700 (PDT) Message-Id: <200304081913.h38JDhEE060779@strings.polstra.com> To: arch@freebsd.org From: John Polstra In-Reply-To: References: <30340.1049663478@critter.freebsd.dk> <20030408091439.A36404@psconsult.nl> Organization: Polstra & Co., Seattle, WA cc: des@ofug.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 19:13:47 -0000 In article , Dag-Erling Smorgrav wrote: > Paul Schenkeveld writes: > > Another thing, *if* we want to automatically set up ntp.conf, what > > about the NTP servers we were informed of by DHCP? > > I don't think dhclient honors these, does it? Maybe it should. You can make it honor them, with a little work. You have to make a dhclient.conf file with the appropriate "request" statement to ask for the "ntp-servers" option. You also have to make a dhclient-exit-hooks script to generate the ntp.conf file. It's a PITA. I agree with you that support for this should be standard. John From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 12:33:35 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9429437B401; Tue, 8 Apr 2003 12:33:35 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2680543FBD; Tue, 8 Apr 2003 12:33:34 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id FAA10944; Wed, 9 Apr 2003 05:33:30 +1000 Date: Wed, 9 Apr 2003 05:33:28 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Yar Tikhiy In-Reply-To: <20030408164614.GA7236@comp.chem.msu.su> Message-ID: <20030409044301.J628@gamplex.bde.org> References: <20030408164614.GA7236@comp.chem.msu.su> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 19:33:35 -0000 On Tue, 8 Apr 2003, Yar Tikhiy wrote: > ... > Let's consider a non-blocking file descriptor that correspons to a > terminal in raw mode. Let's also assume read(2) is issued on it > when there is no data to read. > > If for this terminal MIN > 0 and TIME == 0, read(2) will return -1 > and set errno to EAGAIN. > > OTOH, if MIN == 0 and TIME > 0, read(2) will return 0. > > While not in disagreement with POSIX[1], such a behaviour has at > least one unwelcome consequence: If a program has been compiled > with ``-pthread'', the TIME counter won't work on terminal descriptors > that are in blocking mode from the program's point of view -- read(2) > will instantly return 0 on them. That is because the following > scenario will happen: The spec is not very clear, but I think it means to say to return -1/EAGAIN (it says that first). I seem to have help break this in FreeBSD-1. Rev.1.17 of tty.c fixed the complementary bug of returning EWOULDBLOCK after a timeout, and rev.1.32 (the last commit to tty.c in FreeBSD-1) "finished" implementing MIN/TIME and didn't handle this case quite right. The MIN/TIME changes are all collected together with no history in rev.1.8 of tty.c in FreeBSD-2. > 1) libc_r sets non-blocking mode on a descriptor as soon as a device > is opened (that is how i/o in user-land threads work); > 2) the program sets the TIME counter through tcsetattr(3); > 3) the program issues read(2), which ends up in the actual read() > syscall, which in turn returns 0 to libc_r (assuming there is no > data to read); > 4) libc_r thinks this is the EOF indicator, so it instantly returns > 0 to the program; > 5) the program breaks. > > Notice, that MIN works right with libc_r since read() syscall will > return -1/EAGAIN, which is correctly understood by libc_r: it will > block the current thread until there is data to read. Does it keep the fd in non-blocking mode and wait for the data using select() or similar? This wouldn't work so well for TIME because select() doesn't really understand MIN/TIME; in particular, TIME has no effect on select() in the MIN == 0 && TIME > 0 case. I think libc_r would have to duplicate most of the kernel's MIN/TIME stuff to fake things properly. It correctly doesn't go near this. Bruce From owner-freebsd-arch@FreeBSD.ORG Tue Apr 8 12:49:48 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 238EE37B401; Tue, 8 Apr 2003 12:49:48 -0700 (PDT) Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id A828A43FBD; Tue, 8 Apr 2003 12:49:46 -0700 (PDT) (envelope-from ache@pobrecita.freebsd.ru) Received: from pobrecita.freebsd.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.12.9/8.12.9) with ESMTP id h38Jni0q043958; Tue, 8 Apr 2003 23:49:44 +0400 (MSD) (envelope-from ache@pobrecita.freebsd.ru) Received: (from ache@localhost) by pobrecita.freebsd.ru (8.12.9/8.12.9/Submit) id h38JnigR043957; Tue, 8 Apr 2003 23:49:44 +0400 (MSD) Date: Tue, 8 Apr 2003 23:49:44 +0400 From: "Andrey A. Chernov" To: Bruce Evans Message-ID: <20030408194944.GA43822@nagual.pp.ru> References: <20030408164614.GA7236@comp.chem.msu.su> <20030409044301.J628@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409044301.J628@gamplex.bde.org> User-Agent: Mutt/1.5.4i cc: arch@freebsd.org cc: Yar Tikhiy Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2003 19:49:48 -0000 On Wed, Apr 09, 2003 at 05:33:28 +1000, Bruce Evans wrote: > The spec is not very clear, but I think it means to say to return > -1/EAGAIN (it says that first). POSIX says: IEEE Std 1003.1-200x does not specify whether the setting of O_NONBLOCK takes precedence over MIN or TIME settings. Therefore, if O_NONBLOCK is set, read( ) may return immediately, regardless of the setting of MIN or TIME. Also, if no data is available, read( ) may either return 0, or return -1 with errno set to [EAGAIN]. -- Andrey A. Chernov http://ache.pp.ru/ From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 01:17:43 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4854337B401 for ; Wed, 9 Apr 2003 01:17:43 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5D0EC43FBD for ; Wed, 9 Apr 2003 01:17:42 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h398HfZq031399 for ; Wed, 9 Apr 2003 10:17:41 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: arch@freebsd.org From: Poul-Henning Kamp Date: Wed, 09 Apr 2003 10:17:41 +0200 Message-ID: <31398.1049876261@critter.freebsd.dk> Subject: endianess of /etc/pwd.db X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 08:17:43 -0000 Kris ran into this problem: copying a /etc/pwd.db from one endianess to another gave him really weird uid/gid numbers. The DB code itself is endianess-agnostic, so the first warning one gets is the weird UID/GID. Should we make the endianess of this file explicit to prevent this pit-fall for our users ? The cost would be less than epsilon. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 02:39:55 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 51A8B37B401 for ; Wed, 9 Apr 2003 02:39:55 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72AF943F75 for ; Wed, 9 Apr 2003 02:39:54 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h399dkZq032184 for ; Wed, 9 Apr 2003 11:39:47 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: arch@freebsd.org From: Poul-Henning Kamp Date: Wed, 09 Apr 2003 11:39:46 +0200 Message-ID: <32183.1049881186@critter.freebsd.dk> Subject: Sharing code between kernel and userland.... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 09:39:55 -0000 This is a problem I have hit before, and now I hit it again: I need to share a function between kernel and userland. In the present case it is the endianess conversions for struct disklabel which currently live in src/sys/geom/geom_bsd.c as g_bsd_ledec_partition() & g_bsd_ledec_disklabel() which now are needed in disklabel(8), libdisk and possibly other places as well also. The other partitioning formats will result in the same issue. It is vitally important that there be no discrepancy between the kernel and userland versions, so obviously they should share the same source code. We have a rule that it should be possible to compile the kernel with only the src/sys tree, so obviously the source code should live somewhere in src/sys, but the good question is: where and how ? As I see these functions, they are library functions, and the library is used both by userland and the kernel, but right now we have no such library in our system. We have a number of other bits of code which are in the same set of circumstances, the sbuf stuff for instance and various bits in libkern as well. Amongst the options I see for avoiding code duplication are: 1. put it in sys/geom/bsdlabel_encode.c have libdisk pull it into userland from there. 2. put it in sys/libkern/disklabel.c have libdisk pull it from there. 3. put it in some more or less random place in the kernel have libdisk pull it from there. 4. use static __inline ... in It is after all a rather trivial bit of code, but not quite trivial enough to make me comfortable with this. What do people think ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 04:20:56 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8BAE837B401; Wed, 9 Apr 2003 04:20:56 -0700 (PDT) Received: from snark.ratmir.ru (snark.ratmir.ru [213.24.248.177]) by mx1.FreeBSD.org (Postfix) with ESMTP id 64DFE43F93; Wed, 9 Apr 2003 04:20:55 -0700 (PDT) (envelope-from freebsd@snark.ratmir.ru) Received: from snark.ratmir.ru (freebsd@localhost [127.0.0.1]) by snark.ratmir.ru (8.12.9/8.12.9) with ESMTP id h39BKrDR033375; Wed, 9 Apr 2003 15:20:54 +0400 (MSD) (envelope-from freebsd@snark.ratmir.ru) Received: (from freebsd@localhost) by snark.ratmir.ru (8.12.9/8.12.9/Submit) id h39BKl48033374; Wed, 9 Apr 2003 15:20:47 +0400 (MSD) Date: Wed, 9 Apr 2003 15:20:47 +0400 From: Alex Semenyaka To: "Andrey A. Chernov" Message-ID: <20030409112047.GB33265@snark.ratmir.ru> References: <20030408164614.GA7236@comp.chem.msu.su> <20030409044301.J628@gamplex.bde.org> <20030408194944.GA43822@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030408194944.GA43822@nagual.pp.ru> User-Agent: Mutt/1.5.4i cc: arch@freebsd.org cc: Yar Tikhiy Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 11:20:56 -0000 On Tue, Apr 08, 2003 at 11:49:44PM +0400, Andrey A. Chernov wrote: > IEEE Std 1003.1-200x does not specify whether the setting of O_NONBLOCK > takes precedence over MIN or TIME settings. Therefore, if O_NONBLOCK is > set, read( ) may return immediately, regardless of the setting of MIN or > TIME. Also, if no data is available, read( ) may either return 0, or > return -1 with errno set to [EAGAIN]. Right you are, but the question is a little bit different, namely - what is _better_ to do: to return 0 or to return -1/EAGAIN. Now the first choice is implemented. And the point IS that in multi-thread environment with utheads such implementation leads to BAD results. The progarm considers the descriptor as being in blocking mode while libc_r hiddenly (for user) set it up to non-blocking operation mode. So 0 returned to the program can be considered only as EOF while it is NOT. And is IS definitely the WRONG behaviour. Sure user's thread system cannot deal with the descriptors in blocking mode. But it should simulate it somehow. Yar described the example when the such simulation is totally broken. SY, Alex From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 04:38:26 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 440A137B401 for ; Wed, 9 Apr 2003 04:38:26 -0700 (PDT) Received: from comp.chem.msu.su (comp-ext.chem.msu.su [158.250.32.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47EB643FAF for ; Wed, 9 Apr 2003 04:38:21 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.12.3p2/8.12.3) with ESMTP id h39BashE064232; Wed, 9 Apr 2003 15:38:15 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.12.3p2/8.12.3/Submit) id h39BasTx064231; Wed, 9 Apr 2003 15:36:54 +0400 (MSD) (envelope-from yar) Date: Wed, 9 Apr 2003 15:36:53 +0400 From: Yar Tikhiy To: "Andrey A. Chernov" Message-ID: <20030409113653.GA63770@comp.chem.msu.su> References: <20030408164614.GA7236@comp.chem.msu.su> <20030408181707.GA42723@nagual.pp.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030408181707.GA42723@nagual.pp.ru> User-Agent: Mutt/1.5.3i cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 11:38:26 -0000 On Tue, Apr 08, 2003 at 10:17:08PM +0400, Andrey A. Chernov wrote: > On Tue, Apr 08, 2003 at 20:46:14 +0400, Yar Tikhiy wrote: > > While not in disagreement with POSIX[1], such a behaviour has at > > least one unwelcome consequence: If a program has been compiled > > with ``-pthread'', the TIME counter won't work on terminal descriptors > > that are in blocking mode from the program's point of view -- read(2) > > will instantly return 0 on them. That is because the following > > scenario will happen: > ... > > > Shouldn't both TIME and MIN cases be uniform in returning -1/EAGAIN > > on non-blocking descriptors? > > It means that libc_r MIN/TIME handling should be fixed to conform POSIX > and not general MIN/TIME handling way. Not exactly, I'm afraid. If the system returns 0 from read(), libc_r has nothing else to do but to pass this 0 to the application because it may be the EOF sign. Of course, the issue is more complex then I outlined, as Bruce Evans has pointed out. However, why to treat TIME differently from MIN in the system? -- Yar From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 04:50:43 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E983F37B401 for ; Wed, 9 Apr 2003 04:50:43 -0700 (PDT) Received: from comp.chem.msu.su (comp-ext.chem.msu.su [158.250.32.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E0FD43FBF for ; Wed, 9 Apr 2003 04:50:40 -0700 (PDT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.12.3p2/8.12.3) with ESMTP id h39BnFhE064826; Wed, 9 Apr 2003 15:50:35 +0400 (MSD) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.12.3p2/8.12.3/Submit) id h39BnFNF064825; Wed, 9 Apr 2003 15:49:15 +0400 (MSD) (envelope-from yar) Date: Wed, 9 Apr 2003 15:49:14 +0400 From: Yar Tikhiy To: Bruce Evans Message-ID: <20030409114914.GB63770@comp.chem.msu.su> References: <20030408164614.GA7236@comp.chem.msu.su> <20030409044301.J628@gamplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409044301.J628@gamplex.bde.org> User-Agent: Mutt/1.5.3i cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 11:50:44 -0000 On Wed, Apr 09, 2003 at 05:33:28AM +1000, Bruce Evans wrote: > On Tue, 8 Apr 2003, Yar Tikhiy wrote: > > > ... > > Let's consider a non-blocking file descriptor that correspons to a > > terminal in raw mode. Let's also assume read(2) is issued on it > > when there is no data to read. > > > > If for this terminal MIN > 0 and TIME == 0, read(2) will return -1 > > and set errno to EAGAIN. > > > > OTOH, if MIN == 0 and TIME > 0, read(2) will return 0. > > > > While not in disagreement with POSIX[1], such a behaviour has at > > least one unwelcome consequence: If a program has been compiled > > with ``-pthread'', the TIME counter won't work on terminal descriptors > > that are in blocking mode from the program's point of view -- read(2) > > will instantly return 0 on them. That is because the following > > scenario will happen: > > The spec is not very clear, but I think it means to say to return > -1/EAGAIN (it says that first). As far as I can understand, the spec says both 0 and -1/EAGAIN are valid return values. So it's up to us to decide which way is better. > ... > > 1) libc_r sets non-blocking mode on a descriptor as soon as a device > > is opened (that is how i/o in user-land threads work); > > 2) the program sets the TIME counter through tcsetattr(3); > > 3) the program issues read(2), which ends up in the actual read() > > syscall, which in turn returns 0 to libc_r (assuming there is no > > data to read); > > 4) libc_r thinks this is the EOF indicator, so it instantly returns > > 0 to the program; > > 5) the program breaks. > > > > Notice, that MIN works right with libc_r since read() syscall will > > return -1/EAGAIN, which is correctly understood by libc_r: it will > > block the current thread until there is data to read. > > Does it keep the fd in non-blocking mode and wait for the data using > select() or similar? Yes, libc_r does read() on the fd and if the read() returns -1/EAGAIN, it does poll() on the fd (as can be seen with ktrace.) > This wouldn't work so well for TIME because > select() doesn't really understand MIN/TIME; in particular, TIME > has no effect on select() in the MIN == 0 && TIME > 0 case. I > think libc_r would have to duplicate most of the kernel's MIN/TIME > stuff to fake things properly. It correctly doesn't go near this. Hmmm, it is a serious complication. Shame on me that I have overlooked it. But that doesn't seem to keep us from making the MIN and TIME cases consistent WRT the return values for non-blocking fd's, does it? -- Yar From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 05:26:25 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 306C937B401 for ; Wed, 9 Apr 2003 05:26:25 -0700 (PDT) Received: from gw.nectar.cc (gw.nectar.cc [208.42.49.153]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80F9C43FBD for ; Wed, 9 Apr 2003 05:26:24 -0700 (PDT) (envelope-from nectar@celabo.org) Received: from madman.celabo.org (madman.celabo.org [10.0.1.111]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "madman.celabo.org", Issuer "celabo.org CA" (verified OK)) by gw.nectar.cc (Postfix) with ESMTP id 9BA54E; Wed, 9 Apr 2003 07:26:21 -0500 (CDT) Received: by madman.celabo.org (Postfix, from userid 1001) id E439378C43; Wed, 9 Apr 2003 07:26:20 -0500 (CDT) Date: Wed, 9 Apr 2003 07:26:20 -0500 From: "Jacques A. Vidrine" To: Poul-Henning Kamp Message-ID: <20030409122620.GC19391@madman.celabo.org> References: <31398.1049876261@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31398.1049876261@critter.freebsd.dk> X-Url: http://www.celabo.org/ User-Agent: Mutt/1.5.3i-ja.1 cc: arch@freebsd.org Subject: Re: endianess of /etc/pwd.db X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 12:26:25 -0000 On Wed, Apr 09, 2003 at 10:17:41AM +0200, Poul-Henning Kamp wrote: > > Kris ran into this problem: copying a /etc/pwd.db from one endianess > to another gave him really weird uid/gid numbers. > > The DB code itself is endianess-agnostic, so the first warning one > gets is the weird UID/GID. > > Should we make the endianess of this file explicit to prevent this > pit-fall for our users ? The cost would be less than epsilon. I am working in this area recently, and the exact same thought occurred to me. I think we should do it. I would add a file format version flag, the absence of which indicates the current MD format, and adjust getpwent/pwd_mkdb accordingly. Are there any other tools that would need to be touched? Cheers, -- Jacques A. Vidrine http://www.celabo.org/ NTT/Verio SME . FreeBSD UNIX . Heimdal Kerberos jvidrine@verio.net . nectar@FreeBSD.org . nectar@kth.se From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 06:06:55 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 168D137B401 for ; Wed, 9 Apr 2003 06:06:55 -0700 (PDT) Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id 482FA43FB1 for ; Wed, 9 Apr 2003 06:06:54 -0700 (PDT) (envelope-from jake@k6.locore.ca) Received: from k6.locore.ca (localhost.locore.ca [127.0.0.1]) by k6.locore.ca (8.12.8/8.12.8) with ESMTP id h39D7IxS085834; Wed, 9 Apr 2003 09:07:18 -0400 (EDT) (envelope-from jake@k6.locore.ca) Received: (from jake@localhost) by k6.locore.ca (8.12.8/8.12.8/Submit) id h39D7Ifc085833; Wed, 9 Apr 2003 09:07:18 -0400 (EDT) Date: Wed, 9 Apr 2003 09:07:18 -0400 From: Jake Burkholder To: Poul-Henning Kamp Message-ID: <20030409130718.GF78831@locore.ca> References: <31398.1049876261@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <31398.1049876261@critter.freebsd.dk> User-Agent: Mutt/1.4i cc: arch@freebsd.org Subject: Re: endianess of /etc/pwd.db X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 13:06:55 -0000 Apparently, On Wed, Apr 09, 2003 at 10:17:41AM +0200, Poul-Henning Kamp said words to the effect of; > > Kris ran into this problem: copying a /etc/pwd.db from one endianess > to another gave him really weird uid/gid numbers. > > The DB code itself is endianess-agnostic, so the first warning one > gets is the weird UID/GID. > > Should we make the endianess of this file explicit to prevent this > pit-fall for our users ? The cost would be less than epsilon. > Yes, please. Jake From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 08:14:46 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4096537B401; Wed, 9 Apr 2003 08:14:46 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C7AB43FA3; Wed, 9 Apr 2003 08:14:45 -0700 (PDT) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h39FEiBg010169; Wed, 9 Apr 2003 11:14:44 -0400 (EDT) Received: from localhost (eischen@localhost)h39FEhvp010166; Wed, 9 Apr 2003 11:14:43 -0400 (EDT) Date: Wed, 9 Apr 2003 11:14:43 -0400 (EDT) From: Daniel Eischen To: Yar Tikhiy In-Reply-To: <20030409113653.GA63770@comp.chem.msu.su> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: "Andrey A. Chernov" cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 15:14:46 -0000 On Wed, 9 Apr 2003, Yar Tikhiy wrote: > On Tue, Apr 08, 2003 at 10:17:08PM +0400, Andrey A. Chernov wrote: > > On Tue, Apr 08, 2003 at 20:46:14 +0400, Yar Tikhiy wrote: > > > While not in disagreement with POSIX[1], such a behaviour has at > > > least one unwelcome consequence: If a program has been compiled > > > with ``-pthread'', the TIME counter won't work on terminal descriptors > > > that are in blocking mode from the program's point of view -- read(2) > > > will instantly return 0 on them. That is because the following > > > scenario will happen: > > ... > > > > > Shouldn't both TIME and MIN cases be uniform in returning -1/EAGAIN > > > on non-blocking descriptors? > > > > It means that libc_r MIN/TIME handling should be fixed to conform POSIX > > and not general MIN/TIME handling way. > > Not exactly, I'm afraid. If the system returns 0 from read(), libc_r > has nothing else to do but to pass this 0 to the application because > it may be the EOF sign. Of course, the issue is more complex then I > outlined, as Bruce Evans has pointed out. However, why to treat TIME > differently from MIN in the system? As Bruce pointed out, libc_r correctly doesn't go near TIME/MIN handling. This is a known problem when using libc_r and has been raised in the past. It's just too messy for libc_r to try and deal with this. It shouldn't be a problem with the threadsNG. -- Dan Eischen From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 09:08:13 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35AAB37B401 for ; Wed, 9 Apr 2003 09:08:12 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22E0443F75 for ; Wed, 9 Apr 2003 09:08:12 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h39G8AA7011761; Wed, 9 Apr 2003 10:08:11 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 09 Apr 2003 10:06:38 -0600 (MDT) Message-Id: <20030409.100638.128617887.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <32183.1049881186@critter.freebsd.dk> References: <32183.1049881186@critter.freebsd.dk> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org Subject: Re: Sharing code between kernel and userland.... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 16:08:13 -0000 In message: <32183.1049881186@critter.freebsd.dk> Poul-Henning Kamp writes: : Amongst the options I see for avoiding code duplication are: : : 1. : put it in sys/geom/bsdlabel_encode.c : have libdisk pull it into userland from there. : : 2. : put it in sys/libkern/disklabel.c : have libdisk pull it from there. : : 3. : put it in some more or less random place in the kernel : have libdisk pull it from there. : : 4. : use static __inline ... in : It is after all a rather trivial bit of code, but not quite : trivial enough to make me comfortable with this. : : What do people think ? Why reinvent a way of doing it. Put the thing in sys somewhere (sys/geom) and use a reachover Makefile like cam does (simplified from the actual Makefile a little): LIB= cam SRCS= camlib.c scsi_cmdparse.c scsi_all.c scsi_da.c scsi_sa.c cam.c INCS= camlib.h .PATH: ${.CURDIR}/../../sys/cam/scsi ${.CURDIR}/../../sys/cam SDIR= ${.CURDIR}/../../sys CFLAGS+= -I${.CURDIR} -I${SDIR} .include just have libdisk do the same thing. Warner From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 09:08:54 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3892A37B401 for ; Wed, 9 Apr 2003 09:08:54 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68AAA43FA3 for ; Wed, 9 Apr 2003 09:08:53 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h39G8qA7011777; Wed, 9 Apr 2003 10:08:52 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 09 Apr 2003 10:07:17 -0600 (MDT) Message-Id: <20030409.100717.35872625.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <32183.1049881186@critter.freebsd.dk> References: <32183.1049881186@critter.freebsd.dk> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: arch@freebsd.org Subject: Re: Sharing code between kernel and userland.... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 16:08:54 -0000 In message: <32183.1049881186@critter.freebsd.dk> Poul-Henning Kamp writes: : As I see these functions, they are library functions, and the library : is used both by userland and the kernel, but right now we have no : such library in our system. libcam has been doing this for a very long time... Warner From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 12:25:09 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7EA4F37B401 for ; Wed, 9 Apr 2003 12:25:09 -0700 (PDT) Received: from sccrmhc01.attbi.com (sccrmhc01.attbi.com [204.127.202.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id B3C1843FBF for ; Wed, 9 Apr 2003 12:25:08 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by sccrmhc01.attbi.com (sccrmhc01) with ESMTP id <2003040919250700100ok20qe>; Wed, 9 Apr 2003 19:25:07 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id MAA81395; Wed, 9 Apr 2003 12:25:04 -0700 (PDT) Date: Wed, 9 Apr 2003 12:24:59 -0700 (PDT) From: Julian Elischer To: Poul-Henning Kamp In-Reply-To: <32183.1049881186@critter.freebsd.dk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: Sharing code between kernel and userland.... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 19:25:09 -0000 I prefer option 4 either a macro or an inline Note that fsck uses macros from the kernel ufs includes. So there is a precedent. On Wed, 9 Apr 2003, Poul-Henning Kamp wrote: > > This is a problem I have hit before, and now I hit it again: I need > to share a function between kernel and userland. > > In the present case it is the endianess conversions for struct disklabel > which currently live in > > src/sys/geom/geom_bsd.c > as > g_bsd_ledec_partition() & g_bsd_ledec_disklabel() > > which now are needed in disklabel(8), libdisk and possibly other > places as well also. > > The other partitioning formats will result in the same issue. > > It is vitally important that there be no discrepancy between the kernel > and userland versions, so obviously they should share the same source > code. > > We have a rule that it should be possible to compile the kernel > with only the src/sys tree, so obviously the source code should live > somewhere in src/sys, but the good question is: where and how ? > > As I see these functions, they are library functions, and the library > is used both by userland and the kernel, but right now we have no > such library in our system. > > We have a number of other bits of code which are in the same set > of circumstances, the sbuf stuff for instance and various bits in > libkern as well. > > Amongst the options I see for avoiding code duplication are: > > 1. > put it in sys/geom/bsdlabel_encode.c > have libdisk pull it into userland from there. > > 2. > put it in sys/libkern/disklabel.c > have libdisk pull it from there. > > 3. > put it in some more or less random place in the kernel > have libdisk pull it from there. > > 4. > use static __inline ... in > It is after all a rather trivial bit of code, but not quite > trivial enough to make me comfortable with this. > > What do people think ? > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 16:29:30 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BA24C37B401 for ; Wed, 9 Apr 2003 16:29:30 -0700 (PDT) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4435743FA3 for ; Wed, 9 Apr 2003 16:29:30 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0163.cvx22-bradley.dialup.earthlink.net ([209.179.198.163] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 193P0A-0003VA-00; Wed, 09 Apr 2003 16:29:10 -0700 Message-ID: <3E94AC5B.1B93F2FB@mindspring.com> Date: Wed, 09 Apr 2003 16:27:23 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jake Burkholder References: <31398.1049876261@critter.freebsd.dk> <20030409130718.GF78831@locore.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a475268a311e27c18d334c8bd86d18ff9f548b785378294e88350badd9bab72f9c350badd9bab72f9c cc: arch@freebsd.org cc: Poul-Henning Kamp Subject: Re: endianess of /etc/pwd.db X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 23:29:31 -0000 Jake Burkholder wrote: > Apparently, On Wed, Apr 09, 2003 at 10:17:41AM +0200, > Poul-Henning Kamp said words to the effect of; > > Kris ran into this problem: copying a /etc/pwd.db from one endianess > > to another gave him really weird uid/gid numbers. > > > > The DB code itself is endianess-agnostic, so the first warning one > > gets is the weird UID/GID. > > > > Should we make the endianess of this file explicit to prevent this > > pit-fall for our users ? The cost would be less than epsilon. > > Yes, please. Sendmail databases have the same problem (mkdb). Might want to coordinate with those people, if they already have a solution, or if you really want to create a general solution (FWIW). -- Terry From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 16:47:35 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EE9A237B401; Wed, 9 Apr 2003 16:47:35 -0700 (PDT) Received: from bluejay.mail.pas.earthlink.net (bluejay.mail.pas.earthlink.net [207.217.120.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BEB543FB1; Wed, 9 Apr 2003 16:47:35 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0163.cvx22-bradley.dialup.earthlink.net ([209.179.198.163] helo=mindspring.com) by bluejay.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 193PHv-0007Sb-00; Wed, 09 Apr 2003 16:47:33 -0700 Message-ID: <3E94B0AE.5FDB3CF1@mindspring.com> Date: Wed, 09 Apr 2003 16:45:50 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Daniel Eischen References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a41cd0bc3545dab10b182c576a2d1abb56a7ce0e8f8d31aa3f350badd9bab72f9c350badd9bab72f9c cc: "Andrey A. Chernov" cc: Yar Tikhiy cc: arch@freebsd.org Subject: Re: termios & non-blocking I/O X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Apr 2003 23:47:36 -0000 Daniel Eischen wrote: > As Bruce pointed out, libc_r correctly doesn't go near TIME/MIN > handling. This is a known problem when using libc_r and has > been raised in the past. It's just too messy for libc_r to > try and deal with this. Further, case #1 (POSIX.1 case "A") *can not be made rational* in the presence of non-blocking I/O, becaue it's not possible for the caller to distinguish a short read in excess of 1 character as a result of NBIO vs. a short read as a result of the inter-character timer expiring. Case #2 (POSIX.a case "B") _requires_ a non-negative return code for a short read which is short as a result of NBIO, since *some* characters are transferred, and that's the only way to guarantee that the number of characters transferred is recorded somewhere. In the degenerate case the original poster was complaining about returning "0", the original poster failed to test with a buffer with some non-zero number of characters N, such that 0 < N < MIN. > It shouldn't be a problem with the threadsNG. Nope. It shouldn't be a problem in general, except for case #3 (POSIX.1 case "C"), which is a bounded read of some number of characters N, where MIN < N < number_requested_by_read_cahracter_count_parameter. Case #4 (POSIX.1 case "D") should be replaced in any code that links against a threads library with a "listener thread" with a blocking read for 1 character, which then dispatches to refactored code that implements the "read return value > 0" code path. This is because a for(;;) loop in a single thread of a threaded program is bad news for the threads scheduler, since it's "always" in the ready-to-run state. See other posting for POSIX.1 lawyering and technical justification. PS: I agree with Daniel: this is not worth implementing in libc_r at this point, but if someone wants it, they should submit patches. -- Terry From owner-freebsd-arch@FreeBSD.ORG Wed Apr 9 22:46:18 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 55AB437B401; Wed, 9 Apr 2003 22:46:18 -0700 (PDT) Received: from possum.cryptohill.net (cambist.cryptohill.net [24.244.145.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id B68FE43F93; Wed, 9 Apr 2003 22:46:17 -0700 (PDT) (envelope-from jeroen@vangelderen.org) Received: from vangelderen.org (catv7146.extern.kun.nl [131.174.117.146]) by possum.cryptohill.net (Postfix) with ESMTP id ABDC8AE2A6; Thu, 10 Apr 2003 01:46:15 -0400 (EDT) Date: Thu, 10 Apr 2003 07:46:18 +0200 Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) To: "Jacques A. Vidrine" From: "Jeroen C. van Gelderen" In-Reply-To: <20030409122620.GC19391@madman.celabo.org> Message-Id: Content-Transfer-Encoding: 7bit X-Mailer: Apple Mail (2.551) cc: arch@freebsd.org cc: Poul-Henning Kamp Subject: Re: endianess of /etc/pwd.db X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 05:46:18 -0000 On Wednesday, Apr 9, 2003, at 14:26 Europe/Amsterdam, Jacques A. Vidrine wrote: > On Wed, Apr 09, 2003 at 10:17:41AM +0200, Poul-Henning Kamp wrote: >> >> Kris ran into this problem: copying a /etc/pwd.db from one endianess >> to another gave him really weird uid/gid numbers. >> >> The DB code itself is endianess-agnostic, so the first warning one >> gets is the weird UID/GID. >> >> Should we make the endianess of this file explicit to prevent this >> pit-fall for our users ? The cost would be less than epsilon. > > I am working in this area recently, and the exact same thought > occurred to me. I think we should do it. I would add a file format > version flag, the absence of which indicates the current MD format, > and adjust getpwent/pwd_mkdb accordingly. Are there any other tools > that would need to be touched? Anybody know how NetBSD handles this? -J -- Jeroen C. van Gelderen - jeroen@vangelderen.org War prosperity is like the prosperity that an earthquake or a plague brings. The earthquake means good business for construction workers, and cholera improves the business of physicians, pharmacists, and undertakers; but no one has for that reason yet sought to celebrate earthquakes and cholera as stimulators of the productive forces in the general interest. -- Ludwig von Mises From owner-freebsd-arch@FreeBSD.ORG Thu Apr 10 11:12:09 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5DD8437B405 for ; Thu, 10 Apr 2003 11:12:09 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id BE95743FA3 for ; Thu, 10 Apr 2003 11:12:07 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 31972 invoked by uid 1000); 10 Apr 2003 18:12:08 -0000 Date: Thu, 10 Apr 2003 11:12:08 -0700 (PDT) From: Nate Lawson To: John Baldwin In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org Subject: Re: cvs commit: src/usr.bin/killall killall.1 killall.csrc/usr.sbinjexec.8 jexec.c src/usr.sbin/jls Makefile jls.8 jls.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 18:12:09 -0000 Please take this to arch@. Headers changed appropriately. On Thu, 10 Apr 2003, John Baldwin wrote: > On 09-Apr-2003 Alfred Perlstein wrote: > > Whatever, path components should be path components. > > You mean like this? > > > sysctl -N net.inet.tcp.syncache > net.inet.tcp.syncache.bucketlimit > net.inet.tcp.syncache.cachelimit > net.inet.tcp.syncache.count > net.inet.tcp.syncache.hashsize > net.inet.tcp.syncache.rexmtlimit The answer to your question will depend on whether or not he likes the sysctl namespace. My question was different: since jail already implies a location in file namespace, why implement a new and disjoint namespace for it? -Nate (Yes, I know jail > chroot in terms of features but at the end of the day, you pass in a file path to start a jail.) From owner-freebsd-arch@FreeBSD.ORG Thu Apr 10 11:21:49 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E42C537B405 for ; Thu, 10 Apr 2003 11:21:49 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A10643FCB for ; Thu, 10 Apr 2003 11:21:48 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 1573 invoked from network); 10 Apr 2003 18:21:54 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 10 Apr 2003 18:21:54 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h3AILiOv053187; Thu, 10 Apr 2003 14:21:45 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: Date: Thu, 10 Apr 2003 14:21:45 -0400 (EDT) From: John Baldwin To: Nate Lawson cc: arch@freebsd.org Subject: Re: cvs commit: src/usr.bin/killall killall.1 killall.c src/usr.sbin Makefile src/usr.sbin/jail jail.8 jail.c src/usr.sbin/jexec Makefile jexec.8 jexec.c src/usr.sbin/jls Makefile jls.8 jls.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 18:21:50 -0000 On 10-Apr-2003 Nate Lawson wrote: > Please take this to arch@. Headers changed appropriately. > > On Thu, 10 Apr 2003, John Baldwin wrote: >> On 09-Apr-2003 Alfred Perlstein wrote: >> > Whatever, path components should be path components. >> >> You mean like this? >> >> > sysctl -N net.inet.tcp.syncache >> net.inet.tcp.syncache.bucketlimit >> net.inet.tcp.syncache.cachelimit >> net.inet.tcp.syncache.count >> net.inet.tcp.syncache.hashsize >> net.inet.tcp.syncache.rexmtlimit > > The answer to your question will depend on whether or not he likes the > sysctl namespace. My question was different: since jail already implies > a location in file namespace, why implement a new and disjoint namespace > for it? jail -n one /foo/bar jail -n two /foo/bar The path for a jail is not necessairly unique across all jails. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ From owner-freebsd-arch@FreeBSD.ORG Thu Apr 10 19:01:35 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2817B37B401; Thu, 10 Apr 2003 19:01:35 -0700 (PDT) Received: from alicia.nttmcl.com (alicia.nttmcl.com [216.69.69.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id A0D0943F85; Thu, 10 Apr 2003 19:01:34 -0700 (PDT) (envelope-from kelly@alicia.nttmcl.com) Received: from alicia.nttmcl.com (localhost [127.0.0.1]) by alicia.nttmcl.com (8.12.5/8.12.5) with ESMTP id h3B21Yvm057464; Thu, 10 Apr 2003 19:01:34 -0700 (PDT) (envelope-from kelly@alicia.nttmcl.com) Received: from localhost (kelly@localhost)h3B21YpM057461; Thu, 10 Apr 2003 19:01:34 -0700 (PDT) Date: Thu, 10 Apr 2003 19:01:34 -0700 (PDT) From: Kelly Yancey To: arch@freebsd.org Message-ID: <20030410184538.U57246-200000@alicia.nttmcl.com> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-473914763-1050026494=:57246" Subject: kqueue's EVFILT_PROC and unreaped children X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 02:01:35 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-473914763-1050026494=:57246 Content-Type: TEXT/PLAIN; charset=US-ASCII The attached patch, against -STABLE, closes a window where a process can fork/exec a child and then register a NOTE_EXIT note for the child only to get ESRCH even if the child is still a zombie. Conceivably, something similar should be done for NOTE_EXEC, but I don't know a simple way to do that (I'm not saying there isn't one...just that I don't know it :) ). Anyway, I'de appreciate feedback before I adapt the patch to -CURRENT and commit. Thanks, Kelly -- Kelly Yancey -- kbyanc@{posi.net,FreeBSD.org} -- kelly@nttmcl.com --0-473914763-1050026494=:57246 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="kqueue-proc.diff" Content-Transfer-Encoding: BASE64 Content-ID: <20030410190134.A57246@alicia.nttmcl.com> Content-Description: Content-Disposition: attachment; filename="kqueue-proc.diff" SW5kZXg6IHN5cy9rZXJuL2tlcm5fZXZlbnQuYw0KPT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PQ0KUkNTIGZpbGU6IC9ob21lL25jdnMvc3JjL3N5cy9rZXJuL2tl cm5fZXZlbnQuYyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuMi4yLjgNCmRp ZmYgLXUgLXAgLXIxLjIuMi44IGtlcm5fZXZlbnQuYw0KLS0tIHN5cy9rZXJu L2tlcm5fZXZlbnQuYwkxNCBEZWMgMjAwMSAxOToyNDo0MiAtMDAwMAkxLjIu Mi44DQorKysgc3lzL2tlcm4va2Vybl9ldmVudC5jCTExIEFwciAyMDAzIDAw OjU1OjQ4IC0wMDAwDQpAQCAtMTc5LDggKzE3OSwxNCBAQCBzdGF0aWMgaW50 DQogZmlsdF9wcm9jYXR0YWNoKHN0cnVjdCBrbm90ZSAqa24pDQogew0KIAlz dHJ1Y3QgcHJvYyAqcDsNCisJaW50IGltbWVkaWF0ZTsNCiANCisJaW1tZWRp YXRlID0gMDsNCiAJcCA9IHBmaW5kKGtuLT5rbl9pZCk7DQorCWlmIChwID09 IE5VTEwgJiYga24tPmtuX3NmZmxhZ3MgJiBOT1RFX0VYSVQpIHsNCisJCXAg PSB6cGZpbmQoa24tPmtuX2lkKTsNCisJCWltbWVkaWF0ZSA9IDE7DQorCX0N CiAJaWYgKHAgPT0gTlVMTCkNCiAJCXJldHVybiAoRVNSQ0gpOw0KIAlpZiAo ISBQUklTT05fQ0hFQ0soY3VycHJvYywgcCkpDQpAQCAtMjAwLDYgKzIwNiwx NCBAQCBmaWx0X3Byb2NhdHRhY2goc3RydWN0IGtub3RlICprbikNCiANCiAJ LyogWFhYIGxvY2sgdGhlIHByb2MgaGVyZSB3aGlsZSBhZGRpbmcgdG8gdGhl IGxpc3Q/ICovDQogCVNMSVNUX0lOU0VSVF9IRUFEKCZwLT5wX2tsaXN0LCBr biwga25fc2VsbmV4dCk7DQorDQorCS8qDQorCSAqIEltbWVkaWF0ZWx5IGFj dGl2YXRlIHRoZSBrbm90ZSBpZiBpdCBpcyBhbiBleGl0IG5vdGUgZm9yIGEg em9tYmllDQorCSAqIHByb2Nlc3MuICBUaGlzIGlzIG5lY2Vzc2FyeSB0byBo YW5kbGUgdGhlIGNhc2Ugd2hlcmUgYSBjaGlsZCBkaWVzDQorCSAqIGJlZm9y ZSB0aGUga2V2ZW50IGlzIHJlZ2lzdGVyZWQuDQorCSAqLw0KKwlpZiAoaW1t ZWRpYXRlICYmIGZpbHRfcHJvYyhrbiwgTk9URV9FWElUKSkNCisJCUtOT1RF X0FDVElWQVRFKGtuKTsNCiANCiAJcmV0dXJuICgwKTsNCiB9DQpJbmRleDog c3lzL2tlcm4va2Vybl9wcm9jLmMNCj09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0N ClJDUyBmaWxlOiAvaG9tZS9uY3ZzL3NyYy9zeXMva2Vybi9rZXJuX3Byb2Mu Yyx2DQpyZXRyaWV2aW5nIHJldmlzaW9uIDEuNjMuMi44DQpkaWZmIC11IC1w IC1yMS42My4yLjgga2Vybl9wcm9jLmMNCi0tLSBzeXMva2Vybi9rZXJuX3By b2MuYwkxIE1heSAyMDAxIDEzOjM5OjA2IC0wMDAwCTEuNjMuMi44DQorKysg c3lzL2tlcm4va2Vybl9wcm9jLmMJMTAgQXByIDIwMDMgMjM6NTA6NTUgLTAw MDANCkBAIC0zMSw3ICszMSw3IEBADQogICogU1VDSCBEQU1BR0UuDQogICoN CiAgKglAKCMpa2Vybl9wcm9jLmMJOC43IChCZXJrZWxleSkgMi8xNC85NQ0K LSAqICRGcmVlQlNEOiBzcmMvc3lzL2tlcm4va2Vybl9wcm9jLmMsdiAxLjYz LjIuNyAyMDAwLzA5LzA3IDE5OjEzOjM2IHRydWNrbWFuIEV4cCAkDQorICog JEZyZWVCU0Q6IHNyYy9zeXMva2Vybi9rZXJuX3Byb2MuYyx2IDEuNjMuMi44 IDIwMDEvMDUvMDEgMTM6Mzk6MDYgZHdtYWxvbmUgRXhwICQNCiAgKi8NCiAN CiAjaW5jbHVkZSA8c3lzL3BhcmFtLmg+DQpAQCAtNDAzLDcgKzQwMyw3IEBA IGZpbGxfZXByb2MocCwgZXApDQogCX0NCiB9DQogDQotc3RhdGljIHN0cnVj dCBwcm9jICoNCitzdHJ1Y3QgcHJvYyAqDQogenBmaW5kKHBpZF90IHBpZCkN CiB7DQogCXN0cnVjdCBwcm9jICpwOw0KSW5kZXg6IHN5cy9zeXMvcHJvYy5o DQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL2hvbWUvbmN2 cy9zcmMvc3lzL3N5cy9wcm9jLmgsdg0KcmV0cmlldmluZyByZXZpc2lvbiAx Ljk5LjIuNw0KZGlmZiAtdSAtcCAtcjEuOTkuMi43IHByb2MuaA0KLS0tIHN5 cy9zeXMvcHJvYy5oCTMxIEphbiAyMDAyIDE4OjQwOjI5IC0wMDAwCTEuOTku Mi43DQorKysgc3lzL3N5cy9wcm9jLmgJMTAgQXByIDIwMDMgMjM6NTA6NTUg LTAwMDANCkBAIC0zNiw3ICszNiw3IEBADQogICogU1VDSCBEQU1BR0UuDQog ICoNCiAgKglAKCMpcHJvYy5oCTguMTUgKEJlcmtlbGV5KSA1LzE5Lzk1DQot ICogJEZyZWVCU0QkDQorICogJEZyZWVCU0Q6IHNyYy9zeXMvc3lzL3Byb2Mu aCx2IDEuOTkuMi43IDIwMDIvMDEvMzEgMTg6NDA6MjkgZGlsbG9uIEV4cCAk DQogICovDQogDQogI2lmbmRlZiBfU1lTX1BST0NfSF8NCkBAIC00MTcsNiAr NDE3LDcgQEAgZXh0ZXJuCXVfbG9uZyBwc19hcmdfY2FjaGVfbGltaXQ7DQog ZXh0ZXJuCWludCBwc19hcmdzb3BlbjsNCiANCiBzdHJ1Y3QgcHJvYyAqcGZp bmQgX19QKChwaWRfdCkpOwkvKiBGaW5kIHByb2Nlc3MgYnkgaWQuICovDQor c3RydWN0IHByb2MgKnpwZmluZCBfX1AoKHBpZF90KSk7CS8qIEZpbmQgem9t YmllIHByb2Nlc3MgYnkgaWQuICovDQogc3RydWN0IHBncnAgKnBnZmluZCBf X1AoKHBpZF90KSk7CS8qIEZpbmQgcHJvY2VzcyBncm91cCBieSBpZC4gKi8N CiANCiBzdHJ1Y3Qgdm1fem9uZTsNCg== --0-473914763-1050026494=:57246-- From owner-freebsd-arch@FreeBSD.ORG Thu Apr 10 23:02:39 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5FD3037B401; Thu, 10 Apr 2003 23:02:39 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D3CF43FB1; Thu, 10 Apr 2003 23:02:38 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (scratch.catspoiler.org [192.168.101.3]) by gw.catspoiler.org (8.12.6/8.12.6) with ESMTP id h3B62T8W066999; Thu, 10 Apr 2003 23:02:33 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200304110602.h3B62T8W066999@gw.catspoiler.org> Date: Thu, 10 Apr 2003 23:02:29 -0700 (PDT) From: Don Lewis To: nate@root.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: arch@FreeBSD.org cc: jhb@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/killall killall.1 killall.c src/usr.sbin Makefile src/usr.sbin/jail jail.8 jail.c src/usr.sbin/jexec Makefile jexec.8 jexec.c src/usr.sbin/jls Makefile jls.8 jls.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 06:02:39 -0000 On 10 Apr, Nate Lawson wrote: > My question was different: since jail already implies > a location in file namespace, why implement a new and disjoint namespace > for it? That was my reaction. Why not just use the path as the ID, unless you want to allow two distinct jails to share the same root directory? From owner-freebsd-arch@FreeBSD.ORG Fri Apr 11 01:55:15 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 43E6937B401 for ; Fri, 11 Apr 2003 01:55:15 -0700 (PDT) Received: from smtp-relay.omnis.com (smtp-relay.omnis.com [216.239.128.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB84A43FA3 for ; Fri, 11 Apr 2003 01:55:14 -0700 (PDT) (envelope-from wes@softweyr.com) Received: from softweyr.homeunix.net (66-91-236-204.san.rr.com [66.91.236.204]) by smtp-relay.omnis.com (Postfix) with ESMTP id 380CC43E0D; Fri, 11 Apr 2003 01:55:14 -0700 (PDT) From: Wes Peters Organization: Softweyr To: "Poul-Henning Kamp" , Dag-Erling Smorgrav Date: Fri, 11 Apr 2003 01:55:13 -0700 User-Agent: KMail/1.5 References: <30340.1049663478@critter.freebsd.dk> In-Reply-To: <30340.1049663478@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200304110155.13446.wes@softweyr.com> cc: arch@freebsd.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 08:55:15 -0000 On Sunday 06 April 2003 14:11, Poul-Henning Kamp wrote: > In message , Dag-Erling Smorgrav writes: > >"Poul-Henning Kamp" writes: > >> In message , Dag-Erling Smorgrav writes: > >> > The attached patch adds a timecounter option to rc.conf and an > >> > rc.d script to handle it. > >> > >> What's wrong with using /etc/sysctl.conf for this ? > > > >Partly because I believe that the choice of timecounter hardware is > >sufficiently important to the performance and correct operation of the > >system to warrant its own rc.conf knob, and partly because I hate the > >"configuration diaspora" of which sysctl.conf is a prime example. > > I on the other hand think that by now /etc/rc.conf has so many knobs > and handles that it is practically impossible to figure out how to > do anything without resorting to "less /etc/rc.*" to figure it out :-( We could always write a nice GTK+ application that edits it for you... /me ducks and hides -- Where am I, and what am I doing in this handbasket? Wes Peters wes@softweyr.com From owner-freebsd-arch@FreeBSD.ORG Fri Apr 11 02:05:15 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A13937B401 for ; Fri, 11 Apr 2003 02:05:15 -0700 (PDT) Received: from gandalf.online.bg (gandalf.online.bg [217.75.128.9]) by mx1.FreeBSD.org (Postfix) with SMTP id 277F743F3F for ; Fri, 11 Apr 2003 02:05:13 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 7152 invoked from network); 11 Apr 2003 08:59:58 -0000 Received: from office.sbnd.net (HELO straylight.ringlet.net) (217.75.140.130) by gandalf.online.bg with SMTP; 11 Apr 2003 08:59:57 -0000 Received: (qmail 81505 invoked by uid 1000); 11 Apr 2003 09:03:09 -0000 Date: Fri, 11 Apr 2003 12:03:09 +0300 From: Peter Pentchev To: Wes Peters Message-ID: <20030411090309.GN6427@straylight.oblivion.bg> Mail-Followup-To: Wes Peters , Poul-Henning Kamp , Dag-Erling Smorgrav , arch@freebsd.org References: <30340.1049663478@critter.freebsd.dk> <200304110155.13446.wes@softweyr.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="27ZtN5FSuKKSZcBU" Content-Disposition: inline In-Reply-To: <200304110155.13446.wes@softweyr.com> User-Agent: Mutt/1.5.4i cc: arch@freebsd.org cc: Poul-Henning Kamp cc: Dag-Erling Smorgrav Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 09:05:15 -0000 --27ZtN5FSuKKSZcBU Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 11, 2003 at 01:55:13AM -0700, Wes Peters wrote: > On Sunday 06 April 2003 14:11, Poul-Henning Kamp wrote: > > In message , Dag-Erling Smorgrav=20 > writes: > > >"Poul-Henning Kamp" writes: > > >> In message , Dag-Erling Smorgrav= =20 > writes: > > >> > The attached patch adds a timecounter option to rc.conf and an > > >> > rc.d script to handle it. > > >> > > >> What's wrong with using /etc/sysctl.conf for this ? > > > > > >Partly because I believe that the choice of timecounter hardware is > > >sufficiently important to the performance and correct operation of the > > >system to warrant its own rc.conf knob, and partly because I hate the > > >"configuration diaspora" of which sysctl.conf is a prime example. > > > > I on the other hand think that by now /etc/rc.conf has so many knobs > > and handles that it is practically impossible to figure out how to > > do anything without resorting to "less /etc/rc.*" to figure it out :-( >=20 > We could always write a nice GTK+ application that edits it for you... >=20 > /me ducks and hides Errr.. you mean like ports/sysutils/thefish ? :) G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@sbnd.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If the meanings of 'true' and 'false' were switched, then this sentence wou= ldn't be false. --27ZtN5FSuKKSZcBU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+loTN7Ri2jRYZRVMRAs+xAJ9cv79oMepQSgUOo5Awp8+lG5wgLACfU0O3 6tUrv7ZLNVlrSE6bgHCXq9g= =walE -----END PGP SIGNATURE----- --27ZtN5FSuKKSZcBU-- From owner-freebsd-arch@FreeBSD.ORG Fri Apr 11 04:39:06 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6319137B401 for ; Fri, 11 Apr 2003 04:39:06 -0700 (PDT) Received: from mail.tcoip.com.br (erato.tco.net.br [200.220.254.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CA7043F93 for ; Fri, 11 Apr 2003 04:39:03 -0700 (PDT) (envelope-from dcs@tcoip.com.br) Received: from tcoip.com.br ([10.0.2.6]) by mail.tcoip.com.br (8.11.6/8.11.6) with ESMTP id h3BBck920517; Fri, 11 Apr 2003 08:38:46 -0300 Message-ID: <3E96A946.4050708@tcoip.com.br> Date: Fri, 11 Apr 2003 08:38:46 -0300 From: "Daniel C. Sobral" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4a) Gecko/20030408 X-Accept-Language: en-us, en, pt-br, ja MIME-Version: 1.0 To: Peter Pentchev References: <30340.1049663478@critter.freebsd.dk> <200304110155.13446.wes@softweyr.com> <20030411090309.GN6427@straylight.oblivion.bg> In-Reply-To: <20030411090309.GN6427@straylight.oblivion.bg> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: Poul-Henning Kamp cc: Dag-Erling Smorgrav cc: arch@freebsd.org Subject: Re: Add timecounter option to rc.conf X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Apr 2003 11:39:06 -0000 Peter Pentchev wrote: > On Fri, Apr 11, 2003 at 01:55:13AM -0700, Wes Peters wrote: > >>On Sunday 06 April 2003 14:11, Poul-Henning Kamp wrote: >> >>>In message , Dag-Erling Smorgrav >> >>writes: >> >>>>"Poul-Henning Kamp" writes: >>>> >>>>>In message , Dag-Erling Smorgrav >> >>writes: >> >>>>>>The attached patch adds a timecounter option to rc.conf and an >>>>>>rc.d script to handle it. >>>>> >>>>>What's wrong with using /etc/sysctl.conf for this ? >>>> >>>>Partly because I believe that the choice of timecounter hardware is >>>>sufficiently important to the performance and correct operation of the >>>>system to warrant its own rc.conf knob, and partly because I hate the >>>>"configuration diaspora" of which sysctl.conf is a prime example. >>> >>>I on the other hand think that by now /etc/rc.conf has so many knobs >>>and handles that it is practically impossible to figure out how to >>>do anything without resorting to "less /etc/rc.*" to figure it out :-( >> >>We could always write a nice GTK+ application that edits it for you... >> >>/me ducks and hides > > > Errr.. you mean like ports/sysutils/thefish ? :) /me is terribly disappointed... Why not extend it to loader.conf? :-) -- Daniel C. Sobral (8-DCS) Gerencia de Operacoes Divisao de Comunicacao de Dados Coordenacao de Seguranca TCO Fones: 55-61-313-7654/Cel: 55-61-9618-0904 E-mail: Daniel.Capo@tco.net.br Daniel.Sobral@tcoip.com.br dcs@tcoip.com.br Outros: dcs@newsguy.com dcs@freebsd.org capo@notorious.bsdconspiracy.net QOTD: "I used to go to UCLA, but then my Dad got a job."