Return the resolution of a clock.
Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks,
return errno::inval.
Note: This is similar to clock_getres in POSIX.
Read environment variable data.
The sizes of the buffers should match that returned by environ_sizes_get.
Key/value pairs are expected to be joined with =s, and terminated with \0s.
Adjust the rights associated with a file descriptor.
This can only be used to remove rights, and returns errno::notcapable if called in a way that would attempt to add rights
Adjust the size of an open file. If this increases the file’s size, the extra bytes are filled with zeros.
Note: This is similar to ftruncate in POSIX.
Read directory entries from a directory.
When successful, the contents of the output buffer consist of a sequence of
directory entries. Each directory entry consists of a dirent object,
followed by dirent::d_namlen bytes holding the name of the directory
entry.
This function fills the output buffer as much as possible, potentially
truncating the last directory entry. This allows the caller to grow its
read buffer size in case it’s too small to fit a single large directory
entry, or skip the oversized directory entry.
Atomically replace a file descriptor by renumbering another file descriptor.
Due to the strong focus on thread safety, this environment does not provide
a mechanism to duplicate or renumber a file descriptor to an arbitrary
number, like dup2(). This would be prone to race conditions, as an actual
file descriptor with the same number could be allocated by a different
thread at the same time.
This function provides a way to atomically renumber file descriptors, which
would disappear if dup2() were to be removed entirely.
Open a file or directory.
The returned file descriptor is not guaranteed to be the lowest-numbered
file descriptor not currently open; it is randomized to prevent
applications from depending on making assumptions about indexes, since this
is error-prone in multi-threaded contexts. The returned file descriptor is
guaranteed to be less than 2**31.
Note: This is similar to openat in POSIX.
Terminate the process normally. An exit code of 0 indicates successful
termination of the program. The meanings of other values is dependent on
the environment.
Write high-quality random data into a buffer.
This function blocks when the implementation is unable to immediately
provide sufficient high-quality random data.
This function may execute slowly, so when large mounts of random data are
required, it’s advisable to use this function to seed a pseudo-random
number generator, rather than to provide the random data directly.
Receive a message from a socket.
Note: This is similar to recv in POSIX, though it also supports reading
the data into multiple buffers in the manner of readv.
Send a message on a socket.
Note: This is similar to send in POSIX, though it also supports writing
the data from multiple buffers in the manner of writev.