diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-07-08 19:20:49 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-07-08 19:20:49 +0000 |
commit | a57ba4db64d5b2e8d9f7e9ab15ac32d1c1abdea5 (patch) | |
tree | c3b20d70c757a11aaffbb6a0c056044c9ebf68f1 | |
parent | 2cd439f7f075c4b6b6c32412a8e1311d589202e3 (diff) | |
download | busybox-w32-a57ba4db64d5b2e8d9f7e9ab15ac32d1c1abdea5.tar.gz busybox-w32-a57ba4db64d5b2e8d9f7e9ab15ac32d1c1abdea5.tar.bz2 busybox-w32-a57ba4db64d5b2e8d9f7e9ab15ac32d1c1abdea5.zip |
Argh. More cross libc cleanup. Should be ok now...
-Erik
-rw-r--r-- | mount.c | 26 | ||||
-rw-r--r-- | umount.c | 23 | ||||
-rw-r--r-- | util-linux/mount.c | 26 | ||||
-rw-r--r-- | util-linux/umount.c | 23 | ||||
-rw-r--r-- | utility.c | 17 |
5 files changed, 66 insertions, 49 deletions
@@ -43,27 +43,41 @@ | |||
43 | #include <string.h> | 43 | #include <string.h> |
44 | #include <stdio.h> | 44 | #include <stdio.h> |
45 | #include <mntent.h> | 45 | #include <mntent.h> |
46 | #include <sys/mount.h> | ||
47 | #include <ctype.h> | 46 | #include <ctype.h> |
48 | #if defined BB_FEATURE_USE_DEVPS_PATCH | 47 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
49 | #include <linux/devmtab.h> | 48 | #include <linux/devmtab.h> |
50 | #endif | 49 | #endif |
51 | 50 | ||
52 | /* 2.0.x. kernels don't know about MS_NODIRATIME */ | 51 | |
53 | #ifndef MS_NODIRATIME | 52 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ |
53 | #define MS_RDONLY 1 /* Mount read-only */ | ||
54 | #define MS_NOSUID 2 /* Ignore suid and sgid bits */ | ||
55 | #define MS_NODEV 4 /* Disallow access to device special files */ | ||
56 | #define MS_NOEXEC 8 /* Disallow program execution */ | ||
57 | #define MS_SYNCHRONOUS 16 /* Writes are synced at once */ | ||
58 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS */ | ||
59 | #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ | ||
60 | #define S_QUOTA 128 /* Quota initialized for file/directory/symlink */ | ||
61 | #define S_APPEND 256 /* Append-only file */ | ||
62 | #define S_IMMUTABLE 512 /* Immutable file */ | ||
63 | #define MS_NOATIME 1024 /* Do not update access times. */ | ||
54 | #define MS_NODIRATIME 2048 /* Do not update directory access times */ | 64 | #define MS_NODIRATIME 2048 /* Do not update directory access times */ |
55 | #endif | ||
56 | 65 | ||
57 | 66 | ||
58 | 67 | ||
59 | #if defined BB_FEATURE_MOUNT_LOOP | 68 | #if defined BB_FEATURE_MOUNT_LOOP |
60 | #include <fcntl.h> | 69 | #include <fcntl.h> |
61 | #include <sys/ioctl.h> | 70 | #include <sys/ioctl.h> |
62 | |||
63 | |||
64 | static int use_loop = FALSE; | 71 | static int use_loop = FALSE; |
65 | #endif | 72 | #endif |
66 | 73 | ||
74 | extern int mount (__const char *__special_file, __const char *__dir, | ||
75 | __const char *__fstype, unsigned long int __rwflag, | ||
76 | __const void *__data); | ||
77 | extern int umount (__const char *__special_file); | ||
78 | extern int umount2 (__const char *__special_file, int __flags); | ||
79 | |||
80 | |||
67 | extern const char mtab_file[]; /* Defined in utility.c */ | 81 | extern const char mtab_file[]; /* Defined in utility.c */ |
68 | 82 | ||
69 | static const char mount_usage[] = | 83 | static const char mount_usage[] = |
@@ -26,31 +26,18 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <linux/unistd.h> | ||
30 | 29 | ||
31 | 30 | ||
32 | #ifndef MNT_FORCE | ||
33 | #define MNT_FORCE 1 | 31 | #define MNT_FORCE 1 |
34 | #endif | ||
35 | #ifndef MS_MGC_VAL | ||
36 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ | 32 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ |
37 | #endif | ||
38 | #ifndef MS_REMOUNT | ||
39 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ | 33 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ |
40 | #endif | ||
41 | #ifndef MS_RDONLY | ||
42 | #define MS_RDONLY 1 /* Mount read-only. */ | 34 | #define MS_RDONLY 1 /* Mount read-only. */ |
43 | #endif | ||
44 | #ifndef __NR_umount2 | ||
45 | #define __NR_umount2 52 | ||
46 | #endif | ||
47 | 35 | ||
48 | /* Include our own version of <sys/mount.h>, since libc5 doesn't | 36 | extern int mount (__const char *__special_file, __const char *__dir, |
49 | * know about umount2 */ | 37 | __const char *__fstype, unsigned long int __rwflag, |
50 | static _syscall1(int, umount, const char *, special_file); | 38 | __const void *__data); |
51 | static _syscall2(int, umount2, const char *, special_file, int, flags); | 39 | extern int umount (__const char *__special_file); |
52 | static _syscall5(int, mount, const char *, special_file, const char *, dir, | 40 | extern int umount2 (__const char *__special_file, int __flags); |
53 | const char *, fstype, unsigned long int, rwflag, const void *, data); | ||
54 | 41 | ||
55 | 42 | ||
56 | 43 | ||
diff --git a/util-linux/mount.c b/util-linux/mount.c index 01e9b3d67..72734ae62 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -43,27 +43,41 @@ | |||
43 | #include <string.h> | 43 | #include <string.h> |
44 | #include <stdio.h> | 44 | #include <stdio.h> |
45 | #include <mntent.h> | 45 | #include <mntent.h> |
46 | #include <sys/mount.h> | ||
47 | #include <ctype.h> | 46 | #include <ctype.h> |
48 | #if defined BB_FEATURE_USE_DEVPS_PATCH | 47 | #if defined BB_FEATURE_USE_DEVPS_PATCH |
49 | #include <linux/devmtab.h> | 48 | #include <linux/devmtab.h> |
50 | #endif | 49 | #endif |
51 | 50 | ||
52 | /* 2.0.x. kernels don't know about MS_NODIRATIME */ | 51 | |
53 | #ifndef MS_NODIRATIME | 52 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ |
53 | #define MS_RDONLY 1 /* Mount read-only */ | ||
54 | #define MS_NOSUID 2 /* Ignore suid and sgid bits */ | ||
55 | #define MS_NODEV 4 /* Disallow access to device special files */ | ||
56 | #define MS_NOEXEC 8 /* Disallow program execution */ | ||
57 | #define MS_SYNCHRONOUS 16 /* Writes are synced at once */ | ||
58 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS */ | ||
59 | #define MS_MANDLOCK 64 /* Allow mandatory locks on an FS */ | ||
60 | #define S_QUOTA 128 /* Quota initialized for file/directory/symlink */ | ||
61 | #define S_APPEND 256 /* Append-only file */ | ||
62 | #define S_IMMUTABLE 512 /* Immutable file */ | ||
63 | #define MS_NOATIME 1024 /* Do not update access times. */ | ||
54 | #define MS_NODIRATIME 2048 /* Do not update directory access times */ | 64 | #define MS_NODIRATIME 2048 /* Do not update directory access times */ |
55 | #endif | ||
56 | 65 | ||
57 | 66 | ||
58 | 67 | ||
59 | #if defined BB_FEATURE_MOUNT_LOOP | 68 | #if defined BB_FEATURE_MOUNT_LOOP |
60 | #include <fcntl.h> | 69 | #include <fcntl.h> |
61 | #include <sys/ioctl.h> | 70 | #include <sys/ioctl.h> |
62 | |||
63 | |||
64 | static int use_loop = FALSE; | 71 | static int use_loop = FALSE; |
65 | #endif | 72 | #endif |
66 | 73 | ||
74 | extern int mount (__const char *__special_file, __const char *__dir, | ||
75 | __const char *__fstype, unsigned long int __rwflag, | ||
76 | __const void *__data); | ||
77 | extern int umount (__const char *__special_file); | ||
78 | extern int umount2 (__const char *__special_file, int __flags); | ||
79 | |||
80 | |||
67 | extern const char mtab_file[]; /* Defined in utility.c */ | 81 | extern const char mtab_file[]; /* Defined in utility.c */ |
68 | 82 | ||
69 | static const char mount_usage[] = | 83 | static const char mount_usage[] = |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 4f6edc2e5..fc9b466c6 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -26,31 +26,18 @@ | |||
26 | #include <stdio.h> | 26 | #include <stdio.h> |
27 | #include <mntent.h> | 27 | #include <mntent.h> |
28 | #include <errno.h> | 28 | #include <errno.h> |
29 | #include <linux/unistd.h> | ||
30 | 29 | ||
31 | 30 | ||
32 | #ifndef MNT_FORCE | ||
33 | #define MNT_FORCE 1 | 31 | #define MNT_FORCE 1 |
34 | #endif | ||
35 | #ifndef MS_MGC_VAL | ||
36 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ | 32 | #define MS_MGC_VAL 0xc0ed0000 /* Magic number indicatng "new" flags */ |
37 | #endif | ||
38 | #ifndef MS_REMOUNT | ||
39 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ | 33 | #define MS_REMOUNT 32 /* Alter flags of a mounted FS. */ |
40 | #endif | ||
41 | #ifndef MS_RDONLY | ||
42 | #define MS_RDONLY 1 /* Mount read-only. */ | 34 | #define MS_RDONLY 1 /* Mount read-only. */ |
43 | #endif | ||
44 | #ifndef __NR_umount2 | ||
45 | #define __NR_umount2 52 | ||
46 | #endif | ||
47 | 35 | ||
48 | /* Include our own version of <sys/mount.h>, since libc5 doesn't | 36 | extern int mount (__const char *__special_file, __const char *__dir, |
49 | * know about umount2 */ | 37 | __const char *__fstype, unsigned long int __rwflag, |
50 | static _syscall1(int, umount, const char *, special_file); | 38 | __const void *__data); |
51 | static _syscall2(int, umount2, const char *, special_file, int, flags); | 39 | extern int umount (__const char *__special_file); |
52 | static _syscall5(int, mount, const char *, special_file, const char *, dir, | 40 | extern int umount2 (__const char *__special_file, int __flags); |
53 | const char *, fstype, unsigned long int, rwflag, const void *, data); | ||
54 | 41 | ||
55 | 42 | ||
56 | 43 | ||
@@ -80,7 +80,6 @@ const char mtab_file[] = "/dev/mtab"; | |||
80 | # endif | 80 | # endif |
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | |||
84 | extern void usage(const char *usage) | 83 | extern void usage(const char *usage) |
85 | { | 84 | { |
86 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", | 85 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", |
@@ -139,6 +138,22 @@ extern int get_kernel_revision(void) | |||
139 | _syscall1(int, sysinfo, struct sysinfo *, info); | 138 | _syscall1(int, sysinfo, struct sysinfo *, info); |
140 | #endif /* BB_INIT */ | 139 | #endif /* BB_INIT */ |
141 | 140 | ||
141 | #if defined BB_MOUNT || defined BB_UMOUNT | ||
142 | #include <sys/syscall.h> | ||
143 | #include <linux/unistd.h> | ||
144 | |||
145 | #ifndef __NR_umount2 | ||
146 | #define __NR_umount2 52 | ||
147 | #endif | ||
148 | |||
149 | /* Include our own version of <sys/mount.h>, since libc5 doesn't | ||
150 | * know about umount2 */ | ||
151 | extern _syscall1(int, umount, const char *, special_file); | ||
152 | extern _syscall2(int, umount2, const char *, special_file, int, flags); | ||
153 | extern _syscall5(int, mount, const char *, special_file, const char *, dir, | ||
154 | const char *, fstype, unsigned long int, rwflag, const void *, data); | ||
155 | #endif | ||
156 | |||
142 | 157 | ||
143 | 158 | ||
144 | #if defined (BB_CP_MV) || defined (BB_DU) | 159 | #if defined (BB_CP_MV) || defined (BB_DU) |