Skip site navigation (1)Skip section navigation (2)
Date:      02 Apr 1999 18:43:12 -0600
From:      Joel Ray Holveck <joelh@gnu.org>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Graham Wheeler <gram@cdsec.com>, Ladavac Marino <mladavac@metropolitan.at>, hackers@FreeBSD.ORG
Subject:   Re: select() on UDP socket returns ECONNREFUSED
Message-ID:  <86yakao7of.fsf@detlev.UUCP>
In-Reply-To: Matthew Dillon's message of "Wed, 31 Mar 1999 09:17:07 -0800 (PST)"
References:  <97A8CA5BF490D211A94F0000F6C2E55D097583@s-lmh-wi-900.corpnet.at> <37020CE5.477F888D@cdsec.com> <199903311717.JAA49728@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>  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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86yakao7of.fsf>