C 1 2 3 4 5 6 7 8 9 10 void decode1int xp int yp int

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (pid = fork()) < 0) unix_error("Fork error"); return pid; } void Execve(const char *filename, char *const argv, char *const envp) { if (execve(filename, argv, envp) < 0) unix_error("Execve error"); 676 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 APPENDIX A. ERROR HANDLING } pid_t Wait(int *status) { pid_t pid; if ((pid = wait(status)) < 0) unix_error("Wait error"); return pid; } pid_t Waitpid(pid_t pid, int *iptr, int options) { pid_t retpid; if ((retpid = waitpid(pid, iptr, options)) < 0) unix_error("Waitpid error"); return(retpid); } handler_t *Signal(int signum, handler_t *handler) { struct sigaction action, old_action; action.sa_handler = handler; sigemptyset(&action.sa_mask); /* block sigs of type being handled */ action.sa_flags = SA_RESTART; /* restart syscalls if possible */ if (sigaction(signum, &action, &old_...
View Full Document

Ask a homework question - tutors are online