The Linux Programming Interface
Pseudoterminals 1397 memset(masterName, 0, PTY_NAME_LEN); strncpy(masterName, PTYM_PREFIX, PTY_PREFIX_LEN); for (x = X_RANGE; *x ...
1398 Chapter 64 64.10 Exercises 64-1. In what order do the script parent process and the child shell process terminate when the ...
Pseudoterminals 1399 One problem with the above scenario is that, by default, the stdio package flushes standard output only whe ...
...
TRACING SYSTEM CALLS The strace command allows us to trace the system calls made by a program. This is useful for debugging, or ...
1402 Appendix A Each system call is displayed in the form of a function call, with both input and out- put arguments shown in pa ...
Tracing System Calls 1403 z The –f option causes children of this process also to be traced. If we are sending trace output to a ...
...
PARSING COMMAND-LINE OPTIONS A typical UNIX command line has the following form: command [ options ] arguments An option takes t ...
1406 Appendix B The getopt() function parses the set of command-line arguments given in argc and argv, which would normally be t ...
Parsing Command-Line Options 1407 The getopt() function returns –1, indicating the end of the option list, in the follow- ing ci ...
1408 Appendix B Example program Listing B-1 demonstrates the use of getopt() to parse the command line for two options: the –x o ...
Parsing Command-Line Options 1409 int main(int argc, char argv[]) { int opt, xfnd; char pstr; xfnd = 0; pstr = NULL; while ((opt ...
1410 Appendix B listed earlier for determining the end of the option list) by setting the environment variable POSIXLY_CORRECT t ...
Parsing Command-Line Options 1411 Although we have used the example of filename pattern matching (globbing) above, similar scena ...
...
CASTING THE NULL POINTER Consider the following call to the variadic function execl(): execl("ls", "ls", "-l", (char *) NULL); A ...
1414 Appendix C The above assignments work because the compiler can determine that a pointer value is required on the right-hand ...
Casting the NULL Pointer 1415 Casting NULL in the manner of the last call above is generally required, even on implementations w ...
...
«
68
69
70
71
72
73
74
75
76
77
»
Free download pdf