From nobody@FreeBSD.ORG Thu Apr 8 00:33:22 1999 Return-Path: Received: by hub.freebsd.org (Postfix, from userid 32767) id 36CE115909; Thu, 8 Apr 1999 00:33:22 -0700 (PDT) Message-Id: <19990408073322.36CE115909@hub.freebsd.org> Date: Thu, 8 Apr 1999 00:33:22 -0700 (PDT) From: mam@werries.de Sender: nobody@FreeBSD.ORG To: freebsd-gnats-submit@freebsd.org Subject: popen does not honor ISO 9899 syntax X-Send-Pr-Version: www-1.0 >Number: 11020 >Category: standards >Synopsis: popen does not honor ISO 9899 syntax >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: closed >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Apr 8 00:40:00 PDT 1999 >Closed-Date: Thu Aug 22 18:57:30 PDT 2002 >Last-Modified: Thu Oct 14 15:37:50 UTC 2010 >Originator: Michael A. Meiszl >Release: 3.10 >Organization: MEC GmbH >Environment: FreeBSD mam48.werries.de 3.1-RELEASE FreeBSD 3.1-RELEASE #6: Tue Mar 30 10:26:27 CEST 1999 root@mam48.werries.de:/usr/src/sys/compile/MAM i386 >Description: the popen() library function does not recognize the optional "b" parameter of the type argument (eg "rb" or "wb"). This is in contrast to the fopen() function. For portability this should be handled equal i think. >How-To-Repeat: popen ("/bin/ls","rb") >Fix: Use the same argument logic as in fopen() The mode string can also include the letter ``b'' either as a third character or as a character between the characters in any of the two-charac ter strings described above. This is strictly for compatibility with ISO 9899: 1990 (``ISO C'') and has no effect; the ``b'' is ignored. popen.c: /* * Lite2 introduced two-way popen() pipes using socketpair(). * FreeBSD's pipe() is bidirectional, so we use that. */ if (strchr(type, '+')) { twoway = 1; type = "r+"; } else { twoway = 0; if ((*type != 'r' && *type != 'w') || type[1]) return (NULL); omit the "|| type[1]" clause >Release-Note: >Audit-Trail: Responsible-Changed-From-To: freebsd-bugs->freebsd-standards Responsible-Changed-By: johan Responsible-Changed-When: Thu Aug 22 17:30:24 PDT 2002 Responsible-Changed-Why: the popen() library function does not recognize the optional "b" Is this something we want to/ should do? http://www.freebsd.org/cgi/query-pr.cgi?pr=11020 From: Mike Barcroft To: freebsd-gnats-submit@FreeBSD.org Cc: johan@FreeBSD.org Subject: Re: kern/11020: popen does not honor ISO 9899 syntax Date: Thu, 22 Aug 2002 20:44:37 -0400 > Responsible-Changed-From-To: freebsd-bugs->freebsd-standards > Responsible-Changed-By: johan > Responsible-Changed-When: Thu Aug 22 17:30:24 PDT 2002 > Responsible-Changed-Why: > the popen() library function does not recognize the optional "b" > > Is this something we want to/ should do? I don't think so. Since popen() is a POSIX-defined function it would make little sense to add an option which would be useful for extending popen() for non-UNIX platforms. Does anyone else have any comments about this, or notes about other platforms that support this extention? Best regards, Mike Barcroft State-Changed-From-To: open->closed State-Changed-By: wollman State-Changed-When: Thu Aug 22 18:54:57 PDT 2002 State-Changed-Why: popen() is specified by POSIX, not ISO C, and POSIX has no need for this feature. Given that, we don't want to encourage non-portable coding practices by introducing a do-nothing extension (even though it is not forbidden by the Standard). http://www.freebsd.org/cgi/query-pr.cgi?pr=11020 From: Johan Karlsson To: bug-followup@freebsd.org Cc: Subject: Fwd: Re: kern/11020: popen does not honor ISO 9899 syntax Date: Fri, 23 Aug 2002 04:01:31 +0200 Attach this to the audit-trail. ----- Forwarded message from Garrett Wollman ----- From: Garrett Wollman To: Johan Karlsson Cc: freebsd-bugs@FreeBSD.ORG, freebsd-standards@FreeBSD.ORG Subject: Re: kern/11020: popen does not honor ISO 9899 syntax Date: Thu, 22 Aug 2002 21:54:28 -0400 (EDT) < said: > the popen() library function does not recognize the optional "b" > Is this something we want to/ should do? Probably not; such a feature is both unnecessary and would encourage unportable code. The POSIX rationale notes: # The behavior of popen( ) is specified for values of mode of r and # w. Other modes such as rb and wb might be supported by specific # implementations, but these would not be portable features. Note # that historical implementations of popen( ) only check to see if the # first character of mode is r. Thus, a mode of robert the robot would # be treated as mode r, and a mode of anything else would be treated # as mode w. Note that the specification is somewhat poorly written, in that the literal mode strings "r" and "w" are not properly identified as such. This is actually a general typographical shortcoming of the Standard. -GAWollman ----- End forwarded message ----- -- Johan Karlsson mailto:johan@FreeBSD.org Responsible-Changed-From-To: freebsd-standards->standards Responsible-Changed-By: johan Responsible-Changed-When: Sat Aug 24 19:02:50 PDT 2002 Responsible-Changed-Why: Use short names for mailing list to make searches using the web query form work with the shown responsible. This also makes open PR show up in the summery mail. http://www.freebsd.org/cgi/query-pr.cgi?pr=11020 Responsible-Changed-From-To: standards->freebsd-standards Responsible-Changed-By: arundel Responsible-Changed-When: Thu Oct 14 15:37:07 UTC 2010 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=11020 >Unformatted: