Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ian Lance Taylor <ian@wasabisystems.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFC] Suggested ways to remove the need for xm-go32.h
Date: Fri, 24 Sep 2004 16:49:00 -0000	[thread overview]
Message-ID: <m3k6ujwr1f.fsf@gossamer.airs.com> (raw)
In-Reply-To: <20040924122406.GA10888@cygbert.vinschen.de>

Corinna Vinschen <vinschen@redhat.com> 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


      parent reply	other threads:[~2004-09-24 16:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-18 13:21 Eli Zaretskii
2004-09-19 11:44 ` Mark Kettenis
2004-09-20  3:33   ` Eli Zaretskii
2004-09-22 20:21     ` Michael Chastain
2004-09-23  4:51       ` Eli Zaretskii
2004-09-23  6:02         ` Michael Chastain
2004-09-23  8:14   ` Corinna Vinschen
2004-09-23  5:03 ` Christopher Faylor
2004-09-23  6:30   ` Michael Chastain
2004-09-23  8:02     ` Corinna Vinschen
2004-09-24 10:51       ` Eli Zaretskii
2004-09-24 14:35         ` Andrew Cagney
2004-09-23 13:56     ` Christopher Faylor
2004-09-23 17:20       ` Michael Chastain
2004-09-23 17:24         ` Christopher Faylor
2004-09-23 15:18     ` Joel Brobecker
2004-09-23 17:57       ` Daniel Jacobowitz
2004-09-24 15:05         ` Andrew Cagney
2004-09-25 16:43           ` Eli Zaretskii
2004-09-26 18:38             ` Mark Kettenis
2004-09-27  2:29           ` Daniel Jacobowitz
2004-09-23 20:58   ` Mark Kettenis
2004-09-23 21:14     ` Christopher Faylor
2004-09-24 10:48       ` Eli Zaretskii
2004-09-24 12:23         ` Corinna Vinschen
2004-09-24 13:39           ` Andreas Schwab
2004-09-24 19:51             ` Christopher Faylor
2004-09-24 21:16               ` Christopher Faylor
2004-09-24 21:32               ` Andreas Schwab
2004-09-24 13:40           ` Eli Zaretskii
2004-09-24 16:49           ` Ian Lance Taylor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3k6ujwr1f.fsf@gossamer.airs.com \
    --to=ian@wasabisystems.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox