Alien-uv
view release on metacpan or search on metacpan
libuv/docs/src/misc.rst view on Meta::CPAN
related to the time of day and therefore not subject to clock drift. The
primary use is for measuring performance between intervals.
.. note::
Not every platform can support nanosecond resolution; however, this value will always
be in nanoseconds.
.. c:function:: void uv_print_all_handles(uv_loop_t* loop, FILE* stream)
Prints all handles associated with the given `loop` to the given `stream`.
Example:
::
uv_print_all_handles(uv_default_loop(), stderr);
/*
[--I] signal 0x1a25ea8
[-AI] async 0x1a25cf0
[R--] idle 0x1a7a8c8
*/
The format is `[flags] handle-type handle-address`. For `flags`:
- `R` is printed for a handle that is referenced
- `A` is printed for a handle that is active
- `I` is printed for a handle that is internal
.. warning::
This function is meant for ad hoc debugging, there is no API/ABI
stability guarantees.
.. versionadded:: 1.8.0
.. c:function:: void uv_print_active_handles(uv_loop_t* loop, FILE* stream)
This is the same as :c:func:`uv_print_all_handles` except only active handles
are printed.
.. warning::
This function is meant for ad hoc debugging, there is no API/ABI
stability guarantees.
.. versionadded:: 1.8.0
.. c:function:: int uv_os_getenv(const char* name, char* buffer, size_t* size)
Retrieves the environment variable specified by `name`, copies its value
into `buffer`, and sets `size` to the string length of the value. When
calling this function, `size` must be set to the amount of storage available
in `buffer`, including the null terminator. If the environment variable
exceeds the storage available in `buffer`, `UV_ENOBUFS` is returned, and
`size` is set to the amount of storage required to hold the value. If no
matching environment variable exists, `UV_ENOENT` is returned.
.. warning::
This function is not thread safe.
.. versionadded:: 1.12.0
.. c:function:: int uv_os_setenv(const char* name, const char* value)
Creates or updates the environment variable specified by `name` with
`value`.
.. warning::
This function is not thread safe.
.. versionadded:: 1.12.0
.. c:function:: int uv_os_unsetenv(const char* name)
Deletes the environment variable specified by `name`. If no such environment
variable exists, this function returns successfully.
.. warning::
This function is not thread safe.
.. versionadded:: 1.12.0
.. c:function:: int uv_os_gethostname(char* buffer, size_t* size)
Returns the hostname as a null-terminated string in `buffer`, and sets
`size` to the string length of the hostname. When calling this function,
`size` must be set to the amount of storage available in `buffer`, including
the null terminator. If the hostname exceeds the storage available in
`buffer`, `UV_ENOBUFS` is returned, and `size` is set to the amount of
storage required to hold the value.
.. versionadded:: 1.12.0
.. versionchanged:: 1.26.0 `UV_MAXHOSTNAMESIZE` is available and represents
the maximum `buffer` size required to store a
hostname and terminating `nul` character.
.. c:function:: int uv_os_getpriority(uv_pid_t pid, int* priority)
Retrieves the scheduling priority of the process specified by `pid`. The
returned value of `priority` is between -20 (high priority) and 19 (low
priority).
.. note::
On Windows, the returned priority will equal one of the `UV_PRIORITY`
constants.
.. versionadded:: 1.23.0
.. c:function:: int uv_os_setpriority(uv_pid_t pid, int priority)
Sets the scheduling priority of the process specified by `pid`. The
`priority` value range is between -20 (high priority) and 19 (low priority).
The constants `UV_PRIORITY_LOW`, `UV_PRIORITY_BELOW_NORMAL`,
`UV_PRIORITY_NORMAL`, `UV_PRIORITY_ABOVE_NORMAL`, `UV_PRIORITY_HIGH`, and
`UV_PRIORITY_HIGHEST` are also provided for convenience.
.. note::
On Windows, this function utilizes `SetPriorityClass()`. The `priority`
argument is mapped to a Windows priority class. When retrieving the
process priority, the result will equal one of the `UV_PRIORITY`
constants, and not necessarily the exact value of `priority`.
.. note::
On Windows, setting `PRIORITY_HIGHEST` will only work for elevated user,
for others it will be silently reduced to `PRIORITY_HIGH`.
.. versionadded:: 1.23.0
.. c:function:: int uv_os_uname(uv_utsname_t* buffer)
Retrieves system information in `buffer`. The populated data includes the
operating system name, release, version, and machine. On non-Windows
( run in 0.793 second using v1.01-cache-2.11-cpan-70e19b8f4f1 )