On errno

Garrett Wollman wollman at hergotha.csail.mit.edu
Mon Mar 30 23:52:11 PDT 2009


In article <95823.1238476941 at critter.freebsd.dk>, phk at phk.freebsd.dk
writes:

>And the "standard" solution is stupid and useless, because more
>often than not, some language, typically french, will want the
>arguments in the opposite order...

Which is why printf() supports putting the arguments in arbitrary
order.

A much more serious objection to this model is the desire someone will
certainly have to use the %s format, with the attendent pain involved
in moving variable-length strings along with the arguments across the
user-kernel boundary.

I'd much rather have plain integers, thank you very much.  At most, a
small structure, in which the only pointer is a reference to a
user-space argument.  (So [ENOENT] and [EACCES] could have an extended
error code ECOMPONENTNAME which indicates that the pointer value is a
substring of the pathname argument, and identifies the beginning of
the pathname component being resolved when the failure occurred.
You'd probably also want to have ENOTANERROR to indicate "error return
indicates an expected success condition" and EFD to indicate "integer
value is the file descriptor which caused the error condition.)

But all this is really irrelevant if no other operating system or
standard adopts the interface.  Interfaces which are peculiar to
FreeBSD are rarely useful.

-GAWollman


More information about the freebsd-arch mailing list