| 104 | } |
| 105 | |
| 106 | static int |
| 107 | ReadHandleFile(int fd, void *ptr, unsigned len) |
| 108 | { |
| 109 | unsigned maxBytes; |
| 110 | Handle h; |
| 111 | |
| 112 | if (!IsHandleFile(fd)) |
| 113 | return -1; |
| 114 | |
| 115 | fd -= FIRST_HF; |
| 116 | maxBytes = theHandleFiles[fd].size - theHandleFiles[fd].mark; |
| 117 | if (len > maxBytes) |
| 118 | len = maxBytes; |
| 119 | |
| 120 | h = theHandleFiles[fd].data; |
| 121 | |
| 122 | HLock(h); |
| 123 | BlockMove(*h + theHandleFiles[fd].mark, ptr, len); |
| 124 | HUnlock(h); |
| 125 | theHandleFiles[fd].mark += len; |
| 126 | |
| 127 | return (len); |
| 128 | } |
| 129 | |
| 130 | static long |
| 131 | SetHandleFilePos(int fd, short whence, long pos) |
no test coverage detected