1 2 3 4 5 6 7 8 9 10 char ctestint a int b int c char

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: ;); return rc; } ssize_t Read(int fd, void *buf, size_t count) { ssize_t rc; if ((rc = read(fd, buf, count)) < 0) unix_error("Read error"); return rc; } ssize_t Write(int fd, const void *buf, size_t count) { ssize_t rc; if ((rc = write(fd, buf, count)) < 0) unix_error("Write error"); < 0) 678 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 APPENDIX A. ERROR HANDLING return rc; } off_t Lseek(int fildes, off_t offset, int whence) { off_t rc; if ((rc = lseek(fildes, offset, whence)) < 0) unix_error("Lseek error"); return rc; } void Close(int fd) { int rc; if ((rc = close(fd)) < 0) unix_error("Close error"); } int Select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout) { int rc; if ((rc = select(n, readfds, writefds, exceptfds, timeout)) < 0) unix_error("Select error"); return rc; } void Dup2(int fd1, int fd2) { if...
View Full Document

Ask a homework question - tutors are online