From: Lukasz Majewski <lukma@denx.de>
To: Alistair Francis <alistair23@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
GNU C Library <libc-alpha@sourceware.org>,
Alistair Francis <alistair.francis@wdc.com>
Subject: Re: 32-bit time_t inside itimerval
Date: Sun, 5 Jan 2020 17:07:19 +0100 [thread overview]
Message-ID: <20200105170719.58719d39@jawa> (raw)
In-Reply-To: <CAKmqyKOK1BZ_1aiH6GzCtJGHZ=V4tJb9jc29TPuOAqLfid61oA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2622 bytes --]
Hi Alistair,
> 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.
Great. Thanks :-)
>
>
> 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
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 --]
prev parent reply other threads:[~2020-01-05 16:07 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
2020-01-05 16:07 ` Lukasz Majewski [this message]
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=20200105170719.58719d39@jawa \
--to=lukma@denx.de \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=arnd@arndb.de \
--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).