aboutsummaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/misc.rst32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst
index ebcb75a2..f32af48f 100644
--- a/docs/src/misc.rst
+++ b/docs/src/misc.rst
@@ -122,6 +122,20 @@ Data types
} netmask;
} uv_interface_address_t;
+.. c:type:: uv_passwd_t
+
+ Data type for password file information.
+
+ ::
+
+ typedef struct uv_passwd_s {
+ char* username;
+ long uid;
+ long gid;
+ char* shell;
+ char* homedir;
+ } uv_passwd_t;
+
API
---
@@ -291,6 +305,24 @@ API
.. versionadded:: 1.9.0
+.. c:function:: int uv_os_get_passwd(uv_passwd_t* pwd)
+
+ Gets a subset of the password file entry for the current effective uid (not
+ the real 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.9.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`.
+
+ .. versionadded:: 1.9.0
+
.. uint64_t uv_get_free_memory(void)
.. c:function:: uint64_t uv_get_total_memory(void)