diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2009-06-19 10:27:38 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2009-06-19 10:27:38 +0000 |
commit | ecd073bd7054c9e13516041e3ef930e39270c8df (patch) | |
tree | bb36abf9662bec5c5027363f6d0d902d00f40815 /include | |
parent | 17d1cf6956d08de9aa79b4a7691fb50a2446fa18 (diff) | |
download | android_external_fuse-ecd073bd7054c9e13516041e3ef930e39270c8df.tar.gz android_external_fuse-ecd073bd7054c9e13516041e3ef930e39270c8df.tar.bz2 android_external_fuse-ecd073bd7054c9e13516041e3ef930e39270c8df.zip |
Add fuse_getgroups (high level lib) and fuse_req_getgroups (low
level lib) functions to query the supplementary group IDs for the
current request. Currently this is implemented on Linux by
reading from the /proc filesystem.
Diffstat (limited to 'include')
-rw-r--r-- | include/fuse.h | 20 | ||||
-rw-r--r-- | include/fuse_lowlevel.h | 21 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/fuse.h b/include/fuse.h index 6ded4f5..a58cd9f 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -624,6 +624,26 @@ int fuse_loop_mt(struct fuse *f); struct fuse_context *fuse_get_context(void); /** + * Get the current supplementary group IDs for the current request + * + * Similar to the getgroups(2) system call, except the return value is + * always the total number of group IDs, even if it is larger than the + * specified size. + * + * The current fuse kernel module in linux (as of 2.6.30) doesn't pass + * the group list to userspace, hence this function needs to parse + * "/proc/$TID/task/$TID/status" to get the group IDs. + * + * This feature may not be supported on all operating systems. In + * such a case this function will return -ENOSYS. + * + * @param size size of given array + * @param list array of group IDs to be filled in + * @return the total number of supplementary group IDs or -errno on failure + */ +int fuse_getgroups(int size, gid_t list[]); + +/** * Check if the current request has already been interrupted * * @return 1 if the request has been interrupted, 0 otherwise diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 5ab2422..a495e15 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -1175,6 +1175,27 @@ void *fuse_req_userdata(fuse_req_t req); const struct fuse_ctx *fuse_req_ctx(fuse_req_t req); /** + * Get the current supplementary group IDs for the specified request + * + * Similar to the getgroups(2) system call, except the return value is + * always the total number of group IDs, even if it is larger than the + * specified size. + * + * The current fuse kernel module in linux (as of 2.6.30) doesn't pass + * the group list to userspace, hence this function needs to parse + * "/proc/$TID/task/$TID/status" to get the group IDs. + * + * This feature may not be supported on all operating systems. In + * such a case this function will return -ENOSYS. + * + * @param req request handle + * @param size size of given array + * @param list array of group IDs to be filled in + * @return the total number of supplementary group IDs or -errno on failure + */ +int fuse_req_getgroups(fuse_req_t req, int size, gid_t list[]); + +/** * Callback function for an interrupt * * @param req interrupted request |