sys_pipe

Function sys_pipe 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn sys_pipe(pipefd: *mut u32) -> i32
Available on crate feature export-syscalls only.
Expand description

sys_pipe() creates a pipe, a unidirectional data channel that can be used for interprocess communication. The pointer pipefd is used to return two file descriptors referring to the ends of the pipe. pipefd[0] refers to the read end of the pipe. pipefd[1] refers to the write end of the pipe. Data written to the write end of the pipe is buffered by the host until it is read from the read end of the pipe.

§Return Value

On success, zero is returned. On error, -1 is returned, and pipefd is left unchanged.

§Safety

pipefd must be aligned, dereferenceable, and have capacity for 2 u32 values.