ANSWER
Yes.
ANSWER
sigset_t pr_sigpend; /* Set of process pending signals */ sigset_t pr_lwppend; /* Set of lwp pending signals */ sigset_t pr_sighold; /* Set of lwp held signals */ struct siginfo pr_info; /* Info associated with signal or fault */ struct sigaltstack pr_altstack; /* Alternate signal stack info */ struct sigaction pr_action; /* Signal action for current signal */
ANSWER Yes
QUESTION
> If we should, I'm not clear if (errno == EINTR) is an actual error or
> if I should just wait for the signal to finish.
ANSWER You must execute the wait again to continue waiting after wait has returned because of a signal.
QUESTION
> Also if the wait return is a -1 and *stat_loc == WIFSIGNALED, is this a
> true error.
ANSWER The WIFSIGNALED refers to detection that the child received a signal. This is not the same as the EINTR which tells whether the parent received a signal while blocked in the wait system call.
ANSWER
You don't have to detect stopped processes for this assignment.
I am thinking about an extension after we cover Chapter 5.
"try.c", line 102: warning: improper pointer/integer combination: op "="
"try.c", line 114: warning: improper pointer/integer combination: op "="
"try.c", line 120: warning: improper pointer/integer combination: op "="
"try.c", line 122: warning: improper pointer/integer combination: op "="
ANSWER You have to include the appropriate header files for calloc and strtok. When you lint you will get messages that these functions are assumed to return int. For example, line 102 is
if ((t = calloc(strlen(snew) + 1, sizeof(char))) == NULL) {
ANSWER MAX_CANON is a system-wide constant that is defined in limits.h specifying how big the canonical input buffer is (for terminal I/O).
ANSWER Yes, this would be better in some cases. The main point is that error messages should go to stderr rather than stdout.
QUESTION > 2. Did you say in class we should not exit in the middle of the program > if we get an error. For example, if I get a fork error or a makeargv > error should I wait until the program finishes instead of exiting
ANSWER You should not exit for a function, but rather return an error code to the calling program. You may exit from the main program at any time (after printing an appropriate error message, or course).
QUESTION
> 3. The way I'm implementing my program is I read one line from testing.data
> and if I have more processes allowed I fork. I keep repeating this until
> end of file. Is this correct or should I strcpy all the fgets together
> and fork the max number of children allowed each time.
ANSWER No you definitely want to read one line and fork a process. If you have the max allowed children currently running then you have to wait.
QUESTION
> 4. I believe you also said we are not using news groups so I guess we mail
> you directly our questions?
ANSWER Yes. I am planning to use the FAQ and mailing lists this semester.