This preview shows page 1. Sign up to view the full content.
Unformatted text preview: reen is 80 columns wide. Thus, you can check your handling of the environment variables by setting the COLUMNS environment to something smaller than 80:
unix> setenv COLUMNS 40 unix> ./myls
...output is 40 columns wide unix> unsetenv COLUMNS unix> ./myls
...output is now 80 columns wide Homework Problem 8.16 [Category 3]: Modify the program in Figure 8.15 so that 1. Each child terminates abnormally after attempting to write to a location in the read-only text segment. 2. The parent prints output that is identical (except for the PIDs) to the following:
child 12255 terminated by signal 11: Segmentation fault child 12254 terminated by signal 11: Segmentation fault Hint: Read the man pages for wait(2) and psignal(3). Homework Problem 8.17 [Category 3]: Write your own version of the Unix system function:
int mysystem(char *command); The mysystem function executes command by calling “/bin/sh -c command”, and then returns after command has completed. If command exits normally (by calling...
View Full Document