aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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`.