tech-userlevel archive

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

Re: strtonum(3) from OpenBSD?



On Sat, 27 Jun 2009, David Holland wrote:

> On Fri, Jun 26, 2009 at 10:13:55PM +0100, Iain Hibbert wrote:
>  >>>> If it *can* set errno on success, which is the usual convention for
>  >>>> library functions,
>  >>>
>  >>> Nonsense, that is no usual convention. Please read errno(2) and see what
>  >>> it says (try the second paragraph in the DIAGNOSTICS section)
>  >>
>  >> Yes, precisely. Did you read your citation before posting it? (Or did
>  >> you misunderstand what I wrote because you assumed I didn't know what
>  >> I was talking about? :-p )
>  >
>  > Yes I read it, can you explain how you translate "Successful calls never
>  > set errno" into setting errno on success being the "usual convention"?
>
> Because "successful calls never set errno" is flatly wrong?

an exception does not make a convention.

also since you appear to be pedantic, errno(2) does mention that it
relates to "system calls" and puts(3) is not actually a system call.
Neither did it return an error indication, so the value of errno is moot.

> and that's certainly a reasonable interpretation, but I'm not yet
> convinced it's the only possible interpretation.

perhaps its best to follow the reasonable interpretation rather than
striving to find another.

iain


Home | Main Index | Thread Index | Old Index