aboutsummaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorJuan José Arboleda <soyjuanarbol@gmail.com>2024-05-27 16:47:52 -0500
committerSaúl Ibarra Corretgé <s@saghul.net>2024-05-28 17:04:30 +0200
commit541329d51f82bce83bd81ff7640edabfc32d149c (patch)
treea7b66b72d296996187e99371f4dac318627dd6b1 /docs/src
parentd2d92b74a8327daf9652a9732454937f3529bd30 (diff)
downloadlibuv-541329d51f82bce83bd81ff7640edabfc32d149c.tar.gz
libuv-541329d51f82bce83bd81ff7640edabfc32d149c.zip
doc: add entries for extended getpw
This patch adds documentation for the introduced `uv_os_get_passwd2`, `uv_os_get_group`, `uv_os_free_group` methods in https://github.com/libuv/libuv/pull/3523 Fixes: https://github.com/libuv/libuv/issues/4007 Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/misc.rst41
1 files changed, 41 insertions, 0 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst
index 98961830..239fc176 100644
--- a/docs/src/misc.rst
+++ b/docs/src/misc.rst
@@ -199,6 +199,18 @@ Data types
char* homedir;
} uv_passwd_t;
+.. c:type:: uv_group_s
+
+ Data type for group file information.
+
+ ::
+
+ typedef struct uv_group_s {
+ char* groupname;
+ unsigned long gid;
+ char** members;
+ };
+
.. c:type:: uv_utsname_t
Data type for operating system name and version information.
@@ -566,6 +578,35 @@ API
.. versionadded:: 1.9.0
+.. c:function:: int uv_os_get_passwd2(uv_passwd_t* pwd, uv_uid_t uid)
+
+ Gets a subset of the password file entry for the provided uid.
+ The populated data includes the username, euid, gid, shell,
+ and home directory. On non-Windows systems, all data comes from
+ :man:`getpwuid_r(3)`. On Windows, uid and gid are set to -1 and have no
+ meaning, and shell is `NULL`. After successfully calling this function, the
+ memory allocated to `pwd` needs to be freed with
+ :c:func:`uv_os_free_passwd`.
+
+ .. versionadded:: 1.45.0
+
+.. c:function:: int uv_os_get_group(uv_group_s* group, uv_uid_t gid)
+
+ Gets a subset of the group file entry for the provided uid.
+ The populated data includes the group name, gid, and members. On non-Windows
+ systems, all data comes from :man:`getgrgid_r(3)`. On Windows, uid and gid
+ are set to -1 and have no meaning. After successfully calling this function,
+ the memory allocated to `group` needs to be freed with
+ :c:func:`uv_os_free_group`.
+
+ .. versionadded:: 1.45.0
+
+.. c:function:: void uv_os_free_group(uv_passwd_t* pwd)
+
+ Frees the memory previously allocated with :c:func:`uv_os_get_group`.
+
+ .. versionadded:: 1.45.0
+
.. c:function:: void uv_os_free_passwd(uv_passwd_t* pwd)
Frees the `pwd` memory previously allocated with :c:func:`uv_os_get_passwd`.