ProcWriteToStdin
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)
- In
Proc.c:441:
}
i32 ProcWriteToStdin(Proc *proc, Str *buf) {
if (!proc || !buf) {
LOG_FATAL("Invalid arguments");- In
Proc.h:180:
Str b_ = StrInit(); \
StrWriteFmt(&b_, __VA_ARGS__); \
ProcWriteToStdin((p), &b_); \
StrDeinit(&b_); \
} while (0)- In
Proc.h:189:
StrWriteFmt(&b_, __VA_ARGS__); \
StrPushBack(&b_, '\n'); \
ProcWriteToStdin((p), &b_); \
StrDeinit(&b_); \
} while (0)- In
SubProcComm.c:22:
StrWriteFmt(&buf, "value = {}", 42);
StrPushBack(&buf, '\n');
ProcWriteToStdin(proc, &buf);
StrDeinit(&buf);
}
Last updated on