Skip to main content

prog_stream_open

Function prog_stream_open 

Source
pub fn prog_stream_open(
    prog: BorrowedFd<'_>,
    stream_id: u32,
    nonblock: bool,
) -> Result<OwnedFd>
Expand description

Open a read-only descriptor on one of prog’s streams, stream_id being BPF_STREAM_STDOUT or BPF_STREAM_STDERR. Reads block unless nonblock. poll(2) reports POLLIN for data and POLLHUP once the program is freed, with buffered data still readable. A kernel without the command fails with EINVAL.