1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-05 22:20:24 -08:00

Update from Gnulib by running admin/merge-gnulib

This commit is contained in:
Paul Eggert 2024-07-15 19:03:17 -07:00
parent fd8bdedde9
commit f5dbdedcc5
13 changed files with 309 additions and 64 deletions

View file

@ -386,6 +386,7 @@ GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
GL_GNULIB_DUP = @GL_GNULIB_DUP@
GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
GL_GNULIB_DZPRINTF = @GL_GNULIB_DZPRINTF@
GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
@ -431,6 +432,7 @@ GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
GL_GNULIB_FZPRINTF = @GL_GNULIB_FZPRINTF@
GL_GNULIB_GETC = @GL_GNULIB_GETC@
GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
@ -602,6 +604,7 @@ GL_GNULIB_SIGNAL_H_SIGPIPE = @GL_GNULIB_SIGNAL_H_SIGPIPE@
GL_GNULIB_SIGPROCMASK = @GL_GNULIB_SIGPROCMASK@
GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
GL_GNULIB_SNZPRINTF = @GL_GNULIB_SNZPRINTF@
GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
GL_GNULIB_STAT = @GL_GNULIB_STAT@
GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
@ -637,6 +640,7 @@ GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
GL_GNULIB_SZPRINTF = @GL_GNULIB_SZPRINTF@
GL_GNULIB_TIME = @GL_GNULIB_TIME@
GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
@ -658,22 +662,24 @@ GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
GL_GNULIB_VAZSPRINTF = @GL_GNULIB_VAZSPRINTF@
GL_GNULIB_VASZPRINTF = @GL_GNULIB_VASZPRINTF@
GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
GL_GNULIB_VDZPRINTF = @GL_GNULIB_VDZPRINTF@
GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
GL_GNULIB_VFZPRINTF = @GL_GNULIB_VFZPRINTF@
GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
GL_GNULIB_VSNZPRINTF = @GL_GNULIB_VSNZPRINTF@
GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
GL_GNULIB_VZSNPRINTF = @GL_GNULIB_VZSNPRINTF@
GL_GNULIB_VZSPRINTF = @GL_GNULIB_VZSPRINTF@
GL_GNULIB_VSZPRINTF = @GL_GNULIB_VSZPRINTF@
GL_GNULIB_VZPRINTF = @GL_GNULIB_VZPRINTF@
GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
GL_GNULIB_ZSNPRINTF = @GL_GNULIB_ZSNPRINTF@
GL_GNULIB_ZSPRINTF = @GL_GNULIB_ZSPRINTF@
GL_GNULIB_ZPRINTF = @GL_GNULIB_ZPRINTF@
GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
GL_STDC_BIT_CEIL = @GL_STDC_BIT_CEIL@
GL_STDC_BIT_FLOOR = @GL_STDC_BIT_FLOOR@
@ -3285,6 +3291,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
-e 's/@''GNULIB_DZPRINTF''@/$(GL_GNULIB_DZPRINTF)/g' \
-e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
-e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
-e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \
@ -3305,6 +3312,7 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
-e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
-e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
-e 's/@''GNULIB_FZPRINTF''@/$(GL_GNULIB_FZPRINTF)/g' \
-e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
-e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
-e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \
@ -3325,25 +3333,29 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
-e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
-e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
-e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
-e 's/@''GNULIB_SNZPRINTF''@/$(GL_GNULIB_SNZPRINTF)/g' \
-e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
-e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
-e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
-e 's/@''GNULIB_SZPRINTF''@/$(GL_GNULIB_SZPRINTF)/g' \
-e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
-e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
-e 's/@''GNULIB_VAZSPRINTF''@/$(GL_GNULIB_VAZSPRINTF)/g' \
-e 's/@''GNULIB_VASZPRINTF''@/$(GL_GNULIB_VASZPRINTF)/g' \
-e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
-e 's/@''GNULIB_VDZPRINTF''@/$(GL_GNULIB_VDZPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
-e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VFZPRINTF''@/$(GL_GNULIB_VFZPRINTF)/g' \
-e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
-e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
-e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
-e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
-e 's/@''GNULIB_VSNZPRINTF''@/$(GL_GNULIB_VSNZPRINTF)/g' \
-e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
-e 's/@''GNULIB_VZSNPRINTF''@/$(GL_GNULIB_VZSNPRINTF)/g' \
-e 's/@''GNULIB_VZSPRINTF''@/$(GL_GNULIB_VZSPRINTF)/g' \
-e 's/@''GNULIB_ZSNPRINTF''@/$(GL_GNULIB_ZSNPRINTF)/g' \
-e 's/@''GNULIB_ZSPRINTF''@/$(GL_GNULIB_ZSPRINTF)/g' \
-e 's/@''GNULIB_VSZPRINTF''@/$(GL_GNULIB_VSZPRINTF)/g' \
-e 's/@''GNULIB_VZPRINTF''@/$(GL_GNULIB_VZPRINTF)/g' \
-e 's/@''GNULIB_ZPRINTF''@/$(GL_GNULIB_ZPRINTF)/g' \
-e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
-e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
-e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \

View file

@ -26,6 +26,20 @@
#if USE_XATTR
# include <attr/libattr.h>
# include <string.h>
# if HAVE_LINUX_XATTR_H
# include <linux/xattr.h>
# endif
# ifndef XATTR_NAME_NFSV4_ACL
# define XATTR_NAME_NFSV4_ACL "system.nfs4_acl"
# endif
# ifndef XATTR_NAME_POSIX_ACL_ACCESS
# define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access"
# endif
# ifndef XATTR_NAME_POSIX_ACL_DEFAULT
# define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default"
# endif
/* Returns 1 if NAME is the name of an extended attribute that is related
to permissions, i.e. ACLs. Returns 0 otherwise. */
@ -33,7 +47,12 @@
static int
is_attr_permissions (const char *name, struct error_context *ctx)
{
return attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
/* We need to explicitly test for the known extended attribute names,
because at least on CentOS 7, attr_copy_action does not do it. */
return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0
|| strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0
|| strcmp (name, XATTR_NAME_NFSV4_ACL) == 0
|| attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
}
#endif /* USE_XATTR */

View file

@ -280,7 +280,26 @@
#endif
#if @GNULIB_DZPRINTF@
/* Prints formatted output to file descriptor FD.
Returns the number of bytes written to the file descriptor. Upon
failure, returns -1 with errno set.
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure codes are ENOMEM
and the possible failure codes from write(), excluding EINTR. */
_GL_FUNCDECL_SYS (dzprintf, off64_t,
(int fd, const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_SYS (dzprintf, off64_t,
(int fd, const char *restrict format, ...));
#endif
#if @GNULIB_DPRINTF@
/* Prints formatted output to file descriptor FD.
Returns the number of bytes written to the file descriptor. Upon
failure, returns a negative value. */
# if @REPLACE_DPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define dprintf rpl_dprintf
@ -547,7 +566,26 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX complian
# endif
#endif
#if @GNULIB_FZPRINTF@
/* Prints formatted output to stream FP.
Returns the number of bytes written to the stream. Upon failure,
returns -1 with the stream's error indicator set.
Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (fzprintf, off64_t,
(FILE *restrict fp, const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (fzprintf, off64_t,
(FILE *restrict fp, const char *restrict format, ...));
#endif
#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
/* Prints formatted output to stream FP.
Returns the number of bytes written to the stream. Upon failure,
returns a negative value with the stream's error indicator set. */
# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
|| (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1227,7 +1265,24 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
# endif
#endif
#if @GNULIB_ZPRINTF@
/* Prints formatted output to standard output.
Returns the number of bytes written to standard output. Upon failure,
returns -1 with stdout's error indicator set.
Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
#endif
#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
/* Prints formatted output to standard output.
Returns the number of bytes written to standard output. Upon failure,
returns a negative value with stdout's error indicator set. */
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if defined __GNUC__ || defined __clang__
@ -1459,7 +1514,7 @@ _GL_CXXALIASWARN (scanf);
# endif
#endif
#if @GNULIB_ZSNPRINTF@
#if @GNULIB_SNZPRINTF@
/* Prints formatted output to string STR. Similar to sprintf, but the
additional parameter SIZE limits how much is written into STR.
STR may be NULL, in which case nothing will be written.
@ -1468,12 +1523,12 @@ _GL_CXXALIASWARN (scanf);
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (zsnprintf, ptrdiff_t,
_GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
(char *restrict str, size_t size,
const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_SYS (zsnprintf, ptrdiff_t,
_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
(char *restrict str, size_t size,
const char *restrict format, ...));
#endif
@ -1520,19 +1575,19 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
# endif
#endif
#if @GNULIB_ZSPRINTF@
#if @GNULIB_SZPRINTF@
/* Prints formatted output to string STR.
Returns the string length of the formatted string. Upon failure,
returns -1 with errno set.
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (zsprintf, ptrdiff_t,
_GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
(char *restrict str,
const char *restrict format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (zsprintf, ptrdiff_t,
_GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
(char *restrict str,
const char *restrict format, ...));
#endif
@ -1629,7 +1684,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
# endif
#endif
#if @GNULIB_VAZSPRINTF@
#if @GNULIB_VASZPRINTF@
/* Prints formatted output to a string dynamically allocated with malloc().
If the memory allocation succeeds, it stores the address of the string in
*RESULT and returns the number of resulting bytes, excluding the trailing
@ -1638,17 +1693,17 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (azsprintf, ptrdiff_t,
_GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
(char **result, const char *format, ...)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (azsprintf, ptrdiff_t,
_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
(char **result, const char *format, ...));
_GL_FUNCDECL_SYS (vazsprintf, ptrdiff_t,
_GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
(char **result, const char *format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vazsprintf, ptrdiff_t,
_GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
(char **result, const char *format, va_list args));
#endif
@ -1703,7 +1758,26 @@ _GL_CXXALIAS_SYS (vasprintf, int,
_GL_CXXALIASWARN (vasprintf);
#endif
#if @GNULIB_VDZPRINTF@
/* Prints formatted output to file descriptor FD.
Returns the number of bytes written to the file descriptor. Upon
failure, returns -1 with errno set.
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure codes are ENOMEM
and the possible failure codes from write(), excluding EINTR. */
_GL_FUNCDECL_SYS (vdzprintf, off64_t,
(int fd, const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((2)));
_GL_CXXALIAS_SYS (vdzprintf, off64_t,
(int fd, const char *restrict format, va_list args));
#endif
#if @GNULIB_VDPRINTF@
/* Prints formatted output to file descriptor FD.
Returns the number of bytes written to the file descriptor. Upon
failure, returns a negative value. */
# if @REPLACE_VDPRINTF@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define vdprintf rpl_vdprintf
@ -1737,7 +1811,28 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
# endif
#endif
#if @GNULIB_VFZPRINTF@
/* Prints formatted output to stream FP.
Returns the number of bytes written to the stream. Upon failure,
returns -1 with the stream's error indicator set.
Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (vfzprintf, off64_t,
(FILE *restrict fp,
const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vfzprintf, off64_t,
(FILE *restrict fp,
const char *restrict format, va_list args));
#endif
#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
/* Prints formatted output to stream FP.
Returns the number of bytes written to the stream. Upon failure,
returns a negative value with the stream's error indicator set. */
# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
|| (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1806,7 +1901,25 @@ _GL_CXXALIASWARN (vfscanf);
# endif
#endif
#if @GNULIB_VZPRINTF@
/* Prints formatted output to standard output.
Returns the number of bytes written to standard output. Upon failure,
returns -1 with stdout's error indicator set.
Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure causes are ENOMEM
and the possible failure causes from fwrite(). */
_GL_FUNCDECL_SYS (vzprintf, off64_t, (const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
_GL_ARG_NONNULL ((1)));
_GL_CXXALIAS_SYS (vzprintf, off64_t,
(const char *restrict format, va_list args));
#endif
#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
/* Prints formatted output to standard output.
Returns the number of bytes written to standard output. Upon failure,
returns a negative value with stdout's error indicator set. */
# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
|| (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@ -1862,7 +1975,7 @@ _GL_CXXALIASWARN (vscanf);
# endif
#endif
#if @GNULIB_VZSNPRINTF@
#if @GNULIB_VSNZPRINTF@
/* Prints formatted output to string STR. Similar to sprintf, but the
additional parameter SIZE limits how much is written into STR.
STR may be NULL, in which case nothing will be written.
@ -1871,12 +1984,12 @@ _GL_CXXALIASWARN (vscanf);
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (vzsnprintf, ptrdiff_t,
_GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
(char *restrict str, size_t size,
const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
_GL_ARG_NONNULL ((3)));
_GL_CXXALIAS_SYS (vzsnprintf, ptrdiff_t,
_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
(char *restrict str, size_t size,
const char *restrict format, va_list args));
#endif
@ -1923,19 +2036,19 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
# endif
#endif
#if @GNULIB_VZSPRINTF@
#if @GNULIB_VSZPRINTF@
/* Prints formatted output to string STR.
Returns the string length of the formatted string. Upon failure,
returns -1 with errno set.
Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
Therefore, if the format string is valid and does not use %ls/%lc
directives nor widths, the only possible failure code is ENOMEM. */
_GL_FUNCDECL_SYS (vzsprintf, ptrdiff_t,
_GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
(char *restrict str,
const char *restrict format, va_list args)
_GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
_GL_ARG_NONNULL ((1, 2)));
_GL_CXXALIAS_SYS (vzsprintf, ptrdiff_t,
_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
(char *restrict str,
const char *restrict format, va_list args));
#endif

View file

@ -20,9 +20,18 @@
#endif
@PRAGMA_COLUMNS@
#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc
#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined __need_malloc_and_calloc
/* Special invocation conventions inside some gnulib header files,
and inside some glibc header files, respectively. */
and inside some glibc header files, respectively.
Do not recognize this special invocation convention when GCC's
c++/11/stdlib.h is being included or has been included. This is needed
to support the use of clang+llvm binaries on Ubuntu 22.04 with
CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
-I/usr/include/x86_64-linux-gnu/c++/11
-L/usr/lib/gcc/x86_64-linux-gnu/11
-Wl,-rpath,$clangdir/lib"
because in this case /usr/include/c++/11/stdlib.h (which does not support
the convention) is seen before the gnulib-generated stdlib.h. */
#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
@ -108,6 +117,17 @@ struct random_data
# include <unistd.h>
#endif
#if ((@GNULIB_STRTOL@ && @REPLACE_STRTOL@) || (@GNULIB_STRTOLL@ && @REPLACE_STRTOLL@) || (@GNULIB_STRTOUL@ && @REPLACE_STRTOUL@) || (@GNULIB_STRTOULL@ && @REPLACE_STRTOULL@)) && defined __cplusplus && !defined GNULIB_NAMESPACE && defined __GNUG__ && !defined __clang__ && defined __sun
/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
below, this may cause compilation errors later in the libstdc++ header files
(that are part of GCC), such as:
error: 'rpl_strtol' is not a member of 'std'
To avoid this, include the relevant header files here, before these symbols
get defined as macros. But do so only on Solaris 11 (where it is needed),
not on mingw (where it would cause other compilation errors). */
# include <string>
#endif
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
that can be freed by passing them as the Ith argument to the
function F. */