From: Alistair Francis <alistair23@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Lukasz Majewski <lukma@denx.de>,
GNU C Library <libc-alpha@sourceware.org>,
Alistair Francis <alistair.francis@wdc.com>
Subject: Re: 32-bit time_t inside itimerval
Date: Sat, 4 Jan 2020 10:03:01 -0800 [thread overview]
Message-ID: <CAKmqyKOK1BZ_1aiH6GzCtJGHZ=V4tJb9jc29TPuOAqLfid61oA@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a1bwfpnXztxBELem7yqEj74kKeqoZaOoYdCv-=K9EWPgw@mail.gmail.com>
On Thu, Jan 2, 2020 at 4:28 AM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thu, Jan 2, 2020 at 1:08 PM Lukasz Majewski <lukma@denx.de> wrote:
> > > On Mon, Dec 30, 2019 at 10:22 PM Alistair Francis
> > > <alistair23@gmail.com> wrote:
> > > > On Mon, Dec 30, 2019 at 12:11 PM Arnd Bergmann <arnd@arndb.de> wrote:
> > > I don't think it's
> > > fundamentally different from the other system calls that he has
> > > converted already to work with time64 callers.
> >
> > I'm not aware of any RV32 specifics, but it seems to me that it would
> > be appropriate to use the 64 bit version of struct __itimerspec64 in
> > glibc - as for example in the conversion patch from [1].
>
> What I mean is that rv32 otherwise does not convert between time32
> and time64 interfaces because it always uses the time64 version,
> so unlike the others, there is probably no helper to convert between
> the timeval formats either.
I have some patches prepared that will convert a 64-bit time_t to
32-bit for the required syscalls. It's generic for 32-bit archs, but
will only apply when __TIMESIZE == 64.
I'll send an RFC out with the RV32 patches soon and then send patches
when the 2.32 merge window opens up.
Alistair
>
> > As it was already mentioned - those calls set the time to be
> > decremented and do not operate on "absolute" time values.
> > Hence, I think that it would be good enough (for now?) to use 32 bit
> > API wrapped into 64 bit internal glibc values and just return errors
> > when somebody wants to set timer relative expiration time to overflow
> > time_t on 32 bit archs (arm,rv32).
>
> Yes, that's the idea. The kernel already limits the range to 64-bit
> nanoseconds because of its timer implementation, so truncating it
> to 32-bit seconds does not change the behavior either.
>
> > Arnd, am I correct that the struct itimerval to __kernel_old_itimerval
> > conversion patch can be found here [2]?
>
> Yes, that's right. This patch only changes the in-kernel implementation
> as a step to removing the timeval definition from the kernel's uapi
> headers, it does not change the behavior at all.
>
> Arnd
next prev parent reply other threads:[~2020-01-04 18:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-20 22:28 32-bit time_t inside itimerval Alistair Francis
2019-12-21 13:31 ` Arnd Bergmann
2019-12-21 17:18 ` Alistair Francis
2019-12-30 10:02 ` Arnd Bergmann
2019-12-30 19:51 ` Alistair Francis
2019-12-30 20:11 ` Arnd Bergmann
2019-12-30 21:16 ` Alistair Francis
2019-12-30 22:11 ` Arnd Bergmann
2020-01-02 12:08 ` Lukasz Majewski
2020-01-02 12:28 ` Arnd Bergmann
2020-01-04 18:03 ` Alistair Francis [this message]
2020-01-05 16:07 ` Lukasz Majewski
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='CAKmqyKOK1BZ_1aiH6GzCtJGHZ=V4tJb9jc29TPuOAqLfid61oA@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=arnd@arndb.de \
--cc=libc-alpha@sourceware.org \
--cc=lukma@denx.de \
/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).