public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Carlos O'Donell <carlos@redhat.com>
Cc: GNU C Library <libc-alpha@sourceware.org>, libc-ports@sourceware.org
Subject: Re: [RFC] Copy as much as you can during a 32-bit stat before returning EOVERFLOW?
Date: Tue, 26 Feb 2013 20:37:00 -0000	[thread overview]
Message-ID: <512D1CF4.4080607@cs.ucla.edu> (raw)
In-Reply-To: <512D1335.1020704@redhat.com>

On 02/26/13 11:55, Carlos O'Donell wrote:> Community,

> The correct solution is going to take time to implement

Don't the proposed patches to xstatconv.c etc. slow down glibc
slightly for the normal (successful) case?  That's a minus.

Here's a different idea: enable wide ino_t, time_t, etc. if
_FILE_OFFSET_BITS is 64.  This would require zero changes to
applications that are portable and largefile aware, as they
already define _FILE_OFFSET_BITS.  And even for nonportable
applications, compiling with -D_FILE_OFFSET_BITS=64 (and fixing any
resulting porting glitches) should take less time and should be safer
than modifying the applications to make the unportable assumption that a
struct stat is filled in if errno == EOVERFLOW.

A more-conservative variant of this idea would establish a new symbol
that means "use wide-enough values for all file-related types".
-D_WIDE_FILE_TYPES, say, would use wide types for off_t, time_t,
ino_t, etc.  Portable application developers could modify their code
to set this symbol as well as setting _FILE_OFFSET_BITS, which is a
bit of a hassle, but I've seen worse (e.g., Mac OS X uses
_DARWIN_USE_64_BIT_INODE to select 64-bit inodes, but that's all it
does -- yuck).

  reply	other threads:[~2013-02-26 20:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26 19:55 Carlos O'Donell
2013-02-26 20:37 ` Paul Eggert [this message]
2013-02-26 22:59   ` Joseph S. Myers
2013-02-26 21:00 ` Roland McGrath
2013-02-26 23:05   ` Joseph S. Myers
2013-02-27 19:26   ` Carlos O'Donell
2013-02-26 23:49 ` Rich Felker
2013-02-26 23:58   ` Roland McGrath

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=512D1CF4.4080607@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).