The solution code was generated by gcc by loading

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: action) < 0) unix_error("Signal error"); return (old_action.sa_handler); } void Kill(pid_t pid, int signum) { int rc; if ((rc = kill(pid, signum)) < 0) unix_error("Kill error"); } void Pause() { (void)pause(); return; } unsigned int Sleep(unsigned int secs) { unsigned int rc; A.5. THE CSAPP.C SOURCE FILE 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 677 if ((rc = sleep(secs)) < 0) unix_error("Sleep error"); return rc; } unsigned int Alarm(unsigned int seconds) { return alarm(seconds); } void Setpgid(pid_t pid, pid_t pgid) { int rc; if ((rc = setpgid(pid, pgid)) < 0) unix_error("Setpgid error"); return; } pid_t Getpgrp(void) { return getpgrp(); } /******************************** * Wrappers for Unix I/O routines ********************************/ int Open(const char *pathname, int flags, mode_t mode) { int rc; if ((rc = open(pathname, flags, mode)) unix_error("Open error&quot...
View Full Document

Ask a homework question - tutors are online