From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5678 invoked by alias); 24 Sep 2004 16:49:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5278 invoked from network); 24 Sep 2004 16:49:43 -0000 Received: from unknown (209.128.65.135) by sourceware.org with QMTP; 24 Sep 2004 16:49:43 -0000 Received: (qmail 4406 invoked by uid 10); 24 Sep 2004 16:49:40 -0000 Received: (qmail 23540 invoked by uid 500); 24 Sep 2004 16:49:32 -0000 From: Ian Lance Taylor To: gdb-patches@sources.redhat.com Subject: Re: [RFC] Suggested ways to remove the need for xm-go32.h References: <01c49d82$Blat.v2.2.2$23875ec0@zahav.net.il> <20040923050534.GA11936@trixie.casa.cgf.cx> <200409232058.i8NKwHg4009186@elgar.sibelius.xs4all.nl> <20040923211643.GA22829@trixie.casa.cgf.cx> <01c4a223$Blat.v2.2.2$e47a6c80@zahav.net.il> <20040924122406.GA10888@cygbert.vinschen.de> Date: Fri, 24 Sep 2004 16:49:00 -0000 In-Reply-To: <20040924122406.GA10888@cygbert.vinschen.de> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-09/txt/msg00405.txt.bz2 Corinna Vinschen writes: > On Sep 24 12:46, Eli Zaretskii wrote: > > > Out of curiousity is O_BINARY mandated by ISO C? I suspect not. > > > > O_BINARY is a Posix thing (ANSI C doesn't know about `open' at all), > > so ISO C has nothing to say about it. But even if you look at the > > latest Posix (well, the draft I have here), you will not find O_BINARY > > there. So Posix systems are not allowed to distinguish between text > > and binary files. > > That's nothing GDB should be concerned of, probably, but that's definitely > a leak in the definitions. How much sense does it make to allow "b" in > fopen but no equivalent in the low-level interface :-( POSIX and ISO C are different standards. In a POSIX system there can be no difference between text and binary files. So there is no reason for POSIX to specify O_BINARY. ISO C permits distinctions between text and binary files, since ISO C is used on non-POSIX systems such as Windows. So ISO C specifies that 'b' is permitted in fopen and related calls. POSIX supports but does not require ISO C. When ISO C is used on POSIX, fopen and friends ignore the 'b'. O_BINARY exists because systems like Windows like to have almost-POSIX interfaces. O_BINARY was invented so that such systems could continue to distinguish text and binary files in the almost-POSIX open call. Ian