1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

Update from Gnulib by running admin/merge-gnulib

This commit is contained in:
Paul Eggert 2024-09-17 00:32:39 -07:00
parent cbe8683410
commit 73427887d6
17 changed files with 141 additions and 112 deletions

View File

@ -104,10 +104,15 @@
# 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)));
@ -116,24 +121,22 @@
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

View File

@ -63,15 +63,17 @@ rpl_faccessat (int fd, char const *file, int mode, int flag)
{
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;

View File

@ -141,14 +141,14 @@ _GL_CXXALIASWARN (creat);
# 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

View File

@ -913,11 +913,11 @@ extern "C" {
# 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
@ -944,11 +944,11 @@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
# 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

View File

@ -149,7 +149,7 @@ typedef void (*sighandler_t) (int);
#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
@ -165,7 +165,7 @@ _GL_WARN_ON_USE (sig2str, "sig2str is not portable - "
#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
@ -189,7 +189,7 @@ _GL_WARN_ON_USE (str2sig, "str2sig is not portable - "
_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,
@ -199,7 +199,7 @@ _GL_CXXALIAS_RPL (pthread_sigmask, int,
_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,
@ -224,11 +224,11 @@ _GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
# 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
@ -359,7 +359,7 @@ _GL_CXXALIASWARN (sigpending);
_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,
@ -384,7 +384,7 @@ typedef void (*_gl_function_taking_int_returning_void_t) (int);
# 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
@ -392,7 +392,7 @@ _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
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));
@ -510,7 +510,7 @@ struct sigaction
# endif
_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
struct sigaction *restrict));
struct sigaction *restrict), );
# elif !@HAVE_STRUCT_SIGACTION_SA_SIGACTION@

View File

@ -308,7 +308,7 @@ __gl_stdbit_popcount_wide (unsigned long long int n)
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;

View File

@ -461,7 +461,7 @@ _GL_CXXALIASWARN (fdopen);
# 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));
@ -994,7 +994,7 @@ _GL_CXXALIASWARN (getc);
# 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));
@ -1112,7 +1112,7 @@ _GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
# 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
@ -1221,7 +1221,7 @@ _GL_WARN_ON_USE (pclose, "pclose is unportable - "
# 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));
@ -1366,7 +1366,7 @@ _GL_CXXALIASWARN (putc);
# 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));
@ -1406,7 +1406,7 @@ _GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
# 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

View File

@ -20,7 +20,9 @@
#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
@ -220,11 +222,11 @@ struct random_data
# 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
@ -249,7 +251,7 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
# 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));
@ -267,9 +269,9 @@ _GL_CXXALIASWARN (abort);
# 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
@ -592,7 +594,7 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
# 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
@ -600,7 +602,7 @@ _GL_CXXALIAS_RPL (getprogname, const char *, (void));
# 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));
@ -662,7 +664,7 @@ _GL_WARN_ON_USE (getsubopt, "getsubopt is unportable - "
/* 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);
@ -788,13 +790,13 @@ _GL_WARN_ON_USE (mbstowcs, "mbstowcs is unportable - "
# 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));
@ -1078,11 +1080,11 @@ _GL_WARN_ON_USE (ptsname, "ptsname is not portable - "
# 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
@ -1204,7 +1206,7 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
# 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));
@ -1221,11 +1223,11 @@ _GL_CXXALIASWARN (rand);
# 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. */
@ -1248,11 +1250,11 @@ _GL_WARN_ON_USE (random, "random is unportable - "
# 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. */
@ -1910,7 +1912,7 @@ _GL_WARN_ON_USE (strtoull, "strtoull is unportable - "
/* 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);
@ -1955,7 +1957,7 @@ _GL_WARN_ON_USE (unsetenv, "unsetenv is unportable - "
# 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));

View File

@ -213,7 +213,7 @@ _GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
/* 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);
@ -231,11 +231,11 @@ _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
# 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
@ -1308,7 +1308,7 @@ _GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
# 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));
@ -1359,11 +1359,11 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
# 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
@ -1379,7 +1379,7 @@ _GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - "
/* 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);
@ -1394,7 +1394,7 @@ _GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - "
/* 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);
@ -1411,11 +1411,11 @@ _GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - "
# 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 *'. */

View File

@ -282,7 +282,7 @@ rpl_fd_isset (SOCKET fd, fd_set * set)
# 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));
@ -290,7 +290,7 @@ _GL_CXXALIAS_RPL (pselect, int,
# 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. */
@ -319,7 +319,7 @@ _GL_WARN_ON_USE (pselect, "pselect is not portable - "
# 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));

View File

@ -585,11 +585,11 @@ _GL_WARN_ON_USE (fstatat, "fstatat is not portable - "
# 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
@ -608,9 +608,9 @@ _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;
_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));

View File

@ -201,7 +201,7 @@ _GL_WARN_ON_USE (timespec_getres, "timespec_getres is unportable - "
# 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));
@ -255,7 +255,7 @@ _GL_WARN_ON_USE (nanosleep, "nanosleep is unportable - "
# 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)
@ -516,7 +516,7 @@ typedef struct tm_zone *rpl_timezone_t;
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
@ -524,7 +524,7 @@ _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
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

View File

@ -399,7 +399,7 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
# 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)
@ -446,7 +446,7 @@ _GL_CXXALIASWARN (close);
# 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));
@ -454,7 +454,7 @@ _GL_CXXALIAS_RPL (copy_file_range, ssize_t, (int ifd, off_t *ipos,
# 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,
@ -521,7 +521,7 @@ _GL_CXXALIASWARN (dup);
# 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)
@ -570,11 +570,11 @@ _GL_CXXALIASWARN (dup2);
# 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
@ -1045,11 +1045,11 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
# 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
@ -1071,7 +1071,7 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
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);
@ -1223,11 +1223,11 @@ _GL_WARN_ON_USE (getdomainname, "getdomainname is unportable - "
# 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
(...). */
@ -1360,7 +1360,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
$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);
@ -1421,13 +1421,13 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
# 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
@ -1559,11 +1559,11 @@ _GL_CXXALIASWARN (getpid);
# 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
@ -1583,11 +1583,11 @@ _GL_WARN_ON_USE (getusershell, "getusershell is unportable - "
# 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
@ -1608,11 +1608,11 @@ _GL_WARN_ON_USE (setusershell, "setusershell is unportable - "
# 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
@ -1629,7 +1629,7 @@ _GL_WARN_ON_USE (endusershell, "endusershell is unportable - "
#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);
@ -1649,7 +1649,7 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
# 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)
@ -1792,7 +1792,7 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
# 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)
@ -2161,11 +2161,11 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
# 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
@ -2409,11 +2409,11 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
# 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. */

View File

@ -516,6 +516,7 @@ fdutimens (int fd, char const *file, struct timespec const timespec[2])
}
}
#if !HAVE_UTIMENS
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively. */
int
@ -523,7 +524,9 @@ utimens (char const *file, struct timespec const timespec[2])
{
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
@ -646,3 +649,4 @@ lutimens (char const *file, struct timespec const timespec[2])
errno = ENOSYS;
return -1;
}
#endif

View File

@ -24,13 +24,21 @@
#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
}

View File

@ -1,5 +1,5 @@
# std-gnu11.m4
# serial 2
# serial 3
# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
@ -9,6 +9,7 @@ m4_ifndef([_AC_C_C23_OPTIONS], [
# 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.
@ -17,9 +18,10 @@ m4_version_prereq([2.70], [], [
# 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,
@ -27,8 +29,15 @@ m4_version_prereq([2.70], [], [
# 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,

View File

@ -1,5 +1,5 @@
# 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,
@ -16,6 +16,7 @@ AC_DEFUN([gl_UTIMENS],
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