The man(2) page for select says:
On Linux, select() modifies timeout to reflect the amount of time
not slept; most other implementations do not do this. (POSIX.1
permits either behavior.)
The shim for select does not modify its timespec argument on return. The real call to select is given a pointer to a local holding scaled time values, but that local is ignored when select() shim returns. I think the "time not slept" held in the local should be inversely scaled and used to modify the argument to the shim.
The pselect shim takes a const timespec argument, but then the path through glibc and the true syscall into the kernel becomes convoluted. pselect6 syscall will modify its timespec argument (if I read the man page correctly) but glibc wrapper ignores those mods, and so pselect doesn't return any indication of how much time is left.
The man(2) page for select says: On Linux, select() modifies timeout to reflect the amount of time not slept; most other implementations do not do this. (POSIX.1 permits either behavior.)
The shim for select does not modify its timespec argument on return. The real call to select is given a pointer to a local holding scaled time values, but that local is ignored when select() shim returns. I think the "time not slept" held in the local should be inversely scaled and used to modify the argument to the shim.
The pselect shim takes a const timespec argument, but then the path through glibc and the true syscall into the kernel becomes convoluted. pselect6 syscall will modify its timespec argument (if I read the man page correctly) but glibc wrapper ignores those mods, and so pselect doesn't return any indication of how much time is left.