From owner-freebsd-current Fri Jun 19 14:13:44 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA06442 for freebsd-current-outgoing; Fri, 19 Jun 1998 14:13:44 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from alpha.xerox.com (omega.Xerox.COM [13.1.64.95]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id OAA06408 for ; Fri, 19 Jun 1998 14:13:29 -0700 (PDT) (envelope-from fenner@parc.xerox.com) Received: from mango.parc.xerox.com ([13.1.102.232]) by alpha.xerox.com with SMTP id <40848(1)>; Fri, 19 Jun 1998 14:12:55 PDT Received: from mango.parc.xerox.com (localhost [127.0.0.1]) by mango.parc.xerox.com (8.8.8/8.8.8) with ESMTP id OAA16187; Fri, 19 Jun 1998 14:12:52 -0700 (PDT) (envelope-from fenner@mango.parc.xerox.com) Message-Id: <199806192112.OAA16187@mango.parc.xerox.com> To: Terry Lambert cc: fenner@parc.xerox.com (Bill Fenner), peter@netplex.com.au, current@FreeBSD.ORG Subject: Re: Bogus errno twiddling by lstat... In-reply-to: Your message of "Fri, 19 Jun 1998 11:51:20 PDT." <199806191851.LAA12551@usr06.primenet.com> Date: Fri, 19 Jun 1998 14:12:52 PDT From: Bill Fenner Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In message <199806191851.LAA12551@usr06.primenet.com>you write: >So the question becomes: "At what point can I expect a library routine >to behave like a system call"? When it's documented to do so. >I *thought* that there were some ISO/POSIX requirements that errno >not be touched in non-error cases ISO/ANSI C says that library functions may modify errno unless the standard says otherwise. The standard says otherwise for at least the math functions, which set errno to things like EDOM and ERANGE or leave it alone if no error occurred, and the calling sequence errno = 0; y = asin(x); if (errno == EDOM) { ... } is meant to work in that situation. However, normal library functions are explicitly allowed to modify errno even if no error occurs. Bill To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message