summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/unlink.c
blob: 33fe615764a27e120c41f3ac9d4d00c5ff1a8fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* COVERAGE: unlink */
#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int main()
{
  int fd1;

  fd1 = creat("foobar1",S_IREAD|S_IWRITE);
  close (fd1);
  
  unlink("foobar1");
  //staptest// unlink ("foobar1") = 0

  unlink("foobar1");
  //staptest// unlink ("foobar1") = -NNNN (ENOENT)

  unlink("foobar2");
  //staptest// unlink ("foobar2") = -NNNN (ENOENT)

  unlink(0);
  //staptest// unlink (NULL) = -NNNN (EFAULT)

  unlink("..");
  //staptest// unlink ("..") = -NNNN (EISDIR)

  unlink("");
  //staptest// unlink ("") = -NNNN (ENOENT)

  return 0;
}