Home Explore Blog CI



neovim

56th chunk of `runtime/doc/luvref.txt`
e810bd564e4242e46aed3c7550345857d23f603fd1ff926f0000000100000fa1
 network interface identifier suitable for use in
                an IPv6 scoped address. On Windows, returns the numeric
                `ifindex` as a string. On all other platforms,
                |uv.if_indextoname()| is used.

                Returns: `string` or `fail`

uv.loadavg()                                                      *uv.loadavg()*

                Returns the load average as a triad. Not supported on Windows.

                Returns: `number, number, number`

uv.os_uname()                                                    *uv.os_uname()*

                Returns system information.

                Returns: `table`
                - `sysname` : `string`
                - `release` : `string`
                - `version` : `string`
                - `machine` : `string`

uv.os_gethostname()                                        *uv.os_gethostname()*

                Returns the hostname.

                Returns: `string`

uv.os_getenv({name} [, {size}])                                 *uv.os_getenv()*

                Parameters:
                - `name`: `string`
                - `size`: `integer` (default = `LUAL_BUFFERSIZE`)

                Returns the environment variable specified by `name` as
                string. The internal buffer size can be set by defining
                `size`. If omitted, `LUAL_BUFFERSIZE` is used. If the
                environment variable exceeds the storage available in the
                internal buffer, `ENOBUFS` is returned. If no matching
                environment variable exists, `ENOENT` is returned.

                Returns: `string` or `fail`

                WARNING: This function is not thread safe.

uv.os_setenv({name}, {value})                                   *uv.os_setenv()*

                Parameters:
                - `name`: `string`
                - `value`: `string`

                Sets the environmental variable specified by `name` with the
                string `value`.

                Returns: `boolean` or `fail`

                WARNING: This function is not thread safe.

uv.os_unsetenv({name})                                        *uv.os_unsetenv()*

                Parameters:
                - `name`: `string`

                Unsets the environmental variable specified by `name`.

                Returns: `boolean` or `fail`

                WARNING: This function is not thread safe.

uv.os_environ()                                                *uv.os_environ()*

                Returns all environmental variables as a dynamic table of
                names associated with their corresponding values.

                Returns: `table`

                WARNING: This function is not thread safe.

uv.os_homedir()                                                *uv.os_homedir()*

                Returns: `string` or `fail`

                WARNING: This function is not thread safe.

uv.os_tmpdir()                                                  *uv.os_tmpdir()*

                Returns: `string` or `fail`

                WARNING: This function is not thread safe.

uv.os_get_passwd()                                          *uv.os_get_passwd()*

                Returns password file information.

                Returns: `table`
                - `username` : `string`
                - `uid` : `integer`
                - `gid` : `integer`
                - `shell` : `string`
                - `homedir` : `string`

uv.os_getpid()                                                  *uv.os_getpid()*

                Returns the current process ID.

                Returns: `number`

uv.os_getppid()                                                *uv.os_getppid()*

                Returns the parent process ID.

                Returns: `number`

uv.os_getpriority({pid})                                   *uv.os_getpriority()*

                Parameters:
                - `pid`: `integer`

                Returns the scheduling priority

Title: Libuv: OS Information and Environment Variables
Summary
This section details libuv functions for retrieving operating system information such as load average (`uv.loadavg`), system details (`uv.os_uname`), hostname (`uv.os_gethostname`), managing environment variables (`uv.os_getenv`, `uv.os_setenv`, `uv.os_unsetenv`, `uv.os_environ`), obtaining home and temporary directories (`uv.os_homedir`, `uv.os_tmpdir`), accessing password file information (`uv.os_get_passwd`), and getting process IDs (`uv.os_getpid`, `uv.os_getppid`, `uv.os_getpriority`). Thread safety warnings are included for relevant functions.