summaryrefslogtreecommitdiff
path: root/src/lib/shm_du_map.c
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-03 00:19:06 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-08-03 00:29:34 +0200
commita6e8978fd9b5786607438689f8cd8b8efb8ef77e (patch)
tree3c2e0982771540ab9b5a061a1645a8a36568bacf /src/lib/shm_du_map.c
parentd409fd569683d8f0e8c8f65d4820087dbf7c0786 (diff)
downloadouroboros-a6e8978fd9b5786607438689f8cd8b8efb8ef77e.tar.gz
ouroboros-a6e8978fd9b5786607438689f8cd8b8efb8ef77e.zip
lib: dev: Add select-like call
This adds a flow_select() call that will sleep until an SDU can be read on a flow. It returns the file descriptor for which an SDU is ready. It takes as optional argument a timespec struct to specify a timeout.
Diffstat (limited to 'src/lib/shm_du_map.c')
-rw-r--r--src/lib/shm_du_map.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/shm_du_map.c b/src/lib/shm_du_map.c
index 6dc4a1bd..b090bb74 100644
--- a/src/lib/shm_du_map.c
+++ b/src/lib/shm_du_map.c
@@ -416,7 +416,7 @@ ssize_t shm_du_map_write(struct shm_du_map * dum,
int sz = size + sizeof *sdb;
#endif
uint8_t * write_pos;
- ssize_t index = -1;
+ ssize_t idx = -1;
if (dum == NULL || data == NULL) {
LOG_DBGF("Bogus input, bugging out.");
@@ -475,7 +475,7 @@ ssize_t shm_du_map_write(struct shm_du_map * dum,
memcpy(write_pos, data, len);
- index = *dum->ptr_head;
+ idx = *dum->ptr_head;
#ifdef SHM_DU_MAP_MULTI_BLOCK
*dum->ptr_head = (*dum->ptr_head + blocks) & (SHM_BLOCKS_IN_MAP - 1);
#else
@@ -483,7 +483,7 @@ ssize_t shm_du_map_write(struct shm_du_map * dum,
#endif
pthread_mutex_unlock(dum->shm_mutex);
- return index;
+ return idx;
}
int shm_du_map_read(uint8_t ** dst,