Date: Sun, 24 May 1998 18:01:18 +0300 (EEST) From: Ruslan Ermilov <ru@ucb.crimea.ua> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/6741: libc: printf() causes errno is set to 2 Message-ID: <199805241501.SAA09939@relay.ucb.crimea.ua>
index | next in thread | raw e-mail
>Number: 6741
>Category: bin
>Synopsis: libc: printf() causes errno is set to 2
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun May 24 08:00:01 PDT 1998
>Last-Modified:
>Originator: Ruslan Ermilov
>Organization:
United Commercial Bank
>Release: FreeBSD 2.2.6-STABLE i386
>Environment:
Fresh FreeBSD 2.2.6-STABLE,
Standard non-threaded C library.
>Description:
Using printf(), fprintf(stdout, ...) causes global
variable errno set to 2.
This is only true for standard non-threaded library.
Threaded library calls do not change errno.
>How-To-Repeat:
Try the following:
1. with standard, non-threada libc
2. with threaded library (libc_r)
3. change printf -> fprintf(stdout), then to fprintf(stderr).
#include <sys/errno.h>
#include <stdio.h>
void main(void)
{
printf("errno=%d\n", errno);
printf("errno=%d\n", errno);
}
>Fix:
Sorry, not available yet.
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805241501.SAA09939>
