strtonum(3) in FreeBSD?

Peter Jeremy PeterJeremy at optushome.com.au
Wed Apr 13 01:00:00 PDT 2005


On Tue, 2005-Apr-12 23:08:15 -0400, David Schultz wrote:
>It actually has a sensible way of distinguishing errors (it always
>sets errno, even if to 0),

I thought so initially but on closer reading, it does correctly preserve
errno on success.

> but this is unintuitive to anyone who
>is used to the broken POSIX way of doing it.

I would dispute the 'broken' adjective.  Having errno only affected by
errors means that you can issue a series of system calls and determine
that something failed - which may be enough.  POSIX inherited this
behaviour from Unix - which has always behaved this way AFAIK.  (That
said, there are a couple of library functions that change errno but
return success).

-- 
Peter Jeremy


More information about the freebsd-current mailing list