From b904e428aa03c806a39b11bcda296bf63fec494e Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 18 Oct 2020 21:24:13 +0200 Subject: 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 --- include/osmocom/core/timer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/osmocom/core') 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); -- cgit v1.2.3