linux-user: Add support for ppoll_time64() and pselect6_time64()
commite5ce9688b47a8f60337ce1e4108f35577494a46a
authorFilip Bozuta <Filip.Bozuta@syrmia.com>
Mon, 24 Aug 2020 22:30:49 +0000 (25 00:30 +0200)
committerLaurent Vivier <laurent@vivier.eu>
Sat, 5 Sep 2020 20:40:43 +0000 (5 22:40 +0200)
treeef2f454018d5fe81a10b6eb62c20f0bbd1c60dd0
parent8ca019b9c9ff916414371dd13d265bbab308b14a
linux-user: Add support for ppoll_time64() and pselect6_time64()

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()).
    This code was moved to new functions ('do_ppoll()' and 'do_pselect6()')
    that take a 'bool time64' from which a right 'struct timespec' converting
    function is called.
    (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>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200824223050.92032-2-Filip.Bozuta@syrmia.com>
[lv: rebase and fix do_pselect6()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c