SysProcWriteToStdin

Table of Contents

SysProcWriteToStdin

Description

Write given raw data to stdin of child process.

Parameters

NameDirectionDescription
procinChild process handle to write to.
bufinPointer to Str object containing data to be written.

Success

Return number of bytes written.

Failure

Return -1

Usage example (Cross-references)

    }
    
    i32 SysProcWriteToStdin(SysProc *proc, Str *buf) {
    if (!proc || !buf) {
    LOG_FATAL("Invalid arguments");
    Str b_ = StrInit();                                                                                            \
    StrWriteFmt(&b_, __VA_ARGS__);                                                                                 \
    SysProcWriteToStdin((p), &b_);                                                                                 \
    StrDeinit(&b_);                                                                                                \
    } while (0)
    StrWriteFmt(&b_, __VA_ARGS__);                                                                                 \
    StrPushBack(&b_, '\n');                                                                                        \
    SysProcWriteToStdin((p), &b_);                                                                                 \
    StrDeinit(&b_);                                                                                                \
    } while (0)

Share :