summaryrefslogtreecommitdiffstats
path: root/src/examples/create.c
blob: 27025528d5635e970cd17897e0b320ed41aa972f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <syscall.h>

int
main (int argc, char *argv[])
{
  if (create ("test", 1)) {
    printf ("created file\n");
  } else {
    printf ("couldn't create file\n");
  }
  int fd = open ("test");
  printf ("opened file with fd %d\n", fd);
  int fd2 = open ("test");
  printf ("opened file with fd %d\n", fd2);
  int fd3 = open ("test");
  printf ("opened file with fd %d\n", fd3);

  halt ();
}