summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/pselect.c
AgeCommit message (Collapse)Author
2024-04-13Provide fixups for riscv32.Dmitry Chestnykh
- Use TIME64 by default for rv32, usage of 32-bit time leads to a lot of incompatibilities with linux kernel 6.6.x and later versions. - Add some other corrections to use proper system calls on riscv32 platform. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-25Add support for using time64 on big-endian machines.Dmitry Chestnykh
For BE architectures there is one significant difference in comparison with time64 support for little-endian architectures like ARMv7. The difference is that we strictly need to pass two 64bit values to system calls because Linux Kernel internally uses `struct __kernel_timespec` and similar, which consists of two 64bit fields. For this reason many files have been changed to convert pointers to timespec-family structures (mixed of 64bit and 32bit values) to the pointer of the similar but 64bit-only structures for using as system calls args. This is general prerequisite for any BE architecture. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2024-02-22Introduce time64 support.Dmitry Chestnykh
This patch introduces *time64 syscalls support for uClibc-ng. Currently the redirection of syscalls to their *time64 analogs is fully supported for 32bit ARM (ARMv5, ARMv6, ARMv7). The main changes that take effect when time64 feature is enabled are: - sizeof(time_t) is 8. - There is a possibility os setting date beyond year 2038. - some syscalls are redirected: clock_adjtime -> clock_adjtime64 clock_getres -> clock_getres_time64 clock_gettime -> clock_gettime64 clock_nanosleep -> clock_nanosleep_time64 clock_settime -> clock_settime64 futex -> futex_time64 mq_timedreceive -> mq_timedreceive_time64 mq_timedsend -> mq_timedsend_time64 ppoll -> ppoll_time64 pselect6 -> pselect6_time64 recvmmsg -> recvmmsg_time64 rt_sigtimedwait -> rt_sigtimedwait_time64 sched_rr_get_interval -> sched_rr_get_interval_time64 semtimedop -> semtimedop_time64 timer_gettime -> timer_gettime64 timer_settime -> timer_settime64 timerfd_gettime -> timerfd_gettime64 timerfd_settime -> timerfd_settime64 utimensat -> utimensat_time64. - settimeofday uses clock_settime (like in glibc/musl). - gettimeofday uses clock_gettime (like in glibc/musl). - nanosleep uses clock_nanosleep (like in glibc/musl). - There are some fixes in data structures used by libc and kernel for correct data handling both with and without enabled time64 support. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
2016-11-27fixup gcc warningsWaldemar Brodkorb
Remove following warning from common code: warning: ISO C90 forbids mixed declarations and code
2016-01-01Fix "pselect: Use linux pselect6 syscall when available"Leonid Lisovskiy
Commit e3c3bf2b58 introduce use of pselect6, but has following disadvantages: * Use of userspace types in args67 structure - it breaks, for example, configs when 32-bit uClibc-ng compiled against 64-bit kernel. Syscall will always return EINVAL. We must use __kernel_* types and __SYSCALL_SIGSET_T_SIZE. * It have excess checks for NSEC_PER_SEC. Original code from select() implementation has struct timeval => struct timespec conversion, kernel select() syscall implementation do the same. But none of libc versions (glibc, eglibc, musl) I know, perform similar checks for pselect() - there is no structure fields conversions, just struct timespec through all the calls. To have such checks in uClibc-ng we need one example, at least. * It is possible to avoid extra userspace reads from kernel code if sigmask == NULL. I suggest to do it, for a few bytes cost. * Commit didn't add test case to testsuite. Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-22pselect: Use linux pselect syscall when availableNicolas S. Dade
Linux has a pselect syscall since 2.6.something. Using it rather than emulating it with sigprocmask+select+sigprocmask is smaller code, and works properly. (The emulation has race conditions when unblocked signals arrive before or after the select) The tv.nsec >= 1E9 handling comes from uclibc's linux select() implementation, which itself uses pselect() internally if the pselect syscall exists. I though it would be good to do the same here. Note that although the libc pselect() API has 6 arguments, the linux kernel syscall as 7 arguments. There is an extra, somewhat vestigial, sizeof the signal mask argument. Signed-off-by: Nicolas S. Dade <nic.dade@gmail.com>
2012-11-18Replace FSF snail mail address with URLsMike Frysinger
This matches a similar change made to glibc. No functional changes here. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-15pselect.c: avoid handling cancellation twicePeter S. Mazinger
Use __select_nocancel instead of select Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-10-17cancellation support for a large amount of the required syscallsAustin Foxley
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-09-18trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer
sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2008-11-20Last portion of libc_hidden_proto removal.Denis Vlasenko
Appears to build fine (several .configs tried)
2008-11-20next portion of libc_hidden_proto removalDenis Vlasenko
2006-08-23psm updates: add __libc symbols for signal cancellationMike Frysinger
2006-02-12grab pselect from glibcMike Frysinger