diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-01-14 00:59:54 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-01-14 00:59:54 +0100 |
commit | 0e023ff2146d086d10c63b8e19bd263ce40d05fe (patch) | |
tree | 9554d2e4ee77052c86f37a0441f8a9232e1c0b0c /pfinet/io-ops.c | |
parent | 1d66e33cd8420401b3431aaefe5a479d9679f277 (diff) | |
download | hurd-0e023ff2146d086d10c63b8e19bd263ce40d05fe.tar.gz hurd-0e023ff2146d086d10c63b8e19bd263ce40d05fe.tar.bz2 hurd-0e023ff2146d086d10c63b8e19bd263ce40d05fe.zip |
Pass pfinet errors to io_select callers
This will be needed to properly support poll in glibc.
* pfinet/glue-include/linux/poll.h (POLLERR): Define to 0x1000.
* pfinet/io-ops.c (S_io_select): Look for POLLERR condition. On such
condition, return EIO.
Diffstat (limited to 'pfinet/io-ops.c')
-rw-r--r-- | pfinet/io-ops.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c index 0236c594..5f3b1e90 100644 --- a/pfinet/io-ops.c +++ b/pfinet/io-ops.c @@ -23,6 +23,7 @@ #include <linux/wait.h> #include <linux/socket.h> #include <linux/net.h> +#include <linux/poll.h> #include <net/sock.h> #include "io_S.h" @@ -256,8 +257,9 @@ S_io_select (struct sock_user *user, mach_msg_type_name_t reply_type, int *select_type) { - const int want = *select_type; + const int want = *select_type | POLLERR; int avail; + int ret = 0; if (!user) return EOPNOTSUPP; @@ -293,12 +295,15 @@ S_io_select (struct sock_user *user, while ((avail & want) == 0); } - /* We got something. */ - *select_type = avail; + if (avail & POLLERR) + ret = EIO; + else + /* We got something. */ + *select_type = avail; pthread_mutex_unlock (&global_lock); - return 0; + return ret; } error_t |