Skip to content
ProcWriteToStdin

ProcWriteToStdin

Description

Write raw data to the child’s stdin pipe.

Success

Returns number of bytes written.

Failure

Returns -1.

Usage example (Cross-references)

Usage examples (Cross-references)
            Str UNPL(buf) = StrInit();                                                                                     \
            StrAppendFmt(&UNPL(buf), __VA_ARGS__);                                                                         \
            ProcWriteToStdin((p), &UNPL(buf));                                                                             \
            StrDeinit(&UNPL(buf));                                                                                         \
        } while (0)
            StrAppendFmt(&UNPL(buf), __VA_ARGS__);                                                                         \
            StrPushBackR(&UNPL(buf), '\n');                                                                                 \
            ProcWriteToStdin((p), &UNPL(buf));                                                                             \
            StrDeinit(&UNPL(buf));                                                                                         \
        } while (0)
    }
    
    i32 ProcWriteToStdin(Proc *proc, const Str *buf) {
        if (!proc || !buf) {
            LOG_FATAL("Invalid arguments");
Last updated on