major(), minor(), and makedev()

This commit is contained in:
cgd 1999-04-26 06:10:36 +00:00
parent 9524149336
commit bd947212ac
2 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1.h,v 1.5 1999/04/26 05:56:34 cgd Exp $ */
/* $NetBSD: osf1.h,v 1.6 1999/04/26 06:10:36 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@ -415,6 +415,13 @@ struct osf1_stat {
};
/* types.h */
#define osf1_major(x) ((((dev_t)(x)) >> 20) & 0x00000fff)
#define osf1_minor(x) ((((dev_t)(x)) >> 0) & 0x000fffff)
#define osf1_makedev(x,y) ((((dev_t)(x)) << 20) | ((dev_t)(x)))
/* uio.h */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1_misc.c,v 1.22 1999/04/26 05:57:53 cgd Exp $ */
/* $NetBSD: osf1_misc.c,v 1.23 1999/04/26 06:10:37 cgd Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@ -475,8 +475,8 @@ osf1_sys_fstat(p, v, retval)
return (error);
}
#define bsd2osf_dev(dev) (major(dev) << 20 | minor(dev))
#define osf2bsd_dev(dev) makedev((dev >> 20) & 0xfff, dev & 0xfffff)
#define bsd2osf_dev(dev) osf1_makedev(major(dev), minor(dev))
#define osf2bsd_dev(dev) makedev(osf1_major(dev), osf1_minor(dev))
/*
* Convert from a stat structure to an osf1 stat structure.