From 8845d8dfa340f3065d7ee1e6e51cfb1ec9028ee6 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 13 May 2013 14:43:20 +0100 Subject: [PATCH] Remove & ban use of select() for waiting for I/O Use of the select() system call is inherantly dangerous since applications will hit a buffer overrun if any FD number exceeds the size of the select set size (typically 1024). Replace the two uses of select() with poll() and use cfg.mk to ban any future use of select(). NB: This changes the phyp driver so that it uses an infinite timeout, instead of busy-waiting for 1ms at a time. Signed-off-by: Daniel P. Berrange --- cfg.mk | 5 +++++ src/phyp/phyp_driver.c | 20 +++++++------------- src/util/virnetlink.c | 16 +++++++--------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/cfg.mk b/cfg.mk index 0bf5bfc1b6..bb93c6abb9 100644 --- a/cfg.mk +++ b/cfg.mk @@ -444,6 +444,11 @@ sc_prohibit_nonreentrant: done ; \ exit $$fail +sc_prohibit_select: + @prohibit="\\