unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Florian Weimer <fweimer@redhat.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Andreas Schwab <schwab@suse.de>,
	Stepan Golosunov <stepan@golosunov.pp.ru>,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH 1/2] y2038: Adjust struct __stat64_t64 to be usable by redirected {f}stat{at} calls
Date: Wed, 14 Oct 2020 10:47:50 +0200	[thread overview]
Message-ID: <20201014104750.230023bc@jawa> (raw)
In-Reply-To: <alpine.DEB.2.21.2010132208570.4206@digraph.polyomino.org.uk>

[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]

Hi Joseph,

> On Tue, 13 Oct 2020, Lukasz Majewski wrote:
> 
> > When glibc port with __WORDSIZE==32 and __TIMESIZE!=64 (e.g. armv7)
> > will use redirected calls to {f}stat{at}64_time64 functions, it
> > will accept the struct __stat64_t64 as its argument.
> > 
> > To avoid errors related to proper data placement after casting from
> > struct __stat64_t64 to struct stat{64} it is necessary to add some
> > missing padding and update type of {__}st_ino member.  
> 
> When redirecting to those functions, the definitions of struct stat / 
> struct stat64 should automatically change as a result of the
> _TIME_BITS=64 definition so that they match the definitions of the
> __stat64_t64 type - just as _FILE_OFFSET_BITS=64 results in changes
> to the content of struct stat.

Thanks for the explanation. I will adjust exported struct stat{64]
accordingly.

> 
> I believe the design is that __stat64_t64 has an
> architecture-independent layout that is never required to match any
> particular kernel layout because translation (typically from statx)
> will always occur in userspace.
> 
> Note that struct_stat_time64.h is currently an *uninstalled* header, 
> despite the name of the multiple-include guard in the header, and
> despite the testing of feature test macros within the header (which
> only makes sense for installed headers); it's not a bits/ header at
> present.

The only change, that I'm going to do is to mode __ino64_t st_ino
member of struct __stat64_t64
(@ sysdeps/unix/sysv/linux/struct_stat_time64.h) to the end of this
structure (as it is in the exported struct stat{64} placed).

This would allow less #ifndef __USE_TIME_BITS64 in the exported struct
stat{64}.

> 
> Maybe there should be some indirection so that the installed version
> of struct_stat_time64.h defines a macro with all the contents of 
> __stat64_t64, so that all the many architecture-specific 
> bits/struct_stat.h headers can just use that macro to get the right 
> contents when _TIME_BITS=64 rather than needing to duplicate the
> structure contents (at least twice per header, for both stat and
> stat64).  But I don't think any change to the layout of __stat64_t64
> is indicated, because there should always be explicit conversions
> between different layouts.
> 


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2020-10-14  8:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 13:16 [PATCH 1/2] y2038: Adjust struct __stat64_t64 to be usable by redirected {f}stat{at} calls Lukasz Majewski
2020-10-13 13:16 ` [PATCH 2/2] y2038: Remove not used __fstatat_time64 define Lukasz Majewski
2020-10-13 13:31   ` Andreas Schwab
2020-10-13 22:17 ` [PATCH 1/2] y2038: Adjust struct __stat64_t64 to be usable by redirected {f}stat{at} calls Joseph Myers
2020-10-14  8:47   ` Lukasz Majewski [this message]
2020-10-14 13:09     ` Joseph Myers

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=20201014104750.230023bc@jawa \
    --to=lukma@denx.de \
    --cc=alistair.francis@wdc.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    --cc=stepan@golosunov.pp.ru \
    /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).