|
| 1 | +--- a/zig/lib/libc/musl/src/ipc/semtimedop.c |
| 2 | ++++ b/zig/lib/libc/musl/src/ipc/semtimedop.c |
| 3 | +@@ -16,7 +16,7 @@ |
| 4 | + |
| 5 | + int semtimedop(int id, struct sembuf *buf, size_t n, const struct timespec *ts) |
| 6 | + { |
| 7 | +-#ifdef SYS_semtimedop_time64 |
| 8 | ++#if defined(SYS_semtimedop_time64) && !defined(__ILP32__) |
| 9 | + time_t s = ts ? ts->tv_sec : 0; |
| 10 | + long ns = ts ? ts->tv_nsec : 0; |
| 11 | + int r = -ENOSYS; |
| 12 | +--- a/zig/lib/libc/musl/src/linux/clock_adjtime.c |
| 13 | ++++ b/zig/lib/libc/musl/src/linux/clock_adjtime.c |
| 14 | +@@ -37,7 +37,7 @@ |
| 15 | + int clock_adjtime (clockid_t clock_id, struct timex *utx) |
| 16 | + { |
| 17 | + int r = -ENOSYS; |
| 18 | +-#ifdef SYS_clock_adjtime64 |
| 19 | ++#if defined(SYS_clock_adjtime64) && !defined(__ILP32__) |
| 20 | + struct ktimex64 ktx = { |
| 21 | + .modes = utx->modes, |
| 22 | + .offset = utx->offset, |
| 23 | +--- a/zig/lib/libc/musl/src/linux/timerfd.c |
| 24 | ++++ b/zig/lib/libc/musl/src/linux/timerfd.c |
| 25 | +@@ -11,7 +11,7 @@ |
| 26 | + |
| 27 | + int timerfd_settime(int fd, int flags, const struct itimerspec *new, struct itimerspec *old) |
| 28 | + { |
| 29 | +-#ifdef SYS_timerfd_settime64 |
| 30 | ++#if defined(SYS_timerfd_settime64) && !defined(__ILP32__) |
| 31 | + time_t is = new->it_interval.tv_sec, vs = new->it_value.tv_sec; |
| 32 | + long ins = new->it_interval.tv_nsec, vns = new->it_value.tv_nsec; |
| 33 | + int r = -ENOSYS; |
| 34 | +@@ -39,7 +39,7 @@ |
| 35 | + |
| 36 | + int timerfd_gettime(int fd, struct itimerspec *cur) |
| 37 | + { |
| 38 | +-#ifdef SYS_timerfd_gettime64 |
| 39 | ++#if defined(SYS_timerfd_gettime64) && !defined(__ILP32__) |
| 40 | + int r = -ENOSYS; |
| 41 | + if (sizeof(time_t) > 4) |
| 42 | + r = __syscall(SYS_timerfd_gettime64, fd, cur); |
| 43 | +--- a/zig/lib/libc/musl/src/linux/wait4.c |
| 44 | ++++ b/zig/lib/libc/musl/src/linux/wait4.c |
| 45 | +@@ -8,7 +8,7 @@ |
| 46 | + pid_t wait4(pid_t pid, int *status, int options, struct rusage *ru) |
| 47 | + { |
| 48 | + int r; |
| 49 | +-#ifdef SYS_wait4_time64 |
| 50 | ++#if defined(SYS_wait4_time64) && !defined(__ILP32__) |
| 51 | + if (ru) { |
| 52 | + long long kru64[18]; |
| 53 | + r = __syscall(SYS_wait4_time64, pid, status, options, kru64); |
| 54 | +--- a/zig/lib/libc/musl/src/misc/getrusage.c |
| 55 | ++++ b/zig/lib/libc/musl/src/misc/getrusage.c |
| 56 | +@@ -6,7 +6,7 @@ |
| 57 | + int getrusage(int who, struct rusage *ru) |
| 58 | + { |
| 59 | + int r; |
| 60 | +-#ifdef SYS_getrusage_time64 |
| 61 | ++#if defined(SYS_getrusage_time64) && !defined(__ILP32__) |
| 62 | + long long kru64[18]; |
| 63 | + r = __syscall(SYS_getrusage_time64, who, kru64); |
| 64 | + if (!r) { |
| 65 | +--- a/zig/lib/libc/musl/src/mq/mq_timedsend.c |
| 66 | ++++ b/zig/lib/libc/musl/src/mq/mq_timedsend.c |
| 67 | +@@ -7,7 +7,7 @@ |
| 68 | + |
| 69 | + int mq_timedsend(mqd_t mqd, const char *msg, size_t len, unsigned prio, const struct timespec *at) |
| 70 | + { |
| 71 | +-#ifdef SYS_mq_timedsend_time64 |
| 72 | ++#if defined(SYS_mq_timedsend_time64) && !defined(__ILP32__) |
| 73 | + time_t s = at ? at->tv_sec : 0; |
| 74 | + long ns = at ? at->tv_nsec : 0; |
| 75 | + long r = -ENOSYS; |
| 76 | +--- a/zig/lib/libc/musl/src/network/recvmmsg.c |
| 77 | ++++ b/zig/lib/libc/musl/src/network/recvmmsg.c |
| 78 | +@@ -18,7 +18,7 @@ |
| 79 | + for (i = vlen; i; i--, mh++) |
| 80 | + mh->msg_hdr.__pad1 = mh->msg_hdr.__pad2 = 0; |
| 81 | + #endif |
| 82 | +-#ifdef SYS_recvmmsg_time64 |
| 83 | ++#if defined(SYS_recvmmsg_time64) && !defined(__ILP32__) |
| 84 | + time_t s = timeout ? timeout->tv_sec : 0; |
| 85 | + long ns = timeout ? timeout->tv_nsec : 0; |
| 86 | + int r = __syscall_cp(SYS_recvmmsg_time64, fd, msgvec, vlen, flags, |
| 87 | +--- a/zig/lib/libc/musl/src/select/ppoll.c |
| 88 | ++++ b/zig/lib/libc/musl/src/select/ppoll.c |
| 89 | +@@ -11,7 +11,7 @@ |
| 90 | + { |
| 91 | + time_t s = to ? to->tv_sec : 0; |
| 92 | + long ns = to ? to->tv_nsec : 0; |
| 93 | +-#ifdef SYS_ppoll_time64 |
| 94 | ++#if defined(SYS_ppoll_time64) && !defined(__ILP32__) |
| 95 | + int r = -ENOSYS; |
| 96 | + if (SYS_ppoll == SYS_ppoll_time64 || !IS32BIT(s)) |
| 97 | + r = __syscall_cp(SYS_ppoll_time64, fds, n, |
| 98 | +--- a/zig/lib/libc/musl/src/select/pselect.c |
| 99 | ++++ b/zig/lib/libc/musl/src/select/pselect.c |
| 100 | +@@ -12,7 +12,7 @@ |
| 101 | + syscall_arg_t data[2] = { (uintptr_t)mask, _NSIG/8 }; |
| 102 | + time_t s = ts ? ts->tv_sec : 0; |
| 103 | + long ns = ts ? ts->tv_nsec : 0; |
| 104 | +-#ifdef SYS_pselect6_time64 |
| 105 | ++#if defined(SYS_pselect6_time64) && !defined(__ILP32__) |
| 106 | + int r = -ENOSYS; |
| 107 | + if (SYS_pselect6 == SYS_pselect6_time64 || !IS32BIT(s)) |
| 108 | + r = __syscall_cp(SYS_pselect6_time64, n, rfds, wfds, efds, |
| 109 | +--- a/zig/lib/libc/musl/src/select/select.c |
| 110 | ++++ b/zig/lib/libc/musl/src/select/select.c |
| 111 | +@@ -25,7 +25,7 @@ |
| 112 | + ns = us*1000; |
| 113 | + } |
| 114 | + |
| 115 | +-#ifdef SYS_pselect6_time64 |
| 116 | ++#if defined(SYS_pselect6_time64) && !defined(__ILP32__) |
| 117 | + int r = -ENOSYS; |
| 118 | + if (SYS_pselect6 == SYS_pselect6_time64 || !IS32BIT(s)) |
| 119 | + r = __syscall_cp(SYS_pselect6_time64, n, rfds, wfds, efds, |
| 120 | +--- a/zig/lib/libc/musl/src/signal/sigtimedwait.c |
| 121 | ++++ b/zig/lib/libc/musl/src/signal/sigtimedwait.c |
| 122 | +@@ -7,7 +7,7 @@ |
| 123 | + |
| 124 | + static int do_sigtimedwait(const sigset_t *restrict mask, siginfo_t *restrict si, const struct timespec *restrict ts) |
| 125 | + { |
| 126 | +-#ifdef SYS_rt_sigtimedwait_time64 |
| 127 | ++#if defined(SYS_rt_sigtimedwait_time64) && !defined(__ILP32__) |
| 128 | + time_t s = ts ? ts->tv_sec : 0; |
| 129 | + long ns = ts ? ts->tv_nsec : 0; |
| 130 | + int r = -ENOSYS; |
| 131 | +--- a/zig/lib/libc/musl/src/stat/fstatat.c |
| 132 | ++++ b/zig/lib/libc/musl/src/stat/fstatat.c |
| 133 | +@@ -7,6 +7,9 @@ |
| 134 | + #include <sys/sysmacros.h> |
| 135 | + #include "syscall.h" |
| 136 | + |
| 137 | ++#undef SYS_lstat |
| 138 | ++#undef SYS_stat |
| 139 | ++ |
| 140 | + struct statx { |
| 141 | + uint32_t stx_mask; |
| 142 | + uint32_t stx_blksize; |
| 143 | +@@ -140,14 +143,18 @@ |
| 144 | + { |
| 145 | + int ret; |
| 146 | + #ifdef SYS_fstatat |
| 147 | ++#if 0 |
| 148 | + if (sizeof((struct kstat){0}.st_atime_sec) < sizeof(time_t)) { |
| 149 | + ret = fstatat_statx(fd, path, st, flag); |
| 150 | + if (ret!=-ENOSYS) return __syscall_ret(ret); |
| 151 | + } |
| 152 | ++#endif |
| 153 | + ret = fstatat_kstat(fd, path, st, flag); |
| 154 | + #else |
| 155 | ++#if 0 |
| 156 | + ret = fstatat_statx(fd, path, st, flag); |
| 157 | + #endif |
| 158 | ++#endif |
| 159 | + return __syscall_ret(ret); |
| 160 | + } |
| 161 | + |
| 162 | +--- a/zig/lib/libc/musl/src/stat/utimensat.c |
| 163 | ++++ b/zig/lib/libc/musl/src/stat/utimensat.c |
| 164 | +@@ -12,7 +12,7 @@ |
| 165 | + int r; |
| 166 | + if (times && times[0].tv_nsec==UTIME_NOW && times[1].tv_nsec==UTIME_NOW) |
| 167 | + times = 0; |
| 168 | +-#ifdef SYS_utimensat_time64 |
| 169 | ++#if defined(SYS_utimensat_time64) && !defined(__ILP32__) |
| 170 | + r = -ENOSYS; |
| 171 | + time_t s0=0, s1=0; |
| 172 | + long ns0=0, ns1=0; |
| 173 | +--- a/zig/lib/libc/musl/src/thread/__timedwait.c |
| 174 | ++++ b/zig/lib/libc/musl/src/thread/__timedwait.c |
| 175 | +@@ -11,7 +11,7 @@ |
| 176 | + static int __futex4_cp(volatile void *addr, int op, int val, const struct timespec *to) |
| 177 | + { |
| 178 | + int r; |
| 179 | +-#ifdef SYS_futex_time64 |
| 180 | ++#if defined(SYS_futex_time64) && !defined(__ILP32__) |
| 181 | + time_t s = to ? to->tv_sec : 0; |
| 182 | + long ns = to ? to->tv_nsec : 0; |
| 183 | + r = -ENOSYS; |
| 184 | +--- a/zig/lib/libc/musl/src/thread/pthread_mutex_timedlock.c |
| 185 | ++++ b/zig/lib/libc/musl/src/thread/pthread_mutex_timedlock.c |
| 186 | +@@ -5,7 +5,7 @@ |
| 187 | + |
| 188 | + static int __futex4(volatile void *addr, int op, int val, const struct timespec *to) |
| 189 | + { |
| 190 | +-#ifdef SYS_futex_time64 |
| 191 | ++#if defined(SYS_futex_time64) && !defined(__ILP32__) |
| 192 | + time_t s = to ? to->tv_sec : 0; |
| 193 | + long ns = to ? to->tv_nsec : 0; |
| 194 | + int r = -ENOSYS; |
| 195 | +--- a/zig/lib/libc/musl/src/time/clock_gettime.c |
| 196 | ++++ b/zig/lib/libc/musl/src/time/clock_gettime.c |
| 197 | +@@ -75,7 +75,7 @@ |
| 198 | + } |
| 199 | + #endif |
| 200 | + |
| 201 | +-#ifdef SYS_clock_gettime64 |
| 202 | ++#if defined(SYS_clock_gettime64) && !defined(__ILP32__) |
| 203 | + r = -ENOSYS; |
| 204 | + if (sizeof(time_t) > 4) |
| 205 | + r = __syscall(SYS_clock_gettime64, clk, ts); |
| 206 | +--- a/zig/lib/libc/musl/src/time/clock_nanosleep.c |
| 207 | ++++ b/zig/lib/libc/musl/src/time/clock_nanosleep.c |
| 208 | +@@ -8,7 +8,7 @@ |
| 209 | + int __clock_nanosleep(clockid_t clk, int flags, const struct timespec *req, struct timespec *rem) |
| 210 | + { |
| 211 | + if (clk == CLOCK_THREAD_CPUTIME_ID) return EINVAL; |
| 212 | +-#ifdef SYS_clock_nanosleep_time64 |
| 213 | ++#if defined(SYS_clock_nanosleep_time64) && !defined(__ILP32__) |
| 214 | + time_t s = req->tv_sec; |
| 215 | + long ns = req->tv_nsec; |
| 216 | + int r = -ENOSYS; |
| 217 | +--- a/zig/lib/libc/musl/src/time/clock_settime.c |
| 218 | ++++ b/zig/lib/libc/musl/src/time/clock_settime.c |
| 219 | +@@ -6,7 +6,7 @@ |
| 220 | + |
| 221 | + int clock_settime(clockid_t clk, const struct timespec *ts) |
| 222 | + { |
| 223 | +-#ifdef SYS_clock_settime64 |
| 224 | ++#if defined(SYS_clock_settime64) && !defined(__ILP32__) |
| 225 | + time_t s = ts->tv_sec; |
| 226 | + long ns = ts->tv_nsec; |
| 227 | + int r = -ENOSYS; |
| 228 | +--- a/zig/lib/libc/musl/src/time/timer_gettime.c |
| 229 | ++++ b/zig/lib/libc/musl/src/time/timer_gettime.c |
| 230 | +@@ -8,7 +8,7 @@ |
| 231 | + pthread_t td = (void *)((uintptr_t)t << 1); |
| 232 | + t = (void *)(uintptr_t)(td->timer_id & INT_MAX); |
| 233 | + } |
| 234 | +-#ifdef SYS_timer_gettime64 |
| 235 | ++#if defined(SYS_timer_gettime64) && !defined(__ILP32__) |
| 236 | + int r = -ENOSYS; |
| 237 | + if (sizeof(time_t) > 4) |
| 238 | + r = __syscall(SYS_timer_gettime64, t, val); |
| 239 | +--- a/zig/lib/libc/musl/src/time/timer_settime.c |
| 240 | ++++ b/zig/lib/libc/musl/src/time/timer_settime.c |
| 241 | +@@ -10,7 +10,7 @@ |
| 242 | + pthread_t td = (void *)((uintptr_t)t << 1); |
| 243 | + t = (void *)(uintptr_t)(td->timer_id & INT_MAX); |
| 244 | + } |
| 245 | +-#ifdef SYS_timer_settime64 |
| 246 | ++#if defined(SYS_timer_settime64) && !defined(__ILP32__) |
| 247 | + time_t is = val->it_interval.tv_sec, vs = val->it_value.tv_sec; |
| 248 | + long ins = val->it_interval.tv_nsec, vns = val->it_value.tv_nsec; |
| 249 | + int r = -ENOSYS; |
0 commit comments