SysProcReadFromStdout

Table of Contents

SysProcReadFromStdout

Description

Perform a blocking read from stdout of child process to provided buffer.

Parameters

NameDirectionDescription
procinChild process handle to read from.
bufoutPointer to Str object where the read data will be appended.

Success

Return number of bytes read.

Failure

Return -1

Usage example (Cross-references)

    }
    
    i32 SysProcReadFromStdout(SysProc *proc, Str *buf) {
    return sys_proc_read_internal(proc, buf, /* is stdout*/ true);
    }
    do {                                                                                                               \
    Str b_ = StrInit();                                                                                            \
    SysProcReadFromStdout((p), &b_);                                                                               \
    const char *in_ = b_.data;                                                                                     \
    StrReadFmt(in_, __VA_ARGS__);                                                                                  \

Share :