From owner-freebsd-hackers Fri Jun 23 9:57:47 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from bluerose.windmoon.nu (c255152-a.plstn1.sfba.home.com [24.176.132.48]) by hub.freebsd.org (Postfix) with ESMTP id DD62D37B721 for ; Fri, 23 Jun 2000 09:57:43 -0700 (PDT) (envelope-from fengyue@bluerose.windmoon.nu) Received: from localhost (fengyue@localhost) by bluerose.windmoon.nu (Windmoon-Patched/8.9.3/8.9.3) with ESMTP id KAA36741; Fri, 23 Jun 2000 10:07:38 -0700 (PDT) Date: Fri, 23 Jun 2000 10:07:37 -0700 (PDT) From: FengYue To: "Bohne, Peter" Cc: "'andrew@ugh.net.au'" , hackers@FreeBSD.ORG Subject: RE: libc_r/_read(), should the errno be reset to 0? In-Reply-To: <35BEC7ED0A15D21199F000805F6F6D6A01CB00E0@bldexc01ntms.clinicom.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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: andrew@ugh.net.au [mailto:andrew@ugh.net.au] > > Sent: Friday, June 23, 2000 3:02 AM > > To: FengYue > > Cc: hackers@FreeBSD.ORG > > 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 majordomo@FreeBSD.org > > with "unsubscribe freebsd-hackers" in the body of the message > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message