From: "M. Warner Losh" <imp@bsdimp.com>
To: qemu-devel@nongnu.org, revol@free.fr
Subject: Re: [Qemu-devel] [6324] Return -errno on write failure (Gleb Natapov)
Date: Mon, 19 Jan 2009 13:03:31 -0700 (MST) [thread overview]
Message-ID: <20090119.130331.1346848276.imp@bsdimp.com> (raw)
In-Reply-To: <7523661163-BeMail@laptop>
In message: <7523661163-BeMail@laptop>
"François Revol" <revol@free.fr> writes:
: > But returning -errno to indicate an error is a very convenient
: > practice. It is deservedly widely used, not just in qemu. To do
:
: I'm still wondering why this convenient way of doing has not been used
: for decades outside Unix kernels themselves until recently...
s/Unix/Linux/g. This is a Linuxism that isn't widespread outside of
Linux and programs that were written to emulate the Linux -EBLAH style
in the Linux kernel. BSD doesn't do this at all, nor does Solaris or
the antecedents of SysV, 8th edition, seventh edition, sixth edition,
etc. The Linux kernel was the first place I saw the practice, which
many have panned as unwise in-band signaling since it tries to encode
in part of the range of the return value the error, when in fact you
can't always assume that all system-call functions will return a
negative number that's not meaningful (which is why the standards are
very careful to specify that the return value of the system call is
-1, and errno is set to provide more information about the error).
So please, let's not get carried away and claim that this practice
originated in Unix, nor tar the whole Unix world with this dubious
practice. Of course, the polemics on this thread are already out of
this world, and I should know better than to reply...
Warner
prev parent reply other threads:[~2009-01-19 20:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 20:44 [Qemu-devel] [6324] Return -errno on write failure (Gleb Natapov) Anthony Liguori
2009-01-15 21:20 ` François Revol
2009-01-15 22:15 ` M. Warner Losh
2009-01-15 22:33 ` François Revol
2009-01-16 7:31 ` Gleb Natapov
2009-01-16 17:37 ` Ian Jackson
2009-01-16 18:36 ` François Revol
2009-01-16 18:49 ` Anthony Liguori
2009-01-16 19:17 ` François Revol
2009-01-16 19:31 ` Anthony Liguori
2009-01-16 19:41 ` François Revol
2009-01-19 11:37 ` Ian Jackson
2009-01-19 18:52 ` François Revol
2009-01-19 19:47 ` Lennart Sorensen
2009-01-19 20:31 ` François Revol
2009-01-19 20:03 ` M. Warner Losh [this message]
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=20090119.130331.1346848276.imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=qemu-devel@nongnu.org \
--cc=revol@free.fr \
/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;
as well as URLs for NNTP newsgroup(s).