2018-08-30 14:18:55 +02:00
|
|
|
// run-pass
|
2010-06-23 21:03:09 -07:00
|
|
|
|
2011-06-15 11:19:50 -07:00
|
|
|
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2011-07-27 14:19:39 +02:00
|
|
|
let f = "Makefile";
|
|
|
|
let s = rustrt.str_buf(f);
|
|
|
|
let buf = libc.malloc(1024);
|
|
|
|
let fd = libc.open(s, 0, 0);
|
2011-06-15 11:19:50 -07:00
|
|
|
libc.read(fd, buf, 1024);
|
|
|
|
libc.write(1, buf, 1024);
|
|
|
|
libc.close(fd);
|
|
|
|
libc.free(buf);
|
2011-08-19 15:16:48 -07:00
|
|
|
}
|