From owner-freebsd-alpha Fri Jan 26 11:12:23 2001 Delivered-To: freebsd-alpha@freebsd.org Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by hub.freebsd.org (Postfix) with ESMTP id 23B1137B400 for ; Fri, 26 Jan 2001 11:12:00 -0800 (PST) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.9.3/8.9.3) id OAA01698; Fri, 26 Jan 2001 14:11:52 -0500 (EST) (envelope-from wollman) Date: Fri, 26 Jan 2001 14:11:52 -0500 (EST) From: Garrett Wollman Message-Id: <200101261911.OAA01698@khavrinen.lcs.mit.edu> To: alpha@freebsd.org Subject: About to make some significant changes which will impact the Alpha Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I am close to committing changes to the kernel and userland which will significantly change the way FreeBSD deals with standard types and with some namespace issues. These will require some changes to the Alpha (and IA64) ports. In addition to changing all namespace-visibility tests to use the new macros instead of directly testing _POSIX_SOURCE et al, there are also some issues with types which need to be dealt with. I should have a new patch ready by the end of the day if anyone wants to look at the whole thing before I commit it; the IA32 and machine-independent bits have already been reviewed (silently but for BDE) in the FreeBSD-standards mailing-list. I have compared the types shown in the following patch with that currently used on the Alpha, and of those that have historically existed, the match is fairly good. I have changed the type of `clock_t' to be unsigned to harmonize with the IA32 port. One place where we will have a significant issue is with the new `fflags_t' type. Currently, file flags are represented using `long' in some places (e.g., strtofflags(3)) and `int' in other places (including struct stat and the chflags(2) system call). I have chosen to standardize on `int' since I don't see the need for more than 32 flags arising any time soon. However, this will break compatibility for strtofflags(), which raises a potentially-serious bootstrapping issue in programs like `mtree' and `install'. -GAWollman Index: ansi.h =================================================================== RCS file: /home/ncvs/src/sys/alpha/include/ansi.h,v retrieving revision 1.10 diff -u -r1.10 ansi.h --- ansi.h 2001/01/08 06:24:05 1.10 +++ ansi.h 2001/01/26 18:54:53 @@ -47,14 +47,59 @@ * #undef _BSD_SIZE_T_ * #endif */ -#define _BSD_CLOCK_T_ int /* clock() */ -#define _BSD_CLOCKID_T_ int /* clockid_t */ -#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */ -#define _BSD_SIZE_T_ unsigned long /* sizeof() */ -#define _BSD_SSIZE_T_ long /* byte count or error */ -#define _BSD_TIME_T_ int /* time() */ -#define _BSD_TIMER_T_ int /* timer_t */ +#define _BSD_BLKCNT_T_ long /* block count (signed) */ +#define _BSD_BLKSIZE_T_ int /* block size (signed) */ +#define _BSD_CLOCK_T_ unsigned int /* clock()... (XSI) */ +#define _BSD_CLOCKID_T_ int /* clock_gettime()... (TMR) */ +#define _BSD_FFLAGS_T_ unsigned int /* file flags [1] */ +#define _BSD_FIXPT_T_ __uint32_t /* fixed-point number */ +#define _BSD_FSBLKCNT_T_ unsigned long /* fs block count [2] */ +#define _BSD_FSFILCNT_T_ unsigned long /* fs inode count [2] */ +#define _BSD_GID_T_ unsigned int /* group */ +#define _BSD_ID_T_ unsigned int /* U(uid_t,gid_t,pid_t) [3] */ +#define _BSD_INO_T_ unsigned int /* inode number */ +#define _BSD_KEY_T_ long /* XSI local IPC identifier */ +#define _BSD_MODE_T_ unsigned short /* permissions */ +#define _BSD_NLINK_T_ unsigned short /* link count */ +#define _BSD_OFF_T_ long /* file offset */ +#define _BSD_PID_T_ int /* process or process group */ +#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */ +#define _BSD_RLIM_T_ long /* resource limit value */ +#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */ +#define _BSD_SIZE_T_ unsigned long /* sizeof() */ +#define _BSD_SSIZE_T_ long /* byte count or error */ +#define _BSD_SUSECONDS_T_ int /* signed microseconds [4] */ +#define _BSD_TIME_T_ int /* time()... */ +#define _BSD_TIMER_T_ int /* timer_gettime()... */ +#define _BSD_UDEV_T_ unsigned int /* device number in userland */ +#define _BSD_UID_T_ unsigned int /* user */ +#define _BSD_USECONDS_T_ unsigned int /* unsigned microseconds [5] */ +#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t (see below) */ +/* + * Notes: + * + * [1] This type (and underlying functionality) are not standardized. + * It was introduced to fix interface skew between the stat structure + * and functions which manipulate the file flags. + * + * [2] This is an XSI type for an interface (statvfs) which we do + * not presently implement. + * + * [3] This XSI type is required to be able to hold a gid_t, pid_t, + * or uid_t. pid_t is currently signed, whereas the others are + * unsigned, because several interfaces use negative pid_t values + * to indicate process groups. We really, really don't want to + * use a longer type here, so we simply simply fudge it and use + * an unsigned int. + * + * [4] This XSI type is required to contain the interval [-1, 1000000]. + * It is used by some XSI-standardized versions of traditional BSD + * `timeval' interfaces. + * + * [5] Unclear what the purpose of this XSI type is. + */ + #if defined __GNUC__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 95) #define _BSD_VA_LIST_ __builtin_va_list /* internally known to gcc */ #else @@ -73,8 +118,6 @@ * use _BSD_XXX_T_ without undef'ing it. */ #define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */ -#define _BSD_OFF_T_ long /* file offset */ -#define _BSD_PID_T_ int /* process [group] */ /* * Runes (wchar_t) is declared to be an ``int'' instead of the more natural To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message