summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pfinet/io-ops.c17
-rw-r--r--pfinet/mutations.h2
2 files changed, 15 insertions, 4 deletions
diff --git a/pfinet/io-ops.c b/pfinet/io-ops.c
index 5e37662f..7e9229fd 100644
--- a/pfinet/io-ops.c
+++ b/pfinet/io-ops.c
@@ -26,7 +26,7 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-
+#include <mach/notify.h>
error_t
S_io_write (struct sock_user *user,
@@ -233,11 +233,12 @@ S_io_clear_some_openmodes (struct sock_user *user,
error_t
S_io_select (struct sock_user *user,
- int *select_type,
- int *id_tag)
+ mach_port_t reply, mach_msg_type_name_t reply_type,
+ int *select_type, int *id_tag)
{
int avail = 0;
int cancel = 0;
+ int requested_notify = 0;
select_table table;
struct select_table_elt *elt, *nxt;
@@ -273,7 +274,15 @@ S_io_select (struct sock_user *user,
? SELECT_URG : 0);
if (!avail)
- cancel = hurd_condition_wait (&table.master_condition, &global_lock);
+ {
+ if (! requested_notify)
+ {
+ ports_interrupt_self_on_notification (user, reply,
+ MACH_NOTIFY_DEAD_NAME);
+ requested_notify = 1;
+ }
+ cancel = hurd_condition_wait (&table.master_condition, &global_lock);
+ }
/* Drop the conditions implications and structures allocated in the
select table. */
diff --git a/pfinet/mutations.h b/pfinet/mutations.h
index 8881c5db..8c0df887 100644
--- a/pfinet/mutations.h
+++ b/pfinet/mutations.h
@@ -20,6 +20,8 @@
/* Only CPP macro definitions should go in this file. */
+#define IO_SELECT_REPLY_PORT
+
#define IO_INTRAN sock_user_t begin_using_socket_port (io_t)
#define IO_DESTRUCTOR end_using_socket_port (sock_user_t)