Keywords: Termios-script-diagram.svg en Diagram of script 1 using Unix98 pseudo terminals e g on Linux 2016-05-09 own Krishnavedala other fields U dvisvgm 1 14 + U Krishnavedala latex LaTeX \documentclass12pt standalone \usepackage times \usepackage pgf tikz \usetikzlibrary arrows shapes patterns fit \begin document \begin tikzpicture thick > Stealthwidth 2mm length 3mm every node/ style fill none font \scriptsize box/ style draw rectangle text width 1 text centered minimum height 1cm font \small box/ default 2 5cm ell/ style ellipse text width 1 text centered minimum height 1cm font \small ell2/ style ellipse text width 1 text centered minimum height 1cm \nodebox at 0 0 script \textit script ; \nodebox at script + 6 0 bash \textit bash ; \nodebox 2cm at script - 1 4 term Terminal ; \nodebox at term + 3 0 pseudomas Pseudo terminal master ; \nodebox 3cm at pseudomas + 4 0 pseudosla Pseudo terminal slave\\\texttt /dev/pts/\ldots ; \nodeell 2cm draw at term + 5 -2 5 user User ; \nodetext width 5cm font \small at script + 3 5 2 write Write to file transcript ; \nodedraw very thick fit script + 0 1 term pseudosla inner sep 5cm f ; \draw-> dashed script -- nodebelow \textit fork bash ; \drawdashed very thick f west -- nodebelow pos 9 \textit Kernel space f east ; \nodeanchor north west font \small at f north west \textit User space ; \draw<-> pseudomas -- pseudosla ; \draw-> dotted script 40 controls ++ -1 5 2 and ++ -1 - 2 write west ; \draw-> term 135 -- nodeleft pos 85 stdin script -145 ; \draw<- term 120 -- noderight pos 15 ell2 5cm stdout\\stderr script -135 ; \draw-> pseudomas 145 -- nodeleft pos 7 \textit read script -55 ; \draw<- pseudomas 130 -- noderight pos 3 \textit write script -40 ; \draw-> pseudosla 145 -- nodeleft pos 7 stdin bash -145 ; \draw<- pseudosla 135 -- noderight pos 15 ell2 5cm stdout\\stderr bash -130 ; \draw<-> term -- noderight pos 3 keyboard input nodeleft pos 7 terminal output user ; \end tikzpicture \end document cc-zero Unix shells |