summaryrefslogtreecommitdiff
path: root/tests/sys_stat.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sys_stat.in.h')
-rw-r--r--tests/sys_stat.in.h50
1 files changed, 47 insertions, 3 deletions
diff --git a/tests/sys_stat.in.h b/tests/sys_stat.in.h
index 0ec320f5..bf08f335 100644
--- a/tests/sys_stat.in.h
+++ b/tests/sys_stat.in.h
@@ -1,5 +1,5 @@
/* Provide a more complete sys/stat.h header file.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2024 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
@@ -25,6 +25,13 @@
#endif
@PRAGMA_COLUMNS@
+/* This file uses #include_next of a system file that defines time_t.
+ For the 'year2038' module to work right, <config.h> needs to have been
+ included before. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
#if defined __need_system_sys_stat_h
/* Special invocation convention. */
@@ -48,12 +55,41 @@
#ifndef _@GUARD_PREFIX@_SYS_STAT_H
#define _@GUARD_PREFIX@_SYS_STAT_H
+/* This file uses _GL_ATTRIBUTE_NOTHROW, GNULIB_POSIXCHECK, HAVE_RAW_DECL_*. */
+#if !_GL_CONFIG_H_INCLUDED
+ #error "Please include config.h first."
+#endif
+
+
+/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
+ */
+#ifndef _GL_ATTRIBUTE_NOTHROW
+# if defined __cplusplus
+# if (__GNUC__ + (__GNUC_MINOR__ >= 8) > 2) || __clang_major >= 4
+# if __cplusplus >= 201103L
+# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
+# else
+# define _GL_ATTRIBUTE_NOTHROW throw ()
+# endif
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
+# else
+# if (__GNUC__ + (__GNUC_MINOR__ >= 3) > 3) || defined __clang__
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+# else
+# define _GL_ATTRIBUTE_NOTHROW
+# endif
+# endif
+#endif
+
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
/* The definition of _GL_ARG_NONNULL is copied here. */
/* The definition of _GL_WARN_ON_USE is copied here. */
+
/* Before doing "#define mknod rpl_mknod" below, we need to include all
headers that may declare mknod(). OS/2 kLIBC declares mknod() in
<unistd.h>, not in <sys/stat.h>. */
@@ -549,7 +585,7 @@ _GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
_GL_CXXALIAS_SYS (futimens, int, (int fd, struct timespec const times[2]));
# endif
-# if @HAVE_FUTIMENS@
+# if __GLIBC__ >= 2 && @HAVE_FUTIMENS@
_GL_CXXALIASWARN (futimens);
# endif
#elif defined GNULIB_POSIXCHECK
@@ -563,7 +599,11 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
#if @GNULIB_GETUMASK@
# if !@HAVE_GETUMASK@
+# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
+_GL_FUNCDECL_SYS (getumask, mode_t, (void) _GL_ATTRIBUTE_NOTHROW);
+# else
_GL_FUNCDECL_SYS (getumask, mode_t, (void));
+# endif
# endif
_GL_CXXALIAS_SYS (getumask, mode_t, (void));
# if @HAVE_GETUMASK@
@@ -716,7 +756,9 @@ _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
# endif
_GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mkfifoat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mkfifoat
# if HAVE_RAW_DECL_MKFIFOAT
@@ -773,7 +815,9 @@ _GL_FUNCDECL_SYS (mknodat, int,
_GL_CXXALIAS_SYS (mknodat, int,
(int fd, char const *file, mode_t mode, dev_t dev));
# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mknodat);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mknodat
# if HAVE_RAW_DECL_MKNODAT
@@ -937,7 +981,7 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name,
_GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name,
struct timespec const times[2], int flag));
# endif
-# if @HAVE_UTIMENSAT@
+# if __GLIBC__ >= 2 && @HAVE_UTIMENSAT@
_GL_CXXALIASWARN (utimensat);
# endif
#elif defined GNULIB_POSIXCHECK