This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 1/6] sysv/linux: Rename alpha functions to be alpha specific


On Tue, Feb 11, 2020 at 10:38 AM Zack Weinberg <zackw@panix.com> wrote:
>
> On Tue, Feb 11, 2020 at 1:04 PM Alistair Francis <alistair23@gmail.com> wrote:
> > > Yes, I understand that, but the definition of the 32-bit-time_t struct
> > > timeval is
> > >
> > >   struct __timeval32 {
> > >      __time32_t tv_sec;
> > >      __suseconds_t tv_usec;
> > >   };
> >
> > This is what the Alpha specific calls use.
> > The generic one uses (the name is confusing, I thought I had changed it)
> >
> > struct __timeval32
> > {
> >   long tv_sec;         /* Seconds.  */
> >   long tv_usec;        /* Microseconds.  */
> > };
> >
> > This is because, as I mentioned earlier, that the kernel expects the
> > time to be the wordsize, regardless of the time_t size (except for
> > Alpha).
>
> I think that's profoundly wrong.  I think we should be using a
> definition along the lines of
>
> struct __timeval32 {
>     __time32_t tv_sec;
>     __suseconds32_t tv_usec;
> };
>
> on all architectures, with all necessary variation handled within the
> definitions of __time32_t and __suseconds32_t.  That way it can all
> live in bits/typesizes.h which has to be system-specific regardless.

When you say all architectures, you mean just 32-bit architectures and
Alpha right?

This is what my v1 did, and the general consensus was against that as
it didn't work for all 32-bit architectures (see the discussion here:
https://patchwork.ozlabs.org/patch/1232973/).

>
> Please consider this a sustained objection to the entire patchset, not
> just this one patch, unless you can come back with a convincing reason
> why the above is not possible or would actually make life more
> complicated.

What are you proposing I do instead?

>
> (Incidentally, since it is probably going to come up yet again if we
> proceed down this path, I still believe that the specification of
> `long tv_nsec` in struct timespec is a defect in C11 and POSIX and we
> should ignore both standards and use a typedef name for it.)

I'll leave this for others to comment on, I don't really mind either
way but ignoring the standard seems like a strange choice.

Alistair

>
> zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]