Allocate extra space for a file descriptor.
fd_allocate function is used to allocate additional space for a file descriptor. It allows extending the size of a file or buffer associated with the file descriptor.
;;; Note: This is similar to `posix_fallocate` in POSIX. ;;; Force the allocation of space in a file. (@interface func (export "fd_allocate") (param $fd $fd) ;;; The offset at which to start the allocation. (param $offset $filesize) ;;; The length of the area that is allocated. (param $len $filesize) (result $error (expected (error $errno))) )
ctx: A mutable reference to the function environment.
fd: The file descriptor to allocate space for.
offset: The offset from the start marking the beginning of the allocation.
len: The length from the offset marking the end of the allocation.
The function returns an
Errno value indicating the success or failure of the operation.
This function has been instrumented with debug-level logging. It will log the following information:
%fd: The file descriptor being used.
%offset: The offset from the start of the allocation.
%len: The length of the allocation.
fd_allocate function allows for allocating additional space for a file descriptor. It extends the size of the file or buffer associated with the file descriptor based on the specified offset and length.