Skip to content

Commit e636610

Browse files
committed
tools/nolibc: remove __nolibc_enosys() fallback from time64-related functions
These fallbacks where added when no explicit fallbacks for time64 was implemented. Now that these fallbacks are in place, the additional fallback to __nolibc_enosys() is superfluous. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250821-nolibc-enosys-v1-1-4b63f2caaa89@weissschuh.net
1 parent b22d81e commit e636610

4 files changed

Lines changed: 6 additions & 18 deletions

File tree

tools/include/nolibc/poll.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ int sys_poll(struct pollfd *fds, int nfds, int timeout)
3939
t.tv_nsec = (timeout % 1000) * 1000000;
4040
}
4141
return my_syscall5(__NR_ppoll_time64, fds, nfds, (timeout >= 0) ? &t : NULL, NULL, 0);
42-
#elif defined(__NR_poll)
43-
return my_syscall3(__NR_poll, fds, nfds, timeout);
4442
#else
45-
return __nolibc_enosys(__func__, fds, nfds, timeout);
43+
return my_syscall3(__NR_poll, fds, nfds, timeout);
4644
#endif
4745
}
4846

tools/include/nolibc/sys.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -814,16 +814,14 @@ int sys_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeva
814814
t.tv_nsec = timeout->tv_usec * 1000;
815815
}
816816
return my_syscall6(__NR_pselect6, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL);
817-
#elif defined(__NR_pselect6_time64)
817+
#else
818818
struct __kernel_timespec t;
819819

820820
if (timeout) {
821821
t.tv_sec = timeout->tv_sec;
822822
t.tv_nsec = timeout->tv_usec * 1000;
823823
}
824824
return my_syscall6(__NR_pselect6_time64, nfds, rfds, wfds, efds, timeout ? &t : NULL, NULL);
825-
#else
826-
return __nolibc_enosys(__func__, nfds, rfds, wfds, efds, timeout);
827825
#endif
828826
}
829827

tools/include/nolibc/sys/timerfd.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,14 @@ int sys_timerfd_gettime(int fd, struct itimerspec *curr_value)
3434
{
3535
#if defined(__NR_timerfd_gettime)
3636
return my_syscall2(__NR_timerfd_gettime, fd, curr_value);
37-
#elif defined(__NR_timerfd_gettime64)
37+
#else
3838
struct __kernel_itimerspec kcurr_value;
3939
int ret;
4040

4141
ret = my_syscall2(__NR_timerfd_gettime64, fd, &kcurr_value);
4242
__nolibc_timespec_kernel_to_user(&kcurr_value.it_interval, &curr_value->it_interval);
4343
__nolibc_timespec_kernel_to_user(&kcurr_value.it_value, &curr_value->it_value);
4444
return ret;
45-
#else
46-
return __nolibc_enosys(__func__, fd, curr_value);
4745
#endif
4846
}
4947

@@ -60,7 +58,7 @@ int sys_timerfd_settime(int fd, int flags,
6058
{
6159
#if defined(__NR_timerfd_settime)
6260
return my_syscall4(__NR_timerfd_settime, fd, flags, new_value, old_value);
63-
#elif defined(__NR_timerfd_settime64)
61+
#else
6462
struct __kernel_itimerspec knew_value, kold_value;
6563
int ret;
6664

@@ -72,8 +70,6 @@ int sys_timerfd_settime(int fd, int flags,
7270
__nolibc_timespec_kernel_to_user(&kold_value.it_value, &old_value->it_value);
7371
}
7472
return ret;
75-
#else
76-
return __nolibc_enosys(__func__, fd, flags, new_value, old_value);
7773
#endif
7874
}
7975

tools/include/nolibc/time.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ int sys_clock_getres(clockid_t clockid, struct timespec *res)
4545
{
4646
#if defined(__NR_clock_getres)
4747
return my_syscall2(__NR_clock_getres, clockid, res);
48-
#elif defined(__NR_clock_getres_time64)
48+
#else
4949
struct __kernel_timespec kres;
5050
int ret;
5151

5252
ret = my_syscall2(__NR_clock_getres_time64, clockid, &kres);
5353
if (res)
5454
__nolibc_timespec_kernel_to_user(&kres, res);
5555
return ret;
56-
#else
57-
return __nolibc_enosys(__func__, clockid, res);
5856
#endif
5957
}
6058

@@ -69,16 +67,14 @@ int sys_clock_gettime(clockid_t clockid, struct timespec *tp)
6967
{
7068
#if defined(__NR_clock_gettime)
7169
return my_syscall2(__NR_clock_gettime, clockid, tp);
72-
#elif defined(__NR_clock_gettime64)
70+
#else
7371
struct __kernel_timespec ktp;
7472
int ret;
7573

7674
ret = my_syscall2(__NR_clock_gettime64, clockid, &ktp);
7775
if (tp)
7876
__nolibc_timespec_kernel_to_user(&ktp, tp);
7977
return ret;
80-
#else
81-
return __nolibc_enosys(__func__, clockid, tp);
8278
#endif
8379
}
8480

0 commit comments

Comments
 (0)