# define _GL_EXTERN_C_FUNC
#endif
-/* _GL_FUNCDECL_RPL (func, rettype, parameters[, attributes]);
+/* _GL_FUNCDECL_RPL (func, rettype, parameters, [attributes]);
declares a replacement function, named rpl_func, with the given prototype,
consisting of return type, parameters, and attributes.
- Example:
+ Although attributes are optional, the comma before them is required
+ for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
+ if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
+ at the end of the declaration.
+ Examples:
+ _GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...),
_GL_ARG_NONNULL ((1)));
because
[[...]] extern "C" <declaration>;
is invalid syntax in C++.)
-
- Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
- of the _GL_FUNCDECL_RPL invocation, at the end of the declaration.
*/
#define _GL_FUNCDECL_RPL(func,rettype,parameters,...) \
_GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters, __VA_ARGS__)
#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype rpl_func parameters
-/* _GL_FUNCDECL_SYS (func, rettype, parameters[, attributes]);
+/* _GL_FUNCDECL_SYS (func, rettype, parameters, [attributes]);
declares the system function, named func, with the given prototype,
consisting of return type, parameters, and attributes.
- Example:
- _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...),
- _GL_ARG_NONNULL ((1)));
-
- Note: The attribute _GL_ATTRIBUTE_NOTHROW, if needed, must be placed outside
- of the _GL_FUNCDECL_SYS invocation, at the end of the declaration.
+ Although attributes are optional, the comma before them is required
+ for portability to C17 and earlier. The attribute _GL_ATTRIBUTE_NOTHROW,
+ if needed, must be placed after the _GL_FUNCDECL_RPL invocation,
+ at the end of the declaration.
+ Examples:
+ _GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
+ _GL_FUNCDECL_SYS (posix_openpt, int, (int flags), _GL_ATTRIBUTE_NODISCARD);
*/
#define _GL_FUNCDECL_SYS(func,rettype,parameters,...) \
_GL_EXTERN_C_FUNC __VA_ARGS__ rettype func parameters
{
int result = orig_faccessat (fd, file, mode, flag);
- if (result == 0 && file[strlen (file) - 1] == '/')
+ if (file[strlen (file) - 1] == '/')
{
struct stat st;
- result = fstatat (fd, file, &st, 0);
- if (result == 0 && !S_ISDIR (st.st_mode))
+ int ret = fstatat (fd, file, &st, 0);
+ if (ret == 0 && !S_ISDIR (st.st_mode))
{
errno = ENOTDIR;
return -1;
}
+ if (result == 0)
+ result = ret;
}
return result;
# undef fcntl
# define fcntl rpl_fcntl
# endif
-_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
+_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...), );
_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
# if !GNULIB_defined_rpl_fcntl
# define GNULIB_defined_rpl_fcntl 1
# endif
# else
# if !@HAVE_FCNTL@
-_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...), );
# if !GNULIB_defined_fcntl
# define GNULIB_defined_fcntl 1
# endif
# undef imaxabs
# define imaxabs rpl_imaxabs
# endif
-_GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x));
+_GL_FUNCDECL_RPL (imaxabs, intmax_t, (intmax_t x), );
_GL_CXXALIAS_RPL (imaxabs, intmax_t, (intmax_t x));
# else
# if !@HAVE_DECL_IMAXABS@
-_GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x));
+_GL_FUNCDECL_SYS (imaxabs, intmax_t, (intmax_t x), );
# endif
_GL_CXXALIAS_SYS (imaxabs, intmax_t, (intmax_t x));
# endif
# undef imaxdiv
# define imaxdiv rpl_imaxdiv
# endif
-_GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
+_GL_FUNCDECL_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom), );
_GL_CXXALIAS_RPL (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
# else
# if !@HAVE_DECL_IMAXDIV@
-_GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
+_GL_FUNCDECL_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom), );
# endif
_GL_CXXALIAS_SYS (imaxdiv, imaxdiv_t, (intmax_t numer, intmax_t denom));
# endif
#if @GNULIB_SIG2STR@
# if !@HAVE_SIG2STR@
-_GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str));
+_GL_FUNCDECL_SYS (sig2str, int, (int signo, char *str), );
# endif
_GL_CXXALIAS_SYS (sig2str, int, (int signo, char *str));
# if __GLIBC__ >= 2
#if @GNULIB_SIG2STR@
# if !@HAVE_STR2SIG@
-_GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p));
+_GL_FUNCDECL_SYS (str2sig, int, (char const *str, int *signo_p), );
# endif
_GL_CXXALIAS_SYS (str2sig, int, (char const *str, int *signo_p));
# if __GLIBC__ >= 2
_GL_FUNCDECL_RPL (pthread_sigmask, int,
(int how,
const sigset_t *restrict new_mask,
- sigset_t *restrict old_mask));
+ sigset_t *restrict old_mask), );
_GL_CXXALIAS_RPL (pthread_sigmask, int,
(int how,
const sigset_t *restrict new_mask,
_GL_FUNCDECL_SYS (pthread_sigmask, int,
(int how,
const sigset_t *restrict new_mask,
- sigset_t *restrict old_mask));
+ sigset_t *restrict old_mask), );
# endif
_GL_CXXALIAS_SYS (pthread_sigmask, int,
(int how,
# undef raise
# define raise rpl_raise
# endif
-_GL_FUNCDECL_RPL (raise, int, (int sig));
+_GL_FUNCDECL_RPL (raise, int, (int sig), );
_GL_CXXALIAS_RPL (raise, int, (int sig));
# else
# if !@HAVE_RAISE@
-_GL_FUNCDECL_SYS (raise, int, (int sig));
+_GL_FUNCDECL_SYS (raise, int, (int sig), );
# endif
_GL_CXXALIAS_SYS (raise, int, (int sig));
# endif
_GL_FUNCDECL_SYS (sigprocmask, int,
(int operation,
const sigset_t *restrict set,
- sigset_t *restrict old_set));
+ sigset_t *restrict old_set), );
# endif
_GL_CXXALIAS_SYS (sigprocmask, int,
(int operation,
# define signal rpl_signal
# endif
_GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
- (int sig, _gl_function_taking_int_returning_void_t func));
+ (int sig, _gl_function_taking_int_returning_void_t func), );
_GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
(int sig, _gl_function_taking_int_returning_void_t func));
# else
because it occurs in <sys/signal.h>, not <signal.h> directly. */
# if defined __OpenBSD__
_GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t,
- (int sig, _gl_function_taking_int_returning_void_t func));
+ (int sig, _gl_function_taking_int_returning_void_t func), );
# endif
_GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
(int sig, _gl_function_taking_int_returning_void_t func));
# endif
_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
- struct sigaction *restrict));
+ struct sigaction *restrict), );
# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@
x333333 = max / (1 << 2 | 1), /* 0x333333... */
x0f0f0f = max / (1 << 4 | 1), /* 0x0f0f0f... */
x010101 = max / ((1 << 8) - 1), /* 0x010101... */
- x000_7f = max / 0xffffffffffffffff * 0x7f; /* 0x000000000000007f... */
+ x000_7f = max / 0xffffffffffffffffLL * 0x7f; /* 0x000000000000007f... */
n -= (n >> 1) & x555555;
n = (n & x333333) + ((n >> 2) & x333333);
n = (n + (n >> 4)) & x0f0f0f;
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define fflush rpl_fflush
# endif
-_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream));
+_GL_FUNCDECL_RPL (fflush, int, (FILE *gl_stream), );
_GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
# else
_GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
# undef getchar
# define getchar rpl_getchar
# endif
-_GL_FUNCDECL_RPL (getchar, int, (void));
+_GL_FUNCDECL_RPL (getchar, int, (void), );
_GL_CXXALIAS_RPL (getchar, int, (void));
# else
_GL_CXXALIAS_SYS (getchar, int, (void));
# if @HAVE_DECL_GETW@
# if defined __APPLE__ && defined __MACH__
/* The presence of the declaration depends on _POSIX_C_SOURCE. */
-_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream));
+_GL_FUNCDECL_SYS (getw, int, (FILE *restrict stream), );
# endif
_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
# endif
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define perror rpl_perror
# endif
-_GL_FUNCDECL_RPL (perror, void, (const char *string));
+_GL_FUNCDECL_RPL (perror, void, (const char *string), );
_GL_CXXALIAS_RPL (perror, void, (const char *string));
# else
_GL_CXXALIAS_SYS (perror, void, (const char *string));
# undef putchar
# define putchar rpl_putchar
# endif
-_GL_FUNCDECL_RPL (putchar, int, (int c));
+_GL_FUNCDECL_RPL (putchar, int, (int c), );
_GL_CXXALIAS_RPL (putchar, int, (int c));
# else
_GL_CXXALIAS_SYS (putchar, int, (int c));
# if @HAVE_DECL_PUTW@
# if defined __APPLE__ && defined __MACH__
/* The presence of the declaration depends on _POSIX_C_SOURCE. */
-_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream));
+_GL_FUNCDECL_SYS (putw, int, (int w, FILE *restrict stream), );
# endif
_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
# endif
#endif
@PRAGMA_COLUMNS@
-#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined __need_malloc_and_calloc
+#if ((defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) \
+ || defined __need_malloc_and_calloc) \
+ && !defined __SUNPRO_CC
/* Special invocation conventions inside some gnulib header files,
and inside some glibc header files, respectively.
Do not recognize this special invocation convention when GCC's
# undef _Exit
# define _Exit rpl__Exit
# endif
-_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status));
+_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status), );
_GL_CXXALIAS_RPL (_Exit, void, (int status));
# else
# if !@HAVE__EXIT@
-_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
+_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status), );
# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
# endif
# undef abort
# define abort rpl_abort
# endif
-_GL_FUNCDECL_RPL (abort, _Noreturn void, (void));
+_GL_FUNCDECL_RPL (abort, _Noreturn void, (void), );
_GL_CXXALIAS_RPL (abort, void, (void));
# else
_GL_CXXALIAS_SYS (abort, void, (void));
# define free rpl_free
# endif
# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
-_GL_FUNCDECL_RPL (free, void, (void *ptr)) _GL_ATTRIBUTE_NOTHROW;
+_GL_FUNCDECL_RPL (free, void, (void *ptr), ) _GL_ATTRIBUTE_NOTHROW;
# else
-_GL_FUNCDECL_RPL (free, void, (void *ptr));
+_GL_FUNCDECL_RPL (free, void, (void *ptr), );
# endif
_GL_CXXALIAS_RPL (free, void, (void *ptr));
# else
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
_GL_FUNCDECL_RPL (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
-_GL_FUNCDECL_RPL (getprogname, const char *, (void));
+_GL_FUNCDECL_RPL (getprogname, const char *, (void), );
# endif
_GL_CXXALIAS_RPL (getprogname, const char *, (void));
# else
# if @HAVE_DECL_PROGRAM_INVOCATION_NAME@
_GL_FUNCDECL_SYS (getprogname, const char *, (void), _GL_ATTRIBUTE_PURE);
# else
-_GL_FUNCDECL_SYS (getprogname, const char *, (void));
+_GL_FUNCDECL_SYS (getprogname, const char *, (void), );
# endif
# endif
_GL_CXXALIAS_SYS (getprogname, const char *, (void));
/* Change the ownership and access permission of the slave side of the
pseudo-terminal whose master side is specified by FD. */
# if !@HAVE_GRANTPT@
-_GL_FUNCDECL_SYS (grantpt, int, (int fd));
+_GL_FUNCDECL_SYS (grantpt, int, (int fd), );
# endif
_GL_CXXALIAS_SYS (grantpt, int, (int fd));
_GL_CXXALIASWARN (grantpt);
# define mbtowc rpl_mbtowc
# endif
_GL_FUNCDECL_RPL (mbtowc, int,
- (wchar_t *restrict pwc, const char *restrict s, size_t n));
+ (wchar_t *restrict pwc, const char *restrict s, size_t n), );
_GL_CXXALIAS_RPL (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n));
# else
# if !@HAVE_MBTOWC@
_GL_FUNCDECL_SYS (mbtowc, int,
- (wchar_t *restrict pwc, const char *restrict s, size_t n));
+ (wchar_t *restrict pwc, const char *restrict s, size_t n), );
# endif
_GL_CXXALIAS_SYS (mbtowc, int,
(wchar_t *restrict pwc, const char *restrict s, size_t n));
# undef ptsname_r
# define ptsname_r rpl_ptsname_r
# endif
-_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_FUNCDECL_RPL (ptsname_r, int, (int fd, char *buf, size_t len), );
_GL_CXXALIAS_RPL (ptsname_r, int, (int fd, char *buf, size_t len));
# else
# if !@HAVE_PTSNAME_R@
-_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
+_GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len), );
# endif
_GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
# endif
# undef rand
# define rand rpl_rand
# endif
-_GL_FUNCDECL_RPL (rand, int, (void));
+_GL_FUNCDECL_RPL (rand, int, (void), );
_GL_CXXALIAS_RPL (rand, int, (void));
# else
_GL_CXXALIAS_SYS (rand, int, (void));
# undef random
# define random rpl_random
# endif
-_GL_FUNCDECL_RPL (random, long, (void));
+_GL_FUNCDECL_RPL (random, long, (void), );
_GL_CXXALIAS_RPL (random, long, (void));
# else
# if !@HAVE_RANDOM@
-_GL_FUNCDECL_SYS (random, long, (void));
+_GL_FUNCDECL_SYS (random, long, (void), );
# endif
/* Need to cast, because on Haiku, the return type is
int. */
# undef srandom
# define srandom rpl_srandom
# endif
-_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
+_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed), );
_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
# else
# if !@HAVE_RANDOM@
-_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+_GL_FUNCDECL_SYS (srandom, void, (unsigned int seed), );
# endif
/* Need to cast, because on FreeBSD, the first parameter is
unsigned long seed. */
/* Unlock the slave side of the pseudo-terminal whose master side is specified
by FD, so that it can be opened. */
# if !@HAVE_UNLOCKPT@
-_GL_FUNCDECL_SYS (unlockpt, int, (int fd));
+_GL_FUNCDECL_SYS (unlockpt, int, (int fd), );
# endif
_GL_CXXALIAS_SYS (unlockpt, int, (int fd));
_GL_CXXALIASWARN (unlockpt);
# undef wctomb
# define wctomb rpl_wctomb
# endif
-_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc));
+_GL_FUNCDECL_RPL (wctomb, int, (char *s, wchar_t wc), );
_GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
# else
_GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
/* Find the index of the least-significant set bit. */
#if @GNULIB_FFSL@
# if !@HAVE_FFSL@
-_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+_GL_FUNCDECL_SYS (ffsl, int, (long int i), );
# endif
_GL_CXXALIAS_SYS (ffsl, int, (long int i));
_GL_CXXALIASWARN (ffsl);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define ffsll rpl_ffsll
# endif
-_GL_FUNCDECL_RPL (ffsll, int, (long long int i));
+_GL_FUNCDECL_RPL (ffsll, int, (long long int i), );
_GL_CXXALIAS_RPL (ffsll, int, (long long int i));
# else
# if !@HAVE_FFSLL@
-_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+_GL_FUNCDECL_SYS (ffsll, int, (long long int i), );
# endif
_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
# endif
# undef strerror
# define strerror rpl_strerror
# endif
-_GL_FUNCDECL_RPL (strerror, char *, (int));
+_GL_FUNCDECL_RPL (strerror, char *, (int), );
_GL_CXXALIAS_RPL (strerror, char *, (int));
# else
_GL_CXXALIAS_SYS (strerror, char *, (int));
# undef strerrorname_np
# define strerrorname_np rpl_strerrorname_np
# endif
-_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum));
+_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum), );
_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum));
# else
# if !@HAVE_STRERRORNAME_NP@
-_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum));
+_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum), );
# endif
_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum));
# endif
/* Return an abbreviation string for the signal number SIG. */
#if @GNULIB_SIGABBREV_NP@
# if ! @HAVE_SIGABBREV_NP@
-_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig));
+_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig), );
# endif
_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig));
_GL_CXXALIASWARN (sigabbrev_np);
/* Return an English description string for the signal number SIG. */
#if @GNULIB_SIGDESCR_NP@
# if ! @HAVE_SIGDESCR_NP@
-_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig));
+_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig), );
# endif
_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig));
_GL_CXXALIASWARN (sigdescr_np);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define strsignal rpl_strsignal
# endif
-_GL_FUNCDECL_RPL (strsignal, char *, (int __sig));
+_GL_FUNCDECL_RPL (strsignal, char *, (int __sig), );
_GL_CXXALIAS_RPL (strsignal, char *, (int __sig));
# else
# if ! @HAVE_DECL_STRSIGNAL@
-_GL_FUNCDECL_SYS (strsignal, char *, (int __sig));
+_GL_FUNCDECL_SYS (strsignal, char *, (int __sig), );
# endif
/* Need to cast, because on Cygwin 1.5.x systems, the return type is
'const char *'. */
# endif
_GL_FUNCDECL_RPL (pselect, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
- struct timespec const *restrict, const sigset_t *restrict));
+ struct timespec const *restrict, const sigset_t *restrict), );
_GL_CXXALIAS_RPL (pselect, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
struct timespec const *restrict, const sigset_t *restrict));
# if !@HAVE_PSELECT@
_GL_FUNCDECL_SYS (pselect, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
- struct timespec const *restrict, const sigset_t *restrict));
+ struct timespec const *restrict, const sigset_t *restrict), );
# endif
/* Need to cast, because on AIX 7, the second, third, fourth argument may be
void *restrict, void *restrict, void *restrict. */
# endif
_GL_FUNCDECL_RPL (select, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
- struct timeval *restrict));
+ struct timeval *restrict), );
_GL_CXXALIAS_RPL (select, int,
(int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
timeval *restrict));
# undef futimens
# define futimens rpl_futimens
# endif
-_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]));
+_GL_FUNCDECL_RPL (futimens, int, (int fd, struct timespec const times[2]), );
_GL_CXXALIAS_RPL (futimens, int, (int fd, struct timespec const times[2]));
# else
# if !@HAVE_FUTIMENS@
-_GL_FUNCDECL_SYS (futimens, int, (int fd, struct timespec const times[2]));
+_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 @GNULIB_GETUMASK@
# if !@HAVE_GETUMASK@
# if __GLIBC__ + (__GLIBC_MINOR__ >= 2) > 2
-_GL_FUNCDECL_SYS (getumask, mode_t, (void)) _GL_ATTRIBUTE_NOTHROW;
+_GL_FUNCDECL_SYS (getumask, mode_t, (void), ) _GL_ATTRIBUTE_NOTHROW;
# else
-_GL_FUNCDECL_SYS (getumask, mode_t, (void));
+_GL_FUNCDECL_SYS (getumask, mode_t, (void), );
# endif
# endif
_GL_CXXALIAS_SYS (getumask, mode_t, (void));
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define time rpl_time
# endif
-_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp));
+_GL_FUNCDECL_RPL (time, time_t, (time_t *__tp), );
_GL_CXXALIAS_RPL (time, time_t, (time_t *__tp));
# else
_GL_CXXALIAS_SYS (time, time_t, (time_t *__tp));
# undef tzset
# define tzset rpl_tzset
# endif
-_GL_FUNCDECL_RPL (tzset, void, (void));
+_GL_FUNCDECL_RPL (tzset, void, (void), );
_GL_CXXALIAS_RPL (tzset, void, (void));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
May return NULL if NAME is invalid (this is platform dependent) or
upon memory allocation failure. */
# if !@HAVE_TZALLOC@
-_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
+_GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name), );
_GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
# endif
Frees a time zone object.
The argument must have been returned by tzalloc(). */
# if !@HAVE_TZALLOC@
-_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
+_GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz), );
_GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
# endif
# undef close
# define close rpl_close
# endif
-_GL_FUNCDECL_RPL (close, int, (int fd));
+_GL_FUNCDECL_RPL (close, int, (int fd), );
_GL_CXXALIAS_RPL (close, int, (int fd));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# endif
_GL_FUNCDECL_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos,
- size_t len, unsigned flags));
+ size_t len, unsigned flags), );
_GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos,
size_t len, unsigned flags));
# if !@HAVE_COPY_FILE_RANGE@
_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos,
- size_t len, unsigned flags));
+ size_t len, unsigned flags), );
# endif
_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
int ofd, off_t *opos,
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dup2 rpl_dup2
# endif
-_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
+_GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd), );
_GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef dup3
# define dup3 rpl_dup3
# endif
-_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags));
+_GL_FUNCDECL_RPL (dup3, int, (int oldfd, int newfd, int flags), );
_GL_CXXALIAS_RPL (dup3, int, (int oldfd, int newfd, int flags));
# else
# if !@HAVE_DUP3@
-_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags));
+_GL_FUNCDECL_SYS (dup3, int, (int oldfd, int newfd, int flags), );
# endif
_GL_CXXALIAS_SYS (dup3, int, (int oldfd, int newfd, int flags));
# endif
# undef fdatasync
# define fdatasync rpl_fdatasync
# endif
-_GL_FUNCDECL_RPL (fdatasync, int, (int fd));
+_GL_FUNCDECL_RPL (fdatasync, int, (int fd), );
_GL_CXXALIAS_RPL (fdatasync, int, (int fd));
# else
# if !@HAVE_FDATASYNC@|| !@HAVE_DECL_FDATASYNC@
-_GL_FUNCDECL_SYS (fdatasync, int, (int fd));
+_GL_FUNCDECL_SYS (fdatasync, int, (int fd), );
# endif
_GL_CXXALIAS_SYS (fdatasync, int, (int fd));
# endif
See POSIX:2008 specification
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>. */
# if !@HAVE_FSYNC@
-_GL_FUNCDECL_SYS (fsync, int, (int fd));
+_GL_FUNCDECL_SYS (fsync, int, (int fd), );
# endif
_GL_CXXALIAS_SYS (fsync, int, (int fd));
_GL_CXXALIASWARN (fsync);
# undef getdtablesize
# define getdtablesize rpl_getdtablesize
# endif
-_GL_FUNCDECL_RPL (getdtablesize, int, (void));
+_GL_FUNCDECL_RPL (getdtablesize, int, (void), );
_GL_CXXALIAS_RPL (getdtablesize, int, (void));
# else
# if !@HAVE_GETDTABLESIZE@
-_GL_FUNCDECL_SYS (getdtablesize, int, (void));
+_GL_FUNCDECL_SYS (getdtablesize, int, (void), );
# endif
/* Need to cast, because on AIX, the parameter list is
(...). */
$USERNAME on native Windows platforms.
*/
# if !@HAVE_DECL_GETLOGIN@
-_GL_FUNCDECL_SYS (getlogin, char *, (void));
+_GL_FUNCDECL_SYS (getlogin, char *, (void), );
# endif
_GL_CXXALIAS_SYS (getlogin, char *, (void));
_GL_CXXALIASWARN (getlogin);
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getpagesize rpl_getpagesize
# endif
-_GL_FUNCDECL_RPL (getpagesize, int, (void));
+_GL_FUNCDECL_RPL (getpagesize, int, (void), );
_GL_CXXALIAS_RPL (getpagesize, int, (void));
# else
/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used. */
# if defined __hpux
-_GL_FUNCDECL_SYS (getpagesize, int, (void));
+_GL_FUNCDECL_SYS (getpagesize, int, (void), );
# endif
# if !@HAVE_GETPAGESIZE@
# if !defined getpagesize
# undef getusershell
# define getusershell rpl_getusershell
# endif
-_GL_FUNCDECL_RPL (getusershell, char *, (void));
+_GL_FUNCDECL_RPL (getusershell, char *, (void), );
_GL_CXXALIAS_RPL (getusershell, char *, (void));
# else
# if !@HAVE_DECL_GETUSERSHELL@
-_GL_FUNCDECL_SYS (getusershell, char *, (void));
+_GL_FUNCDECL_SYS (getusershell, char *, (void), );
# endif
_GL_CXXALIAS_SYS (getusershell, char *, (void));
# endif
# undef setusershell
# define setusershell rpl_setusershell
# endif
-_GL_FUNCDECL_RPL (setusershell, void, (void));
+_GL_FUNCDECL_RPL (setusershell, void, (void), );
_GL_CXXALIAS_RPL (setusershell, void, (void));
# else
# if !@HAVE_DECL_GETUSERSHELL@
-_GL_FUNCDECL_SYS (setusershell, void, (void));
+_GL_FUNCDECL_SYS (setusershell, void, (void), );
# endif
_GL_CXXALIAS_SYS (setusershell, void, (void));
# endif
# undef endusershell
# define endusershell rpl_endusershell
# endif
-_GL_FUNCDECL_RPL (endusershell, void, (void));
+_GL_FUNCDECL_RPL (endusershell, void, (void), );
_GL_CXXALIAS_RPL (endusershell, void, (void));
# else
# if !@HAVE_DECL_GETUSERSHELL@
-_GL_FUNCDECL_SYS (endusershell, void, (void));
+_GL_FUNCDECL_SYS (endusershell, void, (void), );
# endif
_GL_CXXALIAS_SYS (endusershell, void, (void));
# endif
#if @GNULIB_GROUP_MEMBER@
/* Determine whether group id is in calling user's group list. */
# if !@HAVE_GROUP_MEMBER@
-_GL_FUNCDECL_SYS (group_member, int, (gid_t gid));
+_GL_FUNCDECL_SYS (group_member, int, (gid_t gid), );
# endif
_GL_CXXALIAS_SYS (group_member, int, (gid_t gid));
_GL_CXXALIASWARN (group_member);
# define isatty rpl_isatty
# endif
# define GNULIB_defined_isatty 1
-_GL_FUNCDECL_RPL (isatty, int, (int fd));
+_GL_FUNCDECL_RPL (isatty, int, (int fd), );
_GL_CXXALIAS_RPL (isatty, int, (int fd));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define lseek rpl_lseek
# endif
-_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+_GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence), );
_GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
# elif defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef sleep
# define sleep rpl_sleep
# endif
-_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n));
+_GL_FUNCDECL_RPL (sleep, unsigned int, (unsigned int n), );
_GL_CXXALIAS_RPL (sleep, unsigned int, (unsigned int n));
# else
# if !@HAVE_SLEEP@
-_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n));
+_GL_FUNCDECL_SYS (sleep, unsigned int, (unsigned int n), );
# endif
_GL_CXXALIAS_SYS (sleep, unsigned int, (unsigned int n));
# endif
# undef usleep
# define usleep rpl_usleep
# endif
-_GL_FUNCDECL_RPL (usleep, int, (useconds_t n));
+_GL_FUNCDECL_RPL (usleep, int, (useconds_t n), );
_GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
# else
# if !@HAVE_USLEEP@
-_GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
+_GL_FUNCDECL_SYS (usleep, int, (useconds_t n), );
# endif
/* Need to cast, because on Haiku, the first parameter is
unsigned int n. */
}
}
+#if !HAVE_UTIMENS
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively. */
int
{
return fdutimens (-1, file, timespec);
}
+#endif
+#if !HAVE_LUTIMENS
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing
symlinks. Fail with ENOSYS if the platform does not support
errno = ENOSYS;
return -1;
}
+#endif
#include <time.h>
+#if HAVE_UTIMENS || HAVE_LUTIMENS
+# include <sys/time.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
int fdutimens (int, char const *, struct timespec const [2]);
+#if !HAVE_UTIMENS
int utimens (char const *, struct timespec const [2]);
+#endif
+#if !HAVE_LUTIMENS
int lutimens (char const *, struct timespec const [2]);
+#endif
#ifdef __cplusplus
}
# std-gnu11.m4
-# serial 2
+# serial 3
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
# commit 017d5ddd82854911f0119691d91ea8a1438824d6
# dated Sun Apr 3 13:57:17 2016 -0700
+# with minor changes to commentary.
# This implementation will be obsolete once we can assume Autoconf 2.70
# or later is installed everywhere a Gnulib program might be developed.
# Copyright (C) 2001-2024 Free Software Foundation, Inc.
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
+# This file is part of Autoconf. This program is free
+# software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
+# Under Section 7 of GPL version 3, you are granted additional
+# permissions described in the Autoconf Configure Script Exception,
+# version 3.0, as published by the Free Software Foundation.
+#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <https://www.gnu.org/licenses/>.
+# and a copy of the Autoconf Configure Script Exception along with
+# this program; see the files COPYINGv3 and COPYING.EXCEPTION
+# respectively. If not, see <https://www.gnu.org/licenses/> and
+# <https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;f=COPYING.EXCEPTION>.
# Written by David MacKenzie, with help from
# Akim Demaille, Paul Eggert,
# utimens.m4
-# serial 16
+# serial 17
dnl Copyright (C) 2003-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
gl_CHECK_FUNCS_ANDROID([lutimes], [[#include <sys/time.h>]])
gl_CHECK_FUNCS_ANDROID([futimens], [[#include <sys/stat.h>]])
gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
+ AC_CHECK_FUNCS_ONCE([utimens lutimens])
if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not