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 /usermux | |
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 *).
Diffstat (limited to 'usermux')
-rw-r--r-- | usermux/leaf.c | 12 | ||||
-rw-r--r-- | usermux/stubs.c | 2 |
2 files changed, 8 insertions, 6 deletions
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; } |