fixes to include major() and minor() in system header files (in a different

file than sys/types.h)

small binpackage update
This commit is contained in:
Ben Gras 2006-01-27 13:57:18 +00:00
parent f4ae126596
commit dd284552b4
4 changed files with 25 additions and 6 deletions

View file

@ -4,6 +4,11 @@ set -e
dir=$1 dir=$1
if [ $# -lt 1 ]
then echo "Usage: $0 packagedir"
exit 1
fi
if [ ! -d "$dir" ] if [ ! -d "$dir" ]
then echo "Error: $dir isn't a directory." then echo "Error: $dir isn't a directory."
exit 1 exit 1
@ -21,6 +26,12 @@ binsizes big
touch $packagestart touch $packagestart
sleep 1 sleep 1
cd $dir cd $dir
if [ ! -f build ]
then echo "Error: No build script in $dir."
exit 1
fi
sh build sh build
cd / cd /
echo " * Making file index, writing $targz" echo " * Making file index, writing $targz"

View file

@ -19,8 +19,10 @@
#define DEF_INODES 63 #define DEF_INODES 63
#define DEF_INDENTSTR "\t" #define DEF_INDENTSTR "\t"
#ifndef major
#define major(x) ( (x>>8) & 0377) #define major(x) ( (x>>8) & 0377)
#define minor(x) (x & 0377) #define minor(x) (x & 0377)
#endif
/* Globals. */ /* Globals. */
int count, origlen, tabs; int count, origlen, tabs;

View file

@ -18,10 +18,6 @@
#define SUPER_USER (uid_t) 0 /* uid_t of superuser */ #define SUPER_USER (uid_t) 0 /* uid_t of superuser */
/* Devices. */
#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
#define NULL ((void *)0) /* null pointer */ #define NULL ((void *)0) /* null pointer */
#define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */ #define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */
#define CPVVEC_NR 64 /* max # of entries in a SYS_VCOPY request */ #define CPVVEC_NR 64 /* max # of entries in a SYS_VCOPY request */

View file

@ -126,9 +126,19 @@ typedef unsigned int u_int;
typedef unsigned long u_long; typedef unsigned long u_long;
typedef char *caddr_t; typedef char *caddr_t;
/* Devices. */
#define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
#define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
#ifndef minor
#define minor(dev) (((dev) >> MINOR) & 0xff)
#endif
#ifndef major
#define major(dev) (((dev) >> MAJOR) & 0xff)
#endif
#ifndef makedev #ifndef makedev
#define minor(dev) (((dev) >> MINOR) & BYTE)
#define major(dev) (((dev) >> MAJOR) & BYTE)
#define makedev(major, minor) \ #define makedev(major, minor) \
((dev_t) (((major) << MAJOR) | ((minor) << MINOR))) ((dev_t) (((major) << MAJOR) | ((minor) << MINOR)))
#endif #endif