From owner-freebsd-standards Sun Oct 20 12:35:46 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEDEF37B401; Sun, 20 Oct 2002 12:35:45 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 204AD43E91; Sun, 20 Oct 2002 12:35:45 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9KJZcpk075783; Sun, 20 Oct 2002 13:35:38 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Oct 2002 13:35:26 -0600 (MDT) Message-Id: <20021020.133526.55624580.imp@bsdimp.com> To: jmallett@FreeBSD.ORG Cc: rehsack@liwing.de, standards@FreeBSD.ORG Subject: Re: ISO C99 From: "M. Warner Losh" In-Reply-To: <20021019030759.A85988@FreeBSD.org> References: <3DB117EF.CD0AEE45@liwing.de> <20021019030759.A85988@FreeBSD.org> 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 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG My common sense answer is 'fixes for std=c99 are cool if they don't break anything (esp with -std=c89) and don't cause bootstrap issues and conform to style(9).' Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sun Oct 20 12:44:45 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B13B37B401; Sun, 20 Oct 2002 12:44:44 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 803E843E9C; Sun, 20 Oct 2002 12:44:43 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9KJiMpk075829; Sun, 20 Oct 2002 13:44:22 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Oct 2002 13:44:09 -0600 (MDT) Message-Id: <20021020.134409.73085448.imp@bsdimp.com> To: dot@dotat.at Cc: tlambert2@mindspring.com, bde@zeta.org.au, rodrigc@attbi.com, freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Problem detecting POSIX symbolic constants From: "M. Warner Losh" In-Reply-To: <20021016121455.A3711@chiark.greenend.org.uk> References: <20021012151336.A24868@chiark.greenend.org.uk> <3DA883F2.33E84C@mindspring.com> <20021016121455.A3711@chiark.greenend.org.uk> 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 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <20021016121455.A3711@chiark.greenend.org.uk> Tony Finch writes: : On Sat, Oct 12, 2002 at 01:20:03PM -0700, Terry Lambert wrote: : > Tony Finch wrote: : > > : > > No -- the short-circuiting behaviour of && and || only matters if : > > you can have side-effects, which you can't in the preprocessor, : > > so there is no need to implement it (unifdef doesn't). : > : > Consider: : > : > #if _DEFINED_SUPPORTED && defined(SOMETHING) : : That's a syntax error in pre-ANSI preprocessors (unless defined() is : #defined), which won't be bypassed by evaluation shortcutting since : evaluation happens after parsing. Actaully, it is only a syntax error on some really really really old cpp. The sun cpp on SunOS 4.x, for example, wasn't ANSI, but did grok the above construct. Warner P.S. % uname -a SunOS hostname 4.1C 4.1.3 sun4 % cc -E foo.c # 1 "foo.c" # 3 "foo.c" bar __STDC__ % cat foo.c #if nope && defined(baz) foo #else bar #endif __STDC__ % To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sun Oct 20 12:49:32 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 94B4237B401; Sun, 20 Oct 2002 12:49:31 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.135.138.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4B45543E6E; Sun, 20 Oct 2002 12:49:30 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 183M4e-0003SF-00 (Debian); Sun, 20 Oct 2002 20:49:20 +0100 Date: Sun, 20 Oct 2002 20:49:20 +0100 From: Tony Finch To: "M. Warner Losh" Cc: dot@dotat.at, tlambert2@mindspring.com, bde@zeta.org.au, rodrigc@attbi.com, freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Problem detecting POSIX symbolic constants Message-ID: <20021020204920.C8767@chiark.greenend.org.uk> References: <20021012151336.A24868@chiark.greenend.org.uk> <3DA883F2.33E84C@mindspring.com> <20021016121455.A3711@chiark.greenend.org.uk> <20021020.134409.73085448.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021020.134409.73085448.imp@bsdimp.com>; from imp@bsdimp.com on Sun, Oct 20, 2002 at 01:44:09PM -0600 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, Oct 20, 2002 at 01:44:09PM -0600, M. Warner Losh wrote: > Tony Finch writes: > : On Sat, Oct 12, 2002 at 01:20:03PM -0700, Terry Lambert wrote: > : > > : > #if _DEFINED_SUPPORTED && defined(SOMETHING) > : > : That's a syntax error in pre-ANSI preprocessors (unless defined() is > : #defined), which won't be bypassed by evaluation shortcutting since > : evaluation happens after parsing. > > Actaully, it is only a syntax error on some really really really old > cpp. The sun cpp on SunOS 4.x, for example, wasn't ANSI, but did grok > the above construct. Yes, the C manual in -CURRENT which sates from 1986 documents defined(). I haven't found any versions of the manual between 1975 (h0h0 C) and then, and I don't have a copy of K&R 1 :-/ Tony. -- f.a.n.finch http://dotat.at/ FITZROY SOLE: SOUTH 7 TO SEVERE GALE 9, OCCASIONALLY STORM 10 IN FITZROY. RAIN OR SQUALLY THUNDERY SHOWERS. MODERATE OR GOOD, OCCASIONALLY POOR. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sun Oct 20 13:34:32 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8685537B401; Sun, 20 Oct 2002 13:34:30 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id DEE6A43E91; Sun, 20 Oct 2002 13:34:28 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g9KKYSpk076185; Sun, 20 Oct 2002 14:34:28 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 20 Oct 2002 14:34:16 -0600 (MDT) Message-Id: <20021020.143416.109047247.imp@bsdimp.com> To: freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Problem detecting POSIX symbolic constants From: "M. Warner Losh" In-Reply-To: <20021020204920.C8767@chiark.greenend.org.uk> References: <20021016121455.A3711@chiark.greenend.org.uk> <20021020.134409.73085448.imp@bsdimp.com> <20021020204920.C8767@chiark.greenend.org.uk> 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 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <20021020204920.C8767@chiark.greenend.org.uk> Tony Finch writes: : On Sun, Oct 20, 2002 at 01:44:09PM -0600, M. Warner Losh wrote: : > Tony Finch writes: : > : On Sat, Oct 12, 2002 at 01:20:03PM -0700, Terry Lambert wrote: : > : > : > : > #if _DEFINED_SUPPORTED && defined(SOMETHING) : > : : > : That's a syntax error in pre-ANSI preprocessors (unless defined() is : > : #defined), which won't be bypassed by evaluation shortcutting since : > : evaluation happens after parsing. : > : > Actaully, it is only a syntax error on some really really really old : > cpp. The sun cpp on SunOS 4.x, for example, wasn't ANSI, but did grok : > the above construct. : : Yes, the C manual in -CURRENT which sates from 1986 documents defined(). : I haven't found any versions of the manual between 1975 (h0h0 C) and : then, and I don't have a copy of K&R 1 :-/ I can verify first hand that SunOS 3.5 (and I think 3.2) behaved the same way as SunOS 4.1.3 did. My copy of K&R 1 is silent on this issue (well, as I recall, I can't find my K&R1 at the moment), which means defined isn't likely to be there. My copy of the Bell Laboratories Technical Journal October 1984 (Vol 63 No.8 Part 2) says, in "The Evolution of C -- Past and Future" by L. Rosler, section 5.9 Compiler Control Lines: The conditional-compile facility (Ref 2. Sect 12.3) has been enhanced in two ways. To facilitate selection of one among a set of choices, any number of control lines of the form #elif constant-expression may now appear on any line between a #if line and its closing #endif (or #else if present). The new pseudofunction defined(identifier) may be used in the constant-expression part of a #if or #elif control line, with value 1 if the identifier is currently defined in the preprocessor, and 0 otherwise. Thus #ifdef identifier is equivalent to #if defined(identifier) and #ifndef identifier is equivalent to #if !defined(identifier). The older forms will be retained for compatibility, as they are deeply entrenched in existing code. But, as they are superfluous, equivalents to #ifdef will not be provided for the new construction #elif. Ref 2 looks to be K&R1: 2. B. W. Kernighan and D. M. Ritchie, The C Programming Language, Englewood Cliffs, NJ.: Prentice Hall, 1978. So it looks like it was added just after K&R1, but early enough that 4.2BSD had it (and maybe earlier), which would explain why SunOS groks it. 1984 definitely pre-dates the standard (and in fact this same article goes on to describe varadic functions with a syntax that is different than what was finally adapoted). Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sun Oct 20 14:11:16 2002 Delivered-To: freebsd-standards@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id C9EBF37B401; Sun, 20 Oct 2002 14:11:15 -0700 (PDT) Date: Sun, 20 Oct 2002 14:11:15 -0700 From: Juli Mallett To: "M. Warner Losh" Cc: freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: Problem detecting POSIX symbolic constants Message-ID: <20021020141115.A88848@FreeBSD.org> References: <20021016121455.A3711@chiark.greenend.org.uk> <20021020.134409.73085448.imp@bsdimp.com> <20021020204920.C8767@chiark.greenend.org.uk> <20021020.143416.109047247.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021020.143416.109047247.imp@bsdimp.com>; from imp@bsdimp.com on Sun, Oct 20, 2002 at 02:34:16PM -0600 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: "M. Warner Losh" [ Data: 2002-10-20 ] [ Subjecte: Re: Problem detecting POSIX symbolic constants ] > So it looks like it was added just after K&R1, but early enough that > 4.2BSD had it (and maybe earlier), which would explain why SunOS groks > it. 1984 definitely pre-dates the standard (and in fact this same > article goes on to describe varadic functions with a syntax that is > different than what was finally adapoted). Look at the old pcc(1) code in the PUPS/TUHS archives. -- Juli Mallett | FreeBSD: The Power To Serve Will break world for fulltime employment. | finger jmallett@FreeBSD.org http://people.FreeBSD.org/~jmallett/ | Support my FreeBSD hacking! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sun Oct 20 15:24:25 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A71037B401; Sun, 20 Oct 2002 15:24:24 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 602DE43E6E; Sun, 20 Oct 2002 15:24:23 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g9KMO4vU074848; Sun, 20 Oct 2002 15:24:07 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200210202224.g9KMO4vU074848@gw.catspoiler.org> Date: Sun, 20 Oct 2002 15:24:04 -0700 (PDT) From: Don Lewis Subject: Re: Problem detecting POSIX symbolic constants To: imp@bsdimp.com Cc: freebsd-standards@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG In-Reply-To: <20021020.143416.109047247.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 20 Oct, M. Warner Losh wrote: > My copy of K&R 1 is silent on this issue (well, as I recall, I can't > find my K&R1 at the moment), which means defined isn't likely to be > there. My copy of the Bell Laboratories Technical Journal October > 1984 (Vol 63 No.8 Part 2) says, in "The Evolution of C -- Past and > Future" by L. Rosler, section 5.9 Compiler Control Lines: > > The conditional-compile facility (Ref 2. Sect 12.3) has been > enhanced in two ways. > > To facilitate selection of one among a set of choices, any > number of control lines of the form > #elif constant-expression > may now appear on any line between a #if line and its closing > #endif (or #else if present). > > The new pseudofunction defined(identifier) may be used in the > constant-expression part of a #if or #elif control line, with > value 1 if the identifier is currently defined in the > preprocessor, and 0 otherwise. Thus #ifdef identifier is > equivalent to #if defined(identifier) and #ifndef identifier > is equivalent to #if !defined(identifier). The older forms > will be retained for compatibility, as they are deeply > entrenched in existing code. But, as they are superfluous, > equivalents to #ifdef will not be provided for the new > construction #elif. > > Ref 2 looks to be K&R1: > 2. B. W. Kernighan and D. M. Ritchie, The C Programming > Language, Englewood Cliffs, NJ.: Prentice Hall, 1978. That's K&R 1 and my copy doesn't mention anything about #elif or defined(). Unlike one compiler I used in the bad old days, it does have #if, which it documents as using a constant expression and provides a pointer to another section of the chapter. The constant expression section mentions integer and character constants, and sizeof expressions, as well as the unary, binary, and ternary operators. No mention of defined() ... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Mon Oct 21 9:49: 1 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0316037B401; Mon, 21 Oct 2002 09:49:01 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id E8B5243E75; Mon, 21 Oct 2002 09:48:59 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9LGmwgQ060344 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Mon, 21 Oct 2002 12:48:59 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9LGmwFp060341; Mon, 21 Oct 2002 12:48:58 -0400 (EDT) (envelope-from wollman) Date: Mon, 21 Oct 2002 12:48:58 -0400 (EDT) From: Garrett Wollman Message-Id: <200210211648.g9LGmwFp060341@khavrinen.lcs.mit.edu> To: Tim Robbins Cc: standards@FreeBSD.ORG Subject: Re: PLEASE no more "standards" headers work until after 5.0. In-Reply-To: <20021021185251.A73608@dilbert.robbins.dropbear.id.au> References: <20021021071515.GA21147@dragon.nuxi.com> <20021021023556.E1126-100000@patrocles.silby.com> <20021021185251.A73608@dilbert.robbins.dropbear.id.au> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > The "appropriate" fix for dsniff is to remove this line from config.h. > Putting the in_addr_t typedef back into under _BSD_VISIBLE > would also fix it. Recall that POSIX gives us plenary authority to define *any* _t type in any standard header. We normally don't do this so that programs which ask to be broken when they make use of non-standard declarations do, in fact, get broken. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Mon Oct 21 12:50: 4 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B0DF837B401 for ; Mon, 21 Oct 2002 12:50:02 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E553A43E4A for ; Mon, 21 Oct 2002 12:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9LJo1x3091564 for ; Mon, 21 Oct 2002 12:50:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9LJo1qb091563; Mon, 21 Oct 2002 12:50:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB43837B40A for ; Mon, 21 Oct 2002 12:47:33 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 318F243E3B for ; Mon, 21 Oct 2002 12:47:33 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9LJlWgQ066184 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Mon, 21 Oct 2002 15:47:32 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9LJlWP8066183; Mon, 21 Oct 2002 15:47:32 -0400 (EDT) (envelope-from wollman) Message-Id: <200210211947.g9LJlWP8066183@khavrinen.lcs.mit.edu> Date: Mon, 21 Oct 2002 15:47:32 -0400 (EDT) From: Garrett Wollman Reply-To: Garrett Wollman To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: standards/44356: strerror_r() has impermissible failure mode Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Number: 44356 >Category: standards >Synopsis: strerror_r() has impermissible failure mode >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 21 12:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Garrett Wollman >Release: FreeBSD 5.0-CURRENT i386 >Organization: MIT LCS >Environment: System: FreeBSD khavrinen.lcs.mit.edu 5.0-CURRENT FreeBSD 5.0-CURRENT #608: Tue Apr 30 19:29:33 EDT 2002 root@:/usr/src/sys/i386/compile/KHAVRINEN i386 >Description: If an unrecognized error number is passed to strerror_r(), the buffer is left unchanged. XSH6 page 1416, lines 43783ff says: The strerror_r( ) function shall map the error number in errnum to a locale-dependent error message string and shall return the string in the buffer pointed to by strerrbuf, with length buflen. The consensus on the Austin Group list seems to be that strerror_r() must always put something in the buffer provided, even if a specific error message is not available for whatever reason. In our implementation, the buffer is only filled in when the error number is recognized (even if the buffer is too small). >How-To-Repeat: char buf[1234]; buf[0] = '\0'; strerror_r(12345678, buf, sizeof buf); assert(buf[0] != '\0'); >Fix: Move all of the `unknown error' processing from strerror() to strerror_r(). >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 1:23: 5 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDF0537B401; Tue, 22 Oct 2002 01:23:03 -0700 (PDT) Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E50843E3B; Tue, 22 Oct 2002 01:22:58 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id g9M8MfD21965; Tue, 22 Oct 2002 11:22:41 +0300 (EEST) (envelope-from ru) Date: Tue, 22 Oct 2002 11:22:41 +0300 From: Ruslan Ermilov To: Kris Kennaway Cc: current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021022082241.GG3325@sunbay.com> References: <20021020025400.GA13776@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U3BNvdZEnlJXqmh+" Content-Disposition: inline In-Reply-To: <20021020025400.GA13776@xor.obsecurity.org> User-Agent: Mutt/1.3.99i Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --U3BNvdZEnlJXqmh+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Oct 19, 2002 at 07:54:01PM -0700, Kris Kennaway wrote: > World is broken if you try and build with -fno-builtin: >=20 > c++ -O -pipe -ggdb -fno-builtin -march=3Dpentium3 -I/usr/src/gnu/usr.= bin/gperf/../../../contrib/gperf/lib -I/usr/src/gnu/usr.bin/gperf -o gperf= bool-array.o gen-perf.o hash-table.o iterator.o key-list.o list-node.o mai= n.o new.o options.o read-line.o trace.o vectors.o version.o hash.o getopt.o= getopt1.o > gen-perf.o: In function `Gen_Perf::Gen_Perf()': > /usr/src/contrib/gperf/src/bool-array.icc:81: warning: rand() does not pr= oduce high-quality random numbers and should not generally be used > /usr/obj/usr/src/i386/usr/lib/libstdc++.so: undefined reference to `fabsl' > *** Error code 1 >=20 This is because we lack the long double fabsl(long double); in -lm and . Cheers, --=20 Ruslan Ermilov Sysadmin and DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --U3BNvdZEnlJXqmh+ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9tQrQUkv4P6juNwoRAhBmAJ9Mcg1eCmuB6yRY6Dn5YCSA+q+FhwCeOdOi ly1jDLX9bLVzxGxNtPHzDRs= =LlkU -----END PGP SIGNATURE----- --U3BNvdZEnlJXqmh+-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 11:46: 8 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EC8DC37B401; Tue, 22 Oct 2002 11:46:06 -0700 (PDT) Received: from obsecurity.dyndns.org (adsl-64-165-226-88.dsl.lsan03.pacbell.net [64.165.226.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 62A3C43E4A; Tue, 22 Oct 2002 11:46:06 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id 089F866E0A; Tue, 22 Oct 2002 11:46:05 -0700 (PDT) Date: Tue, 22 Oct 2002 11:46:05 -0700 From: Kris Kennaway To: Ruslan Ermilov Cc: Kris Kennaway , current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021022184605.GA85779@xor.obsecurity.org> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <20021022082241.GG3325@sunbay.com> User-Agent: Mutt/1.4i Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --5vNYLRcllDrimb99 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 22, 2002 at 11:22:41AM +0300, Ruslan Ermilov wrote: > On Sat, Oct 19, 2002 at 07:54:01PM -0700, Kris Kennaway wrote: > > World is broken if you try and build with -fno-builtin: > >=20 > > c++ -O -pipe -ggdb -fno-builtin -march=3Dpentium3 -I/usr/src/gnu/us= r.bin/gperf/../../../contrib/gperf/lib -I/usr/src/gnu/usr.bin/gperf -o gpe= rf bool-array.o gen-perf.o hash-table.o iterator.o key-list.o list-node.o m= ain.o new.o options.o read-line.o trace.o vectors.o version.o hash.o getopt= .o getopt1.o > > gen-perf.o: In function `Gen_Perf::Gen_Perf()': > > /usr/src/contrib/gperf/src/bool-array.icc:81: warning: rand() does not = produce high-quality random numbers and should not generally be used > > /usr/obj/usr/src/i386/usr/lib/libstdc++.so: undefined reference to `fab= sl' > > *** Error code 1 > >=20 > This is because we lack the >=20 > long double fabsl(long double); >=20 > in -lm and . OK, thanks for tracking it down. This looks like an important omission that should be fixed for 5.0-R. Kris --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9tZztWry0BWjoQKURAleBAJ9t9CyplmChvxX0LWMpo0aqsjRRVQCfYhPN v3XJLR6KkGJAv4wwqPZZvLk= =XMMw -----END PGP SIGNATURE----- --5vNYLRcllDrimb99-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 12:45:47 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2924637B401; Tue, 22 Oct 2002 12:45:46 -0700 (PDT) Received: from avocet.mail.pas.earthlink.net (avocet.mail.pas.earthlink.net [207.217.120.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB3E443E3B; Tue, 22 Oct 2002 12:45:45 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0482.cvx21-bradley.dialup.earthlink.net ([209.179.193.227] helo=mindspring.com) by avocet.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1844uT-0004Cr-00; Tue, 22 Oct 2002 12:41:49 -0700 Message-ID: <3DB5A9B6.1C2D1684@mindspring.com> Date: Tue, 22 Oct 2002 12:40:38 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Kris Kennaway Cc: Ruslan Ermilov , current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kris Kennaway wrote: > > > /usr/src/contrib/gperf/src/bool-array.icc:81: warning: rand() does not produce high-quality random numbers and should not generally be used > > > /usr/obj/usr/src/i386/usr/lib/libstdc++.so: undefined reference to `fabsl' > > > *** Error code 1 > > > > > This is because we lack the > > > > long double fabsl(long double); > > > > in -lm and . > > OK, thanks for tracking it down. This looks like an important > omission that should be fixed for 5.0-R. Is it? What standard defines this thing, which g++ has as a built-in? Alternately, the use could avoid adding the "-fno-builtin", and the problem would go away. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 13: 8:36 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9573537B401; Tue, 22 Oct 2002 13:08:34 -0700 (PDT) Received: from fafoe.dyndns.org (chello212186121237.14.vie.surfer.at [212.186.121.237]) by mx1.FreeBSD.org (Postfix) with ESMTP id E4E6D43E4A; Tue, 22 Oct 2002 13:08:33 -0700 (PDT) (envelope-from stefan@fafoe.dyndns.org) Received: by frog.fafoe (Postfix, from userid 1001) id 3297E2B1; Tue, 22 Oct 2002 22:08:27 +0200 (CEST) Date: Tue, 22 Oct 2002 22:08:27 +0200 From: Stefan Farfeleder To: Terry Lambert Cc: Kris Kennaway , Ruslan Ermilov , current@FreeBSD.ORG, standards@FreeBSD.ORG Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021022200827.GA252@frog.fafoe> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <3DB5A9B6.1C2D1684@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DB5A9B6.1C2D1684@mindspring.com> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Oct 22, 2002 at 12:40:38PM -0700, Terry Lambert wrote: > Kris Kennaway wrote: > > > > /usr/src/contrib/gperf/src/bool-array.icc:81: warning: rand() does not produce high-quality random numbers and should not generally be used > > > > /usr/obj/usr/src/i386/usr/lib/libstdc++.so: undefined reference to `fabsl' > > > > *** Error code 1 > > > > > > > This is because we lack the > > > > > > long double fabsl(long double); > > > > > > in -lm and . > > > > OK, thanks for tracking it down. This looks like an important > > omission that should be fixed for 5.0-R. > > > Is it? > > What standard defines this thing, which g++ has as a built-in? > > Alternately, the use could avoid adding the "-fno-builtin", and > the problem would go away. ISO C99 7.12.7.2 The fabs functions Synopsis #include double fabs(double x); float fabsf(float x); long double fabsl(long double x); Description The fabs functions compute the absolute value of a floating-point number x. Returns The fabs functions return | x |. Regards, Stefan Farfeleder To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 13:20:50 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1E36437B401; Tue, 22 Oct 2002 13:20:49 -0700 (PDT) Received: from obsecurity.dyndns.org (adsl-64-165-226-88.dsl.lsan03.pacbell.net [64.165.226.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8EF3343E4A; Tue, 22 Oct 2002 13:20:48 -0700 (PDT) (envelope-from kris@obsecurity.org) Received: by obsecurity.dyndns.org (Postfix, from userid 1000) id E3DF466B5E; Tue, 22 Oct 2002 13:20:47 -0700 (PDT) Date: Tue, 22 Oct 2002 13:20:47 -0700 From: Kris Kennaway To: Terry Lambert Cc: Kris Kennaway , Ruslan Ermilov , current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021022202047.GA88314@xor.obsecurity.org> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <3DB5A9B6.1C2D1684@mindspring.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AqsLC8rIMeq19msA" Content-Disposition: inline In-Reply-To: <3DB5A9B6.1C2D1684@mindspring.com> User-Agent: Mutt/1.4i Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Oct 22, 2002 at 12:40:38PM -0700, Terry Lambert wrote: > Is it? Yes, because as it stands this function is supplied by gcc as a built-in function, and the source tree will not compile without it (e.g. with a non-gcc compiler). > Alternately, the use could avoid adding the "-fno-builtin", and > the problem would go away. -fno-builtin tells gcc to stop using its own builtin functions and use the FreeBSD version instead. We don't built with it by default, but we probably should. Kris --AqsLC8rIMeq19msA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iD8DBQE9tbMfWry0BWjoQKURAln0AKDLEm2STD6pxuFlwKfb+iSRm8yjPQCg5Lrq ncsO4hA4amMxLSP2vIvNAWg= =Xq5m -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 13:30:15 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2A04D37B401; Tue, 22 Oct 2002 13:30:14 -0700 (PDT) Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id AFD2743E6A; Tue, 22 Oct 2002 13:30:13 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0482.cvx21-bradley.dialup.earthlink.net ([209.179.193.227] helo=mindspring.com) by falcon.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1845fE-0003Ss-00; Tue, 22 Oct 2002 13:30:09 -0700 Message-ID: <3DB5B508.25EC9C14@mindspring.com> Date: Tue, 22 Oct 2002 13:28:56 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Stefan Farfeleder Cc: Kris Kennaway , Ruslan Ermilov , current@FreeBSD.ORG, standards@FreeBSD.ORG Subject: Re: libstdc++ does not contain fabsl symbol References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <3DB5A9B6.1C2D1684@mindspring.com> <20021022200827.GA252@frog.fafoe> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Stefan Farfeleder wrote: [ ... fabsl() ... ] > > What standard defines this thing, which g++ has as a built-in? > > > > Alternately, the use could avoid adding the "-fno-builtin", and > > the problem would go away. > > ISO C99 > > 7.12.7.2 The fabs functions > Synopsis > #include > double fabs(double x); > float fabsf(float x); > long double fabsl(long double x); Thanks; that's exactly what I wanted to know. The answer, then, is that FreeBSD is not fully compliant with ISO C99, although there is work in progress to add compliance. I personally don't understand why the avoidance of the built-in. It's worthwhile adding the function, but rather than doing this one at a time, and finding out 10 years later that FreeBSD is finally compliant (in 2011, after the 2009 version of the standard is out ;^)), it's probably a better idea to write an "external reference compliance program", so that you can compile it up, and find out all the undefined references at once, so that we can make a concerted effort. I expect this will have to be done by someone with access to the ISO C99 standard, unles it's postied online for free somewhere? -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 13:36:36 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D67F37B401; Tue, 22 Oct 2002 13:36:35 -0700 (PDT) Received: from flamingo.mail.pas.earthlink.net (flamingo.mail.pas.earthlink.net [207.217.120.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8D62643E4A; Tue, 22 Oct 2002 13:36:34 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0482.cvx21-bradley.dialup.earthlink.net ([209.179.193.227] helo=mindspring.com) by flamingo.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1845lQ-000597-00; Tue, 22 Oct 2002 13:36:32 -0700 Message-ID: <3DB5B688.C3E5520B@mindspring.com> Date: Tue, 22 Oct 2002 13:35:20 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Kris Kennaway Cc: Ruslan Ermilov , current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <3DB5A9B6.1C2D1684@mindspring.com> <20021022202047.GA88314@xor.obsecurity.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kris Kennaway wrote: > Yes, because as it stands this function is supplied by gcc as a > built-in function, and the source tree will not compile without it > (e.g. with a non-gcc compiler). > > > Alternately, the use could avoid adding the "-fno-builtin", and > > the problem would go away. > > -fno-builtin tells gcc to stop using its own builtin functions and use > the FreeBSD version instead. We don't built with it by default, but > we probably should. It's a good idea. See other posting though... I think the problem is that sources are being converted to assume C99 compliance, when FreeBSD is, in fact, not compliant. It would be better if this were a compliance complaint, rather than a "-fno-builtin"; it would be best to tackle all these issues at once, rather than one at a time over a very long time. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 13:41:45 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 67DC137B401; Tue, 22 Oct 2002 13:41:44 -0700 (PDT) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.208.78.105]) by mx1.FreeBSD.org (Postfix) with ESMTP id B099843E77; Tue, 22 Oct 2002 13:41:43 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.12.6/8.12.5) with ESMTP id g9MKfh4G018142; Tue, 22 Oct 2002 13:41:43 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.12.6/8.12.6/Submit) id g9MKfhiN018141; Tue, 22 Oct 2002 13:41:43 -0700 (PDT) Date: Tue, 22 Oct 2002 13:41:43 -0700 From: Steve Kargl To: Terry Lambert Cc: Stefan Farfeleder , Kris Kennaway , Ruslan Ermilov , current@FreeBSD.ORG, standards@FreeBSD.ORG Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021022204143.GA18064@troutmask.apl.washington.edu> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <3DB5A9B6.1C2D1684@mindspring.com> <20021022200827.GA252@frog.fafoe> <3DB5B508.25EC9C14@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3DB5B508.25EC9C14@mindspring.com> User-Agent: Mutt/1.4i Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Oct 22, 2002 at 01:28:56PM -0700, Terry Lambert wrote: > Stefan Farfeleder wrote: > [ ... fabsl() ... ] > > > What standard defines this thing, which g++ has as a built-in? > > > > > > Alternately, the use could avoid adding the "-fno-builtin", and > > > the problem would go away. > > > > ISO C99 > > > > 7.12.7.2 The fabs functions > > #include > > long double fabsl(long double x); > > The answer, then, is that FreeBSD is not fully compliant with ISO > C99, although there is work in progress to add compliance. AFAIK, FreeBSD contains none of the long double math.h functions. I also suspect that many of the complex.h functions aren't implemented, yet. > > I personally don't understand why the avoidance of the built-in. > Can you selectively turn off the memcpy, etc. built-in functions? -- Steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 14: 2:30 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 57DC137B401; Tue, 22 Oct 2002 14:02:29 -0700 (PDT) Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97A4643E75; Tue, 22 Oct 2002 14:02:28 -0700 (PDT) (envelope-from ak03@gte.com) Received: from kanpc.gte.com (localhost [IPv6:::1]) by h132-197-179-27.gte.com (8.12.6/8.12.6) with ESMTP id g9ML2RUw001773; Tue, 22 Oct 2002 17:02:28 -0400 (EDT) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.6/8.12.6/Submit) id g9ML2Rf1001772; Tue, 22 Oct 2002 17:02:27 -0400 (EDT) Date: Tue, 22 Oct 2002 17:02:27 -0400 From: Alexander Kabaev To: Ruslan Ermilov Cc: kris@obsecurity.org, current@FreeBSD.ORG, standards@FreeBSD.ORG Subject: Re: libstdc++ does not contain fabsl symbol Message-Id: <20021022170227.7bf490d0.ak03@gte.com> In-Reply-To: <20021022082241.GG3325@sunbay.com> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> Organization: Verizon Data Services X-Mailer: Sylpheed version 0.8.5claws7 (GTK+ 1.2.10; i386-portbld-freebsd5.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG libstdc++ is supposed to provide crude replacements for missing -l functions in its libmath/stubs.c file. Apparently, missing fabsl is an omission and should be fixed in FSF sources. -- Alexander Kabaev To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 14:37:21 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05E7837B401; Tue, 22 Oct 2002 14:37:20 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id E975143E42; Tue, 22 Oct 2002 14:37:18 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id DF0BA9C11; Tue, 22 Oct 2002 17:29:12 -0400 (EDT) Date: Tue, 22 Oct 2002 17:29:12 -0400 From: Mike Barcroft To: Kris Kennaway Cc: Ruslan Ermilov , current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021022172912.B22851@espresso.q9media.com> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021022184605.GA85779@xor.obsecurity.org>; from kris@obsecurity.org on Tue, Oct 22, 2002 at 11:46:05AM -0700 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Kris Kennaway writes: > On Tue, Oct 22, 2002 at 11:22:41AM +0300, Ruslan Ermilov wrote: > > On Sat, Oct 19, 2002 at 07:54:01PM -0700, Kris Kennaway wrote: > > > World is broken if you try and build with -fno-builtin: > > > > > > c++ -O -pipe -ggdb -fno-builtin -march=pentium3 -I/usr/src/gnu/usr.bin/gperf/../../../contrib/gperf/lib -I/usr/src/gnu/usr.bin/gperf -o gperf bool-array.o gen-perf.o hash-table.o iterator.o key-list.o list-node.o main.o new.o options.o read-line.o trace.o vectors.o version.o hash.o getopt.o getopt1.o > > > gen-perf.o: In function `Gen_Perf::Gen_Perf()': > > > /usr/src/contrib/gperf/src/bool-array.icc:81: warning: rand() does not produce high-quality random numbers and should not generally be used > > > /usr/obj/usr/src/i386/usr/lib/libstdc++.so: undefined reference to `fabsl' > > > *** Error code 1 > > > > > This is because we lack the > > > > long double fabsl(long double); > > > > in -lm and . > > OK, thanks for tracking it down. This looks like an important > omission that should be fixed for 5.0-R. No one has started work on any of the C99 math functions yet. I think with the exception of the math functions we conform to C99. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 15:20: 8 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BE2E37B401 for ; Tue, 22 Oct 2002 15:20:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65EED43E75 for ; Tue, 22 Oct 2002 15:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9MMK2x3036625 for ; Tue, 22 Oct 2002 15:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9MMK20P036624; Tue, 22 Oct 2002 15:20:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1B4637B401 for ; Tue, 22 Oct 2002 15:12:08 -0700 (PDT) Received: from dibbler.ne.client2.attbi.com (dibbler.ne.client2.attbi.com [24.61.41.247]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CC7343E4A for ; Tue, 22 Oct 2002 15:12:08 -0700 (PDT) (envelope-from rodrigc@attbi.com) Received: from dibbler.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1]) by dibbler.ne.client2.attbi.com (8.12.6/8.12.5) with ESMTP id g9MMCGRD023584 for ; Tue, 22 Oct 2002 18:12:16 -0400 (EDT) (envelope-from rodrigc@dibbler.ne.client2.attbi.com) Received: (from rodrigc@localhost) by dibbler.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id g9MMCGR6023583; Tue, 22 Oct 2002 18:12:16 -0400 (EDT) Message-Id: <200210222212.g9MMCGR6023583@dibbler.ne.client2.attbi.com> Date: Tue, 22 Oct 2002 18:12:16 -0400 (EDT) From: Craig Rodrigues Reply-To: Craig Rodrigues To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: standards/44394: restrict qualifiers missing from sys/socket.h Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Number: 44394 >Category: standards >Synopsis: restrict qualifiers missing from sys/socket.h >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Tue Oct 22 15:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Craig Rodrigues >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD dibbler.ne.client2.attbi.com 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sun Sep 8 09:39:46 EDT 2002 rodrigc@dibbler.ne.client2.attbi.com:/usr/obj/usr/src/sys/MYKERNEL1 i386 >Description: sys/socket.h prototypes are missing restrict qualifiers >How-To-Repeat: >Fix: This patch handles the prototypes and man pages. The actual implementations of these functions are system calls and need to be changed in sys/kern and also in sys/kern/syscalls.master. --- sys/sys/socket.h.orig Sat Oct 12 21:47:34 2002 +++ sys/sys/socket.h Sat Oct 12 23:07:49 2002 @@ -445,15 +445,15 @@ #include __BEGIN_DECLS -int accept(int, struct sockaddr *, socklen_t *); +int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); int bind(int, const struct sockaddr *, socklen_t); int connect(int, const struct sockaddr *, socklen_t); -int getpeername(int, struct sockaddr *, socklen_t *); -int getsockname(int, struct sockaddr *, socklen_t *); -int getsockopt(int, int, int, void *, socklen_t *); +int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); +int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); +int getsockopt(int, int, int, void * __restrict, socklen_t * __restrict); int listen(int, int); ssize_t recv(int, void *, size_t, int); -ssize_t recvfrom(int, void *, size_t, int, struct sockaddr *, socklen_t *); +ssize_t recvfrom(int, void * __restrict, size_t, int, struct sockaddr * __restrict, socklen_t * __restrict); ssize_t recvmsg(int, struct msghdr *, int); ssize_t send(int, const void *, size_t, int); ssize_t sendto(int, const void *, --- lib/libc/sys/accept.2.orig Sat Oct 12 22:11:06 2002 +++ lib/libc/sys/accept.2 Sat Oct 12 22:11:40 2002 @@ -44,7 +44,7 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn accept "int s" "struct sockaddr *addr" "socklen_t *addrlen" +.Fn accept "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" .Sh DESCRIPTION The argument .Fa s --- lib/libc/sys/getpeername.2.orig Sat Oct 12 22:12:38 2002 +++ lib/libc/sys/getpeername.2 Sat Oct 12 22:13:23 2002 @@ -44,7 +44,7 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn getpeername "int s" "struct sockaddr *name" "socklen_t *namelen" +.Fn getpeername "int s" "struct sockaddr * restrict name" "socklen_t * restrict namelen" .Sh DESCRIPTION .Fn Getpeername returns the name of the peer connected to --- lib/libc/sys/getsockname.2.orig Sat Oct 12 22:49:34 2002 +++ lib/libc/sys/getsockname.2 Sat Oct 12 22:50:10 2002 @@ -44,7 +44,7 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn getsockname "int s" "struct sockaddr *name" "socklen_t *namelen" +.Fn getsockname "int s" "struct sockaddr * restrict name" "socklen_t * restrict namelen" .Sh DESCRIPTION .Fn Getsockname returns the current --- lib/libc/sys/getsockopt.2.orig Sat Oct 12 22:52:49 2002 +++ lib/libc/sys/getsockopt.2 Sat Oct 12 22:53:02 2002 @@ -45,7 +45,7 @@ .In sys/types.h .In sys/socket.h .Ft int -.Fn getsockopt "int s" "int level" "int optname" "void *optval" "socklen_t *optlen" +.Fn getsockopt "int s" "int level" "int optname" "void * restrict optval" "socklen_t * restrict optlen" .Ft int .Fn setsockopt "int s" "int level" "int optname" "const void *optval" "socklen_t optlen" .Sh DESCRIPTION --- lib/libc/sys/recv.2.orig Sat Oct 12 22:55:59 2002 +++ lib/libc/sys/recv.2 Sat Oct 12 22:56:33 2002 @@ -48,7 +48,7 @@ .Ft ssize_t .Fn recv "int s" "void *buf" "size_t len" "int flags" .Ft ssize_t -.Fn recvfrom "int s" "void *buf" "size_t len" "int flags" "struct sockaddr *from" "socklen_t *fromlen" +.Fn recvfrom "int s" "void * restrict buf" "size_t len" "int flags" "struct sockaddr * restrict from" "socklen_t * restrict fromlen" .Ft ssize_t .Fn recvmsg "int s" "struct msghdr *msg" "int flags" .Sh DESCRIPTION >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Tue Oct 22 16:12:50 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0497F37B404; Tue, 22 Oct 2002 16:12:48 -0700 (PDT) Received: from snipe.mail.pas.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id E422F43E4A; Tue, 22 Oct 2002 16:12:41 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0482.cvx21-bradley.dialup.earthlink.net ([209.179.193.227] helo=mindspring.com) by snipe.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1848CR-0007ly-00; Tue, 22 Oct 2002 16:12:36 -0700 Message-ID: <3DB5DAF7.77BDDE1C@mindspring.com> Date: Tue, 22 Oct 2002 16:10:47 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Mike Barcroft Cc: Kris Kennaway , Ruslan Ermilov , current@FreeBSD.org, standards@FreeBSD.org Subject: Re: libstdc++ does not contain fabsl symbol References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <20021022172912.B22851@espresso.q9media.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mike Barcroft wrote: > > > This is because we lack the > > > > > > long double fabsl(long double); > > > > > > in -lm and . > > > > OK, thanks for tracking it down. This looks like an important > > omission that should be fixed for 5.0-R. > > No one has started work on any of the C99 math functions yet. I > think with the exception of the math functions we conform to C99. I have written compile time compliance validation tests for: 7.12 Mathematics (macros and constants) 7.12.3 Classification macros 7.12.4 Trigonometric functions 7.12.5 Hyperbolic functions 7.12.6 Exponential and logarithmic functions They test that things that are supposed to be defined are defined, and they enforce type checking for defintions that are in scope at the time the code is compiled (assuming you make the compiler gripe). In case someone wants to work on this, I can send you a tar-ball. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Oct 23 8:38:12 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E372A37B401; Wed, 23 Oct 2002 08:38:11 -0700 (PDT) Received: from HAL9000.homeunix.com (12-232-220-15.client.attbi.com [12.232.220.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4DB0843E65; Wed, 23 Oct 2002 08:38:10 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.6/8.12.5) with ESMTP id g9NFc92w007625; Wed, 23 Oct 2002 08:38:09 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.6/8.12.5/Submit) id g9NFc92Z007624; Wed, 23 Oct 2002 08:38:09 -0700 (PDT) (envelope-from dschultz@uclink.Berkeley.EDU) Date: Wed, 23 Oct 2002 08:38:09 -0700 From: David Schultz To: Mike Barcroft Cc: Kris Kennaway , Ruslan Ermilov , current@FreeBSD.ORG, standards@FreeBSD.ORG Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021023153809.GA7503@HAL9000.homeunix.com> Mail-Followup-To: Mike Barcroft , Kris Kennaway , Ruslan Ermilov , current@FreeBSD.ORG, standards@FreeBSD.ORG References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <20021022172912.B22851@espresso.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021022172912.B22851@espresso.q9media.com> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Thus spake Mike Barcroft : > No one has started work on any of the C99 math functions yet. I > think with the exception of the math functions we conform to C99. Actually, I hacked up some patches for fpclassify(), is*(), and friends some time ago. But nobody was interested in compliance at the time except for a couple of port maintainers, so I didn't bother finishing it up. In any case, I no longer have the time. (It's fairly easy, given that some of the code is already there, but a bit more work to optimize for every architecture FreeBSD supports.) Note that while you're adding the C99 math stuff, you might want to fix up float.h, which is just wrong about long doubles (see PR i386/38288). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Oct 23 9:45: 2 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8DDF37B401; Wed, 23 Oct 2002 09:45:01 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B92843E65; Wed, 23 Oct 2002 09:45:01 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 7AFB99BC3; Wed, 23 Oct 2002 12:36:53 -0400 (EDT) Date: Wed, 23 Oct 2002 12:36:53 -0400 From: Mike Barcroft To: David Schultz Cc: current@FreeBSD.ORG, standards@FreeBSD.ORG Subject: Re: libstdc++ does not contain fabsl symbol Message-ID: <20021023123653.A39814@espresso.q9media.com> References: <20021020025400.GA13776@xor.obsecurity.org> <20021022082241.GG3325@sunbay.com> <20021022184605.GA85779@xor.obsecurity.org> <20021022172912.B22851@espresso.q9media.com> <20021023153809.GA7503@HAL9000.homeunix.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021023153809.GA7503@HAL9000.homeunix.com>; from dschultz@uclink.Berkeley.EDU on Wed, Oct 23, 2002 at 08:38:09AM -0700 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG David Schultz writes: > Thus spake Mike Barcroft : > > No one has started work on any of the C99 math functions yet. I > > think with the exception of the math functions we conform to C99. > > Actually, I hacked up some patches for fpclassify(), is*(), and > friends some time ago. But nobody was interested in compliance at > the time except for a couple of port maintainers, so I didn't > bother finishing it up. In any case, I no longer have the time. > (It's fairly easy, given that some of the code is already there, > but a bit more work to optimize for every architecture FreeBSD > supports.) Note that while you're adding the C99 math stuff, you > might want to fix up float.h, which is just wrong about long > doubles (see PR i386/38288). Right, I should have said no one has started committing C99 math functions. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Oct 23 14:10: 4 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 862D837B401 for ; Wed, 23 Oct 2002 14:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CCE843E65 for ; Wed, 23 Oct 2002 14:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9NLA3x3010108 for ; Wed, 23 Oct 2002 14:10:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9NLA2hV010107; Wed, 23 Oct 2002 14:10:02 -0700 (PDT) Date: Wed, 23 Oct 2002 14:10:02 -0700 (PDT) Message-Id: <200210232110.g9NLA2hV010107@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org Cc: From: Andriy Gapon Subject: Re: standards/43335: libc_r: execve() and close-on-exec flag, interrupted write() Reply-To: Andriy Gapon Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The following reply was made to PR standards/43335; it has been noted by GNATS. From: Andriy Gapon To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: standards/43335: libc_r: execve() and close-on-exec flag, interrupted write() Date: Wed, 23 Oct 2002 16:57:13 -0400 (EDT) Valentin, what you caught is actually a broader issue, it is my belief that it can not be resolved using existing libc_r architecture. The need for libc_r to have all descriptors non-blocking undercovers results in a real mess when sharing the descriptors between processes, since there can not be any reliable knowledge of what is going on in other process. Possible solution could be an extension to system calls with an addtional parameter specifying mode only for a current call, so that libc_r could specifically request non-blocking operation on a descriptor in blocking mode( or something like that). Maybe this can be emulated by putting a blocking descriptor into non-blocking mode and back imeediately before and after an operation on the descriptor. This can work because the descriptors are not supposed to be used concurrently by multiple processes anyway, they need to syncronize somehow. -- Andriy Gapon * "Never try to outstubborn a cat." Lazarus Long, "Time Enough for Love" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Oct 23 14:10: 8 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C974737B401 for ; Wed, 23 Oct 2002 14:10:05 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6712043E65 for ; Wed, 23 Oct 2002 14:10:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9NLA5x3010116 for ; Wed, 23 Oct 2002 14:10:05 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9NLA5eN010115; Wed, 23 Oct 2002 14:10:05 -0700 (PDT) Date: Wed, 23 Oct 2002 14:10:05 -0700 (PDT) Message-Id: <200210232110.g9NLA5eN010115@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org Cc: From: Andriy Gapon Subject: Re: standards/43335: libc_r: execve() and close-on-exec flag, interrupted write() Reply-To: Andriy Gapon Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The following reply was made to PR standards/43335; it has been noted by GNATS. From: Andriy Gapon To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: standards/43335: libc_r: execve() and close-on-exec flag, interrupted write() Date: Wed, 23 Oct 2002 17:04:00 -0400 (EDT) patches updated for 4.7. Partial write: --- uthread_write.c.orig Thu Oct 10 12:43:35 2002 +++ uthread_write.c Wed Oct 23 16:19:48 2002 @@ -108,8 +108,13 @@ * interrupted by a signal */ if (_thread_run->interrupted) { - /* Return an error: */ - ret = -1; + if(num > 0) + ret = num; + else { + /* Return an error: */ + errno = EINTR; + ret = -1; + } } /* @@ -117,10 +122,16 @@ * error occurred, just return whatever the write * syscall did: */ - } else if (!blocking || n < 0) { + } else if (!blocking) { /* A non-blocking call might return zero: */ ret = n; break; + } else if (n < 0) { + /* if we have written something already */ + if(num > 0) + ret = num; + else + ret = n; /* Check if the write has completed: */ } else if (num >= nbytes) Close-on-exec: --- uthread_execve.c.orig Wed Oct 23 16:27:59 2002 +++ uthread_execve.c Wed Oct 23 16:33:30 2002 @@ -67,10 +67,17 @@ /* Check if this file descriptor is in use: */ if (_thread_fd_table[i] != NULL && (_thread_fd_getflags(i) & O_NONBLOCK) == 0) { - /* Get the current flags: */ - flags = _thread_sys_fcntl(i, F_GETFL, NULL); - /* Clear the nonblocking file descriptor flag: */ - _thread_sys_fcntl(i, F_SETFL, flags & ~O_NONBLOCK); + /* get close-on-exec flag */ + int fd_flags = _thread_sys_fcntl(i, F_GETFD, NULL); + if (fd_flags & FD_CLOEXEC) { + /* don't bother */ + } + else { + /* Get the current flags: */ + flags = _thread_sys_fcntl(i, F_GETFL, NULL); + /* Clear the nonblocking file descriptor flag: */ + _thread_sys_fcntl(i, F_SETFL, flags & ~O_NONBLOCK); + } } } -- Andriy Gapon * "Never try to outstubborn a cat." Lazarus Long, "Time Enough for Love" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Oct 23 14:20: 4 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 77C2637B401 for ; Wed, 23 Oct 2002 14:20:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B11AC43E6A for ; Wed, 23 Oct 2002 14:20:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9NLK2x3012273 for ; Wed, 23 Oct 2002 14:20:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9NLK2mZ012272; Wed, 23 Oct 2002 14:20:02 -0700 (PDT) Date: Wed, 23 Oct 2002 14:20:02 -0700 (PDT) Message-Id: <200210232120.g9NLK2mZ012272@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org Cc: From: Andriy Gapon Subject: Re: standards/43335: libc_r: execve() and close-on-exec flag, interrupted write() Reply-To: Andriy Gapon Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The following reply was made to PR standards/43335; it has been noted by GNATS. From: Andriy Gapon To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: standards/43335: libc_r: execve() and close-on-exec flag, interrupted write() Date: Wed, 23 Oct 2002 16:59:26 -0400 (EDT) If this PR does not quite fit to , could somebody please change it to something more appropriate for libc_r ? (I wonder what that is) Thanks! -- Andriy Gapon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Wed Oct 23 15: 0:14 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F39A337B401 for ; Wed, 23 Oct 2002 15:00:11 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EDA7043E4A for ; Wed, 23 Oct 2002 15:00:10 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9NM0Ax3021088 for ; Wed, 23 Oct 2002 15:00:10 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9NM0AHM021087; Wed, 23 Oct 2002 15:00:10 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC79337B404 for ; Wed, 23 Oct 2002 14:56:47 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 29A1F43E6A for ; Wed, 23 Oct 2002 14:56:47 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9NLuk7R020604 for ; Wed, 23 Oct 2002 14:56:46 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g9NLukQY020603; Wed, 23 Oct 2002 14:56:46 -0700 (PDT) Message-Id: <200210232156.g9NLukQY020603@www.freebsd.org> Date: Wed, 23 Oct 2002 14:56:46 -0700 (PDT) From: Chris BeHanna To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: standards/44425: getcwd() succeeds even if current dir has perm 000. Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Number: 44425 >Category: standards >Synopsis: getcwd() succeeds even if current dir has perm 000. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Oct 23 15:00:10 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Chris BeHanna >Release: 4.7 >Organization: >Environment: FreeBSD topperwein.pennasoft.com 4.7-STABLE FreeBSD 4.7-STABLE #0: Mon Oct 21 14:19:21 EDT 2002 behanna@topperwein.pennasoft.com:/raid0/usr/src/sys/TOPPERWEIN i386 >Description: POSIX requires that getcwd() return EACCES if any component of the pathname lacks either read or search permission; however, even in a directory for which the permissions mask is 000, getcwd() succeeds. >How-To-Repeat: Compile the following program: /* * getcwd bug demo */ #include #include #include #include int main(int argc, char* argv[]) { char* retbuf; if ((retbuf = getcwd(NULL, MAXPATHLEN+1)) == NULL) { fprintf(stderr, "getcwd() failed: errno = %d (%s)\n", errno, strerror(errno)); exit(1); } printf("%s\n", retbuf); free(retbuf); exit(0); } as, say gcc -o /tmp/t t.c then do the following: mkdir foo cd foo chmod 000 . /tmp/t >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Oct 25 5: 1:13 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86D8637B401; Fri, 25 Oct 2002 05:01:12 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 36F0443E42; Fri, 25 Oct 2002 05:01:12 -0700 (PDT) (envelope-from johan@FreeBSD.org) Received: from freefall.freebsd.org (johan@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9PC1Cx3001555; Fri, 25 Oct 2002 05:01:12 -0700 (PDT) (envelope-from johan@freefall.freebsd.org) Received: (from johan@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9PC1CWq001551; Fri, 25 Oct 2002 05:01:12 -0700 (PDT) Date: Fri, 25 Oct 2002 05:01:12 -0700 (PDT) From: Johan Karlsson Message-Id: <200210251201.g9PC1CWq001551@freefall.freebsd.org> To: johan@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-standards@FreeBSD.org Subject: Re: misc/40378: stdlib.h gives needless warnings with -ansi Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Synopsis: stdlib.h gives needless warnings with -ansi Responsible-Changed-From-To: freebsd-bugs->freebsd-standards Responsible-Changed-By: johan Responsible-Changed-When: Fri Oct 25 04:52:03 PDT 2002 Responsible-Changed-Why: Hopefully the people here knows if this is the correct behavior in 4-Stable? Should gcc -ansi warn about long long? Should we use long long in our headers? Please close this PR if everything is as it should. http://www.freebsd.org/cgi/query-pr.cgi?pr=40378 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Fri Oct 25 10:28:23 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 213C237B401; Fri, 25 Oct 2002 10:28:22 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id A734B43E65; Fri, 25 Oct 2002 10:28:20 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id DAA22830; Sat, 26 Oct 2002 03:09:41 +1000 Date: Sat, 26 Oct 2002 03:20:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Johan Karlsson Cc: freebsd-bugs@FreeBSD.ORG, Subject: Re: misc/40378: stdlib.h gives needless warnings with -ansi In-Reply-To: <200210251201.g9PC1CWq001551@freefall.freebsd.org> Message-ID: <20021026031633.G4681-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 25 Oct 2002, Johan Karlsson wrote: > Synopsis: stdlib.h gives needless warnings with -ansi > > Responsible-Changed-From-To: freebsd-bugs->freebsd-standards > Responsible-Changed-By: johan > Responsible-Changed-When: Fri Oct 25 04:52:03 PDT 2002 > Responsible-Changed-Why: > Hopefully the people here knows if this is > the correct behavior in 4-Stable? > > Should gcc -ansi warn about long long? > Should we use long long in our headers? > > Please close this PR if everything is as it should. This is fixed in -current in revs mumble1 of stdlib.h and mumble2 and mumble3 of cdefs.h (__LONG_SUPPORTED stuff). These fixes should be MFC'ed. Nearby lint damage (/* LONGLONG */ stuff) should not be MFC'ed. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 9:39:53 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBDAA37B404 for ; Sat, 26 Oct 2002 09:39:41 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20A1043E3B for ; Sat, 26 Oct 2002 09:39:38 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.12.3/8.12.3) with ESMTP id g9QGdZcF053867 for ; Sat, 26 Oct 2002 17:39:36 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.6/8.12.6) with ESMTP id g9QGdZH5008951 for ; Sat, 26 Oct 2002 17:39:35 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.6/8.12.6/Submit) id g9QGdZ8F008950 for freebsd-standards@freebsd.org; Sat, 26 Oct 2002 17:39:35 +0100 (BST) Date: Sat, 26 Oct 2002 17:39:35 +0100 (BST) From: Mark Valentine Message-Id: <200210261639.g9QGdZ8F008950@dotar.thuvia.org> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: freebsd-standards@freebsd.org Subject: /usr/posix: a first cut Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The following patch implements a /usr/posix directory where POSIX.1 versions of utilities which conflict with traditional BSD behaviour can be installed. It installs versions of expr(1) and sort(1) there, reverts /bin/expr to being BSD-compatible, and enables the new /usr/posix/sort behaviour by bumping _POSIX2_VERSION in back to 200112. In actual fact the /usr/posix binaries are exactly what were /bin/expr and /usr/bin/sort, which are replaced by one-line scripts which call the /usr/posix versions with the appropriate existing compatibility environment variable set. The patch updates heir(7) and adds an initial stab at a posix(7) page. NOTES: 1. I chose /usr/posix instead of /usr/posix/bin which has been mentioned to align with historical BSD practice: /usr/ucb, /usr/games, /usr/contrib and so on; also, I'd expect any POSIX-specific libraries to go under /usr/lib/posix or similar, rather than /usr/posix/lib. It's not like this is a separate subsystem. This is a point for discussion. 2. /usr/posix/expr still obeys the EXPR_COMPAT environment variable, which makes the manual page a little messy. The alternative is to compile separate binaries with and without -DEXPR_COMPAT (once I implement that) instead - it's probably tidier, but let's see what people think. 3. The GNU sort manual page is somewhat lacking - it seems a shame to take it off the vendor branch to add the pathetic attempt I've made at documenting the two versions. All ideas welcome. 4. Were any other things affected unduly by the previous bump of _POSIX2_VERSION to 200112? If so, I'll need to look at what to do with those. 5. /usr/posix/sort still obeys the _POSIX2_VERSION environment variable. I think that's fine. This is just a first cut to get a feel for whether people think something like this is useful. Any and all comments are welcome. Documentation improvements from those more familiar with the standards are especially welcome. Cheers, Mark. Index: bin/expr/Makefile =================================================================== RCS file: /usr/cvs/src/bin/expr/Makefile,v retrieving revision 1.17 diff -u -u -r1.17 Makefile --- bin/expr/Makefile 23 Mar 2002 00:44:00 -0000 1.17 +++ bin/expr/Makefile 26 Oct 2002 11:14:55 -0000 @@ -1,8 +1,12 @@ # $FreeBSD: src/bin/expr/Makefile,v 1.17 2002/03/23 00:44:00 wollman Exp $ +BINDIR= /usr/posix + PROG= expr SRCS= expr.y YFLAGS= + +SUBDIR= compat NO_WERROR= "GCC can't handle C99 printf formats." Index: bin/expr/expr.1 =================================================================== RCS file: /usr/cvs/src/bin/expr/expr.1,v retrieving revision 1.20 diff -u -u -r1.20 expr.1 --- bin/expr/expr.1 29 May 2002 15:18:35 -0000 1.20 +++ bin/expr/expr.1 26 Oct 2002 14:24:56 -0000 @@ -30,14 +30,16 @@ .\" .\" $FreeBSD: src/bin/expr/expr.1,v 1.20 2002/05/29 15:18:35 ru Exp $ .\" -.Dd May 10, 2002 +.Dd October 26, 2002 .Dt EXPR 1 .Os .Sh NAME .Nm expr .Nd evaluate expression .Sh SYNOPSIS -.Nm +.Nm /bin/expr +.Ar expression +.Nm /usr/posix/expr .Op Fl e .Ar expression .Sh DESCRIPTION @@ -51,6 +53,17 @@ Several of the operators have special meaning to command interpreters and must therefore be quoted appropriately. All integer operands are interpreted in base 10. +.Ss Nm /bin/expr +.Pp +Arithmetic operations are performed using signed integer math. +Arithmetic uses the C +.Vt intmax_t +data type (the largest integral type available), and +.Nm +will detect arithmetic overflow and return an error indication. +If a numeric operand is specified which is so large as to overflow +conversion to an integer, it is parsed as a string instead. +.Ss Nm /usr/posix/expr .Pp Arithmetic operations are performed using signed integer math. If the @@ -120,6 +133,7 @@ .El .Pp Parentheses are used for grouping in the usual manner. +.Ss Nm /usr/posix/expr .Pp Unless the .Ev EXPR_COMPAT @@ -134,17 +148,17 @@ syntax may be used to prevent this interpretation. However, many historic implementations of .Nm , -including the one in previous versions of -.Fx , +including +.Nm /bin/expr +for compatibility reasons, will not permit this syntax. See the examples below for portable ways to guarantee the correct interpretation. The -.Ev EXPR_COMPAT -variable is intended for use as a transition and debugging aid, when -.Nm -is used in complex scripts which cannot easily be recast to avoid the -non-portable usage. +.Nm /bin/expr +utility in future versions of +.Fx +may adopt the \*[Px] syntax and conventions. Defining .Ev EXPR_COMPAT also implicitly enables the @@ -168,10 +182,11 @@ New applications are advised to use shell arithmetic rather than .Nm . .Sh ENVIRONMENT +.Ss Nm /usr/posix/expr .Bl -tag -width ".Ev EXPR_COMPAT" .It Ev EXPR_COMPAT If set, -.Nm +.Nm /usr/posix/expr will emulate historic .Nm implementations which did not obey the Utility Syntax Guidelines. @@ -179,6 +194,10 @@ .Fl e . .El .Sh EXAMPLES +The following examples will work with both +.Nm /bin/expr +and +.Nm /usr/posix/expr . .Bl -bullet .It The following example (in @@ -216,21 +235,23 @@ .Pp The following examples output the number of characters in variable .Va a . +.Bl -bullet +.It +The +.Nm /bin/expr +command does not interpret leading hyphens as options: +.Dl "expr \*q$a\*q \&: \*q.*\*q" +.It Again, if .Va a might begin with a hyphen, it is necessary to prevent it from being interpreted as an option to -.Nm . -.Bl -bullet -.It -If the -.Nm -command conforms to -.St -p1003.1-2001 , -this is simple: +.Nm /usr/posix/expr : .Dl "expr -- \*q$a\*q \&: \*q.*\*q" .It -For portability to older systems, however, a more complicated command +For portability to both versions of +.Nm , +however, a more complicated command is required: .Dl "expr \e( \*qX$a\*q \&: \*q.*\*q \e) - 1" .El @@ -248,10 +269,11 @@ .El .Sh SEE ALSO .Xr sh 1 , -.Xr test 1 +.Xr test 1 , +.Xr posix 7 .Sh STANDARDS The -.Nm +.Nm /usr/posix/expr utility conforms to .St -p1003.1-2001 , provided that the Index: bin/expr/compat/Makefile =================================================================== RCS file: bin/expr/compat/Makefile diff -N bin/expr/compat/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/expr/compat/Makefile 26 Oct 2002 15:54:45 -0000 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SCRIPTSDIR=/bin +SCRIPTS= expr + +.include Index: bin/expr/compat/expr.sh =================================================================== RCS file: bin/expr/compat/expr.sh diff -N bin/expr/compat/expr.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ bin/expr/compat/expr.sh 26 Oct 2002 15:55:26 -0000 @@ -0,0 +1,5 @@ +#! /bin/sh +# +# $FreeBSD$ + +EXPR_COMPAT=true exec /usr/posix/expr "$@" Index: contrib/gnu-sort/man/sort.1 =================================================================== RCS file: /usr/cvs/src/contrib/gnu-sort/man/sort.1,v retrieving revision 1.1.1.1 diff -u -u -r1.1.1.1 sort.1 --- contrib/gnu-sort/man/sort.1 8 Jun 2002 07:47:23 -0000 1.1.1.1 +++ contrib/gnu-sort/man/sort.1 26 Oct 2002 15:45:59 -0000 @@ -3,7 +3,10 @@ .SH NAME sort \- sort lines of text files .SH SYNOPSIS -.B sort +.B /usr/bin/sort +[\fIOPTION\fR]... [\fIFILE\fR]... +.PP +.B /usr/posix/sort [\fIOPTION\fR]... [\fIFILE\fR]... .SH DESCRIPTION .\" Add any additional description here @@ -85,6 +88,13 @@ % 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y. .PP With no FILE, or when FILE is -, read standard input. +.PP +The +.B /usr/bin/sort +command accepts the traditional \fB+\fRPOS syntax (obsoleted by \fB-k\fR); +the +.B /usr/posix/sort +command treats an argument starting with a \fB+\fR as a FILE. .PP *** WARNING *** The locale specified by the environment affects sort order. Index: gnu/usr.bin/sort/Makefile =================================================================== RCS file: /usr/cvs/src/gnu/usr.bin/sort/Makefile,v retrieving revision 1.7 diff -u -u -r1.7 Makefile --- gnu/usr.bin/sort/Makefile 8 Jun 2002 10:34:12 -0000 1.7 +++ gnu/usr.bin/sort/Makefile 26 Oct 2002 14:28:24 -0000 @@ -1,5 +1,7 @@ # $FreeBSD: src/gnu/usr.bin/sort/Makefile,v 1.7 2002/06/08 10:34:12 ache Exp $ +BINDIR= /usr/posix + SORTDIR= ${.CURDIR}/../../../contrib/gnu-sort .PATH: ${SORTDIR}/lib ${SORTDIR}/src ${SORTDIR}/man @@ -26,5 +28,7 @@ xstrtoumax.c CFLAGS+=-I${.CURDIR} -I${SORTDIR}/lib -DHAVE_CONFIG_H + +SUBDIR= compat .include Index: gnu/usr.bin/sort/compat/Makefile =================================================================== RCS file: gnu/usr.bin/sort/compat/Makefile diff -N gnu/usr.bin/sort/compat/Makefile --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/usr.bin/sort/compat/Makefile 26 Oct 2002 15:56:47 -0000 @@ -0,0 +1,6 @@ +# $FreeBSD$ + +SCRIPTSDIR=/usr/bin +SCRIPTS= sort + +.include Index: gnu/usr.bin/sort/compat/sort.sh =================================================================== RCS file: gnu/usr.bin/sort/compat/sort.sh diff -N gnu/usr.bin/sort/compat/sort.sh --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ gnu/usr.bin/sort/compat/sort.sh 26 Oct 2002 15:56:56 -0000 @@ -0,0 +1,5 @@ +#! /bin/sh +# +# $FreeBSD$ + +_POSIX2_VERSION=199212 exec /usr/posix/sort "$@" Index: include/unistd.h =================================================================== RCS file: /usr/cvs/src/include/unistd.h,v retrieving revision 1.61 diff -u -u -r1.61 unistd.h --- include/unistd.h 13 Oct 2002 14:25:01 -0000 1.61 +++ include/unistd.h 26 Oct 2002 14:34:36 -0000 @@ -144,7 +144,7 @@ #endif /* Define the POSIX.2 version we target for compliance. */ -#define _POSIX2_VERSION 199212L +#define _POSIX2_VERSION 200112L /* * POSIX-style system configuration variable accessors (for the Index: share/man/man7/Makefile =================================================================== RCS file: /usr/cvs/src/share/man/man7/Makefile,v retrieving revision 1.24 diff -u -u -r1.24 Makefile --- share/man/man7/Makefile 6 Jul 2002 20:30:29 -0000 1.24 +++ share/man/man7/Makefile 26 Oct 2002 15:04:17 -0000 @@ -3,7 +3,7 @@ #MISSING: eqnchar.7 ms.7 term.7 MAN= ascii.7 build.7 clocks.7 environ.7 firewall.7 ffs.7 hier.7 \ - hostname.7 intro.7 mailaddr.7 operator.7 ports.7 release.7 \ + hostname.7 intro.7 mailaddr.7 operator.7 ports.7 posix.7 release.7 \ sdoc.7 security.7 sprog.7 stdint.7 tuning.7 MLINKS= intro.7 miscellaneous.7 Index: share/man/man7/hier.7 =================================================================== RCS file: /usr/cvs/src/share/man/man7/hier.7,v retrieving revision 1.77 diff -u -u -r1.77 hier.7 --- share/man/man7/hier.7 22 Oct 2002 10:37:07 -0000 1.77 +++ share/man/man7/hier.7 26 Oct 2002 15:02:49 -0000 @@ -419,6 +419,10 @@ The .Fx ports collection (optional). +.It Pa posix/ +POSIX-compatible versions of certain utilities; +see +.Xr posix 7 .It Pa sbin/ system daemons & system utilities (executed by users) .It Pa share/ Index: share/man/man7/posix.7 =================================================================== RCS file: share/man/man7/posix.7 diff -N share/man/man7/posix.7 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ share/man/man7/posix.7 26 Oct 2002 15:21:08 -0000 @@ -0,0 +1,46 @@ +.\" Copyright (c) 2002 Thuvia Labs Limited +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the author nor the names of any co-contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 26, 2002 +.Os +.Dt POSIX 7 +.Sh NAME +.Nm ports +.Nd POSIX conformance notes +.Sh DESCRIPTION +.Fx attempts to be compatible with various applicable standards, including +.St -p1003.1-2001 . +In certain cases, where the behaviour specified by \*[Px] conflicts +with traditional BSD behaviour, a more standards compliant version +of the utility may be found in the +.Pa /usr/posix +directory. +.Sh SEE ALSO +.Xr expr 1 , +.Xr sort 1 , +.Xr hier 7 -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 9:41:48 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 329F337B401 for ; Sat, 26 Oct 2002 09:41:48 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id D22F643E88 for ; Sat, 26 Oct 2002 09:41:46 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.12.3/8.12.3) with ESMTP id g9QGfjcF053873 for ; Sat, 26 Oct 2002 17:41:45 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.6/8.12.6) with ESMTP id g9QGfjH5009008 for ; Sat, 26 Oct 2002 17:41:45 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.6/8.12.6/Submit) id g9QGfjRG009007 for freebsd-standards@freebsd.org; Sat, 26 Oct 2002 17:41:45 +0100 (BST) Date: Sat, 26 Oct 2002 17:41:45 +0100 (BST) From: Mark Valentine Message-Id: <200210261641.g9QGfjRG009007@dotar.thuvia.org> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: freebsd-standards@freebsd.org Subject: Re: /usr/posix: a first cut Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Yes, I forgot mtree(8)... Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 10: 2: 0 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B56637B401 for ; Sat, 26 Oct 2002 10:01:59 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2D7A43E75 for ; Sat, 26 Oct 2002 10:01:58 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9QH1vgQ024578 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 26 Oct 2002 13:01:58 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9QH1v14024575; Sat, 26 Oct 2002 13:01:57 -0400 (EDT) (envelope-from wollman) Date: Sat, 26 Oct 2002 13:01:57 -0400 (EDT) From: Garrett Wollman Message-Id: <200210261701.g9QH1v14024575@khavrinen.lcs.mit.edu> To: Mark Valentine Cc: freebsd-standards@FreeBSD.ORG Subject: /usr/posix: a first cut In-Reply-To: <200210261639.g9QGdZ8F008950@dotar.thuvia.org> References: <200210261639.g9QGdZ8F008950@dotar.thuvia.org> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > It installs versions of expr(1) and sort(1) there, reverts /bin/expr to > being BSD-compatible I object to re-breaking the base expr. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 10:38: 3 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 29F3F37B401 for ; Sat, 26 Oct 2002 10:38:01 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id F305E43E4A for ; Sat, 26 Oct 2002 10:37:57 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.12.3/8.12.3) with ESMTP id g9QHbtcF054016; Sat, 26 Oct 2002 18:37:55 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.6/8.12.6) with ESMTP id g9QHbsH5010290; Sat, 26 Oct 2002 18:37:54 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.6/8.12.6/Submit) id g9QHbsYS010289; Sat, 26 Oct 2002 18:37:54 +0100 (BST) Date: Sat, 26 Oct 2002 18:37:54 +0100 (BST) From: Mark Valentine Message-Id: <200210261737.g9QHbsYS010289@dotar.thuvia.org> In-Reply-To: <200210261701.g9QH1v14024575@khavrinen.lcs.mit.edu> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: Garrett Wollman Subject: Re: /usr/posix: a first cut Cc: freebsd-standards@FreeBSD.ORG Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: Garrett Wollman > Date: Sat 26 Oct, 2002 > Subject: /usr/posix: a first cut > < said: > > > It installs versions of expr(1) and sort(1) there, reverts /bin/expr to > > being BSD-compatible > > I object to re-breaking the base expr. It just so happens the -CURRENT expr(1) breaks a large proportion of the scripts I've written over the last couple of decades, and I can't be alone. I'm pretty sure a release of 5.0 with this expr(1) will find a few more... One of the problems is obviously that I've not kept up with the incompatibilities introduced by POSIX, and believed the manual pages all these years. I was always happy in the erroneous (but practically true) knowledge that expr(1) didn't take any options. However, my main justification for reverting it in favour of /usr/posix/expr is that I haven't seen other vendors make their default expr(1) behave this way. Sun certainly haven't, at least as far as Solaris 9 FCS. The one change I *have* seen to support POSIX.1 is for implementations to silently discard an initial '--', which at least starts a migration path; in fact, I'd suggest we might even do this also in the EXPR_COMPAT case? The ability to set EXPR_COMPAT to deal with this problem is insufficient with respect to third party scripts over which the user has little control. I just find it hard to imagine FreeBSD 5.0 being the first OS release in my knowledge to break traditional expr(1) use. If /usr/posix is useful at all, it's useful for exactly this kind of thing; in fact there's no point having /usr/posix at all if we still break backwards compatibility due to POSIX! Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 11:45:42 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1981037B401 for ; Sat, 26 Oct 2002 11:45:40 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7AB6A43E6A for ; Sat, 26 Oct 2002 11:45:39 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 9E9B79C0E; Sat, 26 Oct 2002 14:37:24 -0400 (EDT) Date: Sat, 26 Oct 2002 14:37:24 -0400 From: Mike Barcroft To: Mark Valentine Cc: freebsd-standards@freebsd.org Subject: Re: /usr/posix: a first cut Message-ID: <20021026143724.D47672@espresso.q9media.com> References: <200210261639.g9QGdZ8F008950@dotar.thuvia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210261639.g9QGdZ8F008950@dotar.thuvia.org>; from mark@thuvia.demon.co.uk on Sat, Oct 26, 2002 at 05:39:35PM +0100 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mark Valentine writes: > The following patch implements a /usr/posix directory where POSIX.1 versions > of utilities which conflict with traditional BSD behaviour can be installed. > > It installs versions of expr(1) and sort(1) there, reverts /bin/expr to > being BSD-compatible, and enables the new /usr/posix/sort behaviour by > bumping _POSIX2_VERSION in back to 200112. > > In actual fact the /usr/posix binaries are exactly what were /bin/expr > and /usr/bin/sort, which are replaced by one-line scripts which call the > /usr/posix versions with the appropriate existing compatibility environment > variable set. > > The patch updates heir(7) and adds an initial stab at a posix(7) page. > > NOTES: > > 1. I chose /usr/posix instead of /usr/posix/bin which has been > mentioned to align with historical BSD practice: /usr/ucb, > /usr/games, /usr/contrib and so on; also, I'd expect any > POSIX-specific libraries to go under /usr/lib/posix or > similar, rather than /usr/posix/lib. It's not like this > is a separate subsystem. > > This is a point for discussion. I would prefer to have /usr/posix/bin and /usr/posix/man. I think manuals will get too cluttered if we try to document two differing utilities in one manual. We would need some sort of manual preprocessor so that the manuals could share the same mdoc source. at(1) does something like this for pathnames. We would need something more complicated than this, but certainly it wouldn't be difficult to create a sed preprocessor script to handle the conditional segments. > 2. /usr/posix/expr still obeys the EXPR_COMPAT environment > variable, which makes the manual page a little messy. > > The alternative is to compile separate binaries with and > without -DEXPR_COMPAT (once I implement that) instead - > it's probably tidier, but let's see what people think. > > 3. The GNU sort manual page is somewhat lacking - it seems a > shame to take it off the vendor branch to add the pathetic > attempt I've made at documenting the two versions. > > All ideas welcome. We are probably going to have to if we want to do a good job with documentation. > 4. Were any other things affected unduly by the previous bump > of _POSIX2_VERSION to 200112? If so, I'll need to look at > what to do with those. > > 5. /usr/posix/sort still obeys the _POSIX2_VERSION environment > variable. I think that's fine. > > This is just a first cut to get a feel for whether people think something like > this is useful. Any and all comments are welcome. Documentation improvements > from those more familiar with the standards are especially welcome. I think we should suggest in posix(7) that users seeking conformant utilities change their PATH and MANPATH. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 12:44:20 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B65EF37B401; Sat, 26 Oct 2002 12:44:18 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C29A43E3B; Sat, 26 Oct 2002 12:44:17 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.12.3/8.12.3) with ESMTP id g9QJiFcF054243; Sat, 26 Oct 2002 20:44:15 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.6/8.12.6) with ESMTP id g9QJiEH5012647; Sat, 26 Oct 2002 20:44:14 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.6/8.12.6/Submit) id g9QJiErS012646; Sat, 26 Oct 2002 20:44:14 +0100 (BST) Date: Sat, 26 Oct 2002 20:44:14 +0100 (BST) From: Mark Valentine Message-Id: <200210261944.g9QJiErS012646@dotar.thuvia.org> In-Reply-To: <20021026143724.D47672@espresso.q9media.com> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: Mike Barcroft Subject: Re: /usr/posix: a first cut Cc: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: Mike Barcroft > Date: Sat 26 Oct, 2002 > Subject: Re: /usr/posix: a first cut > I would prefer to have /usr/posix/bin and /usr/posix/man. I think > manuals will get too cluttered if we try to document two differing > utilities in one manual. I was hoping this wouldn't get that much out of hand; I see the differences being very small. Most users will never see the POSIX-related manual pages if they are separate. Do you know of any other systems which take this approach? I've sort of been following Solaris' style, which I've found to be effective. > I think we should suggest in posix(7) that users seeking conformant > utilities change their PATH and MANPATH. I explicitly didn't do that, because I think /usr/posix is there for script writers, not users. In fact, putting /usr/posix at the start of your path is more likely to _break_ the scripts you run. Portable scripts don't hardwire paths for standard executables, they rely on a reasonable default environment for the platform which behaves as that platform normally does (there are exceptions to this rule, of course). An example would be a script which knows that all its target platforms support a POSIX.1 expr(1) command, even if it's not the default behaviour: #!/bin/sh case `uname` in FreeBSD) expr=/usr/posix/expr;; SunOS) expr=/usr/xpg4/bin/expr;; *) expr=expr;; esac ... use $expr ... Note that the default in absence of any better knowledge is "hope and pray". Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 13:36:42 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C98537B401 for ; Sat, 26 Oct 2002 13:36:41 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6D2643E3B for ; Sat, 26 Oct 2002 13:36:40 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9QKadgQ025537 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 26 Oct 2002 16:36:39 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9QKadk2025534; Sat, 26 Oct 2002 16:36:39 -0400 (EDT) (envelope-from wollman) Date: Sat, 26 Oct 2002 16:36:39 -0400 (EDT) From: Garrett Wollman Message-Id: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> To: Mark Valentine Cc: freebsd-standards@FreeBSD.ORG Subject: Re: /usr/posix: a first cut In-Reply-To: <200210261944.g9QJiErS012646@dotar.thuvia.org> References: <20021026143724.D47672@espresso.q9media.com> <200210261944.g9QJiErS012646@dotar.thuvia.org> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > Portable scripts don't hardwire paths for standard executables, they > rely on a reasonable default environment for the platform which behaves > as that platform normally does (there are exceptions to this rule, of > course). Actually, portable scripts do the following: PATH=$(command -p getconf PATH) and should never supply explicit paths to the Standard Utilities (unless it cares to go to the effort of emulating execve() all by itself). So any move to create a ghetto for Standard-compliant utilities must perforce update the Standard Path to put the directory containing the Standard utilities first. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 14:15:47 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3E5637B401 for ; Sat, 26 Oct 2002 14:15:45 -0700 (PDT) Received: from thuvia.demon.co.uk (thuvia.demon.co.uk [193.237.34.248]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3A41043E3B for ; Sat, 26 Oct 2002 14:15:44 -0700 (PDT) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (dotar.thuvia.org [10.0.0.4]) by phaidor.thuvia.org (8.12.3/8.12.3) with ESMTP id g9QLFfcF054444; Sat, 26 Oct 2002 22:15:42 +0100 (BST) (envelope-from mark@thuvia.demon.co.uk) Received: from dotar.thuvia.org (localhost [IPv6:::1]) by dotar.thuvia.org (8.12.6/8.12.6) with ESMTP id g9QLFfH5014716; Sat, 26 Oct 2002 22:15:41 +0100 (BST) (envelope-from mark@dotar.thuvia.org) Received: (from mark@localhost) by dotar.thuvia.org (8.12.6/8.12.6/Submit) id g9QLFeCw014715; Sat, 26 Oct 2002 22:15:40 +0100 (BST) Date: Sat, 26 Oct 2002 22:15:40 +0100 (BST) From: Mark Valentine Message-Id: <200210262115.g9QLFeCw014715@dotar.thuvia.org> In-Reply-To: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> X-Mailer: Mail User's Shell (7.2.6 beta(5) 10/07/98) To: Garrett Wollman Subject: Re: /usr/posix: a first cut Cc: freebsd-standards@freebsd.org Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: Garrett Wollman > Date: Sat 26 Oct, 2002 > Subject: Re: /usr/posix: a first cut > Actually, portable scripts do the following: > > PATH=$(command -p getconf PATH) > > and should never supply explicit paths to the Standard Utilities > (unless it cares to go to the effort of emulating execve() all by > itself). Eek! Portable != POSIX (despite all the good POSIX does for steering everyone in the same direction eventually). My portable scripts use neither $(anything) nor getconf. Maybe next century... Sheesh, FreeBSD 4.7 doesn't even _have_ getconf(1), and Solaris 9 /bin/sh still doesn't support $(foo). > So any move to create a ghetto for Standard-compliant utilities must > perforce update the Standard Path to put the directory containing the > Standard utilities first. OK, you're right that there should be a way to get a Standard environment (as opposed the default as-near-as-possible-but-still-BSD-when-it-comes- to-the-crunch environment). So posix(7) should state something like: The default FreeBSD command environment is as close as possible to POSIX.1 without introducing backwards compatibility issues. In order to set up a more complete POSIX-compliant environment, it is sufficient to place /usr/posix at the start of your PATH (or at least before /bin and /usr/bin). NOTE: placing /usr/posix early in your PATH may adversely effect any non-POSIX utilities you cause to run, and is not intended for general use. EXAMPLES % env PATH=/bin:/usr/bin expr -1 + 2 1 % env PATH=/bin:/usr/bin expr -- hello : '.*' expr: syntax error % env PATH=/usr/posix:/bin:/usr/bin expr -1 + 2 expr: illegal option -- 1 usage: expr [-e] expression % env PATH=/usr/posix:/bin:/usr/bin expr -- hello : '.*' 5 SEE ALSO environ(7) Cheers, Mark. -- Mark Valentine, Thuvia Labs "Tigers will do ANYTHING for a tuna fish sandwich." Mark Valentine uses "We're kind of stupid that way." *munch* *munch* and endorses FreeBSD -- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 15:24: 8 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B03E337B401 for ; Sat, 26 Oct 2002 15:24:06 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 054ED43E75 for ; Sat, 26 Oct 2002 15:24:06 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9QMO4gQ026013 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 26 Oct 2002 18:24:05 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9QMO4pw026010; Sat, 26 Oct 2002 18:24:04 -0400 (EDT) (envelope-from wollman) Date: Sat, 26 Oct 2002 18:24:04 -0400 (EDT) From: Garrett Wollman Message-Id: <200210262224.g9QMO4pw026010@khavrinen.lcs.mit.edu> To: Mark Valentine Cc: freebsd-standards@FreeBSD.ORG Subject: Re: /usr/posix: a first cut In-Reply-To: <200210262115.g9QLFeCw014715@dotar.thuvia.org> References: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> <200210262115.g9QLFeCw014715@dotar.thuvia.org> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > Portable != POSIX (despite all the good POSIX does for steering everyone > in the same direction eventually). Quite to the contraty. POSIX, and other formal standards, define the behavior portable applications can expect. An application which contains work-arounds for non-standard systems is merely ported, not necessary portable. > Sheesh, FreeBSD 4.7 doesn't even _have_ getconf(1), FreeBSD 4.7 doesn't claim compliance to POSIX.2, so all bets are off. A script can only hope that the PATH includes utilities which do the right thing. > and Solaris 9 /bin/sh > still doesn't support $(foo). That's because the only POSIX-compliant shell on Solaris is called `/usr/xpg4/bin/sh'. Since /usr/xpg4/bin is the first directory in the standard PATH, this is OK (even if confusing and poor QOI). (There seem to be other problems, though, at least in my quick inspection, some of which may be due to the fact that I don't use `sh' as my standard shell on the one Solaris machine I have easy access to.) > OK, you're right that there should be a way to get a Standard environment > (as opposed the default as-near-as-possible-but-still-BSD-when-it-comes- > to-the-crunch environment). The Standard defines a self-consistent environment, and a way (`getconf -p PATH') for any script to ensure that it gets it. You'll have to change many more utilities than just `sort' to go down that path. (Look at /usr/xpg4/bin on a Solaris machine to get an idea of how many utilities are broken by default on that platform.) > % env PATH=/bin:/usr/bin expr -1 + 2 > 1 Examples should be given in Standard (i.e., Bourne Shell) syntax. In any case, this is a red herring, since the expr(1) manual page gives generous advice as to how to use the `expr' command in a way which will work identically on both pre-POSIX and POSIX-standard `expr' implementations. Rather than pile kluge on top of hack on top of bogus workaround, just fix your scripts. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 15:57:46 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95B0D37B401 for ; Sat, 26 Oct 2002 15:57:44 -0700 (PDT) Received: from espresso.q9media.com (espresso.q9media.com [65.39.129.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id C17C043E4A for ; Sat, 26 Oct 2002 15:57:43 -0700 (PDT) (envelope-from mike@espresso.q9media.com) Received: by espresso.q9media.com (Postfix, from userid 1002) id 83B359C0E; Sat, 26 Oct 2002 18:49:28 -0400 (EDT) Date: Sat, 26 Oct 2002 18:49:28 -0400 From: Mike Barcroft To: Mark Valentine Cc: freebsd-standards@freebsd.org Subject: Re: /usr/posix: a first cut Message-ID: <20021026184928.E47672@espresso.q9media.com> References: <20021026143724.D47672@espresso.q9media.com> <200210261944.g9QJiErS012646@dotar.thuvia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200210261944.g9QJiErS012646@dotar.thuvia.org>; from mark@thuvia.demon.co.uk on Sat, Oct 26, 2002 at 08:44:14PM +0100 Organization: The FreeBSD Project Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Mark Valentine writes: > > From: Mike Barcroft > > Date: Sat 26 Oct, 2002 > > Subject: Re: /usr/posix: a first cut > > > I would prefer to have /usr/posix/bin and /usr/posix/man. I think > > manuals will get too cluttered if we try to document two differing > > utilities in one manual. > > I was hoping this wouldn't get that much out of hand; I see the > differences being very small. I don't. Take for instance /usr/posix/bin/ps which will be completely different, with many conflicting options. > Most users will never see the POSIX-related manual pages if they > are separate. Users that don't need POSIX-conformant applications won't need to read about conformant versions and vice versa. > Do you know of any other systems which take this approach? I've > sort of been following Solaris' style, which I've found to be effective. Take a look at the sccs(1) manual on Solaris to see why I think manuals get cluttered when you go that route. > > I think we should suggest in posix(7) that users seeking conformant > > utilities change their PATH and MANPATH. > > I explicitly didn't do that, because I think /usr/posix is there for > script writers, not users. I think both will be using it. > In fact, putting /usr/posix at the start of your path is more likely > to _break_ the scripts you run. I use a different shell for scripting (/bin/sh) vs. my regular shell (/bin/tcsh). A run of w(1) on freefall shows I'm not alone, 0/27 users are running sh(1). I believe most advanced Bourne shells define something to distinguish themselves from regular /bin/sh, so it shouldn't be a problem to change the path only for interactive sessions. > Portable scripts don't hardwire paths for standard executables, they > rely on a reasonable default environment for the platform which behaves > as that platform normally does (there are exceptions to this rule, of > course). > > An example would be a script which knows that all its target platforms > support a POSIX.1 expr(1) command, even if it's not the default behaviour: > > #!/bin/sh > > case `uname` in > FreeBSD) expr=/usr/posix/expr;; > SunOS) expr=/usr/xpg4/bin/expr;; > *) expr=expr;; > esac > > ... use $expr ... > > Note that the default in absence of any better knowledge is "hope and pray". [Garrett covered this.] Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 16:16:13 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22B8A37B401 for ; Sat, 26 Oct 2002 16:16:12 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 912DB43E42 for ; Sat, 26 Oct 2002 16:16:11 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9QNGAgQ026177 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Sat, 26 Oct 2002 19:16:10 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9QNGAWB026174; Sat, 26 Oct 2002 19:16:10 -0400 (EDT) (envelope-from wollman) Date: Sat, 26 Oct 2002 19:16:10 -0400 (EDT) From: Garrett Wollman Message-Id: <200210262316.g9QNGAWB026174@khavrinen.lcs.mit.edu> To: standards@FreeBSD.org Subject: Why I am opposed to a Standards Ghetto Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG What it boils down to is that we end up with two completely separate versions of every utility for which a standard exists -- one which implements the standard behavior, and one which does not -- for all time. Broken scripts will never get updated, because script-writers will hard-code them to ignore the standard utilities and use the non-standard ones instead. (We see that already in Solaris, where many users are totally unaware of the way in which their default environment differs from what the standard says, blithely trusting in Sun's conformance claim on the ticklist without investigating all the myriad actions one must take to get a compliant programming environment.) That way lies madness. Every question about a standard utility will then become unanswerable without a piece of information users would be surprised and in some cases hard-pressed to answer. Ultimately, I think it's less of a POLA violation to tell our users, ``this used to work this way, but now there's a standard that says it works that way instead, and we wanted to comply with the standard'', than it is to encourage the creation of scripts which only work when one of multiple official FreeBSD versions of a utility is found in the search path first. Note that I am specifically speaking of the base POSIX standard. I am not including in this discussion the X/Open System Interfaces option of POSIX.1-2001, which is in essence the old System V Interface Definition. To the extent we can support XSI behavior without conflicts, I think we should do so. I do not think that we should supply a separate XSI version of utilities which do have significant conflicts (like `ps'), since our aim is not to emulate System V, and most of the differences as remain are old System V mistakes. -GAWollman To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 20:25:15 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA3B037B401 for ; Sat, 26 Oct 2002 20:25:14 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [193.201.200.170]) by mx1.FreeBSD.org (Postfix) with ESMTP id C27CA43E6A for ; Sat, 26 Oct 2002 20:25:13 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 185e36-0007f1-00 (Debian); Sun, 27 Oct 2002 03:25:12 +0000 Date: Sun, 27 Oct 2002 03:25:12 +0000 From: Tony Finch To: Garrett Wollman Cc: Mark Valentine , freebsd-standards@FreeBSD.ORG Subject: Re: /usr/posix: a first cut Message-ID: <20021027032512.A27342@chiark.greenend.org.uk> References: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> <200210262115.g9QLFeCw014715@dotar.thuvia.org> <200210262224.g9QMO4pw026010@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200210262224.g9QMO4pw026010@khavrinen.lcs.mit.edu>; from wollman@lcs.mit.edu on Sat, Oct 26, 2002 at 06:24:04PM -0400 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Oct 26, 2002 at 06:24:04PM -0400, Garrett Wollman wrote: > > That's because the only POSIX-compliant shell on Solaris is called > `/usr/xpg4/bin/sh'. Since /usr/xpg4/bin is the first directory in the > standard PATH, this is OK (even if confusing and poor QOI). As far as I can tell you have to explicitly put /usr/xpg4/bin in your path on Solaris in order to get post-1980s behaviour, and it will not do that for you by default. Coding "portably" (i.e. coding to standards) is all very well, but it does not mean that your code will run on lots of systems. If you want to write a script that will run on many unices then you have to code to the 7th Edition. FreeBSD should remain compatible with that (for the sake of antediluvian scripts and Solaris) and with BSDs from recent years (so that autoconf doesn't lose its marbles) and aim for newer standards as a lower priority. Tony. -- f.a.n.finch http://dotat.at/ FORTIES CROMARTY FORTH TYNE DOGGER: SOUTHERLY 4 OR 5 BECOMING CYCLONIC THEN NORTHWESTERLY 6 TO GALE 8, PERHAPS SEVERE GALE 9 LATER. RAIN. MODERATE. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message From owner-freebsd-standards Sat Oct 26 20:53:48 2002 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5AC3437B401 for ; Sat, 26 Oct 2002 20:53:47 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD4B743E65 for ; Sat, 26 Oct 2002 20:53:46 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g9R3rWgQ027244 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 26 Oct 2002 23:53:33 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g9R3rWRM027241; Sat, 26 Oct 2002 23:53:32 -0400 (EDT) (envelope-from wollman) Date: Sat, 26 Oct 2002 23:53:32 -0400 (EDT) From: Garrett Wollman Message-Id: <200210270353.g9R3rWRM027241@khavrinen.lcs.mit.edu> To: Tony Finch Cc: freebsd-standards@FreeBSD.ORG Subject: Re: /usr/posix: a first cut In-Reply-To: <20021027032512.A27342@chiark.greenend.org.uk> References: <200210262036.g9QKadk2025534@khavrinen.lcs.mit.edu> <200210262115.g9QLFeCw014715@dotar.thuvia.org> <200210262224.g9QMO4pw026010@khavrinen.lcs.mit.edu> <20021027032512.A27342@chiark.greenend.org.uk> Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG < said: > As far as I can tell you have to explicitly put /usr/xpg4/bin in your > path on Solaris in order to get post-1980s behaviour, and it will not > do that for you by default. `getconf PATH' reports it as first, so a script (or more likely an installation program) can use that to find where the Proper Shell really lives. Other programs which might care about the standard path are supposed to call confstr(_CS_PATH) to find it, but may well be broken. (This is, by the way, one of the reasons why the `#!' hack is not and likely never will be standardized.) > Coding "portably" (i.e. coding to standards) is all very well, but it > does not mean that your code will run on lots of systems. If you want to > write a script that will run on many unices then you have to code to the > 7th Edition. Actually, if you really want to go back that far into ancient history, you would have to code for the intersection of V7 and every official and unofficial standard released since then. (That means, among other things, protecting your `expr' command arguments from undesired alternative interpretations. Let's please keep in mind that -current's `expr' now for the first time conforms to a TEN-YEAR-OLD STANDARD, 1003.2-1992.) > FreeBSD should remain compatible with that It never has been, since our shell makes at least an attempt at accepting the POSIX grammar, of which the V7 shell language is not a proper subset. I'm not sure if Tom Duff's comment on the original Bourne shell language[1] doesn't still apply. -GAWollman [1] ``This is surely an oversight, but it suggests something darker: Nobody really knows what the Bourne shell's grammar is. Even examination of the source code is little help.'' To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message