From 3e6b0a28ebc2319262b318790019558f78249c8b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 26 Feb 2009 01:43:53 +0000 Subject: [PATCH] * include/features.h: Define macros for XPG7/POSIX 2008. * sysdeps/unix/sysv/linux/bits/stat.h: Protect UTIME_NOW and UTIME_OMIT only with __USE_ATFILE. * sysdeps/unix/sysv/linux/ia64/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise. * io/sys/stat.h: Move mknodat definition into same conditional as mknod. * time/sys/time.h: futimesat is not among the functions accepted into the POSIX standard. --- ChangeLog | 13 +++++++++++++ include/features.h | 22 ++++++++++++++++++---- io/sys/stat.h | 4 ++-- sysdeps/unix/sysv/linux/bits/stat.h | 5 ++--- sysdeps/unix/sysv/linux/ia64/bits/stat.h | 5 ++--- sysdeps/unix/sysv/linux/powerpc/bits/stat.h | 5 ++--- sysdeps/unix/sysv/linux/s390/bits/stat.h | 5 ++--- sysdeps/unix/sysv/linux/sparc/bits/stat.h | 6 ++---- sysdeps/unix/sysv/linux/x86_64/bits/stat.h | 5 ++--- time/sys/time.h | 4 ++-- 10 files changed, 47 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4240e039a..d196f534eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2009-02-25 Ulrich Drepper + * include/features.h: Define macros for XPG7/POSIX 2008. + * sysdeps/unix/sysv/linux/bits/stat.h: Protect UTIME_NOW and + UTIME_OMIT only with __USE_ATFILE. + * sysdeps/unix/sysv/linux/ia64/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise. + * sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise. + * io/sys/stat.h: Move mknodat definition into same conditional as + mknod. + * time/sys/time.h: futimesat is not among the functions accepted + into the POSIX standard. + * include/features.h: If no feature selection given and we select by default a POSIX mode, also define __USE_POSIX_IMPLICITLY. * posix/Versions: Export __posix_getopt. diff --git a/include/features.h b/include/features.h index eb05b0fb45..a696d8b59c 100644 --- a/include/features.h +++ b/include/features.h @@ -29,9 +29,10 @@ if >=199309L, add IEEE Std 1003.1b-1993; if >=199506L, add IEEE Std 1003.1c-1995; if >=200112L, all of IEEE 1003.1-2004 + if >=200809L, all of IEEE 1003.1-2008 _XOPEN_SOURCE Includes POSIX and XPG things. Set to 500 if Single Unix conformance is wanted, to 600 for the - upcoming sixth revision. + sixth revision, to 700 for the seventh revision. _XOPEN_SOURCE_EXTENDED XPG things and X/Open Unix extensions. _LARGEFILE_SOURCE Some more functions for correct standard I/O. _LARGEFILE64_SOURCE Additional functionality from LFS for large files. @@ -65,6 +66,7 @@ __USE_XOPEN_EXTENDED Define X/Open Unix things. __USE_UNIX98 Define Single Unix V2 things. __USE_XOPEN2K Define XPG6 things. + __USE_XOPEN2K8 Define XPG7 things. __USE_LARGEFILE Define correct standard I/O things. __USE_LARGEFILE64 Define LFS things with separate names. __USE_FILE_OFFSET64 Define 64bit interface as default. @@ -100,6 +102,7 @@ #undef __USE_XOPEN_EXTENDED #undef __USE_UNIX98 #undef __USE_XOPEN2K +#undef __USE_XOPEN2K8 #undef __USE_LARGEFILE #undef __USE_LARGEFILE64 #undef __USE_FILE_OFFSET64 @@ -152,9 +155,9 @@ # undef _POSIX_SOURCE # define _POSIX_SOURCE 1 # undef _POSIX_C_SOURCE -# define _POSIX_C_SOURCE 200112L +# define _POSIX_C_SOURCE 200809L # undef _XOPEN_SOURCE -# define _XOPEN_SOURCE 600 +# define _XOPEN_SOURCE 700 # undef _XOPEN_SOURCE_EXTENDED # define _XOPEN_SOURCE_EXTENDED 1 # undef _LARGEFILE64_SOURCE @@ -201,8 +204,10 @@ # define _POSIX_C_SOURCE 2 # elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 600 # define _POSIX_C_SOURCE 199506L -# else +# elif defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 700 # define _POSIX_C_SOURCE 200112L +# else +# define _POSIX_C_SOURCE 200809L # endif # define __USE_POSIX_IMPLICITLY 1 #endif @@ -227,6 +232,12 @@ # define __USE_XOPEN2K 1 #endif +#if (_POSIX_C_SOURCE - 0) >= 200809L +# define __USE_XOPEN2K8 1 +# undef _ATFILE_SOURCE +# define _ATFILE_SOURCE 1 +#endif + #ifdef _XOPEN_SOURCE # define __USE_XOPEN 1 # if (_XOPEN_SOURCE - 0) >= 500 @@ -235,6 +246,9 @@ # undef _LARGEFILE_SOURCE # define _LARGEFILE_SOURCE 1 # if (_XOPEN_SOURCE - 0) >= 600 +# if (_XOPEN_SOURCE - 0) >= 700 +# define __USE_XOPEN2K8 1 +# endif # define __USE_XOPEN2K 1 # undef __USE_ISOC99 # define __USE_ISOC99 1 diff --git a/io/sys/stat.h b/io/sys/stat.h index 98b950d5f2..60955016eb 100644 --- a/io/sys/stat.h +++ b/io/sys/stat.h @@ -333,14 +333,14 @@ extern int mkdirat (int __fd, __const char *__path, __mode_t __mode) #if defined __USE_MISC || defined __USE_BSD || defined __USE_XOPEN_EXTENDED extern int mknod (__const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull ((1)); -#endif -#ifdef __USE_ATFILE +# ifdef __USE_ATFILE /* Like mknod, create a new device file with permission bits MODE and device number DEV. But interpret relative PATH names relative to the directory associated with FD. */ extern int mknodat (int __fd, __const char *__path, __mode_t __mode, __dev_t __dev) __THROW __nonnull ((2)); +# endif #endif diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h index cc665f377e..e6a5b6afbf 100644 --- a/sysdeps/unix/sysv/linux/bits/stat.h +++ b/sysdeps/unix/sysv/linux/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995-2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2001, 2002, 2009 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 @@ -162,8 +162,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/ia64/bits/stat.h b/sysdeps/unix/sysv/linux/ia64/bits/stat.h index 1988c492b0..75a3318286 100644 --- a/sysdeps/unix/sysv/linux/ia64/bits/stat.h +++ b/sysdeps/unix/sysv/linux/ia64/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2002, 2009 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 @@ -139,8 +139,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h index 53457ef1fa..b6c82c55bb 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -266,8 +266,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h index 00fcf078ba..c062498556 100644 --- a/sysdeps/unix/sysv/linux/s390/bits/stat.h +++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +/* Copyright (C) 2000, 2001, 2002, 2009 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 @@ -255,8 +255,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h index 17c912a70f..7426e16806 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h @@ -1,5 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2006 - Free Software Foundation, Inc. +/* Copyright (C) 1992, 1995-2002, 2006, 2009 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 @@ -164,8 +163,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h index 286c1a2a02..51367b2fc1 100644 --- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h +++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc. +/* Copyright (C) 1999,2000,2001,2002,2003,2009 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 @@ -202,8 +202,7 @@ struct stat64 #define __S_IWRITE 0200 /* Write by owner. */ #define __S_IEXEC 0100 /* Execute by owner. */ -#if defined __USE_ATFILE || defined __USE_GNU -/* XXX This will change to the macro for the next 2008 POSIX revision. */ +#ifdef __USE_ATFILE # define UTIME_NOW ((1l << 30) - 1l) # define UTIME_OMIT ((1l << 30) - 2l) #endif diff --git a/time/sys/time.h b/time/sys/time.h index 177696b08a..3aecf60b61 100644 --- a/time/sys/time.h +++ b/time/sys/time.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-1994,1996-2002,2003,2005,2006 +/* Copyright (C) 1991-1994,1996-2003,2005,2006,2009 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -149,7 +149,7 @@ extern int lutimes (__const char *__file, __const struct timeval __tvp[2]) extern int futimes (int __fd, __const struct timeval __tvp[2]) __THROW; #endif -#ifdef __USE_ATFILE +#ifdef __USE_GNU /* Change the access time of FILE relative to FD to TVP[0] and the modification time of FILE to TVP[1]. If TVP is a null pointer, use the current time instead. Returns 0 on success, -1 on errors. */ -- 2.11.4.GIT