[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] linux-user: Add support for 'ppoll_time64()' and 'pselec
From: |
Laurent Vivier |
Subject: |
Re: [PATCH 1/2] linux-user: Add support for 'ppoll_time64()' and 'pselect6_time64()' |
Date: |
Mon, 24 Aug 2020 19:12:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Le 12/08/2020 à 15:57, Filip Bozuta a écrit :
> This patch introduces functionality for following time64 syscalls:
>
> *ppoll_time64
>
> This is a year 2038 safe variant of:
>
> int poll(struct pollfd *fds, nfds_t nfds, int timeout)
> -- wait for some event on a file descriptor --
> man page: https://man7.org/linux/man-pages/man2/ppoll.2.html
>
> *pselect6_time64
>
> This is a year 2038 safe variant of:
>
> int pselect6(int nfds, fd_set *readfds, fd_set *writefds,
> fd_set *exceptfds, const struct timespec *timeout,
> const sigset_t *sigmask);
> -- synchronous I/O multiplexing --
> man page: https://man7.org/linux/man-pages/man2/pselect6.2.html
>
> Implementation notes:
>
> Year 2038 safe syscalls in this patch were implemented
> with the same code as their regular variants (ppoll() and pselect()).
> A switch/case statement was used to call an apropriate converting
> function for 'struct timespec' between target and host.
> (target_to_host/host_to_target_timespec() for regular and
> target_to_host/host_to_target_timespec64() for time64 variants)
>
> Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
> ---
> linux-user/syscall.c | 101 ++++++++++++++++++++++++++++++++++++-------
> 1 file changed, 86 insertions(+), 15 deletions(-)
>
I think it would be cleaner if you move the code to new functions,
do_ppoll() and do_pselect6() first, and then you introduce a new
parameter "bool time64" to implement the time64 variant (rather than a
switch()) as you do in PATCH 2.
Thanks,
Laurent