This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
- From: Arnd Bergmann <arnd at arndb dot de>
- To: Vineet Gupta <vineetg76 at gmail dot com>
- Cc: Alistair Francis <alistair23 at gmail dot com>, Florian Weimer <fweimer at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>, Palmer Dabbelt <palmerdabbelt at google dot com>, Zong Li <zongbox at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, "Maciej W. Rozycki" <macro at wdc dot com>, arcml <linux-snps-arc at lists dot infradead dot org>, Joseph Myers <joseph at codesourcery dot com>
- Date: Wed, 12 Feb 2020 13:58:12 +0100
- Subject: Re: [RFC v6 07/23] RISC-V: Use 64-bit time_t and off_t for RV32 and RV64
- References: <cover.1578824547.git.alistair.francis@wdc.com> <4e95f95966d8d7c6a8339160dc62d81c1f6a1bfb.1578824547.git.alistair.francis@wdc.com> <00574bfb-981a-3a1c-cbdf-b2fee4eddc32@gmail.com> <CAKmqyKMyf2psPp+-EHoidvbPbSXv0=dP26GjVQnT5BUriLc1gA@mail.gmail.com> <3ca7e2cb-55c2-1118-90b8-505586b36ee7@gmail.com>
On Wed, Feb 12, 2020 at 2:42 AM Vineet Gupta <vineetg76@gmail.com> wrote:
> On 2/11/20 4:14 PM, Alistair Francis wrote:
> > On Tue, Feb 11, 2020 at 4:14 PM Vineet Gupta <vineetg76@gmail.com> wrote:
>
> >>> +/* Same for ino_t and ino64_t. */
> >>> +# define __INO_T_MATCHES_INO64_T 1
>
> I'm surprised that ARC port doesn't define this in glibc, yet we use the
> asm-generic syscall interface where this is true. I need to investigate more.
All 32-bit kernels supported by glibc today define the 64-bit file offset types
(__off64_t, __ino64_t, ...) and a lot of them never had the old 'long' types
(__off_t, __ino_t, ...), but applications can still pick between the two ABIs
when compiling against glibc, see /usr/include/fcntl.h:
#ifndef __off_t_defined
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
# define __off_t_defined
#endif
If you use the old types, glibc will do the conversion in the syscall wrappers
on architectures that only have the 64-bit interfaces.
Arnd