diff options
Diffstat (limited to 'src/lib/linux_os.rs')
| -rw-r--r-- | src/lib/linux_os.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/linux_os.rs b/src/lib/linux_os.rs new file mode 100644 index 00000000..a775a97a --- /dev/null +++ b/src/lib/linux_os.rs @@ -0,0 +1,19 @@ +import _str.sbuf; +import _vec.vbuf; + +native mod libc = "libc.so.6" { + + fn open(sbuf s, int flags) -> int; + fn read(int fd, vbuf buf, uint count) -> int; + fn write(int fd, vbuf buf, uint count) -> int; + fn close(int fd) -> int; + + type dir; + // readdir is a mess; handle via wrapper function in rustrt. + fn opendir(sbuf d) -> dir; + fn closedir(dir d) -> int; + + fn getenv(sbuf n) -> sbuf; + fn setenv(sbuf n, sbuf v, int overwrite) -> int; + fn unsetenv(sbuf n) -> int; +} |