Source-Changes-D archive

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

Re: CVS commit: src/lib/libc/gen



    Date:        Sat, 9 Sep 2017 18:00:40 +0000
    From:        "Kamil Rytarowski" <kamil%netbsd.org@localhost>
    Message-ID:  <20170909180040.222C2FA98%cvs.NetBSD.org@localhost>

  | Not that devname(3) does not set errno on failure and document it as a bug.

Not everything in libc is expected to set errno on failure - in fact
most functions don't (though they may alter it) and shouldn't.

errno is (mostly) intended for sys calls - the values defined for it are
chosen with that (mostly) in mind - there are a few other functions that have
no other reasonable way to indicate errors, and so also use errno, but those
are decidedly in the minority.

devname() is in neither set, having it return errors through errno would be
a mistake.

kre



Home | Main Index | Thread Index | Old Index