True enough. That's the best advice. However, your original post indicated
an expectation on your part that errno would be somehow automatically reset
to 0 before a system call, which is definitely *not* the case. You have to
clear it - the kernel does not do it for you.
pete
> -----Original Message-----
> From: FengYue [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 23, 2000 11:08 AM
> To: Bohne, Peter
> Cc: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
> Subject: RE: libc_r/_read(), should the errno be reset to 0?
>
>
>
> Wait, that's not going to do anything, the errno is set inside the
> _thread_sys_read(). But I agree with Andrew, why bother to check
> errno if read() returns no error.
>
> On Fri, 23 Jun 2000, Bohne, Peter wrote:
>
> > This means that *you* should set errno to 0 just before you
> do the read
> > call. At this point, you no longer care what it had been before.
> > --
> > pete
> >
> > ====== pbohne at hboc dot com
> > Peter Bohne -- McKessonHBOC -- Louisville, CO
> > Work: 303-926-2218 -- Cell: 303-817-8312 -- Home Ofc: 970-586-9031
> > ====== "Very funny, Scottie. Now beam down my clothes!"
> >
> >
> >
> > > -----Original Message-----
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, June 23, 2000 3:02 AM
> > > To: FengYue
> > > Cc: [EMAIL PROTECTED]
> > > Subject: Re: libc_r/_read(), should the errno be reset to 0?
> > >
> > >
> > >
> > >
> > > On Fri, 23 Jun 2000, FengYue wrote:
> > >
> > > > My question is, shouldn't it be reset to zero?
> > >
> > > From intro(2):
> > >
> > > Successful calls never set errno; once set, it remains until
> > > another error
> > > occurs. It should only be examined after an error.
> > >
> > > Andrew
> > >
> > >
> > >
> > > To Unsubscribe: send mail to [EMAIL PROTECTED]
> > > with "unsubscribe freebsd-hackers" in the body of the message
> > >
>
>
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message