From 3458a0f98645cd5c9de8b5d22872e2bbd4d82185 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Mon, 13 May 2002 02:16:25 +0000 Subject: 2002-05-13 Marcus Brinkmann * 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. --- trans/ChangeLog | 13 +++++++++++ trans/fakeroot.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) (limited to 'trans') 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 + + * 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 * 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, -- cgit v1.2.3