move libc related stuff out of platform.h
authorDenys Vlasenko <vda.linux@googlemail.com>
Wed, 8 Jul 2009 00:58:38 +0000 (02:58 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 8 Jul 2009 00:58:38 +0000 (02:58 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
12 files changed:
coreutils/stty.c
include/platform.h
libbb/login.c
miscutils/eject.c
miscutils/hdparm.c
util-linux/fdisk.c
util-linux/freeramdisk.c
util-linux/mkfs_vfat.c
util-linux/mount.c
util-linux/switch_root.c
util-linux/umount.c
util-linux/volume_id/get_devname.c

index 5506fdb66754fc026ce49f8e0c2f557fb6b391a1..e02fe7c720f87c8b43b933b9a9ca4658f29d2f64 100644 (file)
 # define CSWTCH _POSIX_VDISABLE
 #endif
 
-#ifndef IUCLC
-# define IUCLC 0
-#endif
-
 /* SunOS 5.3 loses (^Z doesn't work) if 'swtch' is the same as 'susp'.
    So the default is to disable 'swtch.'  */
 #if defined(__sparc__) && defined(__svr4__)
index 99e747f0dafbefe7e19f162ad1302cf342908318..7c88d1ba68c844f8cfa470af5b26e9e1195c69a6 100644 (file)
@@ -342,49 +342,5 @@ static ALWAYS_INLINE char* strchrnul(const char *s, char c)
 
 #endif
 
-#if defined(__linux__)
-# include <sys/mount.h>
-/* Make sure we have all the new mount flags we actually try to use. */
-# 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
-
-# if !defined(BLKSSZGET)
-#  define BLKSSZGET _IO(0x12, 104)
-# endif
-# if !defined(BLKGETSIZE64)
-#  define BLKGETSIZE64 _IOR(0x12,114,size_t)
-# endif
-#endif
-
-/* The field domainname of struct utsname is Linux specific. */
-#if !defined(__linux__)
-# define HAVE_NO_UTSNAME_DOMAINNAME
-#endif
 
 #endif
index 98e641cceeef106d1acaa24136ac6ef206fb1df8..ba9f4d2b58b3d27d0b91194ba2e3bcd8f91a4d05 100644 (file)
@@ -62,7 +62,8 @@ void FAST_FUNC print_login_issue(const char *issue_file, const char *tty)
                        case 'm':
                                outbuf = uts.machine;
                                break;
-#ifndef HAVE_NO_UTSNAME_DOMAINNAME
+/* The field domainname of struct utsname is Linux specific. */
+#if defined(__linux__)
                        case 'D':
                        case 'o':
                                outbuf = uts.domainname;
index 94a36c0da3ea9ce87baadd695db047397e3c5fce..75618bea6dd038a0dbc4eb26d130168d58142140 100644 (file)
  * Most of the dirty work blatantly ripped off from cat.c =)
  */
 
+#include <sys/mount.h>
 #include "libbb.h"
+/* Must be after libbb.h: they need size_t */
+#include <scsi/sg.h>
+#include <scsi/scsi.h>
 
 /* various defines swiped from linux/cdrom.h */
 #define CDROMCLOSETRAY            0x5319  /* pendant of CDROMEJECT  */
@@ -27,9 +31,6 @@
 /* Code taken from the original eject (http://eject.sourceforge.net/),
  * refactored it a bit for busybox (ne-bb@nicoerfurth.de) */
 
-#include <scsi/sg.h>
-#include <scsi/scsi.h>
-
 static void eject_scsi(const char *dev)
 {
        static const char sg_commands[3][6] = {
index e8a483830ca6cfb62ca51e1708b15072e57e4f04..362b212a36994d10fe3cb0781c37ba3120314ade 100644 (file)
@@ -11,8 +11,9 @@
  * hdparm.c - Command line interface to get/set hard disk parameters
  *          - by Mark Lord (C) 1994-2002 -- freely distributable
  */
-#include "libbb.h"
 #include <linux/hdreg.h>
+#include <sys/mount.h>
+#include "libbb.h"
 
 /* device types */
 /* ------------ */
index 514b5d79caf652fd7b3ca92a57a1fbd48e1604f0..4416408314ca77d221c0661b09d7274a26515960 100644 (file)
 #define _LARGEFILE64_SOURCE
 #endif
 #include <assert.h>             /* assert */
+#include <sys/mount.h>
+#if !defined(BLKSSZGET)
+# define BLKSSZGET _IO(0x12, 104)
+#endif
 #include "libbb.h"
 
 /* Looks like someone forgot to add this to config system */
index bde6afc0a7914d2ef808a7321f5f6644235c7e77..6b9d95e69963a163a63a55eecf3688130e163d29 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Licensed under GPLv2, see file LICENSE in this tarball for details.
  */
-
+#include <sys/mount.h>
 #include "libbb.h"
 
 /* From <linux/fd.h> */
index 8c6078d7b4355fe5edc672e38aedb92ab3327575..8d12babdc34dc91e7e75fd98ceb42c243a4c488e 100644 (file)
@@ -7,12 +7,15 @@
  *
  * Licensed under GPLv2, see file LICENSE in this tarball for details.
  */
-#include "libbb.h"
-#include "volume_id/volume_id_internal.h"
-
 #include <linux/hdreg.h> /* HDIO_GETGEO */
 #include <linux/fd.h>    /* FDGETPRM */
+#include <sys/mount.h>   /* BLKSSZGET */
+#if !defined(BLKSSZGET)
+# define BLKSSZGET _IO(0x12, 104)
+#endif
 //#include <linux/msdos_fs.h>
+#include "libbb.h"
+#include "volume_id/volume_id_internal.h"
 
 #define SECTOR_SIZE             512
 
index 72dabd8408f5a8666793ef703432aa93856b9128..56c32e126ccbddc6650dae823c3e6af60f6e034b 100644 (file)
@@ -8,7 +8,6 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
-
 // Design notes: There is no spec for mount.  Remind me to write one.
 //
 // mount_main() calls singlemount() which calls mount_it_now().
 // singlemount() can loop through /etc/filesystems for fstype detection.
 // mount_it_now() does the actual mount.
 //
-
 #include <mntent.h>
 #include <syslog.h>
+#include <sys/mount.h>
+#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
 #include "libbb.h"
 
 #if ENABLE_FEATURE_MOUNT_LABEL
index 0f00b605afe2bfc539b67f39ed8e3f06481fca0b..ff0551843f00f3e2d451d3530995acdd37c87a30 100644 (file)
@@ -5,18 +5,16 @@
  *
  * Licensed under GPL version 2, see file LICENSE in this tarball for details.
  */
-#include "libbb.h"
 #include <sys/vfs.h>
-
+#include <sys/mount.h>
+#include "libbb.h"
 // Make up for header deficiencies
 #ifndef RAMFS_MAGIC
 # define RAMFS_MAGIC ((unsigned)0x858458f6)
 #endif
-
 #ifndef TMPFS_MAGIC
 # define TMPFS_MAGIC ((unsigned)0x01021994)
 #endif
-
 #ifndef MS_MOVE
 # define MS_MOVE     8192
 #endif
index 5b22bfacccd1548317b7d9eb856abc3bab2e91b9..a4b2bd08784be977a71659772e2b79bc9e0ad377 100644 (file)
@@ -7,8 +7,37 @@
  *
  * Licensed under GPL version 2, see file LICENSE in this tarball for details.
  */
-
 #include <mntent.h>
+#include <sys/mount.h>
+/* Make sure we have all the new mount flags we actually try to use. */
+#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
 #include "libbb.h"
 
 #if defined(__dietlibc__)
index a1786df1c0620f6ef4e45aedaa9d80dc76d3aba5..0686a07414da9bc2c37b1a05d20e5cf0ca59a364 100644 (file)
@@ -7,11 +7,12 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  */
-
+#include <sys/mount.h> /* BLKGETSIZE64 */
+#if !defined(BLKGETSIZE64)
+# define BLKGETSIZE64 _IOR(0x12,114,size_t)
+#endif
 #include "volume_id_internal.h"
 
-//#define BLKGETSIZE64 _IOR(0x12,114,size_t)
-
 static struct uuidCache_s {
        struct uuidCache_s *next;
 //     int major, minor;