Skip to content
SysProcWriteToStdin

SysProcWriteToStdin

SysProcWriteToStdin

Description

Write given raw data to stdin of child process.

Parameters

Name Direction Description
proc in Child process handle to write to.
buf in Pointer to Str object containing data to be written.

Success

Return number of bytes written.

Failure

Return -1

Usage example (Cross-references)

Usage examples (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)
Last updated on