Maxime Henrion wrote:
> Terry Lambert wrote:
> > > Wrong, counter-example: strtol().
> >
> > Wrong; the standard specifies that the errno shall only be
> > checked when the return value is -1. The exception in the
> > strtol() case is only for presetting errno to 0 before you
> > make the call, an
> Wrong, strtol() can set errno in two cases, when the value is outside
> the range of representable values or when no conversion could be
> performed.
well 'natch. it's trying to do math.h style hacks and overloads errno.
iirc those sorts of things stem from V6/V7 on the PDP/11 when you
may hav
Terry Lambert wrote:
> Stefan Farfeleder wrote:
> > On Mon, Nov 24, 2003 at 07:05:02PM +0100, boyd, rounin wrote:
> > > From: "Jacques A. Vidrine" <[EMAIL PROTECTED]>
> > > > The application is broken. You must only check errno if you get an
> > > > error indication from the library call.
> > >
>
Stefan Farfeleder wrote:
> On Mon, Nov 24, 2003 at 07:05:02PM +0100, boyd, rounin wrote:
> > From: "Jacques A. Vidrine" <[EMAIL PROTECTED]>
> > > The application is broken. You must only check errno if you get an
> > > error indication from the library call.
> >
> > errno is only meaningful after
On Tue, Nov 25, 2003 at 04:46:24PM +0200, Enache Adrian wrote:
> On Mon, Nov 24, 2003 a.d., Jacques A. Vidrine wrote:
> > The application is broken. You must only check errno if you get an
> > error indication from the library call.
>
> Sorry, but I don't see your point. I know when to check for
On Tue, 25 Nov 2003, Enache Adrian wrote:
> On Mon, Nov 24, 2003 a.d., Jacques A. Vidrine wrote:
> > The application is broken. You must only check errno if you get an
> > error indication from the library call.
>
> Sorry, but I don't see your point. I know when to check for errno.
> If you took
On Mon, Nov 24, 2003 a.d., Jacques A. Vidrine wrote:
> The application is broken. You must only check errno if you get an
> error indication from the library call.
Sorry, but I don't see your point. I know when to check for errno.
If you took the little illustrating program for a real life exampl
In message <[EMAIL PROTECTED]>, "boyd, rounin" write
s:
>From: "Stefan Farfeleder" <[EMAIL PROTECTED]>
>> > errno is meaningful for syscalls after an error (the original
>> > message). The fact that other functions also dink with errno is not
>> > relevant to that statement.
>>
>> I read boyd's s
From: "Stefan Farfeleder" <[EMAIL PROTECTED]>
> > errno is meaningful for syscalls after an error (the original
> > message). The fact that other functions also dink with errno is not
> > relevant to that statement.
>
> I read boyd's statement as a contradiction to Jacques' one (only after
> sysc
On Mon, Nov 24, 2003 at 03:33:49PM -0700, M. Warner Losh wrote:
> In message: <[EMAIL PROTECTED]>
> Stefan Farfeleder <[EMAIL PROTECTED]> writes:
> : On Mon, Nov 24, 2003 at 07:05:02PM +0100, boyd, rounin wrote:
> : > From: "Jacques A. Vidrine" <[EMAIL PROTECTED]>
> : > > The applicatio
In message: <[EMAIL PROTECTED]>
Stefan Farfeleder <[EMAIL PROTECTED]> writes:
: On Mon, Nov 24, 2003 at 07:05:02PM +0100, boyd, rounin wrote:
: > From: "Jacques A. Vidrine" <[EMAIL PROTECTED]>
: > > The application is broken. You must only check errno if you get an
: > > error indicati
On Mon, Nov 24, 2003 at 07:05:02PM +0100, boyd, rounin wrote:
> From: "Jacques A. Vidrine" <[EMAIL PROTECTED]>
> > The application is broken. You must only check errno if you get an
> > error indication from the library call.
>
> errno is only meaningful after a syscall error.
Wrong, counter-exa
From: "Jacques A. Vidrine" <[EMAIL PROTECTED]>
> The application is broken. You must only check errno if you get an
> error indication from the library call.
errno is only meaningful after a syscall error.
it is also well known that stdio uses isatty(3) (or equivelant) that may
set errno to ENOT
On Sun, Nov 23, 2003 at 04:14:08PM +0200, Enache Adrian wrote:
> $ cc close.c -o close && ./close
> 0
> 0
>
> $ cc close.c -lc_r -o close && ./close
> 0
> 25
>
> $ cat close.c
> #include
> main()
> {
> int fd = open("/dev/null", 1);
> printf("%d\n", errno);
> close(fd);
>
$ cc close.c -o close && ./close
0
0
$ cc close.c -lc_r -o close && ./close
0
25
$ cat close.c
#include
main()
{
int fd = open("/dev/null", 1);
printf("%d\n", errno);
close(fd);
printf("%d\n", errno);
}
This confuses rather badly applications which assume errno i
15 matches
Mail list logo