summaryrefslogtreecommitdiffstats
path: root/src/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/select.c b/src/select.c
index 5421c773..477ff662 100644
--- a/src/select.c
+++ b/src/select.c
@@ -170,6 +170,18 @@ restart:
return work;
}
+/*! \brief find an osmo_fd based on the integer fd */
+struct osmo_fd *osmo_fd_get_by_fd(int fd)
+{
+ struct osmo_fd *ofd;
+
+ llist_for_each_entry(ofd, &osmo_fds, list) {
+ if (ofd->fd == fd)
+ return ofd;
+ }
+ return NULL;
+}
+
/*! @} */
#endif /* _HAVE_SYS_SELECT_H */