From bfef6800268cdcf0b9118d89f1ce7c3541bd0309 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Thu, 12 Nov 2026 22:28:39 +0100 Subject: Stop forcing 64 bit variables on 32 bit targets where a long would do just fine --- src/ot_fdstate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ot_fdstate.c') diff --git a/src/ot_fdstate.c b/src/ot_fdstate.c index 8e4bd89..bbb25d2 100644 --- a/src/ot_fdstate.c +++ b/src/ot_fdstate.c @@ -24,7 +24,7 @@ enum { FD_FREE, FD_IDLE, FD_BUSY, FD_CLOSING }; typedef struct { _Atomic uint64_t state; _Atomic(void *) cookie; - _Atomic ot_time expiry; + _Atomic unsigned long expiry; } ot_fdslot; /* A descriptor the kernel can hand out is below the limit it was handed out @@ -72,7 +72,7 @@ static ot_fdslot *fdstate_slot(int fd) { return g_slots + fd; } -uint32_t fdstate_open(int fd, void *cookie, ot_time expiry) { +uint32_t fdstate_open(int fd, void *cookie, unsigned long expiry) { ot_fdslot *slot = fdstate_slot(fd); uint64_t word; @@ -132,10 +132,10 @@ void fdstate_release(int fd) { atomic_store_explicit(&slot->state, FD_SET_ST(word, FD_IDLE), memory_order_release); } -int fdstate_claim_expired(int fd, ot_time now) { +int fdstate_claim_expired(int fd, unsigned long now) { ot_fdslot *slot = fdstate_slot(fd); uint64_t word; - ot_time expiry; + unsigned long expiry; if (!slot) return 0; @@ -168,7 +168,7 @@ void fdstate_close(int fd) { atomic_store_explicit(&slot->state, FD_WORD(FD_GEN(word) + 1, FD_FREE), memory_order_release); } -int fdstate_next_expired(ot_time now, int *cursor) { +int fdstate_next_expired(unsigned long now, int *cursor) { size_t highest = atomic_load_explicit(&g_slot_highest, memory_order_relaxed); for (; (size_t)*cursor <= highest; ++*cursor) @@ -194,7 +194,7 @@ void fdstate_set_cookie(int fd, void *cookie) { atomic_store_explicit(&slot->cookie, cookie, memory_order_release); } -void fdstate_set_expiry(int fd, ot_time expiry) { +void fdstate_set_expiry(int fd, unsigned long expiry) { ot_fdslot *slot = fdstate_slot(fd); if (slot) -- cgit v1.3