File: xmount.h

package info (click to toggle)
busybox 1:1.22.0-9+deb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 16,488 kB
  • ctags: 27,643
  • sloc: ansic: 187,197; sh: 6,816; cpp: 1,428; makefile: 1,029; yacc: 570; lex: 355; perl: 312; python: 255; awk: 29
file content (109 lines) | stat: -rw-r--r-- 2,903 bytes parent folder | download | duplicates (3)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* vi: set sw=4 ts=4: */
/*
 * System-specific definitions for mount.
 *
 * Copyright (C) 2010 by Jeremie Koenig <jk@jk.fr.eu.org>
 * Copyright (C) 2010 by Luca Favatella <slackydeb@gmail.com>
 *
 * The Linux prototypes for mount(), umount2(), swapon() and swapoff()  are
 * used as a reference for our versions of them. On non-Linux system those
 * should be implemented as compatibility wrappers (see xmount.c).
 */

/*
 * Definitions for mount flags. Non-Linux systems are free to use whatever
 * their version of xmount() will work with.
 */

#ifdef __linux__
# include <sys/mount.h>
# include <sys/swap.h>
/* Make sure we have all the new mount flags we actually try to use
 * (grab more as needed from util-linux's mount/mount_constants.h). */
# ifndef MS_DIRSYNC
#  define MS_DIRSYNC     (1 << 7) // Directory modifications are synchronous
# endif
# ifndef MS_UNION
#  define MS_UNION       (1 << 8)
# endif
# ifndef MS_BIND
#  define MS_BIND        (1 << 12)
# endif
# ifndef MS_MOVE
#  define MS_MOVE        (1 << 13)
# endif
# ifndef MS_RECURSIVE
#  define MS_RECURSIVE   (1 << 14)
# endif
# ifndef MS_SILENT
#  define MS_SILENT      (1 << 15)
# endif
/* The shared subtree stuff, which went in around 2.6.15. */
# ifndef MS_UNBINDABLE
#  define MS_UNBINDABLE  (1 << 17)
# endif
# ifndef MS_PRIVATE
#  define MS_PRIVATE     (1 << 18)
# endif
# ifndef MS_SLAVE
#  define MS_SLAVE       (1 << 19)
# endif
# ifndef MS_SHARED
#  define MS_SHARED      (1 << 20)
# endif
# ifndef MS_RELATIME
#  define MS_RELATIME    (1 << 21)
# endif
# ifndef MS_STRICTATIME
#  define MS_STRICTATIME (1 << 24)
# endif

#elif defined(__FreeBSD_kernel__)
# include <sys/mount.h>
# include <sys/swap.h>
# define MS_NOSUID      MNT_NOSUID
# ifdef MNT_NODEV
#  define MS_NODEV	MNT_NODEV
# else
#  define MS_NODEV	0
# endif
# define MS_NOEXEC      MNT_NOEXEC
# define MS_SYNCHRONOUS MNT_SYNCHRONOUS
# define MS_DIRSYNC     0
# define MS_NOATIME     MNT_NOATIME
# define MS_NODIRATIME  0
# define MS_MANDLOCK    0
# define MS_RELATIME    0
# define MS_SILENT      0
# define MS_STRICTATIME	0
# define MS_UNION       MNT_UNION
# define MS_BIND        0
# define MS_MOVE        0
# define MS_SHARED      0
# define MS_SLAVE       0
# define MS_PRIVATE     0
# define MS_UNBINDABLE  0
# define MS_RECURSIVE   0
# define MS_RDONLY      MNT_RDONLY
# define MS_REMOUNT     MNT_UPDATE

#else
# error There is no xmount() implementation for your system.
#endif

/*
 * Prototypes for the compatibility wrappers
 */

#ifdef __linux__
# define xmount mount
# define xumount umount2
# define xswapon swapon
# define xswapoff swapoff
#else
int xmount(const char *source, const char *target, const char *filesystemtype,
		unsigned long mountflags, const void *data) FAST_FUNC;
int xumount(const char *target, int flags) FAST_FUNC;
int xswapon(const char *path, int swapflags) FAST_FUNC;
int xswapoff(const char *path) FAST_FUNC;
#endif