From owner-freebsd-bugs Mon May 25 04:50:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA02882 for freebsd-bugs-outgoing; Mon, 25 May 1998 04:50:20 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from ifi.uio.no (0@ifi.uio.no [129.240.64.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA02873 for ; Mon, 25 May 1998 04:50:16 -0700 (PDT) (envelope-from dag-erli@ifi.uio.no) Received: from ringhorni.ifi.uio.no (2602@ringhorni.ifi.uio.no [129.240.64.75]) by ifi.uio.no (8.8.8/8.8.7/ifi0.2) with ESMTP id NAA12216; Mon, 25 May 1998 13:49:57 +0200 (MET DST) Received: (from dag-erli@localhost) by ringhorni.ifi.uio.no ; Mon, 25 May 1998 13:49:57 +0200 (MET DST) Mime-Version: 1.0 To: Ruslan Ermilov Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/6741: libc: printf() causes errno is set to 2 References: <199805250610.XAA29526@freefall.freebsd.org> Organization: University of Oslo, Department of Informatics X-url: http://www.stud.ifi.uio.no/~dag-erli/ X-Stop-Spam: http://www.cauce.org From: dag-erli@ifi.uio.no (Dag-Erling Coidan =?iso-8859-1?Q?Sm=F8rgrav?= ) Date: 25 May 1998 13:49:56 +0200 In-Reply-To: Ruslan Ermilov's message of "Sun, 24 May 1998 23:10:01 -0700 (PDT)" Message-ID: Lines: 14 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Ruslan Ermilov writes: > > 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? What the h* does it matter? The point is that the value of errno is not to be relied upon *except* in the *specific* case of a system call or library function that returns an error code which tells you that errno was set to a meaningful value. No such guarantee is given for the printf family. Read 'man 2 intro' if you still don't get it. -- Noone else has a .sig like this one. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message