From owner-freebsd-standards@FreeBSD.ORG Mon Jan 22 11:08:50 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.org Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F13916A667 for ; Mon, 22 Jan 2007 11:08:50 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8E313C467 for ; Mon, 22 Jan 2007 11:08:50 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0MB8oMb037086 for ; Mon, 22 Jan 2007 11:08:50 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0MB8nIv037082 for freebsd-standards@FreeBSD.org; Mon, 22 Jan 2007 11:08:49 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 22 Jan 2007 11:08:49 GMT Message-Id: <200701221108.l0MB8nIv037082@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: linimon set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 11:08:50 -0000 Current FreeBSD problem reports Critical problems Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/25542 standards /bin/sh: null char in quoted string o kern/46239 standards posix semaphore implementation errors o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/82654 standards C99 long double math functions are missing o stand/94729 standards fcntl() throws undocumented ENOTTY o stand/104422 standards TCP-MD5 key length limits 6 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o bin/21519 standards sys/dir.h should be deprecated some more o bin/24390 standards Replacing old dir-symlinks when using /bin/ln s stand/24590 standards timezone function not compatible witn Single Unix Spec s kern/28260 standards UIO_MAXIOV needs to be made public s stand/36076 standards Implementation of POSIX fuser command o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings p stand/41576 standards POSIX compliance of ln(1) o stand/44425 standards getcwd() succeeds even if current dir has perm 000. o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/54833 standards [pcvt] more pcvt deficits o stand/54839 standards [pcvt] pcvt deficits p stand/55112 standards glob.h, glob_t's gl_pathc should be "size_t", not "int o stand/56476 standards cd9660 unicode support simple hack o stand/58676 standards grantpt(3) alters storage used by ptsname(3) s stand/62858 standards malloc(0) not C99 compliant s kern/64875 standards [libc] [patch] [feature request] add a system call: fd o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- o stand/66531 standards _gettemp uses a far smaller set of filenames than docu o stand/70813 standards [PATCH] ls(1) not Posix compliant o stand/72006 standards floating point formating in non-C locales o stand/79056 standards regex(3) regression tests a stand/80293 standards sysconf() does not support well-defined unistd values o stand/81287 standards [PATCH]: fingerd(8) might send a line not ending in CR o stand/83845 standards [libm] [patch] add log2() and log2f() support for libm o stand/85080 standards output of long double subnormals (with printf) is wron o stand/92360 standards [headers] [patch] Missing TAB3 in kernel headers o stand/92362 standards [headers] [patch] Missing SIGPOLL in kernel headers o kern/93705 standards [headers] [patch] ENODATA and EGREGIOUS (for glibc com o stand/96016 standards clock_getres et al should be in o stand/96236 standards [PATCH] [POSIX] sed.1 incorrectly describes a function p stand/99517 standards Missing SIGRTMIN and SIGRTMAX signals o stand/99960 standards [Patch] [make] Add -p flag o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/104743 standards Wrong values for _POSIX_ minimal limits o stand/104841 standards C99 long double square root. o stand/107561 standards Missing SUS function tcgetsid() 36 problems total. From owner-freebsd-standards@FreeBSD.ORG Mon Jan 22 21:55:33 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0BE3C16A400 for ; Mon, 22 Jan 2007 21:55:33 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from shark.2a.pl (shark.2a.pl [195.117.102.3]) by mx1.freebsd.org (Postfix) with ESMTP id 8AF9813C44B for ; Mon, 22 Jan 2007 21:55:32 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from localhost (av.2a.pl [10.0.0.99]) by shark.2a.pl (Postfix) with ESMTP id 3A914B24E1 for ; Mon, 22 Jan 2007 22:32:04 +0100 (CET) Received: from shark.2a.pl ([10.0.0.3]) by localhost (av.2a.pl [10.0.0.99]) (amavisd-new, port 10024) with ESMTP id 81835-02 for ; Mon, 22 Jan 2007 22:30:42 +0100 (CET) Received: from POCZTOWIEC (2a-gts [217.153.29.142]) by shark.2a.pl (Postfix) with ESMTP id C3FD2B24C9 for ; Mon, 22 Jan 2007 22:31:49 +0100 (CET) From: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= To: Date: Mon, 22 Jan 2007 22:31:50 +0100 Message-ID: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Acc+bLn/h6B+492BSSSe+yiphoIXhw== X-Virus-Scanned: amavisd-new at 2a.pl Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 21:55:33 -0000 The fprintf manual page says it is ANSI = C compatible and it returns the number of characters printed. The latter is correct: I get printf("abcd") =3D=3D 4 even under = >/dev/full. (uname is Interix on x86 ver. 3.5) However, the former is not: according to the ANSI C standard , = =A77.19.6.1/14, printf should return a negative value in this case. I would like to make it a problem report so I send it for public review first. Chris From owner-freebsd-standards@FreeBSD.ORG Mon Jan 22 22:46:50 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C93516A400 for ; Mon, 22 Jan 2007 22:46:50 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (khavrinen.csail.mit.edu [128.30.28.20]) by mx1.freebsd.org (Postfix) with ESMTP id 01D6213C469 for ; Mon, 22 Jan 2007 22:46:49 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (localhost.csail.mit.edu [127.0.0.1]) by khavrinen.csail.mit.edu (8.13.6/8.13.6) with ESMTP id l0MMkkXY032124 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.csail.mit.edu issuer=Client+20CA); Mon, 22 Jan 2007 17:46:46 -0500 (EST) (envelope-from wollman@khavrinen.csail.mit.edu) Received: (from wollman@localhost) by khavrinen.csail.mit.edu (8.13.6/8.13.6/Submit) id l0MMkk91032121; Mon, 22 Jan 2007 17:46:46 -0500 (EST) (envelope-from wollman) From: Garrett Wollman MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <17845.16086.313698.205301@khavrinen.csail.mit.edu> Date: Mon, 22 Jan 2007 17:46:46 -0500 To: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= In-Reply-To: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> References: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> X-Mailer: VM 7.17 under 21.4 (patch 20) "Double Solitaire" XEmacs Lucid X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-3.0 (khavrinen.csail.mit.edu [127.0.0.1]); Mon, 22 Jan 2007 17:46:46 -0500 (EST) Cc: freebsd-standards@freebsd.org Subject: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Jan 2007 22:46:50 -0000 < said: > The latter is correct: I get printf("abcd") =3D=3D 4 even under >/dev= /full. > (uname is Interix on x86 ver. 3.5) The FreeBSD C library is only supported as an integral part of the FreeBSD operating system. > However, the former is not: according to the ANSI C standard > , =A77.19= .6.1/14, > printf should return a negative value in this case. The standard makes no such requirement; neither an encoding error nor an I/O error can ever be encountered in this example. The error condition will not be detected until the stream's buffer is flushed, as by fflush() or fclose(). -GAWollman From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 07:59:21 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 47E1D16A402 for ; Tue, 23 Jan 2007 07:59:21 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id A9C0C13C474 for ; Tue, 23 Jan 2007 07:59:20 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (chobmt@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l0N7xCBP002572; Tue, 23 Jan 2007 08:59:18 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l0N7xCdg002571; Tue, 23 Jan 2007 08:59:12 +0100 (CET) (envelope-from olli) Date: Tue, 23 Jan 2007 08:59:12 +0100 (CET) Message-Id: <200701230759.l0N7xCdg002571@lurza.secnetix.de> From: Oliver Fromme To: freebsd-standards@FreeBSD.ORG, giecrilj@stegny.2a.pl In-Reply-To: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> X-Newsgroups: list.freebsd-standards User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 23 Jan 2007 08:59:18 +0100 (CET) Cc: Subject: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-standards@FreeBSD.ORG, giecrilj@stegny.2a.pl List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 07:59:21 -0000 K?i?tof ?elechovski wrote: > The > h=FreeBSD+7-current&format=html> fprintf manual page says it is ANSI C > compatible and it returns the number of characters printed. > > The latter is correct: I get printf("abcd") == 4 even under >/dev/full. > (uname is Interix on x86 ver. 3.5) Because the printf() function doesn't write to /dev/full directly. It writes to a stdio buffer associated with the standard output stream. > However, the former is not: according to the ANSI C standard > , §7.19.6.1/14, > printf should return a negative value in this case. POSIX/SUSv4 (which is aligned with the ISO C standard) says: "If an output error was encountered, these functions shall return a negative value." FreeBSD is compliant with that specification. Note the use of the words "if ... encountered": If the file system is full, that condition is encountered _only_ the next time the stdio library flushes its buffer (which can be as late as the close() call). It is _not_ encountered by the fprintf() function itself, so it is perferctly legal that it does not return a negative value. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Emacs ist für mich kein Editor. Für mich ist das genau das gleiche, als wenn ich nach einem Fahrrad (für die Sonntagbrötchen) frage und einen pangalaktischen Raumkreuzer mit 10 km Gesamtlänge bekomme. Ich weiß nicht, was ich damit soll." -- Frank Klemm, de.comp.os.unix.discussion From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 07:59:40 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B17F216A400 for ; Tue, 23 Jan 2007 07:59:40 +0000 (UTC) (envelope-from "") Received: from shelbyville.concord.org (shelbyville.concord.org [63.138.152.75]) by mx1.freebsd.org (Postfix) with ESMTP id 5931E13C4D1 for ; Tue, 23 Jan 2007 07:59:40 +0000 (UTC) (envelope-from "") Received: from fc.concord.org (fc.concord.org [63.138.152.60]) by shelbyville.concord.org (8.13.8/8.13.8) with ESMTP id l0N7xdRX004758 for ; Tue, 23 Jan 2007 02:59:39 -0500 Message-id: Date: Tue, 23 Jan 2007 02:59:21 -0500 X-Mailer: FirstClass 8.2 (build 8.094) X-FC-Icon-ID: 13401 X-FC-SERVER-TZ: 181273068 X-FC-MachineGenerated: true To: freebsd-standards@freebsd.org From: Gateway@shelbyville.concord.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: NDN: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 07:59:40 -0000 Sorry. Your message could not be delivered to: library,Concord Consortium (The name was not found at the remote site. Check that the name has been entered correctly.) From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 10:29:27 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7EA0416A40F for ; Tue, 23 Jan 2007 10:29:27 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from shark.2a.pl (shark.2a.pl [195.117.102.3]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE1E13C4C6 for ; Tue, 23 Jan 2007 10:29:24 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from localhost (av.2a.pl [10.0.0.99]) by shark.2a.pl (Postfix) with ESMTP id AAF48B2526; Tue, 23 Jan 2007 11:29:22 +0100 (CET) Received: from shark.2a.pl ([10.0.0.3]) by localhost (av.2a.pl [10.0.0.99]) (amavisd-new, port 10024) with ESMTP id 90711-06; Tue, 23 Jan 2007 11:28:02 +0100 (CET) Received: from POCZTOWIEC (2a-gts [217.153.29.142]) by shark.2a.pl (Postfix) with ESMTP id AB0CBB24F0; Tue, 23 Jan 2007 11:29:11 +0100 (CET) From: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= To: , References: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> <200701230759.l0N7xCdg002571@lurza.secnetix.de> Date: Tue, 23 Jan 2007 11:29:13 +0100 Message-ID: <000401c73ed9$540afca0$1a01080a@POCZTOWIEC> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 In-Reply-To: <200701230759.l0N7xCdg002571@lurza.secnetix.de> Thread-Index: Acc+xre2cLUo/zLPTgyaxDCSk9FdTQABbDkg X-Virus-Scanned: amavisd-new at 2a.pl Cc: Subject: RE: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 10:29:27 -0000 Oh I see. =20 Indeed, the documentation was fixed to explain this in FreeBSD=A05.2=20 - I must have overlooked that. =20 My documentation is apparently taken from FreeBSD=A04.4. =20 Error return value is not documented here. I have run the code in a loop and the return value is periodically -1. =20 Interestingly enough,=20 although the stream error indicator is persistent,=20 it is not taken into account to prevent data corruption as in C++ = streams. =20 The reason may be that POSIX streams must set errno on failure=20 (this is *not* required by the ANSI standard) but there is no errno value to indicate that the error condition is set=20 (except EBADF -=20 but the POSIX standard should be modified to allow this extension,=20 since at present it only means "Bad file descriptor"). Thanks for your time Chris -----Original Message----- From: Oliver Fromme [mailto:olli@lurza.secnetix.de]=20 Sent: Tuesday, January 23, 2007 8:59 AM To: freebsd-standards@FreeBSD.ORG; giecrilj@stegny.2a.pl Subject: Re: return value of fprintf K?i?tof ?elechovski wrote: > The > h=3DFreeBSD+7-current&format=3Dhtml> fprintf manual page says it is = ANSI C > compatible and it returns the number of characters printed. >=20 > The latter is correct: I get printf("abcd") =3D=3D 4 even under = >/dev/full. > (uname is Interix on x86 ver. 3.5) Because the printf() function doesn't write to /dev/full directly. It writes to a stdio buffer associated with the standard output stream. > However, the former is not: according to the ANSI C standard > , =A77.19.6.1/14, > printf should return a negative value in this case. POSIX/SUSv4 (which is aligned with the ISO C standard) says: "If an output error was encountered, these functions shall return a negative value." FreeBSD is compliant with that specification. Note the use of the words "if ... encountered": If the file system is full, that condition is encountered _only_ the next time the stdio library flushes its buffer (which can be as late as the close() call). It is _not_ encountered by the fprintf() function itself, so it is perferctly legal that it does not return a negative value. Best regards Oliver --=20 Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "Emacs ist f=FCr mich kein Editor. F=FCr mich ist das genau das gleiche, = als wenn ich nach einem Fahrrad (f=FCr die Sonntagbr=F6tchen) frage und = einen pangalaktischen Raumkreuzer mit 10 km Gesamtl=E4nge bekomme. Ich wei=DF = nicht, was ich damit soll." -- Frank Klemm, de.comp.os.unix.discussion From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 10:31:57 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6186516A402 for ; Tue, 23 Jan 2007 10:31:57 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 20DC613C44B for ; Tue, 23 Jan 2007 10:31:57 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id 22AB12083; Tue, 23 Jan 2007 11:05:50 +0100 (CET) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on tim.des.no Received: from dwp.des.no (des.no [80.203.243.180]) by tim.des.no (Postfix) with ESMTP id 122AF2082; Tue, 23 Jan 2007 11:05:50 +0100 (CET) Received: by dwp.des.no (Postfix, from userid 1001) id 23333B870; Tue, 23 Jan 2007 11:07:15 +0100 (CET) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: =?iso-8859-2?Q?K=F8i=B9tof_=AEelechovski?= References: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> Date: Tue, 23 Jan 2007 11:07:15 +0100 In-Reply-To: <005301c73e6c$ba6ffd00$1a01080a@POCZTOWIEC> (=?iso-8859-2?Q?K?= =?iso-8859-2?Q?=F8i=B9tof=09=AEelechovski's?= message of "Mon, 22 Jan 2007 22:31:50 +0100") Message-ID: <86ireyukdo.fsf@dwp.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-standards@freebsd.org Subject: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 10:31:57 -0000 K=C5=99i=C5=A1tof =C5=BDelechovski writes: > (uname is Interix on x86 ver. 3.5) Issues with Microsoft products should be reported to Microsoft, not to the FreeBSD project. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 13:40:08 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E977416A401 for ; Tue, 23 Jan 2007 13:40:08 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 4BDF313C4C9 for ; Tue, 23 Jan 2007 13:40:07 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (bufwdi@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l0NDdv91046533; Tue, 23 Jan 2007 14:40:02 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l0NDdvF3046532; Tue, 23 Jan 2007 14:39:57 +0100 (CET) (envelope-from olli) Date: Tue, 23 Jan 2007 14:39:57 +0100 (CET) Message-Id: <200701231339.l0NDdvF3046532@lurza.secnetix.de> From: Oliver Fromme To: freebsd-standards@FreeBSD.ORG, giecrilj@stegny.2a.pl In-Reply-To: <000401c73ed9$540afca0$1a01080a@POCZTOWIEC> X-Newsgroups: list.freebsd-standards User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 23 Jan 2007 14:40:02 +0100 (CET) Cc: Subject: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-standards@FreeBSD.ORG, giecrilj@stegny.2a.pl List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 13:40:09 -0000 K?i?tof ?elechovski wrote: > I have run the code in a loop and the return value is periodically -1. That's to be expected. Once in a while, the fprintf() will fill the stdio buffer, causing it to be flushed. If an error occurs during the flushing, it will be noticed and returned. That's the "if an error was encountered" case from the standard's wording. ;-) Basically, you can think of fprintf() calling fputc() repeatedly, which simply adds characters to the stdio buffer until it is full. If it's full, it gets flushed, and only then an actual I/O operation occurs, and only then an actual I/O error can occur. > Interestingly enough, > although the stream error indicator is persistent, > it is not taken into account to prevent data corruption as in C++ streams. Can you describe that in more detail, please? Maybe give a code example? I don't see how data corruption could occur if your code is correct. > The reason may be that POSIX streams must set errno on failure > (this is *not* required by the ANSI standard) > but there is no errno value to indicate that the error condition is set > (except EBADF - > but the POSIX standard should be modified to allow this extension, > since at present it only means "Bad file descriptor"). I'm sorry I don't understand what you mean. When the error indicator is set, errno is always set to an appropriate value (e.g. ENOSPC if you run out of space on the file system). If you have an error condition on s stream, but you ignore it and continue to perform I/O on the stream without removing the cause of the problem, you're on your own. You'll get undefined behaviour. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. (On the statement print "42 monkeys" + "1 snake":) By the way, both perl and Python get this wrong. Perl gives 43 and Python gives "42 monkeys1 snake", when the answer is clearly "41 monkeys and 1 fat snake". -- Jim Fulton From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 13:40:20 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7839616A407 for ; Tue, 23 Jan 2007 13:40:20 +0000 (UTC) (envelope-from "") Received: from shelbyville.concord.org (shelbyville.concord.org [63.138.152.75]) by mx1.freebsd.org (Postfix) with ESMTP id 623CE13C448 for ; Tue, 23 Jan 2007 13:40:19 +0000 (UTC) (envelope-from "") Received: from fc.concord.org (fc.concord.org [63.138.152.60]) by shelbyville.concord.org (8.13.8/8.13.8) with ESMTP id l0NDeH28030864 for ; Tue, 23 Jan 2007 08:40:17 -0500 Message-id: Date: Tue, 23 Jan 2007 08:39:59 -0500 X-Mailer: FirstClass 8.2 (build 8.094) X-FC-Icon-ID: 13401 X-FC-SERVER-TZ: 181273068 X-FC-MachineGenerated: true To: freebsd-standards@freebsd.org From: Gateway@shelbyville.concord.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: NDN: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 13:40:20 -0000 Sorry. Your message could not be delivered to: library,Concord Consortium (The name was not found at the remote site. Check that the name has been entered correctly.) From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 14:47:30 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE3C516A403 for ; Tue, 23 Jan 2007 14:47:30 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from shark.2a.pl (shark.2a.pl [195.117.102.3]) by mx1.freebsd.org (Postfix) with ESMTP id 9A57313C46A for ; Tue, 23 Jan 2007 14:47:28 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from localhost (av.2a.pl [10.0.0.99]) by shark.2a.pl (Postfix) with ESMTP id 2D303B2572; Tue, 23 Jan 2007 15:47:24 +0100 (CET) Received: from shark.2a.pl ([10.0.0.3]) by localhost (av.2a.pl [10.0.0.99]) (amavisd-new, port 10024) with ESMTP id 95277-04; Tue, 23 Jan 2007 15:46:00 +0100 (CET) Received: from POCZTOWIEC (2a-gts [217.153.29.142]) by shark.2a.pl (Postfix) with ESMTP id 520E7B25B6; Tue, 23 Jan 2007 15:47:09 +0100 (CET) From: =?us-ascii?Q?Kristof_Zelechovski?= To: , References: <000401c73ed9$540afca0$1a01080a@POCZTOWIEC> <200701231339.l0NDdvF3046532@lurza.secnetix.de> Date: Tue, 23 Jan 2007 15:47:11 +0100 Message-ID: <002401c73efd$5db24280$1a01080a@POCZTOWIEC> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 In-Reply-To: <200701231339.l0NDdvF3046532@lurza.secnetix.de> Thread-Index: Acc+9CGZt13QkJIwQWme36z88QdtDAABwZ9g X-Virus-Scanned: amavisd-new at 2a.pl Cc: Subject: RE: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 14:47:30 -0000 > -----Original Message----- > From: Oliver Fromme [mailto:olli@lurza.secnetix.de] > Sent: Tuesday, January 23, 2007 2:40 PM > To: freebsd-standards@FreeBSD.ORG; giecrilj@stegny.2a.pl > Subject: Re: return value of fprintf > > K?i?tof ?elechovski wrote: > > > Interestingly enough, > > although the stream error indicator is persistent, > > it is not taken into account to prevent data corruption as in C++ > streams. > > Can you describe that in more detail, please? Maybe > give a code example? I don't see how data corruption > could occur if your code is correct. > If you output A, B and C into cout and flushing of B fails, you get truncation: only A when you read it back. However, if you do the same with fprintf, you get elision: you can read back AC and B has been lost. This is what I call data corruption. It certainly can be prevented, and sometimes it can be detected afterwards that the file produced contains invalid data, only that I did not expect such a difference of behaviour here, nor do I understand why the C library prefers to let sloppy code leave holes in data. > > The reason may be that POSIX streams must set errno on failure > > (this is *not* required by the ANSI standard) > > but there is no errno value to indicate that the error condition is set > > (except EBADF - > > but the POSIX standard should be modified to allow this extension, > > since at present it only means "Bad file descriptor"). > > I'm sorry I don't understand what you mean. When the > error indicator is set, errno is always set to an > appropriate value (e.g. ENOSPC if you run out of space > on the file system). If you have an error condition > on s stream, but you ignore it and continue to perform > I/O on the stream without removing the cause of the > problem, you're on your own. You'll get undefined > behaviour. > The ANSI standard does not define ENOSPC and it does not require the stream I/O functions to set errno. Therefore, "always set" is guaranteed to work only within the confines of POSIX, otherwise it remains unspecified. And the behaviour in question is undefined in the sense that the standard does not define what happens when you a stream for I/O with the error indicator set; however, it is not defined as undefined, either. The Standard uses the term "undefined behaviour" for errors that cannot be easily diagnosed either by the compiler or by the runtime library, which is not the case; I would rather say it is unspecified and implementation-dependent. Thanks Chris From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 16:06:06 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB50D16A402 for ; Tue, 23 Jan 2007 16:06:06 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (khavrinen.csail.mit.edu [128.30.28.20]) by mx1.freebsd.org (Postfix) with ESMTP id 6455413C465 for ; Tue, 23 Jan 2007 16:06:06 +0000 (UTC) (envelope-from wollman@khavrinen.csail.mit.edu) Received: from khavrinen.csail.mit.edu (localhost.csail.mit.edu [127.0.0.1]) by khavrinen.csail.mit.edu (8.13.6/8.13.6) with ESMTP id l0NG64dn042676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK CN=khavrinen.csail.mit.edu issuer=Client+20CA); Tue, 23 Jan 2007 11:06:05 -0500 (EST) (envelope-from wollman@khavrinen.csail.mit.edu) Received: (from wollman@localhost) by khavrinen.csail.mit.edu (8.13.6/8.13.6/Submit) id l0NG64DE042673; Tue, 23 Jan 2007 11:06:04 -0500 (EST) (envelope-from wollman) From: Garrett Wollman MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17846.12908.302073.145442@khavrinen.csail.mit.edu> Date: Tue, 23 Jan 2007 11:06:04 -0500 To: =?us-ascii?Q?Kristof_Zelechovski?= In-Reply-To: <002401c73efd$5db24280$1a01080a@POCZTOWIEC> References: <000401c73ed9$540afca0$1a01080a@POCZTOWIEC> <200701231339.l0NDdvF3046532@lurza.secnetix.de> <002401c73efd$5db24280$1a01080a@POCZTOWIEC> X-Mailer: VM 7.17 under 21.4 (patch 20) "Double Solitaire" XEmacs Lucid X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-3.0 (khavrinen.csail.mit.edu [127.0.0.1]); Tue, 23 Jan 2007 11:06:05 -0500 (EST) Cc: freebsd-standards@freebsd.org Subject: RE: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 16:06:06 -0000 < said: > And the behaviour in question is undefined > in the sense that the standard does not define > what happens when you a stream for I/O with the error indicator set; > however, it is not defined as undefined, either. The Standard is what the Standard says, not what it doesn't say. If the Standard is silent, the behavior is undefined. -GAWollman From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 17:27:26 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 585BA16A400 for ; Tue, 23 Jan 2007 17:27:26 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id C80AC13C474 for ; Tue, 23 Jan 2007 17:27:25 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (wfgjaj@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l0NHRItj074661; Tue, 23 Jan 2007 18:27:24 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l0NHRIRN074657; Tue, 23 Jan 2007 18:27:18 +0100 (CET) (envelope-from olli) Date: Tue, 23 Jan 2007 18:27:18 +0100 (CET) Message-Id: <200701231727.l0NHRIRN074657@lurza.secnetix.de> From: Oliver Fromme To: freebsd-standards@FreeBSD.ORG, giecrilj@stegny.2a.pl In-Reply-To: <002401c73efd$5db24280$1a01080a@POCZTOWIEC> X-Newsgroups: list.freebsd-standards User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 23 Jan 2007 18:27:24 +0100 (CET) Cc: Subject: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-standards@FreeBSD.ORG, giecrilj@stegny.2a.pl List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 17:27:26 -0000 Kristof Zelechovski wrote: > Oliver Fromme wrote: > > K?i?tof ?elechovski wrote: By the way, I'm sorry that my MUA mangled your name. Unfortunately I only have ISO-8859-1 and 8859-15 at this particular client, not 8859-2 or ISO-10646 (unicode). > > > Interestingly enough, > > > although the stream error indicator is persistent, > > > it is not taken into account to prevent data corruption as > > > in C++ streams. > > > > Can you describe that in more detail, please? Maybe > > give a code example? I don't see how data corruption > > could occur if your code is correct. > > If you output A, B and C into cout and flushing of B fails, > you get truncation: only A when you read it back. > However, if you do the same with fprintf, you get elision: > you can read back AC and B has been lost. That cannot happen if you always check the return code from I/O functions. If you don't do that, well, then you should expect undesired behaviour in such situations. If an application ignores error conditions that are reported through the exit code of library functions, well, then the application clearly has a bug. Either that, or the programmer didn't care because it wasn't important enough. For example, most little utilities simply don't care if writing to stdout fails for some reason. It just doesn't matter, and it doesn't justify polluting the code with hundreds of checks. C++ is different anyway for its support for exceptions, which is the normal mechanism to handle I/O errors. C doesn't support exceptions, so you have to check the return code from every I/O operation yourself. > nor do I understand why the C library prefers > to let sloppy code leave holes in data. Would you suggest that _all_ I/O operations continue to fail until the application explicitly clears the error indicator? That would break many programs. Many. In fact, I think that the existing behaviour makes more sense. For example, if one printf() failed because of ENOSPC, then the next printf() should still be performed, because the error condition might have cleared in the meantime. It should work, no matter if the programmer decided to check all return values and reset the error indicator or not. > > > The reason may be that POSIX streams must set errno on failure > > > (this is *not* required by the ANSI standard) > > > but there is no errno value to indicate that the error condition is set > > > (except EBADF - > > > but the POSIX standard should be modified to allow this extension, > > > since at present it only means "Bad file descriptor"). > > > > I'm sorry I don't understand what you mean. When the > > error indicator is set, errno is always set to an > > appropriate value (e.g. ENOSPC if you run out of space > > on the file system). If you have an error condition > > on s stream, but you ignore it and continue to perform > > I/O on the stream without removing the cause of the > > problem, you're on your own. You'll get undefined > > behaviour. > > The ANSI standard does not define ENOSPC Right, but POSIX/SUSv3 does. And it says: "Some of the functionality described [for errno values] extends the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers to the ISO C standard." > and it does not require the stream I/O functions to set errno. Right, but POSIX/SUSv3 does. See above. > Therefore, "always set" is guaranteed to work > only within the confines of POSIX, otherwise it remains unspecified. And FreeBSD aims to comply with POSIX, so there is no problem at all. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. I suggested holding a "Python Object Oriented Programming Seminar", but the acronym was unpopular. -- Joseph Strout From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 17:31:46 2007 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DDEA316A405 for ; Tue, 23 Jan 2007 17:31:46 +0000 (UTC) (envelope-from "") Received: from shelbyville.concord.org (shelbyville.concord.org [63.138.152.75]) by mx1.freebsd.org (Postfix) with ESMTP id 8843613C468 for ; Tue, 23 Jan 2007 17:31:46 +0000 (UTC) (envelope-from "") Received: from fc.concord.org (lisa.concord.org [63.138.152.60]) by shelbyville.concord.org (8.13.8/8.13.8) with ESMTP id l0NHVjMo013362 for ; Tue, 23 Jan 2007 12:31:45 -0500 Message-id: Date: Tue, 23 Jan 2007 12:31:26 -0500 X-Mailer: FirstClass 8.2 (build 8.094) X-FC-Icon-ID: 13401 X-FC-SERVER-TZ: 181273068 X-FC-MachineGenerated: true To: freebsd-standards@freebsd.org From: Gateway@shelbyville.concord.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: NDN: Re: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 17:31:46 -0000 Sorry. Your message could not be delivered to: library,Concord Consortium (The name was not found at the remote site. Check that the name has been entered correctly.) From owner-freebsd-standards@FreeBSD.ORG Tue Jan 23 17:45:12 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.ORG Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5FC116A402 for ; Tue, 23 Jan 2007 17:45:12 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from shark.2a.pl (shark.2a.pl [195.117.102.3]) by mx1.freebsd.org (Postfix) with ESMTP id 5BEC113C44B for ; Tue, 23 Jan 2007 17:45:12 +0000 (UTC) (envelope-from giecrilj@stegny.2a.pl) Received: from localhost (av.2a.pl [10.0.0.99]) by shark.2a.pl (Postfix) with ESMTP id A0D7DB253E; Tue, 23 Jan 2007 18:45:10 +0100 (CET) Received: from shark.2a.pl ([10.0.0.3]) by localhost (av.2a.pl [10.0.0.99]) (amavisd-new, port 10024) with ESMTP id 97597-02; Tue, 23 Jan 2007 18:43:47 +0100 (CET) Received: from POCZTOWIEC (2a-gts [217.153.29.142]) by shark.2a.pl (Postfix) with ESMTP id A64A8B253B; Tue, 23 Jan 2007 18:44:58 +0100 (CET) From: =?us-ascii?Q?Kristof_Zelechovski?= To: , References: <002401c73efd$5db24280$1a01080a@POCZTOWIEC> <200701231727.l0NHRIRN074657@lurza.secnetix.de> Date: Tue, 23 Jan 2007 18:45:01 +0100 Message-ID: <003101c73f16$3555e300$1a01080a@POCZTOWIEC> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 In-Reply-To: <200701231727.l0NHRIRN074657@lurza.secnetix.de> Thread-Index: Acc/E8lyoHP/DBXqSSGVZY+YwZjcnAAAPtnQ X-Virus-Scanned: amavisd-new at 2a.pl Cc: Subject: RE: return value of fprintf X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jan 2007 17:45:12 -0000 > -----Original Message----- > From: Oliver Fromme [mailto:olli@lurza.secnetix.de] > Sent: Tuesday, January 23, 2007 6:27 PM > To: freebsd-standards@FreeBSD.ORG; giecrilj@stegny.2a.pl > Subject: Re: return value of fprintf > > > C++ is different anyway for its support for exceptions, > which is the normal mechanism to handle I/O errors. Only if you explicitly ask for exceptions. You do not get exceptions out of the box because it is still possible to use C++ without exceptions (in an environment where exceptions are not supported). You get a bad stream that refuses to do anything more instead. > C doesn't support exceptions, so you have to check the > return code from every I/O operation yourself. > > > nor do I understand why the C library prefers > > to let sloppy code leave holes in data. > > Would you suggest that _all_ I/O operations continue to > fail until the application explicitly clears the error > indicator? That would break many programs. Many. > > In fact, I think that the existing behaviour makes more > sense. For example, if one printf() failed because of > ENOSPC, then the next printf() should still be performed, > because the error condition might have cleared in the > meantime. It should work, no matter if the programmer > decided to check all return values and reset the error > indicator or not. Thanks for your opinion, I just could not imagine anybody would like it that way. I also believed that C++ streams were similar to C streams by design, which is apparently not the case. Chris From owner-freebsd-standards@FreeBSD.ORG Wed Jan 24 14:50:23 2007 Return-Path: X-Original-To: freebsd-standards@hub.freebsd.org Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8ACFC16A401 for ; Wed, 24 Jan 2007 14:50:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 3C55813C44B for ; Wed, 24 Jan 2007 14:50:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l0OEoMSo076095 for ; Wed, 24 Jan 2007 14:50:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l0OEoMO8076094; Wed, 24 Jan 2007 14:50:22 GMT (envelope-from gnats) Date: Wed, 24 Jan 2007 14:50:22 GMT Message-Id: <200701241450.l0OEoMO8076094@freefall.freebsd.org> To: freebsd-standards@FreeBSD.org From: Ed Schouten Cc: Subject: Re: standards/100017: [Patch] Add fuser(1) functionality to fstat(1) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Schouten List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2007 14:50:23 -0000 The following reply was made to PR standards/100017; it has been noted by GNATS. From: Ed Schouten To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-standards@FreeBSD.org Cc: Subject: Re: standards/100017: [Patch] Add fuser(1) functionality to fstat(1) Date: Wed, 24 Jan 2007 15:41:09 +0100 --JK5NARynUCwOaxbc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, The patch has been updated, the old version didn't initialize the flags field in fuser_desc structures, causing some flags to be spuriously set. http://g-rave.nl/junk/freebsd-fstat-fuser-posix.diff --=20 Ed Schouten WWW: http://g-rave.nl/ PS: What's taking so long? --JK5NARynUCwOaxbc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFt3AF52SDGA2eCwURAkS6AJ94NuMVopIJ0kfeFhAAjuYStfZlQACcCZQK qA09i4OEUgKe54FmGVAoJMg= =GEYF -----END PGP SIGNATURE----- --JK5NARynUCwOaxbc-- From owner-freebsd-standards@FreeBSD.ORG Wed Jan 24 14:58:53 2007 Return-Path: X-Original-To: freebsd-standards@FreeBSD.org Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFF1516A409 for ; Wed, 24 Jan 2007 14:58:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (palm.hoeg.nl [83.98.131.212]) by mx1.freebsd.org (Postfix) with ESMTP id 9FC8913C467 for ; Wed, 24 Jan 2007 14:58:53 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 3BAF61CC77; Wed, 24 Jan 2007 15:41:09 +0100 (CET) Date: Wed, 24 Jan 2007 15:41:09 +0100 From: Ed Schouten To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-standards@FreeBSD.org Message-ID: <20070124144109.GH64263@hoeg.nl> References: <200607100823.k6A8NKlV052666@compy.fxq.nl> <200607100830.k6A8UL8E045214@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JK5NARynUCwOaxbc" Content-Disposition: inline In-Reply-To: <200607100830.k6A8UL8E045214@freefall.freebsd.org> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: Subject: Re: standards/100017: [Patch] Add fuser(1) functionality to fstat(1) X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jan 2007 14:58:54 -0000 --JK5NARynUCwOaxbc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, The patch has been updated, the old version didn't initialize the flags field in fuser_desc structures, causing some flags to be spuriously set. http://g-rave.nl/junk/freebsd-fstat-fuser-posix.diff --=20 Ed Schouten WWW: http://g-rave.nl/ PS: What's taking so long? --JK5NARynUCwOaxbc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFFt3AF52SDGA2eCwURAkS6AJ94NuMVopIJ0kfeFhAAjuYStfZlQACcCZQK qA09i4OEUgKe54FmGVAoJMg= =GEYF -----END PGP SIGNATURE----- --JK5NARynUCwOaxbc--