summaryrefslogtreecommitdiffstats
path: root/sys/sys
diff options
context:
space:
mode:
authormike <mike@FreeBSD.org>2003-03-28 15:27:30 +0000
committermike <mike@FreeBSD.org>2003-03-28 15:27:30 +0000
commit70f89c52b847076a353c28b1b081c645af2e39e8 (patch)
tree02ce50a896e9b4fa9b4ada3981116a7781223b5d /sys/sys
parentd6b685fe45c9bfe193fd3cdf5dc53d54df6897ac (diff)
downloadFreeBSD-src-70f89c52b847076a353c28b1b081c645af2e39e8.zip
FreeBSD-src-70f89c52b847076a353c28b1b081c645af2e39e8.tar.gz
Move details of dev_t (and udev_t) to <sys/_types.h>.
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/_types.h11
-rw-r--r--sys/sys/acct.h9
-rw-r--r--sys/sys/stat.h23
-rw-r--r--sys/sys/types.h16
4 files changed, 28 insertions, 31 deletions
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index 09b1586..f9f00f2 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -53,6 +53,7 @@ typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t; /* microseconds (signed) */
typedef __int32_t __timer_t; /* timer_gettime()... */
+typedef __uint32_t __udev_t; /* device number */
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t; /* microseconds (unsigned) */
@@ -80,6 +81,16 @@ typedef __ct_rune_t __wchar_t;
typedef __ct_rune_t __wint_t;
/*
+ * dev_t has differing meanings in userland and the kernel.
+ */
+#ifdef _KERNEL
+struct cdev;
+typedef struct cdev *__dev_t;
+#else
+typedef __udev_t __dev_t; /* device number */
+#endif
+
+/*
* mbstate_t is an opaque object to keep conversion state during multibyte
* stream conversions.
*/
diff --git a/sys/sys/acct.h b/sys/sys/acct.h
index 8e1b294..d0ff947 100644
--- a/sys/sys/acct.h
+++ b/sys/sys/acct.h
@@ -49,12 +49,6 @@
*/
typedef u_int16_t comp_t;
-#ifdef _KERNEL
-#define __dev_t udev_t
-#else
-#define __dev_t dev_t
-#endif
-
#define AC_COMM_LEN 16
struct acct {
char ac_comm[AC_COMM_LEN]; /* command name */
@@ -66,7 +60,7 @@ struct acct {
gid_t ac_gid; /* group id */
u_int16_t ac_mem; /* average memory usage */
comp_t ac_io; /* count of IO blocks */
- __dev_t ac_tty; /* controlling tty */
+ __udev_t ac_tty; /* controlling tty */
#define AFORK 0x01 /* forked but not exec'ed */
/* ASU is no longer supported */
@@ -76,7 +70,6 @@ struct acct {
#define AXSIG 0x10 /* killed by a signal */
u_int8_t ac_flag; /* accounting flags */
};
-#undef __dev_t
/*
* 1/AHZ is the granularity of the data encoded in the comp_t fields.
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index d2e8dfb..2c830a6 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -45,7 +45,12 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
-/* XXX missing blkcnt_t, blksize_t, dev_t. */
+/* XXX missing blkcnt_t, blksize_t. */
+
+#ifndef _DEV_T_DECLARED
+typedef __dev_t dev_t;
+#define _DEV_T_DECLARED
+#endif
#ifndef _FFLAGS_T_DECLARED
typedef __fflags_t fflags_t;
@@ -99,12 +104,6 @@ typedef __uid_t uid_t;
#include <sys/_timespec.h>
#endif
-#ifdef _KERNEL /* XXX __dev_t should be in <sys/_types.h>. */
-#define __dev_t udev_t
-#else
-#define __dev_t dev_t
-#endif
-
#if __BSD_VISIBLE
struct ostat {
__uint16_t st_dev; /* inode's device */
@@ -126,13 +125,13 @@ struct ostat {
#endif /* __BSD_VISIBLE */
struct stat {
- __dev_t st_dev; /* inode's device */
+ __udev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */
mode_t st_mode; /* inode protection mode */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
- __dev_t st_rdev; /* device type */
+ __udev_t st_rdev; /* device type */
#if __BSD_VISIBLE
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
@@ -173,13 +172,13 @@ struct stat {
#if __BSD_VISIBLE
struct nstat {
- __dev_t st_dev; /* inode's device */
+ __udev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */
__uint32_t st_mode; /* inode protection mode */
__uint32_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
- __dev_t st_rdev; /* device type */
+ __udev_t st_rdev; /* device type */
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last file status change */
@@ -197,8 +196,6 @@ struct nstat {
};
#endif
-#undef __dev_t
-
#if __BSD_VISIBLE
#define st_atime st_atimespec.tv_sec
#define st_mtime st_mtimespec.tv_sec
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 57d2719..d20581c 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -132,6 +132,11 @@ typedef __clockid_t clockid_t;
typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
+#ifndef _DEV_T_DECLARED
+typedef __dev_t dev_t; /* device number or struct cdev */
+#define _DEV_T_DECLARED
+#endif
+
#ifndef _FFLAGS_T_DECLARED
typedef __fflags_t fflags_t; /* file flags */
#define _FFLAGS_T_DECLARED
@@ -230,6 +235,7 @@ typedef __timer_t timer_t;
#endif
typedef __u_register_t u_register_t;
+typedef __udev_t udev_t; /* device number */
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t; /* user id */
@@ -265,18 +271,8 @@ typedef __uintfptr_t uintfptr_t;
typedef __uint64_t uoff_t;
typedef struct vm_page *vm_page_t;
-struct cdev;
-
-typedef __uint32_t udev_t; /* device number */
-typedef struct cdev *dev_t;
-
#define offsetof(type, field) __offsetof(type, field)
-#else /* !_KERNEL */
-
-typedef __uint32_t dev_t; /* device number */
-#define udev_t dev_t
-
#endif /* !_KERNEL */
/*
OpenPOWER on IntegriCloud