Re: [dev] [sbase] style

From: Louis Santillan <lpsantil_AT_gmail.com>
Date: Tue, 18 Nov 2014 08:57:22 -0800

Returning error code doesn't work well for many asynchronous calls
(aio_*) [0]. It also makes errno (possibly) inconsistent, but I
didn't come up with that standard. I guess someone decided that
making errno inconsistent is less of an issue than make the return
code of libc inconsistent.

[0] http://www.gnu.org/software/libc/manual/html_node/Asynchronous-Reads_002fWrites.html#Asynchronous-Reads_002fWrites

On Tue, Nov 18, 2014 at 8:47 AM, Dimitris Papastamos <sin_AT_2f30.org> wrote:
> On Tue, Nov 18, 2014 at 11:35:04AM -0500, M Farkas-Dyck wrote:
>> On 18/11/2014, Dimitris Papastamos <sin_AT_2f30.org> wrote:
>> > On a side note here, for a failing syscall or similar, I think the
>> > idea is to check for < 0 rather than == -1. I am not opposed to the
>> > latter except that is already used less frequently in sbase.
>>
>> On an edge note, it would be much saner for many syscalls and libc
>> functions to return minus the error code rather than return -1 and set
>> errno, and in the future suckless-dominated world we could do so. The
>> OpenBSD kernel already often does so internally. To check < 0 rather
>> than == -1 would ease transition.
>
> Yes I've always wondered.
>
Received on Tue Nov 18 2014 - 17:57:22 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 18 2014 - 18:00:15 CET