diff options
Diffstat (limited to 'src/ot_fdstate.c')
| -rw-r--r-- | src/ot_fdstate.c | 12 |
1 files changed, 6 insertions, 6 deletions
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 }; | |||
| 24 | typedef struct { | 24 | typedef struct { |
| 25 | _Atomic uint64_t state; | 25 | _Atomic uint64_t state; |
| 26 | _Atomic(void *) cookie; | 26 | _Atomic(void *) cookie; |
| 27 | _Atomic ot_time expiry; | 27 | _Atomic unsigned long expiry; |
| 28 | } ot_fdslot; | 28 | } ot_fdslot; |
| 29 | 29 | ||
| 30 | /* A descriptor the kernel can hand out is below the limit it was handed out | 30 | /* 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) { | |||
| 72 | return g_slots + fd; | 72 | return g_slots + fd; |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | uint32_t fdstate_open(int fd, void *cookie, ot_time expiry) { | 75 | uint32_t fdstate_open(int fd, void *cookie, unsigned long expiry) { |
| 76 | ot_fdslot *slot = fdstate_slot(fd); | 76 | ot_fdslot *slot = fdstate_slot(fd); |
| 77 | uint64_t word; | 77 | uint64_t word; |
| 78 | 78 | ||
| @@ -132,10 +132,10 @@ void fdstate_release(int fd) { | |||
| 132 | atomic_store_explicit(&slot->state, FD_SET_ST(word, FD_IDLE), memory_order_release); | 132 | atomic_store_explicit(&slot->state, FD_SET_ST(word, FD_IDLE), memory_order_release); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | int fdstate_claim_expired(int fd, ot_time now) { | 135 | int fdstate_claim_expired(int fd, unsigned long now) { |
| 136 | ot_fdslot *slot = fdstate_slot(fd); | 136 | ot_fdslot *slot = fdstate_slot(fd); |
| 137 | uint64_t word; | 137 | uint64_t word; |
| 138 | ot_time expiry; | 138 | unsigned long expiry; |
| 139 | 139 | ||
| 140 | if (!slot) | 140 | if (!slot) |
| 141 | return 0; | 141 | return 0; |
| @@ -168,7 +168,7 @@ void fdstate_close(int fd) { | |||
| 168 | atomic_store_explicit(&slot->state, FD_WORD(FD_GEN(word) + 1, FD_FREE), memory_order_release); | 168 | atomic_store_explicit(&slot->state, FD_WORD(FD_GEN(word) + 1, FD_FREE), memory_order_release); |
| 169 | } | 169 | } |
| 170 | 170 | ||
| 171 | int fdstate_next_expired(ot_time now, int *cursor) { | 171 | int fdstate_next_expired(unsigned long now, int *cursor) { |
| 172 | size_t highest = atomic_load_explicit(&g_slot_highest, memory_order_relaxed); | 172 | size_t highest = atomic_load_explicit(&g_slot_highest, memory_order_relaxed); |
| 173 | 173 | ||
| 174 | for (; (size_t)*cursor <= highest; ++*cursor) | 174 | for (; (size_t)*cursor <= highest; ++*cursor) |
| @@ -194,7 +194,7 @@ void fdstate_set_cookie(int fd, void *cookie) { | |||
| 194 | atomic_store_explicit(&slot->cookie, cookie, memory_order_release); | 194 | atomic_store_explicit(&slot->cookie, cookie, memory_order_release); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | void fdstate_set_expiry(int fd, ot_time expiry) { | 197 | void fdstate_set_expiry(int fd, unsigned long expiry) { |
| 198 | ot_fdslot *slot = fdstate_slot(fd); | 198 | ot_fdslot *slot = fdstate_slot(fd); |
| 199 | 199 | ||
| 200 | if (slot) | 200 | if (slot) |
