From: Linus Torvalds <torvalds@osdl.org>
To: Albert Cahalan <albert@users.sourceforge.net>
Cc: linux-kernel mailing list <linux-kernel@vger.kernel.org>,
Andrew Morton OSDL <akpm@osdl.org>
Subject: Re: errno
Date: Mon, 3 May 2004 21:14:48 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0405032111450.1636@ppc970.osdl.org> (raw)
In-Reply-To: <1083634011.952.154.camel@cube>
On Mon, 3 May 2004, Albert Cahalan wrote:
>
> The obvious fix would be to stuff errno into the
> task_struct, hmmm?
No. "errno" is one of those fundamentally broken things that should not
exist. It was wrogn in original UNIX, it's wrong now.
The kernel usage comes not from the kernel wanting to use it per se (the
kernel has always used the "negative error" approach), but from some
misguided kernel modules using the user-space interfaces.
The Linux way of returning negative error numbers is much nicer. It's
inherently thread-safe, and it has no performance downsides. Of course, it
does depend on having enough of a result domain that you can always
separate error returns from good returns, but that's true in practice for
all system calls.
Too bad we can't fix broken calling conventions.
Linus
next prev parent reply other threads:[~2004-05-04 4:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-04 1:26 errno Albert Cahalan
2004-05-04 4:14 ` Linus Torvalds [this message]
2004-05-04 5:58 ` errno Philippe Troin
2004-05-06 1:16 ` errno Philippe Troin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0405032111450.1636@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=akpm@osdl.org \
--cc=albert@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®