|
1347 | 1347 | depends on what, use the \texttt{-v} option. macOS does not have \texttt{ldd}, |
1348 | 1348 | use \texttt{otool -L} instead. |
1349 | 1349 | \item What libraries are eventually used when running the program could be |
1350 | | -different from what \texttt{ldd} shows. For example, |
| 1350 | +different from what \texttt{ldd} shows. For example, |
1351 | 1351 | one could use the \texttt{LD\_PRELOAD} mechanism. For that reason, |
1352 | 1352 | Solaris has a \texttt{pldd} command which provides the library dependencies for |
1353 | 1353 | a running process. For an example on \texttt{LD\_PRELOAD} with \texttt{gcc}: |
|
1611 | 1611 |
|
1612 | 1612 | \begin{verbatim} |
1613 | 1613 | $ cc coredump.c |
1614 | | -$ ./a.out |
| 1614 | +$ ./a.out |
1615 | 1615 | Segmentation Fault (core dumped) |
1616 | 1616 | $ dbx ./a.out core |
1617 | 1617 | Reading a.out |
|
2136 | 2136 | char *const \emph{argv}[],}\\ |
2137 | 2137 | \>\texttt{const char *\emph{optstring});}\\ |
2138 | 2138 | \texttt{extern char *\emph{optarg};}\\ |
2139 | | -\texttt{extern int \emph{optind}, \emph{opterr}, \emph{optopt};} |
| 2139 | +\texttt{extern int \emph{optind}, \emph{opterr}, \emph{optopt};} |
2140 | 2140 | \end{tabbing} |
2141 | 2141 | ]]]) |
2142 | 2142 | \begin{itemize} |
2143 | 2143 | \item the function receives command line parameters and processes and returns |
2144 | 2144 | one option. If a given option has an argument, it is set in the |
2145 | 2145 | \texttt{optarg} variable. |
2146 | | -\item when all options are processed, it returns -1 and the \texttt{optind} |
| 2146 | +\item when all options are processed, it returns -1 and the \texttt{optind} |
2147 | 2147 | variable contains the index of first unprocessed argument of the program. |
2148 | 2148 | \item possible options are passed in the \texttt{optstring} string. |
2149 | 2149 | If an option has mandatory argument, its character is followed by '\texttt{:}' |
|
2337 | 2337 | \begin{itemize} |
2338 | 2338 | \item a \emsl{process} is a system object characterized by its context, |
2339 | 2339 | identified by a unique number (\emsl{process ID}, |
2340 | | -\emsl{PID}); in other words \uv{code and data in memory} |
| 2340 | +\emsl{PID}); in other words \uv{code and data in memory} |
2341 | 2341 | \item a \emsl{thread} is a system object that exists inside a process and |
2342 | 2342 | is characterized by its state. All threads within a single process share |
2343 | 2343 | the same memory area sans registers and stack; \uv{line of execution}, |
2344 | | -\uv{what is running} |
| 2344 | +\uv{what is running} |
2345 | 2345 | \item a \emsl{program} is a file with a precisely defined format that contains |
2346 | 2346 | instructions, data and service information needed for execution; |
2347 | 2347 | \uv{executable file on disk} |
2348 | 2348 | \end{itemize} |
2349 | 2349 |
|
2350 | 2350 | \begin{itemize} |
2351 | | -\item[$\circ$] \emsl{memory} is assigned to \emsl{processes}. |
| 2351 | +\item[$\circ$] \emsl{memory} is assigned to \emsl{processes}. |
2352 | 2352 | \item[$\circ$] \emsl{processors} are assigned to \emsl{threads}. |
2353 | 2353 | \item[$\circ$] threads of single process can run on different processors. |
2354 | 2354 | \end{itemize} |
|
0 commit comments