summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/sync.c
blob: d6e22203b50e3355212884113fb4657d2bc0db90 (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
/* COVERAGE: fdatasync fsync sync */

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>


int main()
{
  int fd;

  fd = creat("foobar",S_IREAD|S_IWRITE);

  sync();
  //staptest// sync () = 0

  fsync(fd);
  //staptest// fsync (NNNN) = 0

  fdatasync(fd);
  //staptest// fdatasync (NNNN) = 0

  close(fd);

  return 0;
}