From 884984ae0a9b551dcd92d6d0486b2d741eabd20f Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 8 Feb 2011 17:33:59 +0100 Subject: s3: Add poll_intr_one_fd --- source3/lib/util_sock.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index 3dd84fe8d7..51de68f4c3 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1793,3 +1793,20 @@ int poll_one_fd(int fd, int events, int timeout, int *revents) return ret; } + +int poll_intr_one_fd(int fd, int events, int timeout, int *revents) +{ + struct pollfd pfd; + int ret; + + pfd.fd = fd; + pfd.events = events; + + ret = sys_poll_intr(&pfd, 1, timeout); + if (ret <= 0) { + *revents = 0; + return ret; + } + *revents = pfd.revents; + return 1; +} -- cgit