public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: GLIBC patches <libc-alpha@sourceware.org>,
	Alistair Francis <alistair.francis@wdc.com>
Subject: Re: [PATCH] time: Skip overflow itimer tests on 32-bit systems
Date: Thu, 8 Jul 2021 06:11:12 +0900	[thread overview]
Message-ID: <YOYYcBzCD3mMn7MU@antec> (raw)
In-Reply-To: <fa437cfa-3940-a846-f96f-61d5046813bc@linaro.org>

On Tue, Jul 06, 2021 at 04:58:58PM -0300, Adhemerval Zanella wrote:
> 
...
> 
> Sigh... it seems that openrisc will the only *one* architecture with
> 64-bit time_t in userland which uses legacy 32-bit kernel ABI. 


In order to adhere to the "don't break userspace" rule I don't think I can
change that, I would like to.  Is there any documented migration path you know
of?

> > 
> > The below patch works for me, but there is probably a better thing to do then
> > create a new functrion.
> > 
> > 
> > 
> > diff --git a/include/time.h b/include/time.h
> > index 4372bfbd96..377a4a45ea 100644
> > --- a/include/time.h
> > +++ b/include/time.h
> > @@ -342,6 +342,14 @@ in_time_t_range (__time64_t t)
> >    return s == t;
> >  }
> >  
> > +/* Check whether T fits in a timeval32 (__int32_t).  */
> > +static inline bool
> > +in_timeval32_range (__time64_t t)
> > +{
> > +  __int32_t s = t;
> > +  return s == t;
> > +}
> > +
> 
> The name is confusing, it is mixing timeval from 'struct timeval' and
> time_t.  And there is no need to use __int32_t, we need to use it only
> on installed headers to avoid namespace pollution. 

Right, I did think about that, but just wanted to get something to show the
change, I couldn't think of a better name.

> I fact I think it would be better to just change 'in_time_t_range' to
> use int32_t internally instead of time_t; I am pretty sure that all
> usages assume that sizeof(time_t) == 32.

Yeah, I like that better too.  I will respin the patch and post again.

-Stafford

  reply	other threads:[~2021-07-07 21:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-07 13:18 Stafford Horne
2021-06-09 13:50 ` Adhemerval Zanella
2021-06-09 21:38   ` Stafford Horne
2021-06-12  9:19     ` Stafford Horne
2021-07-06 19:58       ` Adhemerval Zanella
2021-07-07 21:11         ` Stafford Horne [this message]
2022-10-28 19:47         ` Aurelien Jarno
2022-10-31 14:02           ` Adhemerval Zanella Netto

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=YOYYcBzCD3mMn7MU@antec \
    --to=shorne@gmail.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=libc-alpha@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).