Used to detect what type of stream should be used with a given file descriptor. Usually this will be used during initialization to guess the type of the stdio streams.
For isatty(3) equivalent functionality use this function and test for UV_TTY.
Returns the current high-resolution real time. This is expressed in nanoseconds. It is relative to an arbitrary time in the past. It is not 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.
Many of the functions below are not thread safe and might block. Functions like cwd are useful nevertheless, if you target windows. Unlike Sys.getcwd() they return UTF8-encoded names
Gets the current user's home directory. On Windows, homedir first checks the USERPROFILE environment variable using GetEnvironmentVariableW(). If USERPROFILE is not set, GetUserProfileDirectoryW() is called.
On all other operating systems, os_homedir first checks the HOME environment variable using getenv(3). If HOME is not set, getpwuid_r(3) is called.
Gets the temp directory. On Windows, uv_os_tmpdir() uses GetTempPathW(). On all other operating systems, uv_os_tmpdir() uses the first environment variable found in the ordered list TMPDIR, TMP, TEMP, and TEMPDIR. If none of these are found, the path "/tmp" is used, or, on Android, "/data/local/tmp" is used.
val get_passwd : unit ->Unix.passwd_entry uv_result
pw_passwd and pw_gecos will currently always contain an empty string. This function does work on Windows (unlike Unix.getpwnam or Unix.getwuid )
putenv ~key ~data sets the value associated to a variable in the process environment. key is the name of the environment variable, and data its new associated value.
Sets the scheduling priority of the process specified by `pid`. The `priority` value range is between -20 (high priority) and 19 (low priority).
On Windows, this function utilizes `SetPriorityClass()`. The `priority` argument is mapped to a Windows priority class. When retrieving the process priority, the result will not necessarily equal the exact value of `priority`.
val setpriority_exn : pid:int ->priority:int -> unit
Retrieves the scheduling priority of the process specified by `pid`. The returned value of `priority` is between -20 (high priority) and 19 (low priority).
Returns the current process ID. Useful for Windows. Unix.getpid doesn't return the current Process Id. See: https://caml.inria.fr/mantis/view.php?id=4034