qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [6324] Return -errno on write failure (Gleb Natapov)


From: M. Warner Losh
Subject: Re: [Qemu-devel] [6324] Return -errno on write failure (Gleb Natapov)
Date: Mon, 19 Jan 2009 13:03:31 -0700 (MST)

In message: <address@hidden>
            "François Revol" <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]