From owner-freebsd-bugs Sun May 24 23:15:16 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA28298 for freebsd-bugs-outgoing; Sun, 24 May 1998 23:15:16 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA28286 for ; Sun, 24 May 1998 23:15:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id XAA29526; Sun, 24 May 1998 23:10:01 -0700 (PDT) Date: Sun, 24 May 1998 23:10:01 -0700 (PDT) Message-Id: <199805250610.XAA29526@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.ORG From: Ruslan Ermilov Subject: Re: bin/6741: libc: printf() causes errno is set to 2 Reply-To: Ruslan Ermilov Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/6741; it has been noted by GNATS. From: Ruslan Ermilov To: Stephen McKay Cc: freebsd-gnats-submit@freebsd.org Subject: Re: bin/6741: libc: printf() causes errno is set to 2 Date: Mon, 25 May 1998 09:07:38 +0300 On Mon, May 25, 1998 at 03:40:09PM +1000, Stephen McKay wrote: > On Sunday, 24th May 1998, Ruslan Ermilov wrote: > > >>Severity: critical > >>Priority: high > > Come now! It can't be as bad as all that! > > > Using printf(), fprintf(stdout, ...) causes global > > variable errno set to 2. > > Library routines can write garbage in errno any time they want because > errno should only be checked for system calls and designated library > routines and only when the call returns an error indication. > > There is no problem here. You just have to expect errno to change > for no good reason. > > In case you are curious, the errno=2 comes from malloc() checking for > the existance of /etc/malloc.conf. Why then it is not set to 2 when I use fprintf(stderr, ...) or compile with libc_r? > > Stephen. -- Ruslan Ermilov System Administrator ru@ucb.crimea.ua United Commercial Bank +380-652-247647 Simferopol, Crimea 2426679 ICQ Network, UIN To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message