From abbd8902334e8c6409384593b4a2c81f939b47b4 Mon Sep 17 00:00:00 2001 From: Mike Barcroft Date: Wed, 21 Aug 2002 16:20:02 +0000 Subject: o Merge and into a new header called . o will continue to live so it can define MD clock macros, which are only MD because of gratuitous differences between architectures. o Change all headers to make use of this. This mainly involves changing: #ifdef _BSD_FOO_T_ typedef _BSD_FOO_T_ foo_t; #undef _BSD_FOO_T_ #endif to: #ifndef _FOO_T_DECLARED typedef __foo_t foo_t; #define _FOO_T_DECLARED #endif Concept by: bde Reviewed by: jake, obrien --- sys/sys/_timespec.h | 6 ++-- sys/sys/_types.h | 12 ++++---- sys/sys/dirent.h | 2 +- sys/sys/sbuf.h | 4 +-- sys/sys/signal.h | 6 ++-- sys/sys/socket.h | 12 ++++---- sys/sys/stat.h | 8 ++--- sys/sys/statvfs.h | 4 +-- sys/sys/stdint.h | 2 +- sys/sys/syslog.h | 6 ++-- sys/sys/systm.h | 10 +++---- sys/sys/times.h | 8 ++--- sys/sys/timespec.h | 8 ++--- sys/sys/types.h | 84 ++++++++++++++++++++++++++++------------------------- sys/sys/un.h | 6 ++-- 15 files changed, 91 insertions(+), 87 deletions(-) (limited to 'sys/sys') diff --git a/sys/sys/_timespec.h b/sys/sys/_timespec.h index 69b8fddd3b0b..48cef5a24986 100644 --- a/sys/sys/_timespec.h +++ b/sys/sys/_timespec.h @@ -36,7 +36,7 @@ */ /* - * Prerequisites: , + * Prerequisites: , * * This file must be kept synchronized with . * It defines a structure which must be a type pun for @@ -49,8 +49,8 @@ #define _SYS__TIMESPEC_H_ struct __timespec { -#ifdef _BSD_TIME_T_ - _BSD_TIME_T_ __tv_sec; /* seconds, but time_t is not yet defined */ +#ifndef _TIME_T_DECLARED + __time_t __tv_sec; /* seconds, but time_t is not yet defined */ #else time_t __tv_sec; /* seconds */ #endif diff --git a/sys/sys/_types.h b/sys/sys/_types.h index cbc430b0602f..864ba71d91ec 100644 --- a/sys/sys/_types.h +++ b/sys/sys/_types.h @@ -30,12 +30,12 @@ #define _SYS__TYPES_H_ #include -#include +#include -#define _BSD_FSBLKCNT_T_ __uint64_t -#define _BSD_FSFILCNT_T_ __uint64_t -#define _BSD_GID_T_ __uint32_t -#define _BSD_SA_FAMILY_T_ __uint8_t -#define _BSD_UID_T_ __uint32_t +typedef __uint64_t __fsblkcnt_t; +typedef __uint64_t __fsfilcnt_t; +typedef __uint32_t __gid_t; +typedef __uint8_t __sa_family_t; +typedef __uint32_t __uid_t; #endif /* !_SYS__TYPES_H_ */ diff --git a/sys/sys/dirent.h b/sys/sys/dirent.h index b9c39d1b4972..9f8cfadc202e 100644 --- a/sys/sys/dirent.h +++ b/sys/sys/dirent.h @@ -37,7 +37,7 @@ #ifndef _SYS_DIRENT_H_ #define _SYS_DIRENT_H_ -#include +#include /* * The dirent structure defines the format of directory entries returned by diff --git a/sys/sys/sbuf.h b/sys/sys/sbuf.h index bd2e9e940953..a63603e4e2ea 100644 --- a/sys/sys/sbuf.h +++ b/sys/sys/sbuf.h @@ -31,7 +31,7 @@ #ifndef _SYS_SBUF_H_ #define _SYS_SBUF_H_ -#include +#include /* * Structure definition @@ -63,7 +63,7 @@ int sbuf_bcpy(struct sbuf *, const char *, size_t); int sbuf_cat(struct sbuf *, const char *); int sbuf_cpy(struct sbuf *, const char *); int sbuf_printf(struct sbuf *, const char *, ...) __printflike(2, 3); -int sbuf_vprintf(struct sbuf *, const char *, _BSD_VA_LIST_) __printflike(2, 0); +int sbuf_vprintf(struct sbuf *, const char *, __va_list) __printflike(2, 0); int sbuf_putc(struct sbuf *, int); int sbuf_trim(struct sbuf *); int sbuf_overflowed(struct sbuf *); diff --git a/sys/sys/signal.h b/sys/sys/signal.h index f0668a9c98f7..909832650733 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -215,9 +215,9 @@ typedef void __siginfohandler_t(int, struct __siginfo *, void *); typedef __sighandler_t *sig_t; /* type of pointer to a signal function */ -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif /* diff --git a/sys/sys/socket.h b/sys/sys/socket.h index 4254c729c86c..0f81be1d5887 100644 --- a/sys/sys/socket.h +++ b/sys/sys/socket.h @@ -49,14 +49,14 @@ /* * Data types. */ -#ifdef _BSD_SA_FAMILY_T_ -typedef _BSD_SA_FAMILY_T_ sa_family_t; -#undef _BSD_SA_FAMILY_T_ +#ifndef _SA_FAMILY_T_DECLARED +typedef __sa_family_t sa_family_t; +#define _SA_FAMILY_T_DECLARED #endif -#ifdef _BSD_SOCKLEN_T_ -typedef _BSD_SOCKLEN_T_ socklen_t; -#undef _BSD_SOCKLEN_T_ +#ifndef _SOCKLEN_T_DECLARED +typedef __socklen_t socklen_t; +#define _SOCKLEN_T_DECLARED #endif /* diff --git a/sys/sys/stat.h b/sys/sys/stat.h index d7e28f33e5fd..a1d207f62fda 100644 --- a/sys/sys/stat.h +++ b/sys/sys/stat.h @@ -43,11 +43,11 @@ #define _SYS_STAT_H_ #include -#include +#include -#ifdef _BSD_FFLAGS_T_ -typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */ -#undef _BSD_FFLAGS_T_ +#ifndef _FFLAGS_T_DECLARED +typedef __fflags_t fflags_t; /* file flags */ +#define _FFLAGS_T_DECLARED #endif #if !defined(_KERNEL) && !defined(_POSIX_SOURCE) diff --git a/sys/sys/statvfs.h b/sys/sys/statvfs.h index ef722c1e847b..15be8ce79a6d 100644 --- a/sys/sys/statvfs.h +++ b/sys/sys/statvfs.h @@ -43,8 +43,8 @@ * a quality implementation should.) */ #ifndef _FSBLKCNT_T_DECLARED /* always declared together */ -typedef _BSD_FSBLKCNT_T_ fsblkcnt_t; -typedef _BSD_FSFILCNT_T_ fsfilcnt_t; +typedef __fsblkcnt_t fsblkcnt_t; +typedef __fsfilcnt_t fsfilcnt_t; #define _FSBLKCNT_T_DECLARED #endif diff --git a/sys/sys/stdint.h b/sys/sys/stdint.h index 1f870fce8bec..27f6dae997fd 100644 --- a/sys/sys/stdint.h +++ b/sys/sys/stdint.h @@ -30,8 +30,8 @@ #define _SYS_STDINT_H_ #include +#include -#include #include #ifndef _INT8_T_DECLARED diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h index 80cac0a53bc6..2b45ca40b953 100644 --- a/sys/sys/syslog.h +++ b/sys/sys/syslog.h @@ -186,17 +186,17 @@ CODE facilitynames[] = { * places ( and ), so if we include one * of them here we may collide with the utility's includes. It's unreasonable * for utilities to have to include one of them to include syslog.h, so we get - * _BSD_VA_LIST_ from and use it. + * __va_list from and use it. */ -#include #include +#include __BEGIN_DECLS void closelog(void); void openlog(const char *, int, int); int setlogmask(int); void syslog(int, const char *, ...) __printflike(2, 3); -void vsyslog(int, const char *, _BSD_VA_LIST_) __printflike(2, 0); +void vsyslog(int, const char *, __va_list) __printflike(2, 0); __END_DECLS #endif /* !_KERNEL */ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index 597f58e9fd79..2029412619cc 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -143,19 +143,19 @@ void init_param1(void); void init_param2(int physpages); void tablefull(const char *); int kvprintf(char const *, void (*)(int, void*), void *, int, - _BSD_VA_LIST_) __printflike(1, 0); + __va_list) __printflike(1, 0); void log(int, const char *, ...) __printflike(2, 3); void log_console(struct uio *); int printf(const char *, ...) __printflike(1, 2); int snprintf(char *, size_t, const char *, ...) __printflike(3, 4); int sprintf(char *buf, const char *, ...) __printflike(2, 3); int uprintf(const char *, ...) __printflike(1, 2); -int vprintf(const char *, _BSD_VA_LIST_) __printflike(1, 0); -int vsnprintf(char *, size_t, const char *, _BSD_VA_LIST_) __printflike(3, 0); -int vsprintf(char *buf, const char *, _BSD_VA_LIST_) __printflike(2, 0); +int vprintf(const char *, __va_list) __printflike(1, 0); +int vsnprintf(char *, size_t, const char *, __va_list) __printflike(3, 0); +int vsprintf(char *buf, const char *, __va_list) __printflike(2, 0); int ttyprintf(struct tty *, const char *, ...) __printflike(2, 3); int sscanf(const char *, char const *, ...); -int vsscanf(const char *, char const *, _BSD_VA_LIST_); +int vsscanf(const char *, char const *, __va_list); long strtol(const char *, char **, int); u_long strtoul(const char *, char **, int); quad_t strtoq(const char *, char **, int); diff --git a/sys/sys/times.h b/sys/sys/times.h index eb68bd0d6da5..dfa3124578a9 100644 --- a/sys/sys/times.h +++ b/sys/sys/times.h @@ -42,11 +42,11 @@ #ifndef _SYS_TIMES_H_ #define _SYS_TIMES_H_ -#include +#include -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED +typedef __clock_t clock_t; +#define _CLOCK_T_DECLARED #endif struct tms { diff --git a/sys/sys/timespec.h b/sys/sys/timespec.h index 038db2884d40..9f17828b37cf 100644 --- a/sys/sys/timespec.h +++ b/sys/sys/timespec.h @@ -36,15 +36,15 @@ */ /* - * Prerequisites: , + * Prerequisites: , */ #ifndef _SYS_TIMESPEC_H_ #define _SYS_TIMESPEC_H_ -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif struct timespec { diff --git a/sys/sys/types.h b/sys/sys/types.h index ded6f7749d75..a0af2b946a45 100644 --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -45,9 +45,7 @@ #include /* Machine type dependent parameters. */ -#include #include -#include #include #ifndef _POSIX_SOURCE @@ -126,36 +124,42 @@ typedef quad_t * qaddr_t; typedef char * caddr_t; /* core address */ typedef __const char * c_caddr_t; /* core address, pointer to const */ typedef __volatile char *v_caddr_t; /* core address, pointer to volatile */ +typedef __critical_t critical_t; /* Critical section value */ typedef int64_t daddr_t; /* disk address */ typedef u_int32_t fixpt_t; /* fixed point number */ -#ifdef _BSD_GID_T_ -typedef _BSD_GID_T_ gid_t; /* group id */ -#undef _BSD_GID_T_ +#ifndef _GID_T_DECLARED +typedef __gid_t gid_t; /* group id */ +#define _GID_T_DECLARED #endif typedef u_int32_t ino_t; /* inode number */ +typedef __intrmask_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */ typedef long key_t; /* IPC key (for Sys V IPC) */ typedef u_int16_t mode_t; /* permissions */ typedef u_int16_t nlink_t; /* link count */ -typedef _BSD_OFF_T_ off_t; /* file offset */ -typedef _BSD_PID_T_ pid_t; /* process id */ +typedef __off_t off_t; /* file offset */ +typedef __pid_t pid_t; /* process id */ +typedef __register_t register_t; typedef quad_t rlim_t; /* resource limit */ - -#ifdef _BSD_SEGSZ_T_ -typedef _BSD_SEGSZ_T_ segsz_t; /* segment size (in pages) */ -#undef _BSD_SEGSZ_T_ -#endif - +typedef __segsz_t segsz_t; /* segment size (in pages) */ typedef int32_t swblk_t; /* swap offset */ +typedef __u_register_t u_register_t; -#ifdef _BSD_UID_T_ -typedef _BSD_UID_T_ uid_t; /* user id */ -#undef _BSD_UID_T_ +#ifndef _UID_T_DECLARED +typedef __uid_t uid_t; /* user id */ +#define _UID_T_DECLARED #endif +typedef __vm_offset_t vm_offset_t; +typedef __vm_ooffset_t vm_ooffset_t; +typedef __vm_pindex_t vm_pindex_t; +typedef __vm_size_t vm_size_t; + #ifdef _KERNEL typedef int boolean_t; +typedef __intfptr_t intfptr_t; +typedef __uintfptr_t uintfptr_t; typedef u_int64_t uoff_t; typedef struct vm_page *vm_page_t; @@ -186,45 +190,45 @@ typedef u_int32_t dev_t; /* device number */ #endif /* !_KERNEL */ -#ifdef _BSD_CLOCK_T_ -typedef _BSD_CLOCK_T_ clock_t; -#undef _BSD_CLOCK_T_ +#ifndef _CLOCK_T_DECLARED +typedef __clock_t clock_t; +#define _CLOCK_T_DECLARED #endif -#ifdef _BSD_CLOCKID_T_ -typedef _BSD_CLOCKID_T_ clockid_t; -#undef _BSD_CLOCKID_T_ +#ifndef _CLOCKID_T_DECLARED +typedef __clockid_t clockid_t; +#define _CLOCKID_T_DECLARED #endif -#ifdef _BSD_FFLAGS_T_ -typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */ -#undef _BSD_FFLAGS_T_ +#ifndef _FFLAGS_T_DECLARED +typedef __fflags_t fflags_t; /* file flags */ +#define _FFLAGS_T_DECLARED #endif #ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */ -typedef _BSD_FSBLKCNT_T_ fsblkcnt_t; -typedef _BSD_FSFILCNT_T_ fsfilcnt_t; -#define _FSBLKCNT_T_DECLARED +typedef __fsblkcnt_t fsblkcnt_t; +typedef __fsfilcnt_t fsfilcnt_t; +#define _FSBLKCNT_T_DECLARED #endif -#ifdef _BSD_SIZE_T_ -typedef _BSD_SIZE_T_ size_t; -#undef _BSD_SIZE_T_ +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED #endif -#ifdef _BSD_SSIZE_T_ -typedef _BSD_SSIZE_T_ ssize_t; -#undef _BSD_SSIZE_T_ +#ifndef _SSIZE_T_DECLARED +typedef __ssize_t ssize_t; +#define _SSIZE_T_DECLARED #endif -#ifdef _BSD_TIME_T_ -typedef _BSD_TIME_T_ time_t; -#undef _BSD_TIME_T_ +#ifndef _TIME_T_DECLARED +typedef __time_t time_t; +#define _TIME_T_DECLARED #endif -#ifdef _BSD_TIMER_T_ -typedef _BSD_TIMER_T_ timer_t; -#undef _BSD_TIMER_T_ +#ifndef _TIMER_T_DECLARED +typedef __timer_t timer_t; +#define _TIMER_T_DECLARED #endif #if __BSD_VISIBLE diff --git a/sys/sys/un.h b/sys/sys/un.h index 65d246b60dea..12ca3605fff5 100644 --- a/sys/sys/un.h +++ b/sys/sys/un.h @@ -40,9 +40,9 @@ #include #include -#ifdef _BSD_SA_FAMILY_T_ -typedef _BSD_SA_FAMILY_T_ sa_family_t; -#undef _BSD_SA_FAMILY_T_ +#ifndef _SA_FAMILY_T_DECLARED +typedef __sa_family_t sa_family_t; +#define _SA_FAMILY_T_DECLARED #endif /* -- cgit v1.2.3