From abc@ai1.anchorage.mtaonline.net  Sun Sep 19 00:30:57 2004
Return-Path: <abc@ai1.anchorage.mtaonline.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 53B8316A4D2
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Sep 2004 00:30:57 +0000 (GMT)
Received: from ai1.anchorage.mtaonline.net (ai1.anchorage.mtaonline.net [12.21.201.252])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C2E9C43D45
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 19 Sep 2004 00:30:53 +0000 (GMT)
	(envelope-from abc@ai1.anchorage.mtaonline.net)
Received: from en26.ai1.anchorage.mtaonline.net (root@faxsrvr [192.168.0.26])
	by ai1.anchorage.mtaonline.net (8.12.9p2/8.12.9) with ESMTP id i8J0Ujmp038547
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 18 Sep 2004 16:30:46 -0800 (AKDT)
	(envelope-from abc@ai1.anchorage.mtaonline.net)
Received: (from abc@localhost)
	by en26.ai1.anchorage.mtaonline.net (8.12.11/8.12.11) id i8J0VMJg065483;
	Sun, 19 Sep 2004 00:31:22 GMT
	(envelope-from abc@ai1.anchorage.mtaonline.net)
Message-Id: <200409190031.i8J0VMJg065483@en26.ai1.anchorage.mtaonline.net>
Date: Sun, 19 Sep 2004 00:31:22 GMT
From: abc@ai1.anchorage.mtaonline.net
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: isatty(3)+errno undocumented

>Number:         71893
>Category:       i386
>Synopsis:       isatty(3)+errno undocumented
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-i386
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 19 00:40:23 GMT 2004
>Closed-Date:    Mon Sep 27 13:25:18 GMT 2004
>Last-Modified:  Mon Sep 27 13:25:18 GMT 2004
>Originator:     Joe Public
>Release:        i386 FreeBSD 4.10-RELEASE
>Organization:
no org
>Environment:
FreeBSD ai1.anchorage.mtaonline.net 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Mon Jul  5 18:00:22 AKDT 2004     root@:/usr/src/sys/compile/MYKERN  i386

>Description:
isatty(3) sets errno=25 on failure - undocumented!
>How-To-Repeat:
test isatty() on a device that is not a tty, check errno.
>Fix:
either it shouldn't set errno, or it should say so in the
                manpage.
>Release-Note:
>Audit-Trail:

From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=)
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: i386/71893
Date: Mon, 27 Sep 2004 15:14:17 +0200

 isatty(3) is a library function, not a system call.  Its return value
 is not a success / failure indication like that of system calls, but a
 yes / no answer.  It is allowed, but not required, to set errno when
 it determines that the specified file descriptor does not correspond
 to a terminal device.
 
 In more general terms, you can not make any assumptions about the
 value of errno except immediately after a failed system call; its
 value is undefined in all other circumstances.  System calls that do
 not fail leave it untouched, but library functions may or may not
 modify it, and its value may or may not reflect the actual error
 experienced by the library function.
 
 For more details on errno and isatty(3), refer to the Open Group Base
 Specification.
 
 DES
 --=20
 Dag-Erling Sm=F8rgrav - des@des.no
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Mon Sep 27 13:25:17 GMT 2004 
State-Changed-Why:  
Pilot error. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=71893 
>Unformatted:
