|
409 | 409 | \item The file descriptor tables are exact copies in both processes. That means |
410 | 410 | that more processes can share and seek a common file position. Signal masks are |
411 | 411 | not changed, more on that on page \pageref{SIGNALBLOCKINGEXAMPLE}. |
412 | | -\item For effiency and less memory consumption, the address space is not copied |
| 412 | +\item For efficiency and less memory consumption, the address space is not copied |
413 | 413 | but a \emph{copy-on-write} mechanism is used. |
414 | 414 | \item The reason why the parent gets its child's PID as a return value and the |
415 | 415 | child gets 0 is because it is easy for the child to get its parent PID via |
|
456 | 456 | runs in foreground (\emph{foreground process group}) and has access to the |
457 | 457 | controlling terminal for input and output, the rest is running in the background |
458 | 458 | (\emph{background process groups}) and have only optional access to the output |
459 | | -or no at all. (unallowed operation with terminal will stop the process). |
| 459 | +or no at all. (disallowed operation with terminal will stop the process). |
460 | 460 | \item[parent process:] Each process (besides \texttt{swapper}u, pid~==~0) |
461 | 461 | has a parent, i.e. process that created it with the \texttt{fork} syscall. |
462 | 462 | If the parent exits before the child, its adoptive parent will become the |
463 | 463 | \texttt{init} process, that will take care of the zombie after the process ends. |
464 | 464 | \end{description} |
465 | 465 | \begin{itemize} |
466 | 466 | \item To get information about running processes programatically is possible |
467 | | -using non-standar API (e.g. the \texttt{libproc} library on Solaris built |
| 467 | +using non-standard API (e.g. the \texttt{libproc} library on Solaris built |
468 | 468 | on top of the \texttt{procfs} filesystem that is mounted under \texttt{/proc}). |
469 | 469 | \item Note that using \texttt{getppid} value to check if parent exited is not |
470 | 470 | portable (commonly \texttt{init} has pid 1 however this is not true in many |
|
899 | 899 | as the EOF would not be detected otherwise. |
900 | 900 | \item Closing the reading descriptor \texttt{pd[0]} in the consumer process is |
901 | 901 | desired as well (see {\color[rgb]{1,0,0} $\triangleright$}) as if the |
902 | | -consumer finishes prematurely the producent properly gets a \texttt{SIGPIPE}. |
| 902 | +consumer finishes prematurely the producer properly gets a \texttt{SIGPIPE}. |
903 | 903 | If that file descriptor in the producer was not closed while the consumer died |
904 | 904 | in the middle of processing the data, for example, the producer would not learn |
905 | 905 | that the consumer was gone (as the producer would remain to be an existing |
|
0 commit comments