|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH] stubdom: support select with NULL arguments
Add support for select() call with NULL arguments.
Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
diff -r 73ec21ad5dc7 extras/mini-os/lib/sys.c
--- a/extras/mini-os/lib/sys.c Tue Mar 11 16:01:04 2008 +0000
+++ b/extras/mini-os/lib/sys.c Tue Mar 11 17:35:14 2008 +0000
@@ -820,9 +820,19 @@
add_waiter(w4, xenbus_watch_queue);
add_waiter(w5, kbdfront_queue);
- myread = *readfds;
- mywrite = *writefds;
- myexcept = *exceptfds;
+ if (readfds)
+ myread = *readfds;
+ else
+ FD_ZERO(&myread);
+ if (writefds)
+ mywrite = *writefds;
+ else
+ FD_ZERO(&mywrite);
+ if (exceptfds)
+ myexcept = *exceptfds;
+ else
+ FD_ZERO(&myexcept);
+
DEBUG("polling ");
dump_set(nfds, &myread, &mywrite, &myexcept, timeout);
DEBUG("\n");
@@ -861,9 +871,19 @@
thread->wakeup_time = stop;
schedule();
- myread = *readfds;
- mywrite = *writefds;
- myexcept = *exceptfds;
+ if (readfds)
+ myread = *readfds;
+ else
+ FD_ZERO(&myread);
+ if (writefds)
+ mywrite = *writefds;
+ else
+ FD_ZERO(&mywrite);
+ if (exceptfds)
+ myexcept = *exceptfds;
+ else
+ FD_ZERO(&myexcept);
+
n = select_poll(nfds, &myread, &mywrite, &myexcept);
if (n) {
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Xen-devel] [PATCH] stubdom: support select with NULL arguments,
Samuel Thibault <=
|
|
|
|
|