Remove all uses of native cdecl except for those that yield

This commit is contained in:
Brian Anderson
2011-11-08 11:09:40 -08:00
parent a727bbaf70
commit 0f1af17a60
14 changed files with 58 additions and 27 deletions

View File

@@ -6,7 +6,7 @@ TODO: Restructure and document
// FIXME Somehow merge stuff duplicated here and macosx_os.rs. Made difficult
// by https://github.com/graydon/rust/issues#issue/268
native "cdecl" mod libc = "" {
native "c-stack-cdecl" mod libc = "" {
fn read(fd: int, buf: *u8, count: uint) -> int;
fn write(fd: int, buf: *u8, count: uint) -> int;
fn fread(buf: *u8, size: uint, n: uint, f: libc::FILE) -> uint;
@@ -72,6 +72,14 @@ fn fd_FILE(fd: int) -> libc::FILE {
ret str::as_buf("r", {|modebuf| libc::fdopen(fd, modebuf) });
}
fn close(fd: int) -> int {
libc::close(fd)
}
fn fclose(file: libc::FILE) {
libc::fclose(file)
}
fn waitpid(pid: int) -> int {
let status = 0;
assert (os::libc::waitpid(pid, status, 0) != -1);