summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.syscall/mount.c
blob: a59582dd3eed5523fc375bfcd10d291421df910e (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: mount oldumount umount */
#include <sys/types.h>
#include <sys/mount.h>

#ifndef MNT_FORCE
#define MNT_FORCE    0x00000001      /* Attempt to forcibily umount */
#endif

#ifndef MNT_DETACH
#define MNT_DETACH   0x00000002      /* Just detach from the tree */
#endif

#ifndef MNT_EXPIRE
#define MNT_EXPIRE   0x00000004      /* Mark for expiry */
#endif

int main()
{
  mount ("mount_source", "mount_target", "ext2", MS_BIND|MS_NOATIME|MS_NODIRATIME|MS_NOSUID, "some arguments");
  //staptest// mount ("mount_source", "mount_target", "ext2", MS_BIND|MS_NOATIME|MS_NODIRATIME|MS_NOSUID, "some arguments") = -NNNN (ENOENT)

  umount("umount_target");
  //staptest// umount ("umount_target", 0) = -NNNN (ENOENT)

  umount2("umount2_target", MNT_FORCE);
  //staptest// umount ("umount2_target", MNT_FORCE) = -NNNN (ENOENT)

  umount2("umount2_target", MNT_DETACH);
  //staptest// umount ("umount2_target", MNT_DETACH) = -NNNN (ENOENT)

  umount2("umount2_target", MNT_EXPIRE);
  //staptest// umount ("umount2_target", MNT_EXPIRE) = -NNNN (ENOENT)

  return 0;
}