Changed debug() format inside newlib_backend, added multiline print test
[akaros.git] / user / apps / parlib / open_read.c
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <fcntl.h>
4 #include <unistd.h>
5
6 int main(int argc, char** argv)
7 {
8         printf("Hello world from newlib!!\n");
9         printf("Hello\nWorld\nMulti\nLine\n");
10         printf("Hello after multiline.\n");
11
12         int fd = open("/test/file", O_RDWR, 0);
13         char buf[10];
14         int read_amt = read(fd, buf, 10);
15         printf("FD: %d\n", fd);
16         printf("read_amt: %d\n", read_amt);
17         printf("read: %s\n", buf);
18
19         char buf2[] = "NANWAN!\n";
20
21         int write_amt = write(fd, buf2, 8);
22         printf("write_amt: %d\n", write_amt);        
23         printf("wrote: %s\n", buf2);
24
25
26         return 0;
27 }