From owner-freebsd-current Wed Mar 21 13:55:21 2001 Delivered-To: freebsd-current@freebsd.org Received: from nagual.pp.ru (pobrecita.freebsd.ru [194.87.13.42]) by hub.freebsd.org (Postfix) with ESMTP id 48D8837B71F; Wed, 21 Mar 2001 13:55:15 -0800 (PST) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.11.3/8.11.3) id f2LLt9Y20317; Thu, 22 Mar 2001 00:55:09 +0300 (MSK) (envelope-from ache) Date: Thu, 22 Mar 2001 00:55:09 +0300 From: "Andrey A. Chernov" To: Garrett Wollman Cc: current@FreeBSD.ORG, i18n@FreeBSD.ORG Subject: Re: Request for review [Re: /bin/ls patch round #2] Message-ID: <20010322005509.A20201@nagual.pp.ru> References: <20010319195438.A43266@peorth.iteration.net> <20010320002043.A46115@peorth.iteration.net> <20010320065321.E63933668@203.141.142.186.user.am.il24.net> <200103201736.MAA09185@khavrinen.lcs.mit.edu> <20010321040241.C97FC3668@203.141.142.186.user.am.il24.net> <200103212119.QAA22140@khavrinen.lcs.mit.edu> <20010322002607.A19574@nagual.pp.ru> <200103212139.QAA22473@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: <200103212139.QAA22473@khavrinen.lcs.mit.edu>; from wollman@khavrinen.lcs.mit.edu on Wed, Mar 21, 2001 at 04:39:44PM -0500 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Mar 21, 2001 at 16:39:44 -0500, Garrett Wollman wrote: > < said: > > > This particular case is different from what you say. There is no strict > > POSIX/ISO C equivalent of functionality you describe, > > Certainly there is. The daemon(3) function is implemented entirely on > top of POSIX interfaces: fork(), setsid(), chdir(), open(), dup2(), > and close(). It is supplied because many programs which attempt to do > this from scratch get it wrong. Similarly, err(3) could be entirely > implemented in terms of ISO C primitives: vfprintf(), strerror(), and > exit(). The style guide recommends its use because err() is a simpler > interface, thus harder to get wrong than rolling one's own. strsep(3) > is another similar example. I mean _strict_ equivalent in more strict sense, i.e. the same amount of calls needed, the same interface complexity, the same capabilities, etc. > > I.e. when two implementations does the same thing, POSIX/ISO C > > variant is preferred. > > Erm, no -- the superior version is preferred. (Something of a Since I mean _strict_ equivalent, there can't be superior version by definition, because it makes equivalent no strict. In case we discuss equivalent is strict. -- Andrey A. Chernov http://ache.pp.ru/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message