diff options
Diffstat (limited to 'io')
-rw-r--r-- | io/fcntl.h | 8 | ||||
-rw-r--r-- | io/ftw.h | 8 | ||||
-rw-r--r-- | io/sys/stat.h | 110 | ||||
-rw-r--r-- | io/utime.h | 7 |
4 files changed, 93 insertions, 40 deletions
@@ -32,6 +32,11 @@ __BEGIN_DECLS numbers and flag bits for `open', `fcntl', et al. */ #include <bits/fcntl.h> +/* For Unix98 all symbols from <sys/stat.h> should also be available. */ +#ifdef __USE_UNIX98 +# include <sys/stat.h> +#endif + #ifdef __USE_MISC # ifndef R_OK /* Verbatim from <unistd.h>. Ugh. */ /* Values for the second argument to access. @@ -76,7 +81,8 @@ extern int creat __P ((__const char *__file, __mode_t __mode)) extern int creat64 __P ((__const char *__file, __mode_t __mode)); #endif -#if !defined F_LOCK && (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) +#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \ + && !defined __USE_POSIX)) /* NOTE: These declarations also appear in <unistd.h>; be sure to keep both files consistent. Some systems have them there and some here, and some software depends on the macros being defined without including both. */ @@ -88,7 +88,7 @@ struct FTW /* Convenient types for callback functions. */ typedef int (*__ftw_func_t) __P ((__const char *__filename, __const struct stat *__status, int __flag)); -#if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64 +#ifdef __USE_LARGEFILE64 typedef int (*__ftw64_func_t) __P ((__const char *__filename, __const struct stat64 *__status, int __flag)); @@ -97,7 +97,7 @@ typedef int (*__ftw64_func_t) __P ((__const char *__filename, typedef int (*__nftw_func_t) __P ((__const char *__filename, __const struct stat *__status, int __flag, struct FTW *__info)); -# if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64 +# ifdef __USE_LARGEFILE64 typedef int (*__nftw64_func_t) __P ((__const char *__filename, __const struct stat64 *__status, int __flag, struct FTW *__info)); @@ -109,7 +109,7 @@ typedef int (*__nftw64_func_t) __P ((__const char *__filename, extern int ftw __P ((__const char *__dir, __ftw_func_t __func, int __descriptors)); #else -extern int ftw __P ((__const char *__dir, __ftw64_func_t __func, +extern int ftw __P ((__const char *__dir, __ftw_func_t __func, int __descriptors)) __asm__ ("ftw64"); #endif #ifdef __USE_LARGEFILE64 @@ -124,7 +124,7 @@ extern int ftw64 __P ((__const char *__dir, __ftw64_func_t __func, extern int nftw __P ((__const char *__dir, __nftw_func_t __func, int __descriptors, int __flag)); # else -extern int nftw __P ((__const char *__dir, __nftw64_func_t __func, +extern int nftw __P ((__const char *__dir, __nftw_func_t __func, int __descriptors, int __flag)) __asm__ ("nftw64"); # endif # ifdef __USE_LARGEFILE64 diff --git a/io/sys/stat.h b/io/sys/stat.h index d57b8d6..76ef3c5 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -27,25 +27,79 @@ #include <bits/types.h> /* For __mode_t and __dev_t. */ +#ifdef __USE_UNIX98 +/* The Single Unix specification says that some more types are + available here. */ +# ifndef dev_t +typedef __dev_t dev_t; +# define dev_t dev_t +# endif + +# ifndef gid_t +typedef __gid_t gid_t; +# define gid_t gid_t +# endif + +# ifndef ino_t +# ifndef __USE_FILE_OFFSET64 +typedef __ino_t ino_t; +# else +typedef __ino64_t ino_t; +# endif +# define ino_t ino_t +# endif + +# ifndef mode_t +typedef __mode_t mode_t; +# define mode_t mode_t +# endif + +# ifndef nlink_t +typedef __nlink_t nlink_t; +# define nlink_t nlink_t +# endif + +# ifndef off_t +# ifndef __USE_FILE_OFFSET64 +typedef __off_t off_t; +# else +typedef __off64_t off_t; +# endif +# define off_t off_t +# endif + +# ifndef uid_t +typedef __uid_t uid_t; +# define uid_t uid_t +# endif + +# ifndef pid_t +typedef __pid_t pid_t; +# define pid_t pid_t +# endif +#endif /* Unix98 */ + __BEGIN_DECLS #include <bits/stat.h> -#if defined __USE_BSD || defined __USE_MISC +#if defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98 # define S_IFMT __S_IFMT # define S_IFDIR __S_IFDIR # define S_IFCHR __S_IFCHR # define S_IFBLK __S_IFBLK # define S_IFREG __S_IFREG -# ifdef __S_IFLNK -# define S_IFLNK __S_IFLNK -# endif -# ifdef __S_IFSOCK -# define S_IFSOCK __S_IFSOCK -# endif # ifdef __S_IFIFO # define S_IFIFO __S_IFIFO # endif +# ifndef __USE_UNIX98 +# ifdef __S_IFLNK +# define S_IFLNK __S_IFLNK +# endif +# ifdef __S_IFSOCK +# define S_IFSOCK __S_IFSOCK +# endif +# endif #endif /* Test macros for file types. */ @@ -221,15 +275,25 @@ extern int mkfifo __P ((__const char *__path, __mode_t __mode)); #endif /* Wrappers for stat and mknod system calls. */ +#ifndef __USE_FILE_OFFSET64 extern int __fxstat __P ((int __ver, int __fildes, struct stat *__stat_buf)); extern int __xstat __P ((int __ver, __const char *__filename, struct stat *__stat_buf)); extern int __lxstat __P ((int __ver, __const char *__filename, struct stat *__stat_buf)); -extern int __xmknod __P ((int __ver, __const char *__path, - __mode_t __mode, __dev_t *__dev)); -#if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64 +#else +extern int __fxstat __P ((int __ver, int __fildes, + struct stat *__stat_buf)) + __asm__ ("__fxstat64"); +extern int __xstat __P ((int __ver, __const char *__filename, + struct stat *__stat_buf)) + __asm__ ("__xstat64"); +extern int __lxstat __P ((int __ver, __const char *__filename, + struct stat *__stat_buf)) + __asm__ ("__lxstat64"); +#endif +#ifdef __USE_LARGEFILE64 extern int __fxstat64 __P ((int __ver, int __fildes, struct stat64 *__stat_buf)); extern int __xstat64 __P ((int __ver, __const char *__filename, @@ -237,61 +301,39 @@ extern int __xstat64 __P ((int __ver, __const char *__filename, extern int __lxstat64 __P ((int __ver, __const char *__filename, struct stat64 *__stat_buf)); #endif +extern int __xmknod __P ((int __ver, __const char *__path, + __mode_t __mode, __dev_t *__dev)); #if defined __GNUC__ && __GNUC__ >= 2 /* Inlined versions of the real stat and mknod functions. */ extern __inline__ int __stat (__const char *__path, struct stat *__statbuf) { -# ifndef __USE_FILE_OFFSET64 return __xstat (_STAT_VER, __path, __statbuf); -# else - return __xstat64 (_STAT_VER, __path, __statbuf); -# endif } extern __inline__ int stat (__const char *__path, struct stat *__statbuf) { -# ifndef __USE_FILE_OFFSET64 return __xstat (_STAT_VER, __path, __statbuf); -# else - return __xstat64 (_STAT_VER, __path, __statbuf); -# endif } extern __inline__ int __lstat (__const char *__path, struct stat *__statbuf) { -# ifndef __USE_FILE_OFFSET64 return __lxstat (_STAT_VER, __path, __statbuf); -# else - return __lxstat64 (_STAT_VER, __path, __statbuf); -# endif } # if defined __USE_BSD || defined __USE_XOPEN_EXTENDED extern __inline__ int lstat (__const char *__path, struct stat *__statbuf) { -# ifndef __USE_FILE_OFFSET64 return __lxstat (_STAT_VER, __path, __statbuf); -# else - return __lxstat64 (_STAT_VER, __path, __statbuf); -# endif } # endif extern __inline__ int __fstat (int __fd, struct stat *__statbuf) { -# ifndef __USE_FILE_OFFSET64 return __fxstat (_STAT_VER, __fd, __statbuf); -# else - return __fxstat64 (_STAT_VER, __fd, __statbuf); -# endif } extern __inline__ int fstat (int __fd, struct stat *__statbuf) { -# ifndef __USE_FILE_OFFSET64 return __fxstat (_STAT_VER, __fd, __statbuf); -# else - return __fxstat64 (_STAT_VER, __fd, __statbuf); -# endif } extern __inline__ int __mknod (__const char *__path, __mode_t __mode, @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -29,6 +29,11 @@ __BEGIN_DECLS #include <bits/types.h> +#ifdef __USE_UNIX98 +# define __need_time_t +# include <time.h> +#endif + /* Structure describing file times. */ struct utimbuf { |