Resurrect one of the easiest changes from my big include files roll-up

patch from a year ago: give file flags their own type.  This does not
(yet) change the type used by system calls or library functions.
The underlying type was chosen to match what is returned by stat().
This commit is contained in:
Garrett Wollman 2002-02-15 22:15:39 +00:00
parent aa99bc993e
commit 3b7a4c4b1d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=90711
8 changed files with 22 additions and 6 deletions

View File

@ -49,6 +49,7 @@
*/
#define _BSD_CLOCK_T_ int /* clock() */
#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */
#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */

View File

@ -48,6 +48,7 @@
*/
#define _BSD_CLOCK_T_ unsigned long /* clock()... */
#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */
#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */

View File

@ -49,6 +49,7 @@
*/
#define _BSD_CLOCK_T_ int /* clock() */
#define _BSD_CLOCKID_T_ int /* clockid_t */
#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */
#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */

View File

@ -47,6 +47,7 @@
* #endif
*/
#define _BSD_CLOCK_T_ int /* clock() */
#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
#define _BSD_CLOCKID_T_ int /* clockid_t */
#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#define _BSD_PTRDIFF_T_ int /* ptr1 - ptr2 */

View File

@ -49,6 +49,7 @@
*/
#define _BSD_CLOCK_T_ int /* clock() */
#define _BSD_CLOCKID_T_ int /* clock_gettime()... */
#define _BSD_FFLAGS_T_ __uint_least32_t /* file flags */
#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
#define _BSD_PTRDIFF_T_ long /* ptr1 - ptr2 */
#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t (see below) */

View File

@ -52,7 +52,7 @@
* there.
*/
#undef __FreeBSD_version
#define __FreeBSD_version 500029 /* Master, propagated to newvers */
#define __FreeBSD_version 500030 /* Master, propagated to newvers */
#ifndef NULL
#define NULL 0

View File

@ -42,6 +42,14 @@
#ifndef _SYS_STAT_H_
#define _SYS_STAT_H_
#include <sys/cdefs.h>
#include <machine/ansi.h>
#ifdef _BSD_FFLAGS_T_
typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */
#undef _BSD_FFLAGS_T_
#endif
#if !defined(_KERNEL) && !defined(_POSIX_SOURCE)
/*
* XXX we need this for struct timespec. We get miscellaneous namespace
@ -71,7 +79,7 @@ struct ostat {
struct timespec st_ctimespec; /* time of last file status change */
int32_t st_blksize; /* optimal blocksize for I/O */
int32_t st_blocks; /* blocks allocated for file */
u_int32_t st_flags; /* user defined flags for file */
fflags_t st_flags; /* user defined flags for file */
u_int32_t st_gen; /* file generation number */
};
#endif /* !_POSIX_SOURCE */
@ -99,7 +107,7 @@ struct stat {
off_t st_size; /* file size, in bytes */
int64_t st_blocks; /* blocks allocated for file */
u_int32_t st_blksize; /* optimal blocksize for I/O */
u_int32_t st_flags; /* user defined flags for file */
fflags_t st_flags; /* user defined flags for file */
u_int32_t st_gen; /* file generation number */
int32_t st_lspare;
int64_t st_qspare[2];
@ -129,7 +137,7 @@ struct nstat {
off_t st_size; /* file size, in bytes */
int64_t st_blocks; /* blocks allocated for file */
u_int32_t st_blksize; /* optimal blocksize for I/O */
u_int32_t st_flags; /* user defined flags for file */
fflags_t st_flags; /* user defined flags for file */
u_int32_t st_gen; /* file generation number */
int64_t st_qspare[2];
};
@ -237,8 +245,6 @@ struct nstat {
#endif /* !_POSIX_SOURCE */
#ifndef _KERNEL
#include <sys/cdefs.h>
__BEGIN_DECLS
int chmod __P((const char *, mode_t));
int fstat __P((int, struct stat *));

View File

@ -138,6 +138,11 @@ typedef _BSD_CLOCKID_T_ clockid_t;
#undef _BSD_CLOCKID_T_
#endif
#ifdef _BSD_FFLAGS_T_
typedef _BSD_FFLAGS_T_ fflags_t; /* file flags */
#undef _BSD_FFLAGS_T_
#endif
/* XXX: Deprecated; now defined in <arpa/inet.h>. */
#ifndef _IN_ADDR_T_DECLARED_
typedef __uint32_t in_addr_t;