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 <[email protected]>
> ---
>  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

Reply via email to