aboutsummaryrefslogtreecommitdiff
path: root/src/lib/macos_os.rs
blob: 8b30c8bc6b08707f6d697c50fdc635bd3f1e7d71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import _str.sbuf;
import _vec.vbuf;

native mod libc = "libc.dylib" {

  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;
}