Re: a question about errno

2006-09-30 Thread Philip Guenther
On 9/30/06, Paul Stoeber <[EMAIL PROTECTED]> wrote: On Fri, 29 Sep 2006 05:30:35 + I wrote: > Should a userland program be allowed to depend on errno==0 on entry > to main()? (At least one in the tree does.) That claim is unfounded, because usr.bin/head/head.c (which I failed to mention; ap

Re: a question about errno

2006-09-30 Thread Paul Stoeber
On Fri, 29 Sep 2006 05:30:35 + I wrote: > Should a userland program be allowed to depend on errno==0 on entry > to main()? (At least one in the tree does.) That claim is unfounded, because usr.bin/head/head.c (which I failed to mention; apologies) is not an example. The question remains unse

Re: a question about errno

2006-09-29 Thread Paul Stoeber
On Fri, 29 Sep 2006 14:40:04 -0600 Theo de Raadt <[EMAIL PROTECTED]> wrote: > > On 9/28/06, Paul Stoeber <[EMAIL PROTECTED]> wrote: > > > Should a userland program be allowed to depend on errno==0 on entry > > > to main()? (At least one in the tree does.) > > > > checking errno is the wrong way

Re: a question about errno

2006-09-29 Thread Jack J. Woehr
On Sep 29, 2006, at 2:40 PM, Theo de Raadt wrote: > if nothing told you to look at it, don't look at it. Exactly. -- Jack J. Woehr Director of Development Absolute Performance, Inc. [EMAIL PROTECTED] 303-443-7000 ext. 527

Re: a question about errno

2006-09-29 Thread Theo de Raadt
> On 9/28/06, Paul Stoeber <[EMAIL PROTECTED]> wrote: > > Should a userland program be allowed to depend on errno==0 on entry > > to main()? (At least one in the tree does.) > > checking errno is the wrong way to ascertain whether a function had a > problem, so this shouldn't be a problem for a w

Re: a question about errno

2006-09-29 Thread Ted Unangst
On 9/28/06, Paul Stoeber <[EMAIL PROTECTED]> wrote: Should a userland program be allowed to depend on errno==0 on entry to main()? (At least one in the tree does.) checking errno is the wrong way to ascertain whether a function had a problem, so this shouldn't be a problem for a well written p

Re: a question about errno

2006-09-28 Thread Pawel S. Veselov
Hi, Paul Stoeber wrote: > Should a userland program be allowed to depend on errno==0 on entry > to main()? (At least one in the tree does.) > > I see no place in the C library that explicitly ensures this, and > it might be false if the user runs the program under LD_PRELOAD > tricks. > I thin

a question about errno

2006-09-28 Thread Paul Stoeber
Should a userland program be allowed to depend on errno==0 on entry to main()? (At least one in the tree does.) I see no place in the C library that explicitly ensures this, and it might be false if the user runs the program under LD_PRELOAD tricks.