summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/sync.c
blob: b23d68be05ded5250d1d7d3525caa6674aee8633 (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();
  // sync () = 0

  fsync(fd);
  // fsync (4) = 0

  fdatasync(fd);
  // fdatasync (4) = 0

  close(fd);

  return 0;
}