diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-08 02:58:38 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-08 02:58:38 +0200 |
commit | da49f5852481adb0b3fa0b5ccba93b266f271c35 (patch) | |
tree | 3ab27dafe02a3723658ab2649e8b3ea28b024ac5 | |
parent | 95cc814dbd37a4cb5a69b5eac80bd3e5173fe908 (diff) | |
download | busybox-w32-da49f5852481adb0b3fa0b5ccba93b266f271c35.tar.gz busybox-w32-da49f5852481adb0b3fa0b5ccba93b266f271c35.tar.bz2 busybox-w32-da49f5852481adb0b3fa0b5ccba93b266f271c35.zip |
move libc related stuff out of platform.h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/stty.c | 4 | ||||
-rw-r--r-- | include/platform.h | 44 | ||||
-rw-r--r-- | libbb/login.c | 3 | ||||
-rw-r--r-- | miscutils/eject.c | 7 | ||||
-rw-r--r-- | miscutils/hdparm.c | 3 | ||||
-rw-r--r-- | util-linux/fdisk.c | 4 | ||||
-rw-r--r-- | util-linux/freeramdisk.c | 2 | ||||
-rw-r--r-- | util-linux/mkfs_vfat.c | 9 | ||||
-rw-r--r-- | util-linux/mount.c | 31 | ||||
-rw-r--r-- | util-linux/switch_root.c | 6 | ||||
-rw-r--r-- | util-linux/umount.c | 31 | ||||
-rw-r--r-- | util-linux/volume_id/get_devname.c | 7 |
12 files changed, 84 insertions, 67 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index 5506fdb66..e02fe7c72 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
@@ -68,10 +68,6 @@ | |||
68 | # define CSWTCH _POSIX_VDISABLE | 68 | # define CSWTCH _POSIX_VDISABLE |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifndef IUCLC | ||
72 | # define IUCLC 0 | ||
73 | #endif | ||
74 | |||
75 | /* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'. | 71 | /* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'. |
76 | So the default is to disable 'swtch.' */ | 72 | So the default is to disable 'swtch.' */ |
77 | #if defined(__sparc__) && defined(__svr4__) | 73 | #if defined(__sparc__) && defined(__svr4__) |
diff --git a/include/platform.h b/include/platform.h index 99e747f0d..7c88d1ba6 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -342,49 +342,5 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c) | |||
342 | 342 | ||
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | #if defined(__linux__) | ||
346 | # include <sys/mount.h> | ||
347 | /* Make sure we have all the new mount flags we actually try to use. */ | ||
348 | # ifndef MS_BIND | ||
349 | # define MS_BIND (1 << 12) | ||
350 | # endif | ||
351 | # ifndef MS_MOVE | ||
352 | # define MS_MOVE (1 << 13) | ||
353 | # endif | ||
354 | # ifndef MS_RECURSIVE | ||
355 | # define MS_RECURSIVE (1 << 14) | ||
356 | # endif | ||
357 | # ifndef MS_SILENT | ||
358 | # define MS_SILENT (1 << 15) | ||
359 | # endif | ||
360 | /* The shared subtree stuff, which went in around 2.6.15. */ | ||
361 | # ifndef MS_UNBINDABLE | ||
362 | # define MS_UNBINDABLE (1 << 17) | ||
363 | # endif | ||
364 | # ifndef MS_PRIVATE | ||
365 | # define MS_PRIVATE (1 << 18) | ||
366 | # endif | ||
367 | # ifndef MS_SLAVE | ||
368 | # define MS_SLAVE (1 << 19) | ||
369 | # endif | ||
370 | # ifndef MS_SHARED | ||
371 | # define MS_SHARED (1 << 20) | ||
372 | # endif | ||
373 | # ifndef MS_RELATIME | ||
374 | # define MS_RELATIME (1 << 21) | ||
375 | # endif | ||
376 | |||
377 | # if !defined(BLKSSZGET) | ||
378 | # define BLKSSZGET _IO(0x12, 104) | ||
379 | # endif | ||
380 | # if !defined(BLKGETSIZE64) | ||
381 | # define BLKGETSIZE64 _IOR(0x12,114,size_t) | ||
382 | # endif | ||
383 | #endif | ||
384 | |||
385 | /* The field domainname of struct utsname is Linux specific. */ | ||
386 | #if !defined(__linux__) | ||
387 | # define HAVE_NO_UTSNAME_DOMAINNAME | ||
388 | #endif | ||
389 | 345 | ||
390 | #endif | 346 | #endif |
diff --git a/libbb/login.c b/libbb/login.c index 98e641cce..ba9f4d2b5 100644 --- a/libbb/login.c +++ b/libbb/login.c | |||
@@ -62,7 +62,8 @@ void FAST_FUNC print_login_issue(const char *issue_file, const char *tty) | |||
62 | case 'm': | 62 | case 'm': |
63 | outbuf = uts.machine; | 63 | outbuf = uts.machine; |
64 | break; | 64 | break; |
65 | #ifndef HAVE_NO_UTSNAME_DOMAINNAME | 65 | /* The field domainname of struct utsname is Linux specific. */ |
66 | #if defined(__linux__) | ||
66 | case 'D': | 67 | case 'D': |
67 | case 'o': | 68 | case 'o': |
68 | outbuf = uts.domainname; | 69 | outbuf = uts.domainname; |
diff --git a/miscutils/eject.c b/miscutils/eject.c index 94a36c0da..75618bea6 100644 --- a/miscutils/eject.c +++ b/miscutils/eject.c | |||
@@ -13,7 +13,11 @@ | |||
13 | * Most of the dirty work blatantly ripped off from cat.c =) | 13 | * Most of the dirty work blatantly ripped off from cat.c =) |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <sys/mount.h> | ||
16 | #include "libbb.h" | 17 | #include "libbb.h" |
18 | /* Must be after libbb.h: they need size_t */ | ||
19 | #include <scsi/sg.h> | ||
20 | #include <scsi/scsi.h> | ||
17 | 21 | ||
18 | /* various defines swiped from linux/cdrom.h */ | 22 | /* various defines swiped from linux/cdrom.h */ |
19 | #define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ | 23 | #define CDROMCLOSETRAY 0x5319 /* pendant of CDROMEJECT */ |
@@ -27,9 +31,6 @@ | |||
27 | /* Code taken from the original eject (http://eject.sourceforge.net/), | 31 | /* Code taken from the original eject (http://eject.sourceforge.net/), |
28 | * refactored it a bit for busybox (ne-bb@nicoerfurth.de) */ | 32 | * refactored it a bit for busybox (ne-bb@nicoerfurth.de) */ |
29 | 33 | ||
30 | #include <scsi/sg.h> | ||
31 | #include <scsi/scsi.h> | ||
32 | |||
33 | static void eject_scsi(const char *dev) | 34 | static void eject_scsi(const char *dev) |
34 | { | 35 | { |
35 | static const char sg_commands[3][6] = { | 36 | static const char sg_commands[3][6] = { |
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c index e8a483830..362b212a3 100644 --- a/miscutils/hdparm.c +++ b/miscutils/hdparm.c | |||
@@ -11,8 +11,9 @@ | |||
11 | * hdparm.c - Command line interface to get/set hard disk parameters | 11 | * hdparm.c - Command line interface to get/set hard disk parameters |
12 | * - by Mark Lord (C) 1994-2002 -- freely distributable | 12 | * - by Mark Lord (C) 1994-2002 -- freely distributable |
13 | */ | 13 | */ |
14 | #include "libbb.h" | ||
15 | #include <linux/hdreg.h> | 14 | #include <linux/hdreg.h> |
15 | #include <sys/mount.h> | ||
16 | #include "libbb.h" | ||
16 | 17 | ||
17 | /* device types */ | 18 | /* device types */ |
18 | /* ------------ */ | 19 | /* ------------ */ |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index 514b5d79c..441640831 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
@@ -12,6 +12,10 @@ | |||
12 | #define _LARGEFILE64_SOURCE | 12 | #define _LARGEFILE64_SOURCE |
13 | #endif | 13 | #endif |
14 | #include <assert.h> /* assert */ | 14 | #include <assert.h> /* assert */ |
15 | #include <sys/mount.h> | ||
16 | #if !defined(BLKSSZGET) | ||
17 | # define BLKSSZGET _IO(0x12, 104) | ||
18 | #endif | ||
15 | #include "libbb.h" | 19 | #include "libbb.h" |
16 | 20 | ||
17 | /* Looks like someone forgot to add this to config system */ | 21 | /* Looks like someone forgot to add this to config system */ |
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index bde6afc0a..6b9d95e69 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * | 8 | * |
9 | * Licensed under GPLv2, see file LICENSE in this tarball for details. | 9 | * Licensed under GPLv2, see file LICENSE in this tarball for details. |
10 | */ | 10 | */ |
11 | 11 | #include <sys/mount.h> | |
12 | #include "libbb.h" | 12 | #include "libbb.h" |
13 | 13 | ||
14 | /* From <linux/fd.h> */ | 14 | /* From <linux/fd.h> */ |
diff --git a/util-linux/mkfs_vfat.c b/util-linux/mkfs_vfat.c index 8c6078d7b..8d12babdc 100644 --- a/util-linux/mkfs_vfat.c +++ b/util-linux/mkfs_vfat.c | |||
@@ -7,12 +7,15 @@ | |||
7 | * | 7 | * |
8 | * Licensed under GPLv2, see file LICENSE in this tarball for details. | 8 | * Licensed under GPLv2, see file LICENSE in this tarball for details. |
9 | */ | 9 | */ |
10 | #include "libbb.h" | ||
11 | #include "volume_id/volume_id_internal.h" | ||
12 | |||
13 | #include <linux/hdreg.h> /* HDIO_GETGEO */ | 10 | #include <linux/hdreg.h> /* HDIO_GETGEO */ |
14 | #include <linux/fd.h> /* FDGETPRM */ | 11 | #include <linux/fd.h> /* FDGETPRM */ |
12 | #include <sys/mount.h> /* BLKSSZGET */ | ||
13 | #if !defined(BLKSSZGET) | ||
14 | # define BLKSSZGET _IO(0x12, 104) | ||
15 | #endif | ||
15 | //#include <linux/msdos_fs.h> | 16 | //#include <linux/msdos_fs.h> |
17 | #include "libbb.h" | ||
18 | #include "volume_id/volume_id_internal.h" | ||
16 | 19 | ||
17 | #define SECTOR_SIZE 512 | 20 | #define SECTOR_SIZE 512 |
18 | 21 | ||
diff --git a/util-linux/mount.c b/util-linux/mount.c index 72dabd840..56c32e126 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -8,7 +8,6 @@ | |||
8 | * | 8 | * |
9 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 9 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
10 | */ | 10 | */ |
11 | |||
12 | // Design notes: There is no spec for mount. Remind me to write one. | 11 | // Design notes: There is no spec for mount. Remind me to write one. |
13 | // | 12 | // |
14 | // mount_main() calls singlemount() which calls mount_it_now(). | 13 | // mount_main() calls singlemount() which calls mount_it_now(). |
@@ -17,9 +16,37 @@ | |||
17 | // singlemount() can loop through /etc/filesystems for fstype detection. | 16 | // singlemount() can loop through /etc/filesystems for fstype detection. |
18 | // mount_it_now() does the actual mount. | 17 | // mount_it_now() does the actual mount. |
19 | // | 18 | // |
20 | |||
21 | #include <mntent.h> | 19 | #include <mntent.h> |
22 | #include <syslog.h> | 20 | #include <syslog.h> |
21 | #include <sys/mount.h> | ||
22 | #ifndef MS_BIND | ||
23 | # define MS_BIND (1 << 12) | ||
24 | #endif | ||
25 | #ifndef MS_MOVE | ||
26 | # define MS_MOVE (1 << 13) | ||
27 | #endif | ||
28 | #ifndef MS_RECURSIVE | ||
29 | # define MS_RECURSIVE (1 << 14) | ||
30 | #endif | ||
31 | #ifndef MS_SILENT | ||
32 | # define MS_SILENT (1 << 15) | ||
33 | #endif | ||
34 | /* The shared subtree stuff, which went in around 2.6.15. */ | ||
35 | #ifndef MS_UNBINDABLE | ||
36 | # define MS_UNBINDABLE (1 << 17) | ||
37 | #endif | ||
38 | #ifndef MS_PRIVATE | ||
39 | # define MS_PRIVATE (1 << 18) | ||
40 | #endif | ||
41 | #ifndef MS_SLAVE | ||
42 | # define MS_SLAVE (1 << 19) | ||
43 | #endif | ||
44 | #ifndef MS_SHARED | ||
45 | # define MS_SHARED (1 << 20) | ||
46 | #endif | ||
47 | #ifndef MS_RELATIME | ||
48 | # define MS_RELATIME (1 << 21) | ||
49 | #endif | ||
23 | #include "libbb.h" | 50 | #include "libbb.h" |
24 | 51 | ||
25 | #if ENABLE_FEATURE_MOUNT_LABEL | 52 | #if ENABLE_FEATURE_MOUNT_LABEL |
diff --git a/util-linux/switch_root.c b/util-linux/switch_root.c index 0f00b605a..ff0551843 100644 --- a/util-linux/switch_root.c +++ b/util-linux/switch_root.c | |||
@@ -5,18 +5,16 @@ | |||
5 | * | 5 | * |
6 | * Licensed under GPL version 2, see file LICENSE in this tarball for details. | 6 | * Licensed under GPL version 2, see file LICENSE in this tarball for details. |
7 | */ | 7 | */ |
8 | #include "libbb.h" | ||
9 | #include <sys/vfs.h> | 8 | #include <sys/vfs.h> |
10 | 9 | #include <sys/mount.h> | |
10 | #include "libbb.h" | ||
11 | // Make up for header deficiencies | 11 | // Make up for header deficiencies |
12 | #ifndef RAMFS_MAGIC | 12 | #ifndef RAMFS_MAGIC |
13 | # define RAMFS_MAGIC ((unsigned)0x858458f6) | 13 | # define RAMFS_MAGIC ((unsigned)0x858458f6) |
14 | #endif | 14 | #endif |
15 | |||
16 | #ifndef TMPFS_MAGIC | 15 | #ifndef TMPFS_MAGIC |
17 | # define TMPFS_MAGIC ((unsigned)0x01021994) | 16 | # define TMPFS_MAGIC ((unsigned)0x01021994) |
18 | #endif | 17 | #endif |
19 | |||
20 | #ifndef MS_MOVE | 18 | #ifndef MS_MOVE |
21 | # define MS_MOVE 8192 | 19 | # define MS_MOVE 8192 |
22 | #endif | 20 | #endif |
diff --git a/util-linux/umount.c b/util-linux/umount.c index 5b22bfacc..a4b2bd087 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c | |||
@@ -7,8 +7,37 @@ | |||
7 | * | 7 | * |
8 | * Licensed under GPL version 2, see file LICENSE in this tarball for details. | 8 | * Licensed under GPL version 2, see file LICENSE in this tarball for details. |
9 | */ | 9 | */ |
10 | |||
11 | #include <mntent.h> | 10 | #include <mntent.h> |
11 | #include <sys/mount.h> | ||
12 | /* Make sure we have all the new mount flags we actually try to use. */ | ||
13 | #ifndef MS_BIND | ||
14 | # define MS_BIND (1 << 12) | ||
15 | #endif | ||
16 | #ifndef MS_MOVE | ||
17 | # define MS_MOVE (1 << 13) | ||
18 | #endif | ||
19 | #ifndef MS_RECURSIVE | ||
20 | # define MS_RECURSIVE (1 << 14) | ||
21 | #endif | ||
22 | #ifndef MS_SILENT | ||
23 | # define MS_SILENT (1 << 15) | ||
24 | #endif | ||
25 | /* The shared subtree stuff, which went in around 2.6.15. */ | ||
26 | #ifndef MS_UNBINDABLE | ||
27 | # define MS_UNBINDABLE (1 << 17) | ||
28 | #endif | ||
29 | #ifndef MS_PRIVATE | ||
30 | # define MS_PRIVATE (1 << 18) | ||
31 | #endif | ||
32 | #ifndef MS_SLAVE | ||
33 | # define MS_SLAVE (1 << 19) | ||
34 | #endif | ||
35 | #ifndef MS_SHARED | ||
36 | # define MS_SHARED (1 << 20) | ||
37 | #endif | ||
38 | #ifndef MS_RELATIME | ||
39 | # define MS_RELATIME (1 << 21) | ||
40 | #endif | ||
12 | #include "libbb.h" | 41 | #include "libbb.h" |
13 | 42 | ||
14 | #if defined(__dietlibc__) | 43 | #if defined(__dietlibc__) |
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c index a1786df1c..0686a0741 100644 --- a/util-linux/volume_id/get_devname.c +++ b/util-linux/volume_id/get_devname.c | |||
@@ -7,11 +7,12 @@ | |||
7 | * | 7 | * |
8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
9 | */ | 9 | */ |
10 | 10 | #include <sys/mount.h> /* BLKGETSIZE64 */ | |
11 | #if !defined(BLKGETSIZE64) | ||
12 | # define BLKGETSIZE64 _IOR(0x12,114,size_t) | ||
13 | #endif | ||
11 | #include "volume_id_internal.h" | 14 | #include "volume_id_internal.h" |
12 | 15 | ||
13 | //#define BLKGETSIZE64 _IOR(0x12,114,size_t) | ||
14 | |||
15 | static struct uuidCache_s { | 16 | static struct uuidCache_s { |
16 | struct uuidCache_s *next; | 17 | struct uuidCache_s *next; |
17 | // int major, minor; | 18 | // int major, minor; |