From owner-freebsd-hackers Fri Apr 2 16:44: 4 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from detlev.UUCP (tex-88.camalott.com [208.229.74.88]) by hub.freebsd.org (Postfix) with ESMTP id DB36214E1A for ; Fri, 2 Apr 1999 16:43:59 -0800 (PST) (envelope-from joelh@gnu.org) Received: (from joelh@localhost) by detlev.UUCP (8.9.3/8.9.1) id SAA47706; Fri, 2 Apr 1999 18:43:12 -0600 (CST) (envelope-from joelh) To: Matthew Dillon Cc: Graham Wheeler , Ladavac Marino , hackers@FreeBSD.ORG Subject: Re: select() on UDP socket returns ECONNREFUSED References: <97A8CA5BF490D211A94F0000F6C2E55D097583@s-lmh-wi-900.corpnet.at> <37020CE5.477F888D@cdsec.com> <199903311717.JAA49728@apollo.backplane.com> From: Joel Ray Holveck Date: 02 Apr 1999 18:43:12 -0600 In-Reply-To: Matthew Dillon's message of "Wed, 31 Mar 1999 09:17:07 -0800 (PST)" Message-ID: <86yakao7of.fsf@detlev.UUCP> Lines: 20 X-Mailer: Gnus v5.5/Emacs 20.3 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > People should remember that system calls do *NOT* clear errno. If > errno is set from a previous error, it stays set even if the system > call succeeds. > Also, system and library routines do not reliably overwrite errno if > errno is non-zero prior to making the call. If you intend to check > errno after a library or system call returns < 0, you have clear > errno prior to making the call or you may get stale data. I also seem to recall that some C library routines will set errno even if they succeed. FreeBSD's malloc used to do this under normal conditions. Happy hacking, joelh -- Joel Ray Holveck - joelh@gnu.org Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message