[klibc] [klibc:master] select: Make all select calls wrappers for pselect6()

klibc-bot for Ben Hutchings ben at decadent.org.uk
Sun Feb 12 14:48:11 PST 2023


Commit-ID:  df8acc6168d9abd9dee5c2eb6b9e6a25311676bc
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=df8acc6168d9abd9dee5c2eb6b9e6a25311676bc
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: Sun, 12 Feb 2023 22:10:18 +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 | 1 -
 usr/klibc/select.c     | 4 ----
 2 files changed, 5 deletions(-)

diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index 6d01c176..ad8eefa4 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -165,7 +165,6 @@ 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 *);
 int pselect6::__pselect6(int, fd_set *, fd_set *, fd_set *, struct timespec *, const struct __pselect6 *);
 <?> int poll(struct pollfd *, nfds_t, long);
 <?> int ppoll::__ppoll(struct pollfd *, nfds_t, struct timespec *, const sigset_t *, size_t);
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