os_cp:fork_exec_pipes
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| os_cp:fork_exec_pipes [2025/05/19 20:27] – jkonczak | os_cp:fork_exec_pipes [2026/05/20 18:31] (current) – jkonczak | ||
|---|---|---|---|
| Line 20: | Line 20: | ||
| There is a list of things that '' | There is a list of things that '' | ||
| - | child process upon '' | + | child process upon '' |
| + | \\ See POSIX standard or | ||
| + | [[https:// | ||
| + | for details. | ||
| + | \\ | ||
| Notice that: | Notice that: | ||
| * all stack and heap memory is copied | * all stack and heap memory is copied | ||
| Line 160: | Line 164: | ||
| < | < | ||
| <code c> | <code c> | ||
| - | char arg0[] = " | ||
| - | char arg1[] = " | ||
| - | char *argv[] = {arg0, arg1, arg2, arg3, NULL}; | ||
| # Argument list: | # Argument list: | ||
| - | execlp(" | + | execlp(" |
| - | # Argument vector: | + | |
| + | # Argument vector: | ||
| + | char *argv[] = {" | ||
| execvp(" | execvp(" | ||
| </ | </ | ||
| Line 233: | Line 236: | ||
| double elapsedSec = (end.tv_sec - start.tv_sec) + (end.tv_nsec - start.tv_nsec) / 1e9; | double elapsedSec = (end.tv_sec - start.tv_sec) + (end.tv_nsec - start.tv_nsec) / 1e9; | ||
| </ | </ | ||
| + | < | ||
| + | Instead of the C11 function '' | ||
| + | use the POSIX function '' | ||
| < | < | ||
| </ | </ | ||
| Line 387: | Line 393: | ||
| < | < | ||
| equivalent. See '' | equivalent. See '' | ||
| - | for details.</ | + | for details. |
| + | \\ | ||
| + | POSIX standard also defines (but not mandates) | ||
| + | [[https:// | ||
| + | </ | ||
| ~~Exercise.# | ~~Exercise.# | ||
os_cp/fork_exec_pipes.1747686430.txt.gz · Last modified: (external edit)