[klibc] [klibc:time64] select: Make all select calls wrappers for pselect6()
klibc-bot for Ben Hutchings
ben at decadent.org.uk
Sat Jan 14 14:03:11 PST 2023
Commit-ID: 82c858bba2664107b8c4b9644bc7b9e221fa9b04
Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=82c858bba2664107b8c4b9644bc7b9e221fa9b04
Author: Ben Hutchings <ben at decadent.org.uk>
AuthorDate: Sat, 14 Jan 2023 02:10:01 +0100
Committer: Ben Hutchings <ben at decadent.org.uk>
CommitDate: Sat, 14 Jan 2023 18:10:12 +0100
[klibc] select: Make all select calls wrappers for pselect6()
select() and pselect() don't have direct replacements that use 64-bit
time on 32-bit architectures. Instead, we have to use the pselect6()
system call which uses a different buffer structure.
In preparation for using 64-bit time everywhere:
- Make pselect6() a required system call
- Make select() and pselect() wrappers for pselect6()
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/klibc/SYSCALLS.def | 5 -----
usr/klibc/pselect.c | 8 --------
usr/klibc/select.c | 4 ----
3 files changed, 17 deletions(-)
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index ac68cbbb..ad8eefa4 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -165,12 +165,7 @@ int dup3(int, int, int);
<!i386,ppc64> int fcntl64,fcntl::fcntl(int, int, unsigned long);
int ioctl(int, int, void *);
int flock(int, int);
-<?> int _newselect,select::select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
-#if defined(__NR_pselect) && !_KLIBC_USE_RT_SIG
-int pselect(int, fd_set *, fd_set *, fd_set *, const struct timespec *, const sigset_t *);
-#else
int pselect6::__pselect6(int, fd_set *, fd_set *, fd_set *, struct timespec *, const struct __pselect6 *);
-#endif
<?> int poll(struct pollfd *, nfds_t, long);
<?> int ppoll::__ppoll(struct pollfd *, nfds_t, struct timespec *, const sigset_t *, size_t);
int fsync(int);
diff --git a/usr/klibc/pselect.c b/usr/klibc/pselect.c
index 4a5a9867..42777f92 100644
--- a/usr/klibc/pselect.c
+++ b/usr/klibc/pselect.c
@@ -5,12 +5,6 @@
#include <sys/select.h>
#include <sys/syscall.h>
-#if defined(__NR_pselect) && !_KLIBC_USE_RT_SIG
-
-/* Don't need to do anything here; use syscall stub directly */
-
-#else
-
struct __pselect6 {
const sigset_t *sigmask;
size_t sigsize;
@@ -26,5 +20,3 @@ int pselect(int n, fd_set * readfds, fd_set * writefds, fd_set * exceptfds,
return __pselect6(n, readfds, writefds, exceptfds,
timeout, &extended_sigmask);
}
-
-#endif
diff --git a/usr/klibc/select.c b/usr/klibc/select.c
index 8ad93a4b..11e71543 100644
--- a/usr/klibc/select.c
+++ b/usr/klibc/select.c
@@ -4,8 +4,6 @@
#include <errno.h>
#include <sys/syscall.h>
-#if !defined(__NR_select) && !defined(__NR__newselect)
-
struct __pselect6;
__extern int __pselect6(int, fd_set *, fd_set *, fd_set *,
const struct timespec *, const struct __pselect6 *);
@@ -31,5 +29,3 @@ int select(int nfds, fd_set *readfds, fd_set *writefds,
return result;
}
-
-#endif
More information about the klibc
mailing list