aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild-aux/gitlog-to-changelog31
-rwxr-xr-xbuild-aux/move-if-change4
-rwxr-xr-xbuild-aux/update-copyright4
-rw-r--r--lib/gnulib.mk.in32
-rw-r--r--lib/qcopy-acl.c21
-rw-r--r--lib/stdio.in.h147
-rw-r--r--lib/stdlib.in.h24
-rw-r--r--m4/acl.m425
-rw-r--r--m4/gnulib-comp.m49
-rw-r--r--m4/manywarnings.m43
-rw-r--r--m4/memmem.m44
-rw-r--r--m4/stdio_h.m418
-rw-r--r--m4/strnlen.m451
13 files changed, 309 insertions, 64 deletions
diff --git a/build-aux/gitlog-to-changelog b/build-aux/gitlog-to-changelog
index 49e7ef95cef..a2c348e2cf0 100755
--- a/build-aux/gitlog-to-changelog
+++ b/build-aux/gitlog-to-changelog
@@ -35,7 +35,7 @@
35eval 'exec perl -wSx "$0" "$@"' 35eval 'exec perl -wSx "$0" "$@"'
36 if 0; 36 if 0;
37 37
38my $VERSION = '2023-06-24 21:59'; # UTC 38my $VERSION = '2024-07-04 10:56'; # UTC
39# The definition above must lie within the first 8 lines in order 39# The definition above must lie within the first 8 lines in order
40# for the Emacs time-stamp write hook (at end) to update it. 40# for the Emacs time-stamp write hook (at end) to update it.
41# If you change this file with Emacs, please let the write hook 41# If you change this file with Emacs, please let the write hook
@@ -97,6 +97,7 @@ OPTIONS:
97 --strip-cherry-pick remove data inserted by "git cherry-pick"; 97 --strip-cherry-pick remove data inserted by "git cherry-pick";
98 this includes the "cherry picked from commit ..." line, 98 this includes the "cherry picked from commit ..." line,
99 and the possible final "Conflicts:" paragraph. 99 and the possible final "Conflicts:" paragraph.
100 --commit-timezone use dates respecting the timezone commits were made in.
100 --help display this help and exit 101 --help display this help and exit
101 --version output version information and exit 102 --version output version information and exit
102 103
@@ -247,6 +248,7 @@ sub git_dir_option($)
247 my $ignore_line; 248 my $ignore_line;
248 my $strip_tab = 0; 249 my $strip_tab = 0;
249 my $strip_cherry_pick = 0; 250 my $strip_cherry_pick = 0;
251 my $commit_timezone = 0;
250 my $srcdir; 252 my $srcdir;
251 GetOptions 253 GetOptions
252 ( 254 (
@@ -262,6 +264,7 @@ sub git_dir_option($)
262 'ignore-line=s' => \$ignore_line, 264 'ignore-line=s' => \$ignore_line,
263 'strip-tab' => \$strip_tab, 265 'strip-tab' => \$strip_tab,
264 'strip-cherry-pick' => \$strip_cherry_pick, 266 'strip-cherry-pick' => \$strip_cherry_pick,
267 'commit-timezone' => \$commit_timezone,
265 'srcdir=s' => \$srcdir, 268 'srcdir=s' => \$srcdir,
266 ) or usage 1; 269 ) or usage 1;
267 270
@@ -274,10 +277,12 @@ sub git_dir_option($)
274 # that makes a correction in the log or attribution of that commit. 277 # that makes a correction in the log or attribution of that commit.
275 my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {}; 278 my $amend_code = defined $amend_file ? parse_amend_file $amend_file : {};
276 279
280 my $commit_time_format = $commit_timezone ? '%cI' : '%ct';
277 my @cmd = ('git', 281 my @cmd = ('git',
278 git_dir_option $srcdir, 282 git_dir_option $srcdir,
279 qw(log --log-size), 283 qw(log --log-size),
280 '--pretty=format:%H:%ct %an <%ae>%n%n'.$format_string, @ARGV); 284 ("--pretty=format:%H:$commit_time_format"
285 . ' %an <%ae>%n%n'.$format_string, @ARGV));
281 open PIPE, '-|', @cmd 286 open PIPE, '-|', @cmd
282 or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n" 287 or die ("$ME: failed to run '". quoted_cmd (@cmd) ."': $!\n"
283 . "(Is your Git too old? Version 1.5.1 or later is required.)\n"); 288 . "(Is your Git too old? Version 1.5.1 or later is required.)\n");
@@ -350,17 +355,31 @@ sub git_dir_option($)
350 my $author_line = shift @line; 355 my $author_line = shift @line;
351 defined $author_line 356 defined $author_line
352 or die "$ME:$.: unexpected EOF\n"; 357 or die "$ME:$.: unexpected EOF\n";
353 $author_line =~ /^(\d+) (.*>)$/ 358 $author_line =~ /^(\S+) (.*>)$/
354 or die "$ME:$.: Invalid line " 359 or die "$ME:$.: Invalid line "
355 . "(expected date/author/email):\n$author_line\n"; 360 . "(expected date/author/email):\n$author_line\n";
356 361
362 # Author <email>
363 my $author = $2;
364
365 my $commit_date = $1;
366 if (! $commit_timezone)
367 {
368 # Seconds since the Epoch.
369 $commit_date = strftime "%Y-%m-%d", localtime ($commit_date);
370 }
371 else
372 {
373 # ISO 8601 date.
374 $commit_date =~ s/T.*$//;
375 }
376
357 # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog 377 # Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
358 # '(tiny change)' annotation. 378 # '(tiny change)' annotation.
359 my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line) 379 my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
360 ? ' (tiny change)' : ''); 380 ? ' (tiny change)' : '');
361 381
362 my $date_line = sprintf "%s %s$tiny\n", 382 my $date_line = "$commit_date $author$tiny\n";
363 strftime ("%Y-%m-%d", localtime ($1)), $2;
364 383
365 my @coauthors = grep /^Co-authored-by:.*$/, @line; 384 my @coauthors = grep /^Co-authored-by:.*$/, @line;
366 # Omit meta-data lines we've already interpreted. 385 # Omit meta-data lines we've already interpreted.
@@ -507,7 +526,7 @@ sub git_dir_option($)
507# Local Variables: 526# Local Variables:
508# mode: perl 527# mode: perl
509# indent-tabs-mode: nil 528# indent-tabs-mode: nil
510# eval: (add-hook 'before-save-hook 'time-stamp) 529# eval: (add-hook 'before-save-hook 'time-stamp nil t)
511# time-stamp-line-limit: 50 530# time-stamp-line-limit: 50
512# time-stamp-start: "my $VERSION = '" 531# time-stamp-start: "my $VERSION = '"
513# time-stamp-format: "%:y-%02m-%02d %02H:%02M" 532# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
diff --git a/build-aux/move-if-change b/build-aux/move-if-change
index 18a720735cd..a73bd2403cf 100755
--- a/build-aux/move-if-change
+++ b/build-aux/move-if-change
@@ -2,7 +2,7 @@
2# Like mv $1 $2, but if the files are the same, just delete $1. 2# Like mv $1 $2, but if the files are the same, just delete $1.
3# Status is zero if successful, nonzero otherwise. 3# Status is zero if successful, nonzero otherwise.
4 4
5VERSION='2018-03-07 03:47'; # UTC 5VERSION='2024-07-04 10:56'; # UTC
6# The definition above must lie within the first 8 lines in order 6# The definition above must lie within the first 8 lines in order
7# for the Emacs time-stamp write hook (at end) to update it. 7# for the Emacs time-stamp write hook (at end) to update it.
8# If you change this file with Emacs, please let the write hook 8# If you change this file with Emacs, please let the write hook
@@ -76,7 +76,7 @@ else
76fi 76fi
77 77
78## Local Variables: 78## Local Variables:
79## eval: (add-hook 'before-save-hook 'time-stamp) 79## eval: (add-hook 'before-save-hook 'time-stamp nil t)
80## time-stamp-start: "VERSION='" 80## time-stamp-start: "VERSION='"
81## time-stamp-format: "%:y-%02m-%02d %02H:%02M" 81## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
82## time-stamp-time-zone: "UTC0" 82## time-stamp-time-zone: "UTC0"
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
index ea3e46fe60f..42f26933835 100755
--- a/build-aux/update-copyright
+++ b/build-aux/update-copyright
@@ -138,7 +138,7 @@
138eval 'exec perl -wSx -0777 -pi "$0" "$@"' 138eval 'exec perl -wSx -0777 -pi "$0" "$@"'
139 if 0; 139 if 0;
140 140
141my $VERSION = '2024-01-15.18:30'; # UTC 141my $VERSION = '2024-07-04.10:56'; # UTC
142# The definition above must lie within the first 8 lines in order 142# The definition above must lie within the first 8 lines in order
143# for the Emacs time-stamp write hook (at end) to update it. 143# for the Emacs time-stamp write hook (at end) to update it.
144# If you change this file with Emacs, please let the write hook 144# If you change this file with Emacs, please let the write hook
@@ -298,7 +298,7 @@ if (!$found)
298# coding: utf-8 298# coding: utf-8
299# mode: perl 299# mode: perl
300# indent-tabs-mode: nil 300# indent-tabs-mode: nil
301# eval: (add-hook 'before-save-hook 'time-stamp) 301# eval: (add-hook 'before-save-hook 'time-stamp nil t)
302# time-stamp-line-limit: 200 302# time-stamp-line-limit: 200
303# time-stamp-start: "my $VERSION = '" 303# time-stamp-start: "my $VERSION = '"
304# time-stamp-format: "%:y-%02m-%02d.%02H:%02M" 304# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 948269e744d..cebde64d117 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -386,6 +386,7 @@ GL_GNULIB_DPRINTF = @GL_GNULIB_DPRINTF@
386GL_GNULIB_DUP = @GL_GNULIB_DUP@ 386GL_GNULIB_DUP = @GL_GNULIB_DUP@
387GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@ 387GL_GNULIB_DUP2 = @GL_GNULIB_DUP2@
388GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@ 388GL_GNULIB_DUP3 = @GL_GNULIB_DUP3@
389GL_GNULIB_DZPRINTF = @GL_GNULIB_DZPRINTF@
389GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@ 390GL_GNULIB_ENVIRON = @GL_GNULIB_ENVIRON@
390GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@ 391GL_GNULIB_EUIDACCESS = @GL_GNULIB_EUIDACCESS@
391GL_GNULIB_EXECL = @GL_GNULIB_EXECL@ 392GL_GNULIB_EXECL = @GL_GNULIB_EXECL@
@@ -431,6 +432,7 @@ GL_GNULIB_FTELLO = @GL_GNULIB_FTELLO@
431GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@ 432GL_GNULIB_FTRUNCATE = @GL_GNULIB_FTRUNCATE@
432GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@ 433GL_GNULIB_FUTIMENS = @GL_GNULIB_FUTIMENS@
433GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@ 434GL_GNULIB_FWRITE = @GL_GNULIB_FWRITE@
435GL_GNULIB_FZPRINTF = @GL_GNULIB_FZPRINTF@
434GL_GNULIB_GETC = @GL_GNULIB_GETC@ 436GL_GNULIB_GETC = @GL_GNULIB_GETC@
435GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@ 437GL_GNULIB_GETCHAR = @GL_GNULIB_GETCHAR@
436GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@ 438GL_GNULIB_GETCWD = @GL_GNULIB_GETCWD@
@@ -602,6 +604,7 @@ GL_GNULIB_SIGNAL_H_SIGPIPE = @GL_GNULIB_SIGNAL_H_SIGPIPE@
602GL_GNULIB_SIGPROCMASK = @GL_GNULIB_SIGPROCMASK@ 604GL_GNULIB_SIGPROCMASK = @GL_GNULIB_SIGPROCMASK@
603GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@ 605GL_GNULIB_SLEEP = @GL_GNULIB_SLEEP@
604GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@ 606GL_GNULIB_SNPRINTF = @GL_GNULIB_SNPRINTF@
607GL_GNULIB_SNZPRINTF = @GL_GNULIB_SNZPRINTF@
605GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@ 608GL_GNULIB_SPRINTF_POSIX = @GL_GNULIB_SPRINTF_POSIX@
606GL_GNULIB_STAT = @GL_GNULIB_STAT@ 609GL_GNULIB_STAT = @GL_GNULIB_STAT@
607GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@ 610GL_GNULIB_STDIO_H_NONBLOCKING = @GL_GNULIB_STDIO_H_NONBLOCKING@
@@ -637,6 +640,7 @@ GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@
637GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@ 640GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@
638GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@ 641GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@
639GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@ 642GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@
643GL_GNULIB_SZPRINTF = @GL_GNULIB_SZPRINTF@
640GL_GNULIB_TIME = @GL_GNULIB_TIME@ 644GL_GNULIB_TIME = @GL_GNULIB_TIME@
641GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@ 645GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@
642GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@ 646GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@
@@ -658,22 +662,24 @@ GL_GNULIB_UNSETENV = @GL_GNULIB_UNSETENV@
658GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@ 662GL_GNULIB_USLEEP = @GL_GNULIB_USLEEP@
659GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@ 663GL_GNULIB_UTIMENSAT = @GL_GNULIB_UTIMENSAT@
660GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@ 664GL_GNULIB_VASPRINTF = @GL_GNULIB_VASPRINTF@
661GL_GNULIB_VAZSPRINTF = @GL_GNULIB_VAZSPRINTF@ 665GL_GNULIB_VASZPRINTF = @GL_GNULIB_VASZPRINTF@
662GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@ 666GL_GNULIB_VDPRINTF = @GL_GNULIB_VDPRINTF@
667GL_GNULIB_VDZPRINTF = @GL_GNULIB_VDZPRINTF@
663GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@ 668GL_GNULIB_VFPRINTF = @GL_GNULIB_VFPRINTF@
664GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@ 669GL_GNULIB_VFPRINTF_POSIX = @GL_GNULIB_VFPRINTF_POSIX@
665GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@ 670GL_GNULIB_VFSCANF = @GL_GNULIB_VFSCANF@
671GL_GNULIB_VFZPRINTF = @GL_GNULIB_VFZPRINTF@
666GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@ 672GL_GNULIB_VPRINTF = @GL_GNULIB_VPRINTF@
667GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@ 673GL_GNULIB_VPRINTF_POSIX = @GL_GNULIB_VPRINTF_POSIX@
668GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@ 674GL_GNULIB_VSCANF = @GL_GNULIB_VSCANF@
669GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@ 675GL_GNULIB_VSNPRINTF = @GL_GNULIB_VSNPRINTF@
676GL_GNULIB_VSNZPRINTF = @GL_GNULIB_VSNZPRINTF@
670GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@ 677GL_GNULIB_VSPRINTF_POSIX = @GL_GNULIB_VSPRINTF_POSIX@
671GL_GNULIB_VZSNPRINTF = @GL_GNULIB_VZSNPRINTF@ 678GL_GNULIB_VSZPRINTF = @GL_GNULIB_VSZPRINTF@
672GL_GNULIB_VZSPRINTF = @GL_GNULIB_VZSPRINTF@ 679GL_GNULIB_VZPRINTF = @GL_GNULIB_VZPRINTF@
673GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@ 680GL_GNULIB_WCTOMB = @GL_GNULIB_WCTOMB@
674GL_GNULIB_WRITE = @GL_GNULIB_WRITE@ 681GL_GNULIB_WRITE = @GL_GNULIB_WRITE@
675GL_GNULIB_ZSNPRINTF = @GL_GNULIB_ZSNPRINTF@ 682GL_GNULIB_ZPRINTF = @GL_GNULIB_ZPRINTF@
676GL_GNULIB_ZSPRINTF = @GL_GNULIB_ZSPRINTF@
677GL_GNULIB__EXIT = @GL_GNULIB__EXIT@ 683GL_GNULIB__EXIT = @GL_GNULIB__EXIT@
678GL_STDC_BIT_CEIL = @GL_STDC_BIT_CEIL@ 684GL_STDC_BIT_CEIL = @GL_STDC_BIT_CEIL@
679GL_STDC_BIT_FLOOR = @GL_STDC_BIT_FLOOR@ 685GL_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)
3285 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ 3291 -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
3286 -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ 3292 -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
3287 -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \ 3293 -e 's/@''GNULIB_DPRINTF''@/$(GL_GNULIB_DPRINTF)/g' \
3294 -e 's/@''GNULIB_DZPRINTF''@/$(GL_GNULIB_DZPRINTF)/g' \
3288 -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \ 3295 -e 's/@''GNULIB_FCLOSE''@/$(GL_GNULIB_FCLOSE)/g' \
3289 -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \ 3296 -e 's/@''GNULIB_FDOPEN''@/$(GL_GNULIB_FDOPEN)/g' \
3290 -e 's/@''GNULIB_FFLUSH''@/$(GL_GNULIB_FFLUSH)/g' \ 3297 -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)
3305 -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \ 3312 -e 's/@''GNULIB_FTELL''@/$(GL_GNULIB_FTELL)/g' \
3306 -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \ 3313 -e 's/@''GNULIB_FTELLO''@/$(GL_GNULIB_FTELLO)/g' \
3307 -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \ 3314 -e 's/@''GNULIB_FWRITE''@/$(GL_GNULIB_FWRITE)/g' \
3315 -e 's/@''GNULIB_FZPRINTF''@/$(GL_GNULIB_FZPRINTF)/g' \
3308 -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \ 3316 -e 's/@''GNULIB_GETC''@/$(GL_GNULIB_GETC)/g' \
3309 -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \ 3317 -e 's/@''GNULIB_GETCHAR''@/$(GL_GNULIB_GETCHAR)/g' \
3310 -e 's/@''GNULIB_GETDELIM''@/$(GL_GNULIB_GETDELIM)/g' \ 3318 -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)
3325 -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \ 3333 -e 's/@''GNULIB_RENAMEAT''@/$(GL_GNULIB_RENAMEAT)/g' \
3326 -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \ 3334 -e 's/@''GNULIB_SCANF''@/$(GL_GNULIB_SCANF)/g' \
3327 -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \ 3335 -e 's/@''GNULIB_SNPRINTF''@/$(GL_GNULIB_SNPRINTF)/g' \
3336 -e 's/@''GNULIB_SNZPRINTF''@/$(GL_GNULIB_SNZPRINTF)/g' \
3328 -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \ 3337 -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_GNULIB_SPRINTF_POSIX)/g' \
3329 -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \ 3338 -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_GNULIB_STDIO_H_NONBLOCKING)/g' \
3330 -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \ 3339 -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_GNULIB_STDIO_H_SIGPIPE)/g' \
3340 -e 's/@''GNULIB_SZPRINTF''@/$(GL_GNULIB_SZPRINTF)/g' \
3331 -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \ 3341 -e 's/@''GNULIB_TMPFILE''@/$(GL_GNULIB_TMPFILE)/g' \
3332 -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \ 3342 -e 's/@''GNULIB_VASPRINTF''@/$(GL_GNULIB_VASPRINTF)/g' \
3333 -e 's/@''GNULIB_VAZSPRINTF''@/$(GL_GNULIB_VAZSPRINTF)/g' \ 3343 -e 's/@''GNULIB_VASZPRINTF''@/$(GL_GNULIB_VASZPRINTF)/g' \
3334 -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \ 3344 -e 's/@''GNULIB_VDPRINTF''@/$(GL_GNULIB_VDPRINTF)/g' \
3345 -e 's/@''GNULIB_VDZPRINTF''@/$(GL_GNULIB_VDZPRINTF)/g' \
3335 -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \ 3346 -e 's/@''GNULIB_VFPRINTF''@/$(GL_GNULIB_VFPRINTF)/g' \
3336 -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \ 3347 -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_GNULIB_VFPRINTF_POSIX)/g' \
3348 -e 's/@''GNULIB_VFZPRINTF''@/$(GL_GNULIB_VFZPRINTF)/g' \
3337 -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \ 3349 -e 's/@''GNULIB_VFSCANF''@/$(GL_GNULIB_VFSCANF)/g' \
3338 -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \ 3350 -e 's/@''GNULIB_VSCANF''@/$(GL_GNULIB_VSCANF)/g' \
3339 -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \ 3351 -e 's/@''GNULIB_VPRINTF''@/$(GL_GNULIB_VPRINTF)/g' \
3340 -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \ 3352 -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_GNULIB_VPRINTF_POSIX)/g' \
3341 -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \ 3353 -e 's/@''GNULIB_VSNPRINTF''@/$(GL_GNULIB_VSNPRINTF)/g' \
3354 -e 's/@''GNULIB_VSNZPRINTF''@/$(GL_GNULIB_VSNZPRINTF)/g' \
3342 -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \ 3355 -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_GNULIB_VSPRINTF_POSIX)/g' \
3343 -e 's/@''GNULIB_VZSNPRINTF''@/$(GL_GNULIB_VZSNPRINTF)/g' \ 3356 -e 's/@''GNULIB_VSZPRINTF''@/$(GL_GNULIB_VSZPRINTF)/g' \
3344 -e 's/@''GNULIB_VZSPRINTF''@/$(GL_GNULIB_VZSPRINTF)/g' \ 3357 -e 's/@''GNULIB_VZPRINTF''@/$(GL_GNULIB_VZPRINTF)/g' \
3345 -e 's/@''GNULIB_ZSNPRINTF''@/$(GL_GNULIB_ZSNPRINTF)/g' \ 3358 -e 's/@''GNULIB_ZPRINTF''@/$(GL_GNULIB_ZPRINTF)/g' \
3346 -e 's/@''GNULIB_ZSPRINTF''@/$(GL_GNULIB_ZSPRINTF)/g' \
3347 -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \ 3359 -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_GNULIB_MDA_FCLOSEALL)/g' \
3348 -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \ 3360 -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_GNULIB_MDA_FDOPEN)/g' \
3349 -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \ 3361 -e 's/@''GNULIB_MDA_FILENO''@/$(GL_GNULIB_MDA_FILENO)/g' \
diff --git a/lib/qcopy-acl.c b/lib/qcopy-acl.c
index dfc39cead05..877f42588b7 100644
--- a/lib/qcopy-acl.c
+++ b/lib/qcopy-acl.c
@@ -26,6 +26,20 @@
26#if USE_XATTR 26#if USE_XATTR
27 27
28# include <attr/libattr.h> 28# include <attr/libattr.h>
29# include <string.h>
30
31# if HAVE_LINUX_XATTR_H
32# include <linux/xattr.h>
33# endif
34# ifndef XATTR_NAME_NFSV4_ACL
35# define XATTR_NAME_NFSV4_ACL "system.nfs4_acl"
36# endif
37# ifndef XATTR_NAME_POSIX_ACL_ACCESS
38# define XATTR_NAME_POSIX_ACL_ACCESS "system.posix_acl_access"
39# endif
40# ifndef XATTR_NAME_POSIX_ACL_DEFAULT
41# define XATTR_NAME_POSIX_ACL_DEFAULT "system.posix_acl_default"
42# endif
29 43
30/* Returns 1 if NAME is the name of an extended attribute that is related 44/* Returns 1 if NAME is the name of an extended attribute that is related
31 to permissions, i.e. ACLs. Returns 0 otherwise. */ 45 to permissions, i.e. ACLs. Returns 0 otherwise. */
@@ -33,7 +47,12 @@
33static int 47static int
34is_attr_permissions (const char *name, struct error_context *ctx) 48is_attr_permissions (const char *name, struct error_context *ctx)
35{ 49{
36 return attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS; 50 /* We need to explicitly test for the known extended attribute names,
51 because at least on CentOS 7, attr_copy_action does not do it. */
52 return strcmp (name, XATTR_NAME_POSIX_ACL_ACCESS) == 0
53 || strcmp (name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0
54 || strcmp (name, XATTR_NAME_NFSV4_ACL) == 0
55 || attr_copy_action (name, ctx) == ATTR_ACTION_PERMISSIONS;
37} 56}
38 57
39#endif /* USE_XATTR */ 58#endif /* USE_XATTR */
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index cf2d8c999bc..38572382d46 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -280,7 +280,26 @@
280#endif 280#endif
281 281
282 282
283#if @GNULIB_DZPRINTF@
284/* Prints formatted output to file descriptor FD.
285 Returns the number of bytes written to the file descriptor. Upon
286 failure, returns -1 with errno set.
287 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
288 Therefore, if the format string is valid and does not use %ls/%lc
289 directives nor widths, the only possible failure codes are ENOMEM
290 and the possible failure codes from write(), excluding EINTR. */
291_GL_FUNCDECL_SYS (dzprintf, off64_t,
292 (int fd, const char *restrict format, ...)
293 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
294 _GL_ARG_NONNULL ((2)));
295_GL_CXXALIAS_SYS (dzprintf, off64_t,
296 (int fd, const char *restrict format, ...));
297#endif
298
283#if @GNULIB_DPRINTF@ 299#if @GNULIB_DPRINTF@
300/* Prints formatted output to file descriptor FD.
301 Returns the number of bytes written to the file descriptor. Upon
302 failure, returns a negative value. */
284# if @REPLACE_DPRINTF@ 303# if @REPLACE_DPRINTF@
285# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 304# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
286# define dprintf rpl_dprintf 305# define dprintf rpl_dprintf
@@ -547,7 +566,26 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX complian
547# endif 566# endif
548#endif 567#endif
549 568
569#if @GNULIB_FZPRINTF@
570/* Prints formatted output to stream FP.
571 Returns the number of bytes written to the stream. Upon failure,
572 returns -1 with the stream's error indicator set.
573 Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
574 Therefore, if the format string is valid and does not use %ls/%lc
575 directives nor widths, the only possible failure causes are ENOMEM
576 and the possible failure causes from fwrite(). */
577_GL_FUNCDECL_SYS (fzprintf, off64_t,
578 (FILE *restrict fp, const char *restrict format, ...)
579 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
580 _GL_ARG_NONNULL ((1, 2)));
581_GL_CXXALIAS_SYS (fzprintf, off64_t,
582 (FILE *restrict fp, const char *restrict format, ...));
583#endif
584
550#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@ 585#if @GNULIB_FPRINTF_POSIX@ || @GNULIB_FPRINTF@
586/* Prints formatted output to stream FP.
587 Returns the number of bytes written to the stream. Upon failure,
588 returns a negative value with the stream's error indicator set. */
551# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \ 589# if (@GNULIB_FPRINTF_POSIX@ && @REPLACE_FPRINTF@) \
552 || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) 590 || (@GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
553# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 591# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1227,7 +1265,24 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
1227# endif 1265# endif
1228#endif 1266#endif
1229 1267
1268#if @GNULIB_ZPRINTF@
1269/* Prints formatted output to standard output.
1270 Returns the number of bytes written to standard output. Upon failure,
1271 returns -1 with stdout's error indicator set.
1272 Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
1273 Therefore, if the format string is valid and does not use %ls/%lc
1274 directives nor widths, the only possible failure causes are ENOMEM
1275 and the possible failure causes from fwrite(). */
1276_GL_FUNCDECL_SYS (zprintf, off64_t, (const char *restrict format, ...)
1277 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
1278 _GL_ARG_NONNULL ((1)));
1279_GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...));
1280#endif
1281
1230#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ 1282#if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
1283/* Prints formatted output to standard output.
1284 Returns the number of bytes written to standard output. Upon failure,
1285 returns a negative value with stdout's error indicator set. */
1231# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ 1286# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
1232 || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) 1287 || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1233# if defined __GNUC__ || defined __clang__ 1288# if defined __GNUC__ || defined __clang__
@@ -1459,7 +1514,7 @@ _GL_CXXALIASWARN (scanf);
1459# endif 1514# endif
1460#endif 1515#endif
1461 1516
1462#if @GNULIB_ZSNPRINTF@ 1517#if @GNULIB_SNZPRINTF@
1463/* Prints formatted output to string STR. Similar to sprintf, but the 1518/* Prints formatted output to string STR. Similar to sprintf, but the
1464 additional parameter SIZE limits how much is written into STR. 1519 additional parameter SIZE limits how much is written into STR.
1465 STR may be NULL, in which case nothing will be written. 1520 STR may be NULL, in which case nothing will be written.
@@ -1468,12 +1523,12 @@ _GL_CXXALIASWARN (scanf);
1468 Failure code EOVERFLOW can only occur when a width > INT_MAX is used. 1523 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
1469 Therefore, if the format string is valid and does not use %ls/%lc 1524 Therefore, if the format string is valid and does not use %ls/%lc
1470 directives nor widths, the only possible failure code is ENOMEM. */ 1525 directives nor widths, the only possible failure code is ENOMEM. */
1471_GL_FUNCDECL_SYS (zsnprintf, ptrdiff_t, 1526_GL_FUNCDECL_SYS (snzprintf, ptrdiff_t,
1472 (char *restrict str, size_t size, 1527 (char *restrict str, size_t size,
1473 const char *restrict format, ...) 1528 const char *restrict format, ...)
1474 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) 1529 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
1475 _GL_ARG_NONNULL ((3))); 1530 _GL_ARG_NONNULL ((3)));
1476_GL_CXXALIAS_SYS (zsnprintf, ptrdiff_t, 1531_GL_CXXALIAS_SYS (snzprintf, ptrdiff_t,
1477 (char *restrict str, size_t size, 1532 (char *restrict str, size_t size,
1478 const char *restrict format, ...)); 1533 const char *restrict format, ...));
1479#endif 1534#endif
@@ -1520,19 +1575,19 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
1520# endif 1575# endif
1521#endif 1576#endif
1522 1577
1523#if @GNULIB_ZSPRINTF@ 1578#if @GNULIB_SZPRINTF@
1524/* Prints formatted output to string STR. 1579/* Prints formatted output to string STR.
1525 Returns the string length of the formatted string. Upon failure, 1580 Returns the string length of the formatted string. Upon failure,
1526 returns -1 with errno set. 1581 returns -1 with errno set.
1527 Failure code EOVERFLOW can only occur when a width > INT_MAX is used. 1582 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
1528 Therefore, if the format string is valid and does not use %ls/%lc 1583 Therefore, if the format string is valid and does not use %ls/%lc
1529 directives nor widths, the only possible failure code is ENOMEM. */ 1584 directives nor widths, the only possible failure code is ENOMEM. */
1530_GL_FUNCDECL_SYS (zsprintf, ptrdiff_t, 1585_GL_FUNCDECL_SYS (szprintf, ptrdiff_t,
1531 (char *restrict str, 1586 (char *restrict str,
1532 const char *restrict format, ...) 1587 const char *restrict format, ...)
1533 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) 1588 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
1534 _GL_ARG_NONNULL ((1, 2))); 1589 _GL_ARG_NONNULL ((1, 2)));
1535_GL_CXXALIAS_SYS (zsprintf, ptrdiff_t, 1590_GL_CXXALIAS_SYS (szprintf, ptrdiff_t,
1536 (char *restrict str, 1591 (char *restrict str,
1537 const char *restrict format, ...)); 1592 const char *restrict format, ...));
1538#endif 1593#endif
@@ -1629,7 +1684,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
1629# endif 1684# endif
1630#endif 1685#endif
1631 1686
1632#if @GNULIB_VAZSPRINTF@ 1687#if @GNULIB_VASZPRINTF@
1633/* Prints formatted output to a string dynamically allocated with malloc(). 1688/* Prints formatted output to a string dynamically allocated with malloc().
1634 If the memory allocation succeeds, it stores the address of the string in 1689 If the memory allocation succeeds, it stores the address of the string in
1635 *RESULT and returns the number of resulting bytes, excluding the trailing 1690 *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 - "
1638 Failure code EOVERFLOW can only occur when a width > INT_MAX is used. 1693 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
1639 Therefore, if the format string is valid and does not use %ls/%lc 1694 Therefore, if the format string is valid and does not use %ls/%lc
1640 directives nor widths, the only possible failure code is ENOMEM. */ 1695 directives nor widths, the only possible failure code is ENOMEM. */
1641_GL_FUNCDECL_SYS (azsprintf, ptrdiff_t, 1696_GL_FUNCDECL_SYS (aszprintf, ptrdiff_t,
1642 (char **result, const char *format, ...) 1697 (char **result, const char *format, ...)
1643 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) 1698 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
1644 _GL_ARG_NONNULL ((1, 2))); 1699 _GL_ARG_NONNULL ((1, 2)));
1645_GL_CXXALIAS_SYS (azsprintf, ptrdiff_t, 1700_GL_CXXALIAS_SYS (aszprintf, ptrdiff_t,
1646 (char **result, const char *format, ...)); 1701 (char **result, const char *format, ...));
1647_GL_FUNCDECL_SYS (vazsprintf, ptrdiff_t, 1702_GL_FUNCDECL_SYS (vaszprintf, ptrdiff_t,
1648 (char **result, const char *format, va_list args) 1703 (char **result, const char *format, va_list args)
1649 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) 1704 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1650 _GL_ARG_NONNULL ((1, 2))); 1705 _GL_ARG_NONNULL ((1, 2)));
1651_GL_CXXALIAS_SYS (vazsprintf, ptrdiff_t, 1706_GL_CXXALIAS_SYS (vaszprintf, ptrdiff_t,
1652 (char **result, const char *format, va_list args)); 1707 (char **result, const char *format, va_list args));
1653#endif 1708#endif
1654 1709
@@ -1703,7 +1758,26 @@ _GL_CXXALIAS_SYS (vasprintf, int,
1703_GL_CXXALIASWARN (vasprintf); 1758_GL_CXXALIASWARN (vasprintf);
1704#endif 1759#endif
1705 1760
1761#if @GNULIB_VDZPRINTF@
1762/* Prints formatted output to file descriptor FD.
1763 Returns the number of bytes written to the file descriptor. Upon
1764 failure, returns -1 with errno set.
1765 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
1766 Therefore, if the format string is valid and does not use %ls/%lc
1767 directives nor widths, the only possible failure codes are ENOMEM
1768 and the possible failure codes from write(), excluding EINTR. */
1769_GL_FUNCDECL_SYS (vdzprintf, off64_t,
1770 (int fd, const char *restrict format, va_list args)
1771 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1772 _GL_ARG_NONNULL ((2)));
1773_GL_CXXALIAS_SYS (vdzprintf, off64_t,
1774 (int fd, const char *restrict format, va_list args));
1775#endif
1776
1706#if @GNULIB_VDPRINTF@ 1777#if @GNULIB_VDPRINTF@
1778/* Prints formatted output to file descriptor FD.
1779 Returns the number of bytes written to the file descriptor. Upon
1780 failure, returns a negative value. */
1707# if @REPLACE_VDPRINTF@ 1781# if @REPLACE_VDPRINTF@
1708# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1782# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
1709# define vdprintf rpl_vdprintf 1783# define vdprintf rpl_vdprintf
@@ -1737,7 +1811,28 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
1737# endif 1811# endif
1738#endif 1812#endif
1739 1813
1814#if @GNULIB_VFZPRINTF@
1815/* Prints formatted output to stream FP.
1816 Returns the number of bytes written to the stream. Upon failure,
1817 returns -1 with the stream's error indicator set.
1818 Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
1819 Therefore, if the format string is valid and does not use %ls/%lc
1820 directives nor widths, the only possible failure causes are ENOMEM
1821 and the possible failure causes from fwrite(). */
1822_GL_FUNCDECL_SYS (vfzprintf, off64_t,
1823 (FILE *restrict fp,
1824 const char *restrict format, va_list args)
1825 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1826 _GL_ARG_NONNULL ((1, 2)));
1827_GL_CXXALIAS_SYS (vfzprintf, off64_t,
1828 (FILE *restrict fp,
1829 const char *restrict format, va_list args));
1830#endif
1831
1740#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@ 1832#if @GNULIB_VFPRINTF_POSIX@ || @GNULIB_VFPRINTF@
1833/* Prints formatted output to stream FP.
1834 Returns the number of bytes written to the stream. Upon failure,
1835 returns a negative value with the stream's error indicator set. */
1741# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \ 1836# if (@GNULIB_VFPRINTF_POSIX@ && @REPLACE_VFPRINTF@) \
1742 || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) 1837 || (@GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1743# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1838# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1806,7 +1901,25 @@ _GL_CXXALIASWARN (vfscanf);
1806# endif 1901# endif
1807#endif 1902#endif
1808 1903
1904#if @GNULIB_VZPRINTF@
1905/* Prints formatted output to standard output.
1906 Returns the number of bytes written to standard output. Upon failure,
1907 returns -1 with stdout's error indicator set.
1908 Failure cause EOVERFLOW can only occur when a width > INT_MAX is used.
1909 Therefore, if the format string is valid and does not use %ls/%lc
1910 directives nor widths, the only possible failure causes are ENOMEM
1911 and the possible failure causes from fwrite(). */
1912_GL_FUNCDECL_SYS (vzprintf, off64_t, (const char *restrict format, va_list args)
1913 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
1914 _GL_ARG_NONNULL ((1)));
1915_GL_CXXALIAS_SYS (vzprintf, off64_t,
1916 (const char *restrict format, va_list args));
1917#endif
1918
1809#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@ 1919#if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
1920/* Prints formatted output to standard output.
1921 Returns the number of bytes written to standard output. Upon failure,
1922 returns a negative value with stdout's error indicator set. */
1810# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \ 1923# if (@GNULIB_VPRINTF_POSIX@ && @REPLACE_VPRINTF@) \
1811 || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) 1924 || (@GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
1812# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 1925# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1862,7 +1975,7 @@ _GL_CXXALIASWARN (vscanf);
1862# endif 1975# endif
1863#endif 1976#endif
1864 1977
1865#if @GNULIB_VZSNPRINTF@ 1978#if @GNULIB_VSNZPRINTF@
1866/* Prints formatted output to string STR. Similar to sprintf, but the 1979/* Prints formatted output to string STR. Similar to sprintf, but the
1867 additional parameter SIZE limits how much is written into STR. 1980 additional parameter SIZE limits how much is written into STR.
1868 STR may be NULL, in which case nothing will be written. 1981 STR may be NULL, in which case nothing will be written.
@@ -1871,12 +1984,12 @@ _GL_CXXALIASWARN (vscanf);
1871 Failure code EOVERFLOW can only occur when a width > INT_MAX is used. 1984 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
1872 Therefore, if the format string is valid and does not use %ls/%lc 1985 Therefore, if the format string is valid and does not use %ls/%lc
1873 directives nor widths, the only possible failure code is ENOMEM. */ 1986 directives nor widths, the only possible failure code is ENOMEM. */
1874_GL_FUNCDECL_SYS (vzsnprintf, ptrdiff_t, 1987_GL_FUNCDECL_SYS (vsnzprintf, ptrdiff_t,
1875 (char *restrict str, size_t size, 1988 (char *restrict str, size_t size,
1876 const char *restrict format, va_list args) 1989 const char *restrict format, va_list args)
1877 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) 1990 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
1878 _GL_ARG_NONNULL ((3))); 1991 _GL_ARG_NONNULL ((3)));
1879_GL_CXXALIAS_SYS (vzsnprintf, ptrdiff_t, 1992_GL_CXXALIAS_SYS (vsnzprintf, ptrdiff_t,
1880 (char *restrict str, size_t size, 1993 (char *restrict str, size_t size,
1881 const char *restrict format, va_list args)); 1994 const char *restrict format, va_list args));
1882#endif 1995#endif
@@ -1923,19 +2036,19 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
1923# endif 2036# endif
1924#endif 2037#endif
1925 2038
1926#if @GNULIB_VZSPRINTF@ 2039#if @GNULIB_VSZPRINTF@
1927/* Prints formatted output to string STR. 2040/* Prints formatted output to string STR.
1928 Returns the string length of the formatted string. Upon failure, 2041 Returns the string length of the formatted string. Upon failure,
1929 returns -1 with errno set. 2042 returns -1 with errno set.
1930 Failure code EOVERFLOW can only occur when a width > INT_MAX is used. 2043 Failure code EOVERFLOW can only occur when a width > INT_MAX is used.
1931 Therefore, if the format string is valid and does not use %ls/%lc 2044 Therefore, if the format string is valid and does not use %ls/%lc
1932 directives nor widths, the only possible failure code is ENOMEM. */ 2045 directives nor widths, the only possible failure code is ENOMEM. */
1933_GL_FUNCDECL_SYS (vzsprintf, ptrdiff_t, 2046_GL_FUNCDECL_SYS (vszprintf, ptrdiff_t,
1934 (char *restrict str, 2047 (char *restrict str,
1935 const char *restrict format, va_list args) 2048 const char *restrict format, va_list args)
1936 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) 2049 _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
1937 _GL_ARG_NONNULL ((1, 2))); 2050 _GL_ARG_NONNULL ((1, 2)));
1938_GL_CXXALIAS_SYS (vzsprintf, ptrdiff_t, 2051_GL_CXXALIAS_SYS (vszprintf, ptrdiff_t,
1939 (char *restrict str, 2052 (char *restrict str,
1940 const char *restrict format, va_list args)); 2053 const char *restrict format, va_list args));
1941#endif 2054#endif
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index cfc69d0a506..e42368eef27 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -20,9 +20,18 @@
20#endif 20#endif
21@PRAGMA_COLUMNS@ 21@PRAGMA_COLUMNS@
22 22
23#if defined __need_system_stdlib_h || defined __need_malloc_and_calloc 23#if (defined __need_system_stdlib_h && !defined _GLIBCXX_STDLIB_H) || defined __need_malloc_and_calloc
24/* Special invocation conventions inside some gnulib header files, 24/* Special invocation conventions inside some gnulib header files,
25 and inside some glibc header files, respectively. */ 25 and inside some glibc header files, respectively.
26 Do not recognize this special invocation convention when GCC's
27 c++/11/stdlib.h is being included or has been included. This is needed
28 to support the use of clang+llvm binaries on Ubuntu 22.04 with
29 CXX="$clangdir/bin/clang++ -I/usr/include/c++/11 \
30 -I/usr/include/x86_64-linux-gnu/c++/11
31 -L/usr/lib/gcc/x86_64-linux-gnu/11
32 -Wl,-rpath,$clangdir/lib"
33 because in this case /usr/include/c++/11/stdlib.h (which does not support
34 the convention) is seen before the gnulib-generated stdlib.h. */
26 35
27#@INCLUDE_NEXT@ @NEXT_STDLIB_H@ 36#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
28 37
@@ -108,6 +117,17 @@ struct random_data
108# include <unistd.h> 117# include <unistd.h>
109#endif 118#endif
110 119
120#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
121/* When strtol, strtoll, strtoul, or strtoull is going to be defined as a macro
122 below, this may cause compilation errors later in the libstdc++ header files
123 (that are part of GCC), such as:
124 error: 'rpl_strtol' is not a member of 'std'
125 To avoid this, include the relevant header files here, before these symbols
126 get defined as macros. But do so only on Solaris 11 (where it is needed),
127 not on mingw (where it would cause other compilation errors). */
128# include <string>
129#endif
130
111/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers 131/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
112 that can be freed by passing them as the Ith argument to the 132 that can be freed by passing them as the Ith argument to the
113 function F. */ 133 function F. */
diff --git a/m4/acl.m4 b/m4/acl.m4
index c7b6ec2b14e..be88f1b8313 100644
--- a/m4/acl.m4
+++ b/m4/acl.m4
@@ -1,5 +1,5 @@
1# acl.m4 1# acl.m4
2# serial 30 2# serial 31
3dnl Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -178,13 +178,14 @@ AC_DEFUN([gl_ACL_GET_FILE],
178 AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2]) 178 AS_IF([test "$gl_cv_func_working_acl_get_file" != no], [$1], [$2])
179]) 179])
180 180
181# On GNU/Linux, testing if a file has an acl can be done with the 181# Prerequisites of module file-has-acl.
182# listxattr and getxattr syscalls, which don't require linking
183# against additional libraries. Assume this works if linux/attr.h
184# and listxattr are present.
185AC_DEFUN([gl_FILE_HAS_ACL], 182AC_DEFUN([gl_FILE_HAS_ACL],
186[ 183[
187 AC_REQUIRE([gl_FUNC_ACL_ARG]) 184 AC_REQUIRE([gl_FUNC_ACL_ARG])
185 # On GNU/Linux, testing if a file has an acl can be done with the
186 # listxattr and getxattr syscalls, which don't require linking
187 # against additional libraries. Assume this works if linux/attr.h
188 # and listxattr are present.
188 AC_CHECK_HEADERS_ONCE([linux/xattr.h]) 189 AC_CHECK_HEADERS_ONCE([linux/xattr.h])
189 AC_CHECK_FUNCS_ONCE([listxattr]) 190 AC_CHECK_FUNCS_ONCE([listxattr])
190 FILE_HAS_ACL_LIB= 191 FILE_HAS_ACL_LIB=
@@ -198,3 +199,17 @@ AC_DEFUN([gl_FILE_HAS_ACL],
198 FILE_HAS_ACL_LIB=$LIB_ACL]) 199 FILE_HAS_ACL_LIB=$LIB_ACL])
199 AC_SUBST([FILE_HAS_ACL_LIB]) 200 AC_SUBST([FILE_HAS_ACL_LIB])
200]) 201])
202
203# Prerequisites of module qcopy-acl.
204AC_DEFUN([gl_QCOPY_ACL],
205[
206 AC_REQUIRE([gl_FUNC_ACL])
207 AC_CHECK_HEADERS_ONCE([linux/xattr.h])
208 gl_FUNC_XATTR
209 if test "$use_xattr" = yes; then
210 QCOPY_ACL_LIB="$LIB_XATTR"
211 else
212 QCOPY_ACL_LIB="$LIB_ACL"
213 fi
214 AC_SUBST([QCOPY_ACL_LIB])
215])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 6c49edac932..79a0f27382a 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -478,14 +478,7 @@ AC_DEFUN([gl_INIT],
478 gl_PREREQ_PTHREAD_SIGMASK 478 gl_PREREQ_PTHREAD_SIGMASK
479 ]) 479 ])
480 gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) 480 gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
481 gl_FUNC_XATTR 481 gl_QCOPY_ACL
482 AC_REQUIRE([gl_FUNC_ACL])
483 if test "$use_xattr" = yes; then
484 QCOPY_ACL_LIB="$LIB_XATTR"
485 else
486 QCOPY_ACL_LIB="$LIB_ACL"
487 fi
488 AC_SUBST([QCOPY_ACL_LIB])
489 gl_FUNC_READLINK 482 gl_FUNC_READLINK
490 gl_CONDITIONAL([GL_COND_OBJ_READLINK], 483 gl_CONDITIONAL([GL_COND_OBJ_READLINK],
491 [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1]) 484 [test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1])
diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 14bc5041eaa..5b0baee2057 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -1,5 +1,5 @@
1# manywarnings.m4 1# manywarnings.m4
2# serial 26 2# serial 27
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,6 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
141 -Wsuggest-final-methods \ 141 -Wsuggest-final-methods \
142 -Wsuggest-final-types \ 142 -Wsuggest-final-types \
143 -Wsync-nand \ 143 -Wsync-nand \
144 -Wsystem-headers \
145 -Wtrampolines \ 144 -Wtrampolines \
146 -Wuninitialized \ 145 -Wuninitialized \
147 -Wunknown-pragmas \ 146 -Wunknown-pragmas \
diff --git a/m4/memmem.m4 b/m4/memmem.m4
index a9bc277813b..e6b1d91cbb1 100644
--- a/m4/memmem.m4
+++ b/m4/memmem.m4
@@ -1,5 +1,5 @@
1# memmem.m4 1# memmem.m4
2# serial 29 2# serial 30
3dnl Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -102,7 +102,7 @@ static void quit (int sig) { _exit (sig + 128); }
102 char *haystack = (char *) malloc (2 * m + 1); 102 char *haystack = (char *) malloc (2 * m + 1);
103 char *needle = (char *) malloc (m + 1); 103 char *needle = (char *) malloc (m + 1);
104 /* Failure to compile this test due to missing alarm is okay, 104 /* Failure to compile this test due to missing alarm is okay,
105 since all such platforms (mingw) also lack memmem. */ 105 since all such platforms (mingw, MSVC) also lack memmem. */
106 signal (SIGALRM, quit); 106 signal (SIGALRM, quit);
107 alarm (5); 107 alarm (5);
108 /* Check for quadratic performance. */ 108 /* Check for quadratic performance. */
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index 10e1fbb8aa9..ec52ae92ff4 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -1,5 +1,5 @@
1# stdio_h.m4 1# stdio_h.m4
2# serial 69 2# serial 75
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
@@ -133,6 +133,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
133[ 133[
134 m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [ 134 m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
135 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF]) 135 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
136 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DZPRINTF])
136 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE]) 137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN]) 138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH]) 139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
@@ -153,6 +154,7 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
153 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL]) 154 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
154 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO]) 155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE]) 156 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
157 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FZPRINTF])
156 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC]) 158 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
157 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR]) 159 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
158 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM]) 160 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
@@ -173,25 +175,29 @@ AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
173 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT]) 175 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
174 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF]) 176 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
175 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF]) 177 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
178 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNZPRINTF])
176 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX]) 179 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
177 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING]) 180 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
178 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE]) 181 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
182 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SZPRINTF])
179 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE]) 183 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
180 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF]) 184 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
181 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VAZSPRINTF]) 185 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASZPRINTF])
182 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF]) 186 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
183 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF]) 187 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
184 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF]) 188 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
189 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDZPRINTF])
185 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF]) 190 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
186 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX]) 191 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
192 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFZPRINTF])
187 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF]) 193 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
188 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX]) 194 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
189 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF]) 195 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
196 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNZPRINTF])
190 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX]) 197 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
191 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSNPRINTF]) 198 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSZPRINTF])
192 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZSPRINTF]) 199 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VZPRINTF])
193 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSNPRINTF]) 200 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZPRINTF])
194 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ZSPRINTF])
195 dnl Support Microsoft deprecated alias function names by default. 201 dnl Support Microsoft deprecated alias function names by default.
196 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1]) 202 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
197 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1]) 203 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index b4d2778524e..83a75c0c327 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,11 +1,60 @@
1# strnlen.m4 1# strnlen.m4
2# serial 14 2# serial 15
3dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, 3dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation,
4dnl Inc. 4dnl Inc.
5dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved. 7dnl with or without modifications, as long as this notice is preserved.
8 8
9m4_version_prereq([2.73], [], [
10# Replace AC_FUNC_STRNLEN from Autoconf 2.72 and earlier,
11# which does not check for Android strnlen bugs.
12
13AC_DEFUN([AC_FUNC_STRNLEN],
14[AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl
15AC_CACHE_CHECK([for working strnlen], [ac_cv_func_strnlen_working],
16[AC_RUN_IFELSE(
17 [AC_LANG_PROGRAM(
18 [AC_INCLUDES_DEFAULT
19 [/* Use pstrnlen to test; 'volatile' prevents the compiler
20 from optimizing the strnlen calls away. */
21 size_t (*volatile pstrnlen) (char const *, size_t) = strnlen;
22 char const s[] = "foobar";
23 int s_len = sizeof s - 1;
24 ]],
25 [[
26 /* AIX 4.3 is buggy: strnlen (S, 1) == 3. */
27 int i;
28 for (i = 0; i < s_len + 1; ++i)
29 {
30 int expected = i <= s_len ? i : s_len;
31 if (pstrnlen (s, i) != expected)
32 return 1;
33 }
34
35 /* Android 5.0 (API 21) strnlen ("", SIZE_MAX) incorrectly crashes. */
36 if (pstrnlen ("", -1) != 0)
37 return 1;]])],
38 [ac_cv_func_strnlen_working=yes],
39 [ac_cv_func_strnlen_working=no],
40 [AC_COMPILE_IFELSE(
41 [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
42 [[#if defined _AIX && !defined _AIX51
43 #error "AIX pre 5.1 is buggy"
44 #endif
45 #ifdef __ANDROID__
46 #include <android/api-level.h>
47 #if __ANDROID_API__ < 22
48 #error "Android API < 22 is buggy"
49 #endif
50 #endif
51 ]])],
52 [ac_cv_func_strnlen_working=yes],
53 [ac_cv_func_strnlen_working=no])])])
54test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen])
55])# AC_FUNC_STRNLEN
56])
57
9AC_DEFUN([gl_FUNC_STRNLEN], 58AC_DEFUN([gl_FUNC_STRNLEN],
10[ 59[
11 AC_REQUIRE([gl_STRING_H_DEFAULTS]) 60 AC_REQUIRE([gl_STRING_H_DEFAULTS])