summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2002-05-13 02:16:25 +0000
committerMarcus Brinkmann <marcus@gnu.org>2002-05-13 02:16:25 +0000
commit3458a0f98645cd5c9de8b5d22872e2bbd4d82185 (patch)
treedc3c92fe14c85090996770f732a27d024ce8621e
parent2672a59c2c54370e4640475155e34db8d1268a7b (diff)
2002-05-13 Marcus Brinkmann <marcus@gnu.org>
* fakeroot.c (NETFS_S_SIMPLE): New macro. (netfs_S_io_get_conch): New function. (netfs_S_io_release_conch): New function. (netfs_S_io_eofnotify): New function. (netfs_S_io_prenotify): New function. (netfs_S_io_postnotify): New function. (netfs_S_io_readnotify): New function. (netfs_S_io_readsleep): New function. (netfs_S_io_sigio): New function. (netfs_S_io_map_cntl): New function.
-rw-r--r--trans/ChangeLog13
-rw-r--r--trans/fakeroot.c69
2 files changed, 82 insertions, 0 deletions
diff --git a/trans/ChangeLog b/trans/ChangeLog
index 85b2ebfc..4d876aec 100644
--- a/trans/ChangeLog
+++ b/trans/ChangeLog
@@ -1,3 +1,16 @@
+2002-05-13 Marcus Brinkmann <marcus@gnu.org>
+
+ * fakeroot.c (NETFS_S_SIMPLE): New macro.
+ (netfs_S_io_get_conch): New function.
+ (netfs_S_io_release_conch): New function.
+ (netfs_S_io_eofnotify): New function.
+ (netfs_S_io_prenotify): New function.
+ (netfs_S_io_postnotify): New function.
+ (netfs_S_io_readnotify): New function.
+ (netfs_S_io_readsleep): New function.
+ (netfs_S_io_sigio): New function.
+ (netfs_S_io_map_cntl): New function.
+
2002-05-12 Roland McGrath <roland@frob.com>
* fakeroot.c (netfs_attempt_lookup): Treat EOPNOTSUPP like EACCES.
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 93435f5d..5f9e721a 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -589,6 +589,75 @@ netfs_S_io_map (struct protid *user,
return err;
}
+error_t
+netfs_S_io_map_cntl (struct protid *user,
+ mach_port_t *obj,
+ mach_msg_type_name_t *objtype)
+{
+ error_t err;
+
+ if (!user)
+ return EOPNOTSUPP;
+ *objtype = MACH_MSG_TYPE_MOVE_SEND;
+
+ mutex_lock (&user->po->np->lock);
+ err = io_map_cntl (user->po->np->nn->file, obj);
+ mutex_unlock (&user->po->np->lock);
+ return err;
+}
+
+#define NETFS_S_SIMPLE(name) \
+error_t \
+netfs_S_##name (struct protid *user) \
+{ \
+ error_t err; \
+ \
+ if (!user) \
+ return EOPNOTSUPP; \
+ \
+ mutex_lock (&user->po->np->lock); \
+ err = name (user->po->np->nn->file); \
+ mutex_unlock (&user->po->np->lock); \
+ return err; \
+}
+
+NETFS_S_SIMPLE (io_get_conch)
+NETFS_S_SIMPLE (io_release_conch)
+NETFS_S_SIMPLE (io_eofnotify)
+NETFS_S_SIMPLE (io_readnotify)
+NETFS_S_SIMPLE (io_readsleep)
+NETFS_S_SIMPLE (io_sigio)
+
+error_t
+netfs_S_io_prenotify (struct protid *user,
+ vm_offset_t start, vm_offset_t stop)
+{
+ error_t err;
+
+ if (!user)
+ return EOPNOTSUPP;
+
+ mutex_lock (&user->po->np->lock);
+ err = io_get_prenotify (user->po->np->nn->file, start, stop);
+ mutex_unlock (&user->po->np->lock);
+ return err;
+}
+
+error_t
+netfs_S_io_postnotify (struct protid *user,
+ vm_offset_t start, vm_offset_t stop)
+{
+ error_t err;
+
+ if (!user)
+ return EOPNOTSUPP;
+
+ mutex_lock (&user->po->np->lock);
+ err = io_get_postnotify (user->po->np->nn->file, start, stop);
+ mutex_unlock (&user->po->np->lock);
+ return err;
+}
+
/* This overrides the library's definition. */
int
netfs_demuxer (mach_msg_header_t *inp,