From a6e8978fd9b5786607438689f8cd8b8efb8ef77e Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 3 Aug 2016 00:19:06 +0200 Subject: 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. --- include/ouroboros/dev.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/ouroboros/dev.h') diff --git a/include/ouroboros/dev.h b/include/ouroboros/dev.h index eb779953..91d5c7de 100644 --- a/include/ouroboros/dev.h +++ b/include/ouroboros/dev.h @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -53,5 +54,6 @@ int flow_dealloc(int fd); int flow_cntl(int fd, int cmd, int oflags); ssize_t flow_write(int fd, void * buf, size_t count); ssize_t flow_read(int fd, void * buf, size_t count); +int flow_select(const struct timespec * timeout); #endif -- cgit v1.2.3