summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/select.h
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2016-12-09 14:07:18 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2017-02-07 13:39:00 +0100
commitb288853ffa01fbce1f5831ae6d387520c8882aec (patch)
treea37468ea47c91bb98f8f56385f68e45e7ecc628b /include/osmocom/core/select.h
parent7132011afa1741f8cc435250a6981a4f6919f396 (diff)
select: add functionality to check socket state
osmo_fd_register() is used to register socket file descriptors, after registering a socket, there is no way to test if the socket is still registered or actually registered at all. This commit adds a new function osmo_fd_register_check() that can be used to check in advance, if the socket fd is registered, before performing further operations. Change-Id: I48ec7098d6bba586c81bf0d5c9088108e2c081c6
Diffstat (limited to 'include/osmocom/core/select.h')
-rw-r--r--include/osmocom/core/select.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/osmocom/core/select.h b/include/osmocom/core/select.h
index 2753637a..c2b51a45 100644
--- a/include/osmocom/core/select.h
+++ b/include/osmocom/core/select.h
@@ -1,6 +1,7 @@
#pragma once
#include <osmocom/core/linuxlist.h>
+#include <stdbool.h>
/*! \defgroup select Select loop abstraction
* @{
@@ -35,6 +36,7 @@ struct osmo_fd {
unsigned int priv_nr;
};
+bool osmo_fd_is_registered(struct osmo_fd *fd);
int osmo_fd_register(struct osmo_fd *fd);
void osmo_fd_unregister(struct osmo_fd *fd);
int osmo_select_main(int polling);