summaryrefslogtreecommitdiff
path: root/ot_fdstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_fdstate.c')
-rw-r--r--ot_fdstate.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ot_fdstate.c b/ot_fdstate.c
index 7f73d3d..537bcb0 100644
--- a/ot_fdstate.c
+++ b/ot_fdstate.c
@@ -99,6 +99,12 @@ uint32_t fdstate_open(int fd, void *cookie, ot_time expiry) {
99 return FD_GEN(word); 99 return FD_GEN(word);
100} 100}
101 101
102uint32_t fdstate_generation(int fd) {
103 ot_fdslot *slot = fdstate_slot(fd);
104
105 return slot ? FD_GEN(atomic_load_explicit(&slot->state, memory_order_relaxed)) : 0;
106}
107
102int fdstate_claim(int fd, uint32_t generation) { 108int fdstate_claim(int fd, uint32_t generation) {
103 ot_fdslot *slot = fdstate_slot(fd); 109 ot_fdslot *slot = fdstate_slot(fd);
104 uint64_t word; 110 uint64_t word;