| 288 | } |
| 289 | |
| 290 | int |
| 291 | macread(int fd, void *ptr, unsigned len) |
| 292 | { |
| 293 | long amt = len; |
| 294 | |
| 295 | if (IsHandleFile(fd)) { |
| 296 | return ReadHandleFile(fd, ptr, amt); |
| 297 | } else { |
| 298 | short err = FSRead(fd, &amt, ptr); |
| 299 | |
| 300 | return ((err == noErr) || (err == eofErr && len)) ? amt : -1; |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | #if 0 /* this function isn't used, if you use it, uncomment prototype in \ |
| 305 | macwin.h */ |
no test coverage detected