Unified · Split
| @@ -1,5 +1,5 @@ | |||
| 1 | 20070714 | 1 | 20070714 |
| 2 | add Sys->readn | 2 | add Sys->readn, update sys-read(2) |
| 3 | copy two repairs from emu/port/inferno.c to os/port/inferno.c | 3 | copy two repairs from emu/port/inferno.c to os/port/inferno.c |
| 4 | 20070619 | 4 | 20070619 |
| 5 | remembered to include /appl/cmd/trfs.b /dis/trfs.dis | 5 | remembered to include /appl/cmd/trfs.b /dis/trfs.dis |
| @@ -7,6 +7,7 @@ include "sys.m"; · 6 unmodified lines | |||
| 7 | sys := load Sys Sys->PATH; | 7 | sys := load Sys Sys->PATH; |
| 8 | 8 | ||
| 9 | read: fn(fd: ref FD, buf: array of byte, nbytes: int): int; | 9 | read: fn(fd: ref FD, buf: array of byte, nbytes: int): int; |
| 10 | readn: fn(fd: ref FD, buf: array of byte, nbytes: int): int; | ||
| 10 | write: fn(fd: ref FD, buf: array of byte, nbytes: int): int; | 11 | write: fn(fd: ref FD, buf: array of byte, nbytes: int): int; |
| 11 | 12 | ||
| 12 | pread: fn(fd: ref FD, buf: array of byte, nbytes: int, | 13 | pread: fn(fd: ref FD, buf: array of byte, nbytes: int, |
| @@ -36,6 +37,19 @@ In any event the number of bytes read is returned. · 23 unmodified lines | |||
| 36 | A return value of | 37 | A return value of |
| 37 | 0 is conventionally interpreted as end of file. | 38 | 0 is conventionally interpreted as end of file. |
| 38 | .PP | 39 | .PP |
| 40 | .B Readn | ||
| 41 | continues to | ||
| 42 | .B read | ||
| 43 | from | ||
| 44 | .I fd | ||
| 45 | sequentially into | ||
| 46 | .IR buf , | ||
| 47 | until | ||
| 48 | .I nbytes | ||
| 49 | have been read, or | ||
| 50 | .B read | ||
| 51 | returns a non-positive count. | ||
| 52 | .PP | ||
| 39 | .B Write | 53 | .B Write |
| 40 | writes | 54 | writes |
| 41 | .I nbytes | 55 | .I nbytes |