3 ms·
Maybe a dumb question here. Why is a child process needed? Can the parent process not open a pipe, write its own state into the pipe, and then call exec, allowi
by CobrastanJorji 2y ago
Maybe a dumb question here. Why is a child process needed? Can the parent process not open a pipe, write its own state into the pipe, and then call exec, allowing the new binary to read from the pipe? Will exec destroy the pipe if there is no child process?
- lmz 2y agoPipes will block (eventually) if written to without a reader.
- pjc50 2y agoA pipe is a pipe, it's not a store. The buffer amount is not defined but usually you only get to write something like 512 bytes into it before it blocks. (you could probably do the same thing by persisting state into a file, though)
- CobrastanJorji 2y agoMakes perfect sense, thank you. Also, I looked it up, and apparently on Linux it's a 65536 byte buffer.