From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15358 invoked by alias); 18 Nov 2002 14:36:09 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15308 invoked by uid 71); 18 Nov 2002 14:36:07 -0000 Date: Fri, 22 Nov 2002 16:15:00 -0000 Message-ID: <20021118143607.15299.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Paolo Carlini Subject: [Fwd: Re: libstdc++/8504: ios::app + pipes] Reply-To: Paolo Carlini X-SW-Source: 2002-11/txt/msg00875.txt.bz2 List-Id: The following reply was made to PR libstdc++/8504; it has been noted by GNATS. From: Paolo Carlini To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: [Fwd: Re: libstdc++/8504: ios::app + pipes] Date: Mon, 18 Nov 2002 15:31:36 +0100 Here are some more details. Running my example in the debugger I found that the relevant code in source file libstdc++-v3/config/io/basic_file_stdio.cc from gcc 3.2 looks like: 115 __basic_file* 116 __basic_file::open(const char* __name, ios_base::openmode __mode, 117 int /*__prot*/) 118 { [...] 128 if ((_M_cfile = fopen(__name, __c_mode))) In an attempt to reproduce the problem, I've written the following code: #include int main() { if (!fopen("/tmp/pipe", "a")) perror("/tmp/pipe"); } This code fails on Solaris and IRIX. It succeeds on Linux: $ uname -sr SunOS 5.8 $ g++ -v Reading specs from /usr/local/gcc/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2/specs Configured with: ../gcc-3.2/configure --prefix=/usr/local/gcc-3.2 --with-as=/usr/local/binutils/bin/as --with-ld=/usr/local/binutils/bin/ld Thread model: posix gcc version 3.2 $ g++ -g -o foo foo.cc $ ./foo /tmp/pipe: Illegal seek $ $ uname -sr Linux 2.4.18-14 $ g++ -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit Thread model: posix gcc version 3.2 200020903 (Red Hat Linux 8.0 3.2-7) $ g++ -g -o foo foo.cc $ ./foo $ So it's really a question of fopen(..., "a") not working on pipes on Solaris and IRIX. Somehow gcc 2.95.3 used to work around this issue. Regards, -- Dimitri http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8504