aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-10-18 21:24:13 +0200
committerlaforge <laforge@osmocom.org>2020-10-23 15:09:05 +0000
commitb904e428aa03c806a39b11bcda296bf63fec494e (patch)
tree901d23e7259d473dd70d5082e9ffedd4cc881e27 /include/osmocom/core
parent6760845da6587785f49af564cfad336fb9fe1586 (diff)
select: Migrate over to poll()
select is an ancient interface with weird restrictions, such as the fact that it cannot be used for file descriptor values > 1024. This may have been sufficient 40 years ago, but certainly is not in 2020. I wanted to migrate to epoll(), but unfortunately it doesn't work well with the fact that existing programs simply set osmo_fd.flags without making any API calls at the time they change those flags. So let's do the migration to poll() as a first step, and then consider epoll() as a second step further down the road, after introducing new APIs and porting applications over. The poll() code introduced in this patch is not extremely efficient, as it needs to do extensive linked list iterations after poll() returns in order to find the osmo_fd from the fd. Optimization is possible, but let's postpone that to a follow-up patch. At compile time, a new --enable-force-io-select argument can be given to configure, forcing the use of the old select() backend instead of the new poll() based backend. Change-Id: I9e80da68a144b36926066610d0d3df06abe09bca
Diffstat (limited to 'include/osmocom/core')
-rw-r--r--include/osmocom/core/timer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index 19797662..6ffc3b17 100644
--- a/include/osmocom/core/timer.h
+++ b/include/osmocom/core/timer.h
@@ -84,6 +84,7 @@ int osmo_timer_remaining(const struct osmo_timer_list *timer,
* internal timer list management
*/
struct timeval *osmo_timers_nearest(void);
+int osmo_timers_nearest_ms(void);
void osmo_timers_prepare(void);
int osmo_timers_update(void);
int osmo_timers_check(void);