File: device.h

package info (click to toggle)
fdclone 3.01b-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 4,772 kB
  • ctags: 8,674
  • sloc: ansic: 100,552; makefile: 4,497; sh: 1,480; sed: 224
file content (44 lines) | stat: -rw-r--r-- 855 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 *	device.h
 *
 *	definitions for device ID
 */

#ifdef	USEMKDEVH
#include <sys/mkdev.h>
#else	/* !USEMKDEVH */
# ifdef	USEMKNODH
# include <sys/mknod.h>
# else	/* !USEMKNODH */
#  ifdef	SVR4
#  include <sys/sysmacros.h>
#  endif
# endif	/* !USEMKNODH */
#endif	/* !USEMKDEVH */

#ifdef	SVR4
#define	BIT_MAJOR		15
#define	BIT_MINOR		18
#else
#define	BIT_MAJOR		8
#define	BIT_MINOR		8
#endif
#define	MASK_MAJOR		(((u_long)1 << BIT_MAJOR) - 1)
#define	MASK_MINOR		(((u_long)1 << BIT_MINOR) - 1)

#ifndef	major
#define	major(n)		((((u_long)(n)) >> BIT_MINOR) & MASK_MAJOR)
#endif
#ifndef	minor
#define	minor(n)		(((u_long)(n)) & MASK_MINOR)
#endif
#ifndef	makedev
#define	makedev(ma, mi)		(((((u_long)(ma)) & MASK_MAJOR) << BIT_MAJOR) \
				| (((u_long)(mi)) & MASK_MINOR))
#endif

#if	MSDOS
typedef short			r_dev_t;
#else
typedef dev_t			r_dev_t;
#endif