stdlib: Implement an interior-vector version of the io module

This commit is contained in:
Patrick Walton
2011-07-10 12:47:51 -07:00
parent 875c4622fb
commit 7871b55597
7 changed files with 489 additions and 0 deletions

View File

@@ -33,6 +33,13 @@ native "cdecl" mod libc = "" {
fn waitpid(int pid, vbuf status, int options) -> int;
}
native "cdecl" mod libc_ivec = "" {
fn read(int fd, *u8 buf, uint count) -> int;
fn write(int fd, *u8 buf, uint count) -> int;
fn fread(*u8 buf, uint size, uint n, libc::FILE f) -> uint;
fn fwrite(*u8 buf, uint size, uint n, libc::FILE f) -> uint;
}
mod libc_constants {
fn O_RDONLY() -> int { ret 0; }
fn O_WRONLY() -> int { ret 1; }