<<On Thu, 22 Mar 2001 00:26:09 +0300, "Andrey A. Chernov" <[EMAIL PROTECTED]> 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.e. when two implementations does the same thing, POSIX/ISO C
> variant is preferred.

Erm, no -- the superior version is preferred.  (Something of a
tautology.)  FreeBSD has never been about slavish adherence to
standards; while we prefer to follow relevant standards, if the
standards are broken we do our own thing, and that goes doubly so for
the way we code the standard utilities.  That doesn't mean we
shouldn't implement <wctype.h> et al, but it does mean that we should
use whichever facilities are cleanest, and easiest to code for and
maintain, rather than those which are specifically blessed by an ISO
working group.


Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
[EMAIL PROTECTED]  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to