diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-08 01:25:50 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-08-08 02:28:06 +0200 |
commit | 3bc9a699ca7106204ffa97272374313bf04f6cc0 (patch) | |
tree | d4b83df84a6bb65a343f746b1f542df3ac64ae4b | |
parent | e22f3a3170e5c3028dc83fbdfb0d8705fd00df75 (diff) | |
download | hurd-3bc9a699ca7106204ffa97272374313bf04f6cc0.tar.gz hurd-3bc9a699ca7106204ffa97272374313bf04f6cc0.tar.bz2 hurd-3bc9a699ca7106204ffa97272374313bf04f6cc0.zip |
Homogeneize [gs]et_translator and get_dire[nc]ts into mach_msg_type_number_t
This makes netfs_[gs]et_translator use mach_msg_type_number_t like
the RPC and diskfs. This also makes the fshelp_fetch_root_callback1_t
for fshelp_fetch_root use mach_msg_type_number_t.
This also makes procfs_get_translator and the get_translator proc method
use mach_msg_type_number_t.
This makes diskfs_get_directs use mach_msg_type_number_t like the
dir_readdir RPC
Also get rid of u_int.
This notably fixes _diskfs_translator_callback1_fn's bogus cast of
size_t *argz_len into (u_int *).
-rw-r--r-- | doc/hurd.texi | 10 | ||||
-rw-r--r-- | eth-multiplexer/netfs_impl.c | 2 | ||||
-rw-r--r-- | ext2fs/dir.c | 2 | ||||
-rw-r--r-- | ext2fs/inode.c | 4 | ||||
-rw-r--r-- | fatfs/dir.c | 2 | ||||
-rw-r--r-- | fatfs/inode.c | 4 | ||||
-rw-r--r-- | ftpfs/netfs.c | 2 | ||||
-rw-r--r-- | hostmux/leaf.c | 20 | ||||
-rw-r--r-- | hostmux/stubs.c | 2 | ||||
-rw-r--r-- | isofs/inode.c | 4 | ||||
-rw-r--r-- | isofs/lookup.c | 2 | ||||
-rw-r--r-- | libdiskfs/dir-readdir.c | 14 | ||||
-rw-r--r-- | libdiskfs/diskfs.h | 6 | ||||
-rw-r--r-- | libdiskfs/file-get-trans.c | 2 | ||||
-rw-r--r-- | libdiskfs/trans-callback.c | 4 | ||||
-rw-r--r-- | libfshelp/fetch-root.c | 4 | ||||
-rw-r--r-- | libfshelp/fshelp.h | 4 | ||||
-rw-r--r-- | libnetfs/netfs.h | 4 | ||||
-rw-r--r-- | libnetfs/set-get-trans.c | 4 | ||||
-rw-r--r-- | libnetfs/trans-callback.c | 2 | ||||
-rw-r--r-- | procfs/netfs.c | 2 | ||||
-rw-r--r-- | procfs/procfs.c | 2 | ||||
-rw-r--r-- | procfs/procfs.h | 4 | ||||
-rw-r--r-- | procfs/rootdir.c | 2 | ||||
-rw-r--r-- | tmpfs/dir.c | 2 | ||||
-rw-r--r-- | tmpfs/node.c | 4 | ||||
-rw-r--r-- | trans/fakeroot.c | 2 | ||||
-rw-r--r-- | usermux/leaf.c | 12 | ||||
-rw-r--r-- | usermux/stubs.c | 2 |
29 files changed, 63 insertions, 67 deletions
diff --git a/doc/hurd.texi b/doc/hurd.texi index b713850c..d11b92cd 100644 --- a/doc/hurd.texi +++ b/doc/hurd.texi @@ -2356,7 +2356,7 @@ If these variables is non-zero, they will be called every time a protid or peropen structure is about to be destroyed. @end deftypefn -@deftypefn {Variable} error_t (*trivfs_getroot_hook) (@w{struct trivfs_control *@var{cntl}}, @w{mach_port_t @var{reply_port}}, @w{mach_msg_type_name_t @var{reply_port_type}}, @w{mach_port_t @var{dotdot}}, @w{const uid_t *@var{uids}}, @w{u_int @var{nuids}}, @w{const uid_t *@var{gids}}, @w{u_int @var{ngids}}, @w{int @var{flags}}, @w{retry_type *@var{do_retry}}, @w{char *@var{retry_name}}, @w{mach_port_t *@var{node}}, @w{mach_msg_type_name_t *@var{node_type}}) +@deftypefn {Variable} error_t (*trivfs_getroot_hook) (@w{struct trivfs_control *@var{cntl}}, @w{mach_port_t @var{reply_port}}, @w{mach_msg_type_name_t @var{reply_port_type}}, @w{mach_port_t @var{dotdot}}, @w{const uid_t *@var{uids}}, @w{unsigned @var{nuids}}, @w{const uid_t *@var{gids}}, @w{unsigned @var{ngids}}, @w{int @var{flags}}, @w{retry_type *@var{do_retry}}, @w{char *@var{retry_name}}, @w{mach_port_t *@var{node}}, @w{mach_msg_type_name_t *@var{node_type}}) If this variable is set, it will be called by @code{trivfs_S_fsys_getroot} before any other processing takes place. If the return value is @code{EAGAIN}, normal trivfs getroot processing continues, otherwise the @@ -2486,7 +2486,7 @@ Initialize a transbox, which contains state information for active translators. @end deftypefun -@deftypefn {Typedef} typedef error_t (*fshelp_fetch_root_callback1_t) (@w{void *@var{cookie1}}, @w{void *@var{cookie2}}, @w{uid_t *@var{uid}}, @w{gid_t *@var{gid}}, @w{char **@var{argz}}, @w{size_t *@var{argz_len}}) +@deftypefn {Typedef} typedef error_t (*fshelp_fetch_root_callback1_t) (@w{void *@var{cookie1}}, @w{void *@var{cookie2}}, @w{uid_t *@var{uid}}, @w{gid_t *@var{gid}}, @w{char **@var{argz}}, @w{mach_msg_type_number_t *@var{argz_len}}) This routine is called by @code{fshelp_fetch_root} to fetch more information. Return the owner and group of the underlying translated file in @code{*@var{uid}} and @code{*@var{gid}}; point @@ -4201,7 +4201,7 @@ continuously since the call to @code{diskfs_lookup}. Initialize @var{ds} such that @code{diskfs_drop_dirstat} will ignore it. @end deftypefun -@deftypefun error_t diskfs_get_directs (@w{struct node *@var{dp}}, @w{int @var{entry}}, @w{int @var{n}}, @w{char **@var{data}}, @w{u_int *@var{datacnt}}, @w{vm_size_t @var{bufsiz}}, @w{int *@var{amt}}) +@deftypefun error_t diskfs_get_directs (@w{struct node *@var{dp}}, @w{int @var{entry}}, @w{int @var{n}}, @w{char **@var{data}}, @w{mach_msg_type_number_t *@var{datacnt}}, @w{vm_size_t @var{bufsiz}}, @w{int *@var{amt}}) Return @var{n} directory entries starting at @var{entry} from locked directory node @var{dp}. Fill @code{*@var{data}} with the entries; which currently points to @code{*@var{datacnt}} bytes. If it isn't big @@ -4222,13 +4222,13 @@ the call@dots{} if this user cannot search the directory, then this routine should fail. @end deftypefun -@deftypefun error_t diskfs_get_translator (@w{struct node *@var{np}}, @w{char **@var{namep}}, @w{u_int *@var{namelen}}) +@deftypefun error_t diskfs_get_translator (@w{struct node *@var{np}}, @w{char **@var{namep}}, @w{mach_msg_type_number_t *@var{namelen}}) For locked node @var{np} (for which @code{diskfs_node_translated} is true) look up the name of its translator. Store the name into newly malloced storage and set @code{*@var{namelen}} to the total length. @end deftypefun -@deftypefun error_t diskfs_set_translator (@w{struct node *@var{np}}, @w{char *@var{name}}, @w{u_int @var{namelen}}, @w{struct protid *@var{cred}}) +@deftypefun error_t diskfs_set_translator (@w{struct node *@var{np}}, @w{char *@var{name}}, @w{mach_msg_type_number_t @var{namelen}}, @w{struct protid *@var{cred}}) For locked node @var{np}, set the name of the translating program to be @var{name}, which is @var{namelen} bytes long. @var{cred} identifies the user responsible for the call. diff --git a/eth-multiplexer/netfs_impl.c b/eth-multiplexer/netfs_impl.c index 1573d6f3..83a23132 100644 --- a/eth-multiplexer/netfs_impl.c +++ b/eth-multiplexer/netfs_impl.c @@ -405,7 +405,7 @@ error_t netfs_attempt_mkdev (struct iouser *cred, struct node *node, /* Attempt to set the passive translator record for FILE to ARGZ (of length ARGZLEN) for user CRED. */ error_t netfs_set_translator (struct iouser *cred, struct node *node, - const char *argz, size_t argzlen) + const char *argz, mach_msg_type_number_t argzlen) { debug(""); return EOPNOTSUPP; diff --git a/ext2fs/dir.c b/ext2fs/dir.c index ede3eda5..faed301e 100644 --- a/ext2fs/dir.c +++ b/ext2fs/dir.c @@ -879,7 +879,7 @@ diskfs_get_directs (struct node *dp, int entry, int nentries, char **data, - size_t *datacnt, + mach_msg_type_number_t *datacnt, vm_size_t bufsiz, int *amt) { diff --git a/ext2fs/inode.c b/ext2fs/inode.c index 2e3ca9a9..5b99069e 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -551,7 +551,7 @@ diskfs_set_statfs (struct statfs *st) /* Implement the diskfs_set_translator callback from the diskfs library; see <hurd/diskfs.h> for the interface description. */ error_t -diskfs_set_translator (struct node *np, const char *name, unsigned namelen, +diskfs_set_translator (struct node *np, const char *name, mach_msg_type_number_t namelen, struct protid *cred) { error_t err; @@ -716,7 +716,7 @@ diskfs_set_translator (struct node *np, const char *name, unsigned namelen, /* Implement the diskfs_get_translator callback from the diskfs library. See <hurd/diskfs.h> for the interface description. */ error_t -diskfs_get_translator (struct node *np, char **namep, unsigned *namelen) +diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *namelen) { error_t err = 0; daddr_t blkno; diff --git a/fatfs/dir.c b/fatfs/dir.c index 79852a77..1c71d68d 100644 --- a/fatfs/dir.c +++ b/fatfs/dir.c @@ -832,7 +832,7 @@ diskfs_get_directs (struct node *dp, int entry, int nentries, char **data, - size_t *datacnt, + mach_msg_type_number_t *datacnt, vm_size_t bufsiz, int *amt) { diff --git a/fatfs/inode.c b/fatfs/inode.c index cb1ca423..1004cf05 100644 --- a/fatfs/inode.c +++ b/fatfs/inode.c @@ -471,7 +471,7 @@ diskfs_set_statfs (struct statfs *st) error_t diskfs_set_translator (struct node *node, - const char *name, u_int namelen, + const char *name, mach_msg_type_number_t namelen, struct protid *cred) { assert_backtrace (!diskfs_readonly); @@ -479,7 +479,7 @@ diskfs_set_translator (struct node *node, } error_t -diskfs_get_translator (struct node *node, char **namep, u_int *namelen) +diskfs_get_translator (struct node *node, char **namep, mach_msg_type_number_t *namelen) { assert_backtrace (0); } diff --git a/ftpfs/netfs.c b/ftpfs/netfs.c index fb48cbda..a6481c10 100644 --- a/ftpfs/netfs.c +++ b/ftpfs/netfs.c @@ -354,7 +354,7 @@ error_t netfs_attempt_mkdev (struct iouser *cred, struct node *node, /* Attempt to set the passive translator record for FILE to ARGZ (of length ARGZLEN) for user CRED. */ error_t netfs_set_translator (struct iouser *cred, struct node *node, - const char *argz, size_t argzlen) + const char *argz, mach_msg_type_number_t argzlen) { return EROFS; } diff --git a/hostmux/leaf.c b/hostmux/leaf.c index ebe9190e..ac32256f 100644 --- a/hostmux/leaf.c +++ b/hostmux/leaf.c @@ -40,7 +40,7 @@ netfs_attempt_readlink (struct iouser *user, struct node *node, char *buf) For hostmux, this creates a new translator string by instantiating the global translator template. */ error_t -netfs_get_translator (struct node *node, char **argz, size_t *argz_len) +netfs_get_translator (struct node *node, char **args, mach_msg_type_number_t *args_len) { if (! node->nn->name) return EINVAL; @@ -49,26 +49,28 @@ netfs_get_translator (struct node *node, char **argz, size_t *argz_len) error_t err = 0; unsigned replace_count = 0; struct hostmux *mux = node->nn->mux; - - *argz = 0; /* Initialize return value. */ - *argz_len = 0; + char *argz = 0; /* Initialize return value. */ + size_t argz_len = 0; /* Return a copy of MUX's translator template, with occurrences of HOST_PAT replaced by the canonical hostname. */ - err = argz_append (argz, argz_len, + err = argz_append (&argz, &argz_len, mux->trans_template, mux->trans_template_len); if (! err) - err = argz_replace (argz, argz_len, + err = argz_replace (&argz, &argz_len, mux->host_pat, node->nn->name->canon, &replace_count); if (!err && replace_count == 0) /* Default, if no instances of HOST_PAT occur, is to append the hostname. */ - err = argz_add (argz, argz_len, node->nn->name->canon); + err = argz_add (&argz, &argz_len, node->nn->name->canon); + + if (err && argz_len > 0) + free (argz); - if (err && *argz_len > 0) - free (*argz); + *args = argz; + *args_len = argz_len; return err; } diff --git a/hostmux/stubs.c b/hostmux/stubs.c index e7399976..ae4daeb5 100644 --- a/hostmux/stubs.c +++ b/hostmux/stubs.c @@ -40,7 +40,7 @@ netfs_attempt_mkdev (struct iouser *cred, struct node *node, ARGZLEN) for user CRED. */ error_t netfs_set_translator (struct iouser *cred, struct node *node, - const char *argz, size_t argzlen) + const char *argz, mach_msg_type_number_t argzlen) { return EOPNOTSUPP; } diff --git a/isofs/inode.c b/isofs/inode.c index f78f336a..6e33f2ee 100644 --- a/isofs/inode.c +++ b/isofs/inode.c @@ -366,14 +366,14 @@ diskfs_grow (struct node *np, off_t end, struct protid *cred) error_t diskfs_set_translator (struct node *np, - const char *name, u_int namelen, + const char *name, mach_msg_type_number_t namelen, struct protid *cred) { return EROFS; } error_t -diskfs_get_translator (struct node *np, char **namep, u_int *namelen) +diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *namelen) { return EOPNOTSUPP; } diff --git a/isofs/lookup.c b/isofs/lookup.c index 59e48cdc..b55aef96 100644 --- a/isofs/lookup.c +++ b/isofs/lookup.c @@ -225,7 +225,7 @@ diskfs_get_directs (struct node *dp, int entry, int nentries, char **data, - size_t *datacnt, + mach_msg_type_number_t *datacnt, vm_size_t bufsiz, int *amt) { diff --git a/libdiskfs/dir-readdir.c b/libdiskfs/dir-readdir.c index 82a9720f..a314e9d1 100644 --- a/libdiskfs/dir-readdir.c +++ b/libdiskfs/dir-readdir.c @@ -26,7 +26,7 @@ kern_return_t diskfs_S_dir_readdir (struct protid *cred, data_t *data, - mach_msg_type_number_t *datacnt, + mach_msg_type_number_t *datacnt, boolean_t *data_dealloc, int entry, int nentries, @@ -35,7 +35,6 @@ diskfs_S_dir_readdir (struct protid *cred, { error_t err; struct node *np; - size_t data_len = *datacnt; if (!cred) return EOPNOTSUPP; @@ -55,15 +54,8 @@ diskfs_S_dir_readdir (struct protid *cred, return ENOTDIR; } - err = diskfs_get_directs (np, entry, nentries, - data, &data_len, - bufsiz, amt); + err = diskfs_get_directs (np, entry, nentries, data, datacnt, bufsiz, amt); *data_dealloc = 1; /* XXX */ pthread_mutex_unlock (&np->lock); - - if (err) - return err; - - *datacnt = data_len; - return 0; + return err; } diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index c8c1ab51..9a6b56fa 100644 --- a/libdiskfs/diskfs.h +++ b/libdiskfs/diskfs.h @@ -401,20 +401,20 @@ error_t diskfs_drop_dirstat (struct node *dp, struct dirstat *ds); then there is no limit on *DATACNT; if N is -1, then there is no limit on AMT. */ error_t diskfs_get_directs (struct node *dp, int entry, int n, - char **data, size_t *datacnt, + char **data, mach_msg_type_number_t *datacnt, vm_size_t bufsiz, int *amt); /* The user must define this function. For locked node NP (for which diskfs_node_translated is true) look up the name of its translator. Store the name into newly malloced storage; set *NAMELEN to the total length. */ -error_t diskfs_get_translator (struct node *np, char **namep, u_int *namelen); +error_t diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *namelen); /* The user must define this function. For locked node NP, set the name of the translating program to be NAME, length NAMELEN. CRED identifies the user responsible for the call. */ error_t diskfs_set_translator (struct node *np, - const char *name, u_int namelen, + const char *name, mach_msg_type_number_t namelen, struct protid *cred); /* The user must define this function. Truncate locked node NP to be SIZE diff --git a/libdiskfs/file-get-trans.c b/libdiskfs/file-get-trans.c index 9cec73ae..b1ca6c00 100644 --- a/libdiskfs/file-get-trans.c +++ b/libdiskfs/file-get-trans.c @@ -119,7 +119,7 @@ diskfs_S_file_get_translator (struct protid *cred, else { char *string; - u_int len; + mach_msg_type_number_t len; err = diskfs_get_translator (np, &string, &len); if (!err) { diff --git a/libdiskfs/trans-callback.c b/libdiskfs/trans-callback.c index d08f91c6..19e99743 100644 --- a/libdiskfs/trans-callback.c +++ b/libdiskfs/trans-callback.c @@ -27,7 +27,7 @@ static error_t _diskfs_translator_callback1_fn (void *cookie1, void *cookie2, uid_t *uid, gid_t *gid, - char **argz, size_t *argz_len) + char **argz, mach_msg_type_number_t *argz_len) { error_t err; struct node *np = cookie1; @@ -35,7 +35,7 @@ _diskfs_translator_callback1_fn (void *cookie1, void *cookie2, if (! (np->dn_stat.st_mode & S_IPTRANS)) return ENOENT; - err = diskfs_get_translator (np, argz, (u_int *) argz_len); + err = diskfs_get_translator (np, argz, argz_len); if (err) { assert_backtrace (err != EOPNOTSUPP); diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c index f3ae0ee9..1c099737 100644 --- a/libfshelp/fetch-root.c +++ b/libfshelp/fetch-root.c @@ -53,7 +53,7 @@ fshelp_fetch_root (struct transbox *box, void *cookie, { uid_t uid, gid; char *argz; - size_t argz_len; + mach_msg_type_number_t argz_len; error_t err; mach_port_t ports[INIT_PORT_MAX]; int ints[INIT_INT_MAX]; @@ -209,7 +209,7 @@ fshelp_fetch_root (struct transbox *box, void *cookie, error_t fshelp_short_circuited_callback1 (void *cookie1, void *cookie2, uid_t *uid, gid_t *gid, - char **argz, size_t *argz_len) + char **argz, mach_msg_type_number_t *argz_len) { struct fshelp_stat_cookie2 *statc = cookie2; diff --git a/libfshelp/fshelp.h b/libfshelp/fshelp.h index b050ecac..5a5b5bb1 100644 --- a/libfshelp/fshelp.h +++ b/libfshelp/fshelp.h @@ -163,7 +163,7 @@ struct transbox COOKIE2 is the cookie passed in the call to fshelp_fetch_root. */ typedef error_t (*fshelp_fetch_root_callback1_t) (void *cookie1, void *cookie2, uid_t *uid, gid_t *gid, - char **argz, size_t *argz_len); + char **argz, mach_msg_type_number_t *argz_len); /* A cookie for fshelp_short_circuited_callback1. Such a structure must be passed to the call to fshelp_fetch_root. */ @@ -178,7 +178,7 @@ struct fshelp_stat_cookie2 S_IFSOCK must be handled elsewhere. */ error_t fshelp_short_circuited_callback1 (void *cookie1, void *cookie2, uid_t *uid, gid_t *gid, - char **argz, size_t *argz_len); + char **argz, mach_msg_type_number_t *argz_len); /* This routine is called by fshelp_fetch_root to fetch more information. diff --git a/libnetfs/netfs.h b/libnetfs/netfs.h index 3bab63cd..6fc53ce4 100644 --- a/libnetfs/netfs.h +++ b/libnetfs/netfs.h @@ -154,7 +154,7 @@ error_t netfs_attempt_mkdev (struct iouser *cred, struct node *np, translator record for FILE to ARGZ (of length ARGZLEN) for user CRED. NP is locked. */ error_t netfs_set_translator (struct iouser *cred, struct node *np, - const char *argz, size_t argzlen); + const char *argz, mach_msg_type_number_t argzlen); /* The user may define this function (but should define it together with netfs_set_translator). For locked node NODE with S_IPTRANS @@ -162,7 +162,7 @@ error_t netfs_set_translator (struct iouser *cred, struct node *np, name into newly malloced storage, and return it in *ARGZ; set *ARGZ_LEN to the total length. */ error_t netfs_get_translator (struct node *node, char **argz, - size_t *argz_len); + mach_msg_type_number_t *argz_len); /* The user must define this function. This should attempt a chflags call for the user specified by CRED on locked node NP, to change diff --git a/libnetfs/set-get-trans.c b/libnetfs/set-get-trans.c index 52e68ac7..585e7fd7 100644 --- a/libnetfs/set-get-trans.c +++ b/libnetfs/set-get-trans.c @@ -30,7 +30,7 @@ CRED. */ error_t __attribute__ ((weak)) netfs_set_translator (struct iouser *cred, struct node *np, - const char *argz, size_t argzlen) + const char *argz, mach_msg_type_number_t argzlen) { return EOPNOTSUPP; } @@ -41,7 +41,7 @@ netfs_set_translator (struct iouser *cred, struct node *np, malloced storage, and return it in *ARGZ; set *ARGZ_LEN to the total length. */ error_t __attribute__ ((weak)) -netfs_get_translator (struct node *node, char **argz, size_t *argz_len) +netfs_get_translator (struct node *node, char **argz, mach_msg_type_number_t *argz_len) { return EOPNOTSUPP; } diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index de436995..d9ec2dc2 100644 --- a/libnetfs/trans-callback.c +++ b/libnetfs/trans-callback.c @@ -27,7 +27,7 @@ static error_t _netfs_translator_callback1_fn (void *cookie1, void *cookie2, uid_t *uid, gid_t *gid, - char **argz, size_t *argz_len) + char **argz, mach_msg_type_number_t *argz_len) { error_t err; struct node *np = cookie1; diff --git a/procfs/netfs.c b/procfs/netfs.c index 8940dfb4..4ed5eab6 100644 --- a/procfs/netfs.c +++ b/procfs/netfs.c @@ -239,7 +239,7 @@ void netfs_node_norefs (struct node *np) name into newly malloced storage, and return it in *ARGZ; set *ARGZ_LEN to the total length. */ error_t netfs_get_translator (struct node *np, char **argz, - size_t *argz_len) + mach_msg_type_number_t *argz_len) { return procfs_get_translator (np, argz, argz_len); } diff --git a/procfs/procfs.c b/procfs/procfs.c index 6d6d9649..da44b4a9 100644 --- a/procfs/procfs.c +++ b/procfs/procfs.c @@ -208,7 +208,7 @@ void procfs_cleanup (struct node *np) error_t procfs_get_translator (struct node *np, char **argz, - size_t *argz_len) + mach_msg_type_number_t *argz_len) { if (np->nn->ops->get_translator) return np->nn->ops->get_translator (np->nn->hook, argz, argz_len); diff --git a/procfs/procfs.h b/procfs/procfs.h index f2fb30eb..aef17e07 100644 --- a/procfs/procfs.h +++ b/procfs/procfs.h @@ -53,7 +53,7 @@ struct procfs_node_ops void (*cleanup) (void *hook); /* Get the passive translator record. */ - error_t (*get_translator) (void *hook, char **argz, size_t *argz_len); + error_t (*get_translator) (void *hook, char **argz, mach_msg_type_number_t *argz_len); }; /* These helper functions can be used as procfs_node_ops.cleanup_contents. */ @@ -95,5 +95,5 @@ error_t procfs_lookup (struct node *np, const char *name, struct node **npp); void procfs_cleanup (struct node *np); /* Get the passive translator record if any. */ -error_t procfs_get_translator (struct node *np, char **argz, size_t *argz_len); +error_t procfs_get_translator (struct node *np, char **argz, mach_msg_type_number_t *argz_len); diff --git a/procfs/rootdir.c b/procfs/rootdir.c index 908cfe6c..7742eddc 100644 --- a/procfs/rootdir.c +++ b/procfs/rootdir.c @@ -769,7 +769,7 @@ rootdir_make_translated_node (void *dir_hook, const void *entry_hook) static error_t rootdir_translated_node_get_translator (void *hook, char **argz, - size_t *argz_len) + mach_msg_type_number_t *argz_len) { const struct procfs_translated_node_ops *ops = hook; diff --git a/tmpfs/dir.c b/tmpfs/dir.c index 340a63da..8af2d070 100644 --- a/tmpfs/dir.c +++ b/tmpfs/dir.c @@ -63,7 +63,7 @@ diskfs_dirempty (struct node *dp, struct protid *cred) error_t diskfs_get_directs (struct node *dp, int entry, int n, - char **data, size_t *datacnt, + char **data, mach_msg_type_number_t *datacnt, vm_size_t bufsiz, int *amt) { struct tmpfs_dirent *d; diff --git a/tmpfs/node.c b/tmpfs/node.c index 2129d305..8cf25090 100644 --- a/tmpfs/node.c +++ b/tmpfs/node.c @@ -340,7 +340,7 @@ diskfs_new_hardrefs (struct node *np) error_t -diskfs_get_translator (struct node *np, char **namep, u_int *namelen) +diskfs_get_translator (struct node *np, char **namep, mach_msg_type_number_t *namelen) { *namelen = np->dn->translen; if (*namelen == 0) @@ -354,7 +354,7 @@ diskfs_get_translator (struct node *np, char **namep, u_int *namelen) error_t diskfs_set_translator (struct node *np, - const char *name, u_int namelen, + const char *name, mach_msg_type_number_t namelen, struct protid *cred) { char *new; diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 5ae0c8b1..f6defbf4 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -517,7 +517,7 @@ netfs_S_dir_lookup (struct protid *diruser, CRED. */ error_t netfs_set_translator (struct iouser *cred, struct node *np, - const char *argz, size_t argzlen) + const char *argz, mach_msg_type_number_t argzlen) { return file_set_translator (netfs_node_netnode (np)->file, FS_TRANS_EXCL|FS_TRANS_SET, diff --git a/usermux/leaf.c b/usermux/leaf.c index ba7fa270..1e1d8819 100644 --- a/usermux/leaf.c +++ b/usermux/leaf.c @@ -44,19 +44,21 @@ netfs_attempt_readlink (struct iouser *user, struct node *node, char *buf) For usermux, this creates a new translator string by instantiating the global translator template. */ error_t -netfs_get_translator (struct node *node, char **trans, size_t *trans_len) +netfs_get_translator (struct node *node, char **trans, mach_msg_type_number_t *trans_len) { if (! node->nn->name) return EINVAL; else { + char *argz = 0; + size_t argz_len = 0; fshelp_touch (&node->nn_stat, TOUCH_ATIME, usermux_maptime); - *trans = 0; - *trans_len = 0; if (S_ISLNK (node->nn_stat.st_mode)) - argz_add (trans, trans_len, _HURD_SYMLINK); + argz_add (&argz, &argz_len, _HURD_SYMLINK); return - argz_append (trans, trans_len, node->nn->trans, node->nn->trans_len); + argz_append (&argz, &argz_len, node->nn->trans, node->nn->trans_len); + *trans = argz; + *trans_len = argz_len; } } diff --git a/usermux/stubs.c b/usermux/stubs.c index 9943f379..c3b9b96a 100644 --- a/usermux/stubs.c +++ b/usermux/stubs.c @@ -40,7 +40,7 @@ netfs_attempt_mkdev (struct iouser *cred, struct node *node, ARGZLEN) for user CRED. */ error_t netfs_set_translator (struct iouser *cred, struct node *node, - const char *argz, size_t argzlen) + const char *argz, mach_msg_type_number_t argzlen) { return EOPNOTSUPP; } |