2025-01-17  Pádraig Brady  <P@draigBrady.com>

	version 9.6
	* NEWS: Record release date.

	build: update gnulib submodule to latest
	Mainly to avoid make dist-check failure with --disable-nls

2025-01-16  Bruno Haible  <bruno@clisp.org>

	build: fix compilation error on CentOS 8 Stream
	* configure.ac (USE_AVX512_CRC32): Set to false if the function
	_mm512_set_epi8 does not exist.

2025-01-16  Pádraig Brady  <P@draigBrady.com>

	tests: tail-c.sh: avoid failure on Linux kernels <= 2
	tests/tail/tail-c.sh: Exclude older kernels from timeout failure.

2025-01-16  Bruno Haible  <bruno@clisp.org>

	ls: Fix compilation error on CentOS 6
	* src/ls.c (XATTR_NAME_CAPS): Define fallback.

2025-01-16  Paul Eggert  <eggert@cs.ucla.edu>

	sort: fix --debug buffer overrun
	* src/sort.c (debug_key): Fix undefined behavior when a key ends
	before it starts.  Problem reported by Bruno Haible
	<https://bugs.gnu.org/75606>.

2025-01-16  Pádraig Brady  <P@draigBrady.com>

	tests: avoid false failure with replaced readdir
	* tests/rm/rm-readdir-fail.sh: Simulate EIO rather than ENOENT,
	as gnulib absorbs the latter since commit 5a2d28df.

	ls: suppress ENOTSUP errors on virtiofs
	* gnulib: Update to latest to pick up commit caf76886.
	* NEWS: Mention the bug fix.

2025-01-15  Pádraig Brady  <P@draigBrady.com>

	tests: misc/write-errors.sh: increase memory limit
	* tests/head/head-c.sh: Use a larger VM limit to avoid
	mem allocation failures, which were seen on CheriBSD.

	tests: head: avoid false failure on some systems
	* tests/head/head-c.sh: Pass a more similar operation
	to get_min_ulimit_v_, so we get a more appropriate limit.
	This was seen to be significant with CheriBSD.

	yes: avoid failure on CHERI protected systems
	* src/yes.c (main): Don't reuse the argv array as CHERI's
	capability bounds do not allow for that, failing like:
	  $ yes $(seq 156) | head -n1
	  In-address space security exception (core dumped)

2025-01-15  Pádraig Brady  <P@draigBrady.com>

	tac: avoid out of bounds access
	This was flagged on CheriBSD on ARM Morello with the error:
	"In-address space security exception (core dumped)"
	triggered with: tac -s '' /dev/null

	* src/tac.c (main): Ensure we don't read beyond the
	end of the supplied optarg.

2025-01-15  Pádraig Brady  <P@draigBrady.com>

	tests: avoid ERRORs with no mntent.h
	* tests/df/skip-duplicates.sh: Just skip this test if we fail
	to build the shared lib.  This fails on Solaris 11 at least
	due to no HAVE_MNTENT_H.  Note HAVE_SYS_MNTENT_H does not
	suffice for this wrapper code.
	* tests/df/no-mtab-status.sh: Likewise.

	tests: avoid false failure with many mountpoints
	* tests/ls/readdir-mountpoint-inode.sh: Only take the first 64.

	tests: printf: avoid false failure
	* tests/printf/printf-surprise.sh: Increase the VM limit
	to avoid false failures in rare cases.

	tests: avoid slow ulimit -v behavior
	* init.cfg (ulimit_supported_): skip_ if the ulimit -v
	takes too long, which was seen with bash 5.2 on Solaris 11,
	where fork() returned EAGAIN under memory constraints,
	and bash retried for about 16 seconds.
	(get_min_ulimit_v_): Break early if skipped.
	* tests/misc/write-errors.sh: Be more conservative and
	skip on failure to determine min ulimit.

	tests: use more portable timeout presence check
	* init.cfg: timeout(1) on FreeBSD doesn't support --version
	(or --help with success status), so use syntax compatible
	with both FreeBSD and GNU.

	tests: tail: avoid failure on Solaris 11
	* tests/tail/tail-c.sh: On Solaris 11, tail -c 4096 /dev/urandom,
	will induce an lseek(,-4096,SEEK_END) which returns -4096 without
	setting errno, and a subsequent read() then gives EINVAL.
	Since tailing the end of a psuedo device is an edge case,
	we just verify that we don't spin reading the device forever.

	maint: avoid syntax-check failure
	* src/cksum.c: Use spaces to indent, not tabs.

2025-01-15  Paul Eggert  <eggert@cs.ucla.edu>

	cksum: port to Oracle Developer Studio 12.6
	* src/cksum.c (cksum_fp_t): New typedef.
	(pclmul_supported, avx2_supported, avx512_supported)
	(vmull_supported): Return this new type instead of bool.
	All callers changed.  That way, callers do not need to
	refer to functions like cksum_avx512 that might not
	exist on this platform.  Although GCC optimizes such
	references away, the C standard does not require this
	optimization.

	build: update gnulib submodule to latest

2025-01-14  Collin Funk  <collin.funk1@gmail.com>

	tests: env-S.pl: unset GNU/Hurd env vars
	* tests/misc/env-S.pl: Unset LD_ORIGIN_PATH.

2025-01-13  Paul Eggert  <eggert@cs.ucla.edu>

	ls: readdir errno fixes
	* src/ls.c (print_dir): Fix bug: file_failure can set errno to
	something other than EOVERFLOW but the code assumed it didn’t.
	Also, omit ENOENT bug workaround with glibc 2.3 and later,
	for consistency with Gnulib.

2025-01-13  Pádraig Brady  <P@draigBrady.com>

	tail: fix regression in open() flags used
	* src/tail.c (tail_file): Fix precedence issue introduced
	in commit v9.5-231-g177fcec66 so that we pass correct flags to open().
	Effectively this meant we would have dropped the O_BINARY flag
	on windows, since O_RDONLY is generally 0.
	Issue spotted by coverity.

	build: update to latest gnulib
	Ensure WCOREDUMP is always defined,
	and ensure --enable-silent-rules is honored with crc code generation.

2025-01-12  Pádraig Brady  <P@draigBrady.com>

	all: fix program name with --enable-single-binary=shebangs
	* gnulib: Pick up gnulib commit f11caad4fd which ensures
	we diagnose the actual utility name, and not just "coreutils"
	when in single binary mode.  This adjustment is required
	since gnulib commit 959152ba37 which enforced use of gnulib's
	error() once verror is used, and gnulib's error() always
	outputs the base name of the command, which the new gnulib
	commit now keeps up to date.

	tests: make misc/write-errors.sh immune to default signal disposition
	* tests/misc/write-errors.sh: Reset SIGPIPE to the default (terminate)
	disposition, so that the test doesn't erroneously fail due to an
	ignored SIGPIPE in the test environment.

2025-01-11  Pádraig Brady  <P@draigBrady.com>

	ls: fix inaccurate indication of ACLs on NFS
	* gnulib: Update to latest to pick up gnulib commit 05c63bc908
	which ensures accurate determination of the presence of NFSv4 ACLs.
	* NEWS: Adjust accordingly.
	Related to https://bugs.gnu.org/74692

2025-01-10  Pádraig Brady  <P@draigBrady.com>

	csplit: avoid extraenous output files given empty input
	* src/csplit.c (get_first_line_in_buffer): Don't exit here
	upon empty input, rather indicate no input in the return
	to let callers handle in a more consistent fashion.
	* NEWS: Mention the bug fix.
	* tests/csplit/csplit.sh: Add a test case.
	Reported by Daniel Hofstetter.

2025-01-10  Pádraig Brady  <P@draigBrady.com>

	ls: suppress "Permission denied" errors on NFS
	NFS (on Linux 6.12 at least) was seen to return EACCES
	from listxattr() for files without read access.
	We started using listxattr() in coreutils 9.4.

	* src/ls.c (gobble_file): Map EACCES from file_has_aclinfo()
	to '?', rather than displaying the error.
	* doc/coreutils.texi (ls invocation): Document the '?' flag.
	* NEWS: Mention the bug fix.
	Addresses https://bugs.gnu.org/74692

2025-01-10  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest

2025-01-08  Paul Eggert  <eggert@cs.ucla.edu>

	ls: update comment
	* src/ls.c (file_has_aclinfo_cache): Fix comment.

2025-01-08  Pádraig Brady  <P@draigBrady.com>

	tail: honor --pid with fifos
	* src/tail.c (tail_file): Open files with O_NONBLOCK
	if we might need async processing.
	(pipe_bytes): Ignore EAGAIN read() errors.
	(pipe_lines): Likewise.
	* tests/tail/pid-pipe.sh: Add a new test.
	* tests/local.mk: Reference the new test.
	* NEWS: Mention the bug fix.
	Reported by Berhard Voelker.

2025-01-07  Pádraig Brady  <P@draigBrady.com>

	cp,mv: decouple --update from -f,-i,-n options
	* src/copy.h: Change update member from bool to enum.
	* src/copy.c: s/interactive == I_ALWAYS_NO/update == UPDATE_NONE_FAIL/;
	              s/interactive == I_ALWAYS_SKIP/update == UPDATE_NONE/;
	              s/update/update == UPDATE_OLDER/;
	* src/install.c: Init with UPDATE_ALL, rather than false.
	* src/cp.c: Likewise.  Simply parse -f,-i,-n to x.interactive,
	and parse --update to x.update.
	* src/mv.c: Likewise.
	* tests/cp/cp-i.sh: Add a test case where -n --update -i
	honors the --update option, which would previously have been
	ignored due to the preceding -n.

2025-01-06  Pádraig Brady  <P@draigBrady.com>

	cp,mv: ensure -i,f are not overridden by -u
	Since coreutils 9.3 we had --update={all,older} override -i.
	In coreutils 9.5 this was expanded to -u
	(to make it consistent with --update=older).

	This patch reinstates things so that -i combines with -u instead.
	I.e. have -i be protective, rather than selective (like -u).

	The -f option of mv is similarly adjusted in this patch,
	so now --update does not override any of -f,-i,-n.

	* NEWS: Mention the bug fix.
	* src/cp.c (main): Don't have -u disable prompting.
	* src/mv.c (main): Likewise.
	* tests/cp/cp-i.sh: Add a test case for -i.
	* tests/mv/update.sh: Likewise.
	* tests/mv/i-3.sh. Add a test case for -f.
	Fixes https://bugs.gnu.org/70887

2025-01-06  Pádraig Brady  <P@draigBrady.com>

	doc: clarify mv -f operation in texinfo
	* doc/coreutils.texi (mv invocation): Be less ambiguous,
	in that -f is significant for any replacement operation
	on the destination, not just unlinking.

2025-01-01  Pádraig Brady  <P@draigBrady.com>

	maint: update all copyright year number ranges
	Update to latest gnulib with new copyright year.
	Run "make update-copyright" and then...

	* gnulib: Update included in this commit as copyright years
	are the only change from the previous gnulib commit.
	* tests/init.sh: Sync with gnulib to pick up copyright year.
	* bootstrap: Likewise.
	* tests/sample-test: Adjust to use the single most recent year.

2025-01-01  Pádraig Brady  <P@draigBrady.com>

	pwd: fix erroneous leading slash on some systems
	* gnulib: Pull in the fix to getcwd() from gnulib.
	* NEWS: Mention the fix.

2024-12-30  Pádraig Brady  <P@draigBrady.com>

	numfmt: don't require a suffix with --from=iec-i
	* src/numfmt.c (simple_strtod_human): Only look for 'i'
	after detecting a suffix.
	* tests/misc/numfmt.pl: Add a test case.
	* NEWS: Mention the bug fix.
	Reported at https://bugs.debian.org/1091758

	maint: fix syntax-check error
	* src/seq.c: Adjust line length.

2024-12-30  Paul Eggert  <eggert@cs.ucla.edu>

	maint: adjust to Gnulib module renaming
	* bootstrap.conf, gl/modules/buffer-lcm, gl/modules/randperm:
	* gl/modules/randread, gl/modules/strnumcmp, gl/modules/targetdir:
	* gl/modules/xdectoint, gl/modules/xfts:
	Adjust to recent renaming of Gnulib modules, e.g., stdbool → bool,
	inttypes → inttypes-h.

	build: update gnulib submodule to latest

	date: improve doc for ambiguous formats
	Problem reported by Tim Connors <https://bugs.gnu.org/75208>.
	* doc/coreutils.texi (Date conversion specifiers):
	* src/date.c (usage):
	Warn about ambiguous formats like %D.

	maint: ISDIGIT → c_isdigit
	* gl/lib/strnumcmp-in.h (ISDIGIT):
	* src/system.h (ISDIGIT): Remove.  All uses replaced by c_isdigit,
	with appropriate inclusions of c-ctype.h.  This is more regular,
	and is more portable to existing (but unlikely) platforms where
	INT_MAX == UINT_MAX.

2024-12-30  Sylvestre Ledru  <sylvestre@debian.org>

	tests: improve the chmod/symlinks.sh test
	The variable of the loop isn't passed to the command making
	it less interesting

	* tests/chmod/symlinks.sh: Fix the test case.

2024-12-23  Pádraig Brady  <P@draigBrady.com>

	kill: with -l,-t list signal 0
	The 0 (EXIT) signal is valid as input
	(and useful to determine existence of a pid),
	so list it along with other signals.

	* doc/coreutils.texi (signal specifications): Document 0, "EXIT".
	* src/kill.c (list_signals): Start loops at 0, not 1.
	* tests/misc/kill.sh: Add a test case.
	* NEWS: Mention the change in behavior.

2024-12-21  Pádraig Brady  <P@draigBrady.com>

	maint: correct © dates for hardware optimized crc routines
	* src/cksum_pclmul.c: 2021-2024.
	* src/cksum_avx2.c: 2024.
	* src/cksum_avx512.c: 2024.
	* src/cksum_vmull.c: 2024.

	tail: always fail when followed files become inaccessible
	* src/tail.c (tail_forever): Without --retry, exit with failure
	status like we do for the inotify case (since v8.11-15-g61de57cd2).
	This is also consistent with the failure exit if no file was
	accessible at tail startup.
	* tests/tail/follow-stdin.sh: Tweak due to earlier exit.
	* tests/tail/follow-name.sh: Test with and without inotify.
	* NEWS: Mention the bug fix.

2024-12-20  Pádraig Brady  <P@draigBrady.com>

	cksum: update to pclmul optimized crc32b from gnulib
	* bootstrap.conf: Depend on crc-x86_64 rather than crc.
	* gnulib: Update to latest.
	* src/cksum.c (crc32b_sum_stream): Add --debug info.
	* NEWS: Mention the performance improvement.

2024-12-16  Daniel Hofstetter  <dhofstet@gmail.com>

	maint: tests: update deprecated perl backreference syntax
	* tests/basenc/basenc.pl: perl warns that $1 is better than \1,
	so update to the preferred form.

2024-12-12  Paul Eggert  <eggert@cs.ucla.edu>

	maint: sync help2man to latest version
	* man/help2man: sync changes from version 1.48.5 through 1.49.3.
	This doesn't materially change the generated man pages.

2024-12-05  Sam Russell  <sam.h.russell@gmail.com>

	cksum: use ARMv8 SIMD extensions
	* configure.ac: Add check for ARMv8 VMULL support.
	* src/cksum.c: Add ARMv8 VMULL detection function.
	* src/cksum.h: Add ARMv8 VMULL implementation declaration.
	* src/cksum_vmull.c: ARMv8 VMULL implementation.
	* src/local.mk: Add build flags for ARMv8 VMULL.
	* NEWS: Mention the ARMv8 SIMD improvement.

2024-12-05  Pádraig Brady  <P@draigBrady.com>

	tail: ensure --follow=name unfollows renamed files
	Require --retry to continue to track files upon rename.
	We already unfollowed a file if it was renamed
	to another file system (unlinked), so this makes the behavior
	consistent if renaming to a file in the same file system.
	I.e. --follow=name without --retry, means unfollow if the
	name is unlinked or moved, so this change ensures that
	behavior for all rename cases.
	Related commits: v8.0-121-g3b997a9bc, v8.23-161-gd313a0b24

	* src/tail.c (tail_forever_notify): Remove watch for a renamed file
	if --retry is not specified.
	* tests/tail/F-vs-rename.sh: Related test cleanup.
	* tests/tail/follow-name.sh: Add a test case.
	* NEWS: Mention the bug fix.
	Fixes https://bugs.gnu.org/74653

2024-11-26  Sam Russell  <sam.h.russell@gmail.com>

	cksum: use AVX2 and AVX512 for speedup
	* configure.ac: Add checks for avx2 and avx512 support.
	* src/cksum_avx2.c: AVX2 implementation.
	* src/cksum_avx512.c: AVX512 implementation.
	* src/local.mk: Add build flags for avx2 and avx512.
	* src/cksum.c: Add avx2 and avx512 detection functions.
	* src/cksum.h: Add avx2 and avx512 implementation declarations.
	* NEWS: Mention the AVX2 and AVX512 improvement.

2024-11-26  Pádraig Brady  <P@draigBrady.com>

	tail,tee: fix broken pipe detection on darwin 9
	* src/iopoll.c (): Restrict use of poll() on macOS
	to >= 11 (darwin 20), as it was seen to fail on macOS 10.5.
	Fixes https://bugs.gnu.org/74503

2024-11-24  Pádraig Brady  <P@draigBrady.com>

	tests: avoid false failure with unicode decomposed file systems
	* tests/ls/dired.sh: macOS normalizes unicode characters to decomposed
	(NFD) form when storing names in the file system, which breaks the
	round-trip comparison employed by the test.  So instead use a character
	which does not decompose; verified with:
	  echo æ | uconv -f utf8 -t utf8 -x nfd | od -Ax -tx1z

2024-11-20  Paul Eggert  <eggert@cs.ucla.edu>

	dd: port big-offset test to macOS 12.6
	* tests/dd/skip-seek-past-file.sh: Do not assume that
	seek to exactly OFF_T_MAX should fail; it works on macOS 12.6
	and POSIX allows this.  Come to think of it, it should work
	on Solaris too, if someone ever comes across a Solaris host
	with a file system that allows such files.

2024-11-20  Collin Funk  <collin.funk1@gmail.com>

	maint: update .gitignore
	* .gitignore (/lib/crc-sliceby8.h): Add file generated by Gnulib.

	maint: prefer mbszero over memset
	* src/df.c (replace_invalid_chars): Use mbszero.

2024-11-20  Paul Eggert  <eggert@cs.ucla.edu>

	ls: port to Oracle Developer Studio 12.6
	Oracle Developer Studio 12.6 for sparc mishandles
	‘sizeof ((char []) {'x', 'y'})’: it says
	“warning: null dimension: sizeof()” and then generates
	the wrong length in data.  Work around the compiler bug
	by counting sizes by hand, which may be a bit clearer anyway,
	if a bit more error-prone.
	* src/ls.c (BIN_STR): Remove.
	(color_indicator): Spell out instead of using BIN_STR.

	factor: fix ‘return’ typo
	* src/factor.c (lbuf_putint): Don’t use ‘return E;’ in
	a void function’s body, fixing a recently-introduced typo.

2024-11-19  Paul Eggert  <eggert@cs.ucla.edu>

	doc: mention "printf %d ''" change

2024-11-19  Pádraig Brady  <P@draigBrady.com>

	tests: fix inconsistent use of getlimits_
	* tests/dd/skip-seek-past-file.sh: s/eval $(getlimits)/getlimits_/

	tests: printf: avoid iconv issues on macOS
	* tests/printf/printf-cov.pl: Since gnulib commit v1.0-1103-ge5b82978e2
	we avoid iconv() on ASCII range 0x32 - 0x7F inclusive, so adjust
	this test to fall within that range.
	Addresses https://bugs.gnu.org/74428

2024-11-19  Paul Eggert  <eggert@cs.ucla.edu>

	chown: port test to macOS 12.6 nogroup user
	* tests/chown/preserve-root.sh (id_g): Set to empty if id -gn
	reports that it is nogroup, and skip that part of the test.

	maint: omit unnecessary to_uchar
	* src/df.c (replace_control_chars):
	* src/dircolors.c (parse_line):
	* src/printf.c (print_esc):
	* src/ptx.c (unescape_string):
	* src/stat.c (print_it):
	* src/tr.c (star_digits_closebracket):
	Omit to_uchar calls that aren’t needed, because the parent
	expression works with ‘char’ as well as with ‘unsigned char’.

	tests: Remove stray ‘i’

	printf: diagnose empty args correctly
	Also, port better to macOS.
	* src/printf.c (verify_numeric): Don’t assume that when s == end
	then errno is zero; it is EINVAL on macOS, and POSIX allows this.
	(print_direc): Treat missing arg as zero for numeric conversions,
	and as an empty string for the others.
	(print_formatted): Use null pointer, not an empty string,
	to represent missing arg.
	* tests/printf/printf.sh: Test empty and space widths and precisions.

	printf: do n$ overflow checking by hand
	* src/printf.c (get_curr_arg): Mark as pure to pacify GCC 14.
	Do overflow checking by hand rather than relying on strspn
	and strtoimax.

	printf: refactor macros to function
	* src/printf.c (struct arg_cursor): New struct.
	(get_curr_arg): New function.
	(print_formatted): Use it instead of ...
	(GET_CURR_ARG, SET_CURR_ARG): ... these removed macros.
	This makes the code a bit easier to follow, and any efficiency
	cost should be minimal.

2024-11-18  Pádraig Brady  <P@draigBrady.com>

	maint: avoid a syntax-check failure
	This was also updated in gnulib.

	* bootstrap: s/can not/cannot/

2024-11-18  Pádraig Brady  <P@draigBrady.com>

	doc: describe "New programs" consistently in NEWS
	* NEWS: s/New commands/New programs/

2024-11-18  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest
	Also, copy bootstrap from gnulib/build-aux/bootstrap.

	factor: pacify -Wunused-macros
	* src/factor.c: Also use __GMP_GNUC_PREREQ

2024-11-15  Paul Eggert  <eggert@cs.ucla.edu>

	ls: refactor gobble_file get_scontext
	* src/ls.c (gobble_file): Simplify by pulling get_scontext
	out of ‘if’.

2024-11-12  Pádraig Brady  <P@draigBrady.com>

	tests: ls: also test security context output for symlinks
	* tests/ls/selinux.sh: Test symlinks as well as files.

	tests: avoid false failure with --disable-selinux
	* tests/ls/selinux-segfault.sh: Move recent addition to ...
	* tests/ls/selinux.sh: ... this new test that uses require_selinux_
	to skip appropriately when we've built without selinux support.
	Also add a non root test that checks we output '.' along with the
	mode for files, to indicate a security context is present.
	* tests/local.mk (Reference the new test).

2024-11-11  Pádraig Brady  <P@draigBrady.com>

	ls: fix security context indication in --long mode
	* src/ls.c (gobble_file): Always get the security context with -l
	so that we can indicate a context with '.' if present.

2024-11-11  Paul Eggert  <eggert@cs.ucla.edu>

	build: update gnulib submodule to latest
	This also fixes a problem with ls -Z when configured with
	--disable-acl, reported by Pádraig Brady
	<https://bugs.gnu.org/73418#52>.
	* src/ls.c (gobble_file): Pass ACL_GET_SCONTEXT to
	file_has_aclinfo, if -Z is used.

2024-11-11  Pádraig Brady  <P@draigBrady.com>

	build: update gnulib to latest
	* NEWS: Mention the fix to nproc honoring the affinity mask
	on systems with more than 1024 processors.

2024-11-10  Paul Eggert  <eggert@cs.ucla.edu>

	ls: add test case for ls -Z bug
	Problem reported by Pádraig Brady <https://bugs.gnu.org/73418#35>.
	This bug was fixed by the recent gnulib update.
	* tests/ls/selinux-segfault.sh:
	Also test for ls -Z on broken symlinks.

	build: update gnulib submodule to latest

2024-11-09  Pádraig Brady  <P@draigBrady.com>

	tests: avoid false failure on older valgrind
	* src/shuf.c (main): In dev mode call randint_all_free()
	to avoid false failure with valgrind 3.16.1 at least.
	Note this partially reinstates commit v9.0-109-g0106b5a4b.
	This was noticed on a debian 11 system running CI tests.

2024-11-09  Paul Eggert  <eggert@cs.ucla.edu>

	seq: seq_fast always exits now
	* src/seq.c (seq_fast): Always exit.  Don’t bother freeing
	just before exit.

	seq: simplify cmp calls
	* src/seq.c (seq_fast): Call cmp in just one place, not two.
	Redo loop structure to make it work.

	seq: use full_write instead of fwrite
	* src/seq.c: Include full-write.h.
	(seq_fast): Since we’re doing all the buffering work anyway,
	we might as well use syscalls instead of stdio to write.
	Use full_write instead of fwrite.

	seq: simplify output buffer management
	* src/seq.c (seq_fast): Simplify by using an output buffer of
	known size (BUFSIZ) on the stack, rather than a heap buffer that
	might grow.  For the number buffer, don’t bother appending NUL
	since nobody uses the NUL, and xpalloc from nullptr not p0 since
	we need to move the buffer data by hand anyway.

	seq: omit unnecessary malloc for upper bound
	* src/seq.c (seq_fast): Speed up test for "inf".
	Do not allocate and free a copy of B, as it is fine as-is.

	seq: simplify cmp
	* src/seq.c (cmp): Simplify, and change some size_t to idx_t.
	(INITIAL_ALLOC_DIGITS): Now a constant, not a macro.

	seq: explicate incr
	* src/seq.c (incr): Change API to make the code easier to follow,
	and also to avoid undefined behavior on hypothetical platforms
	where '9' == INT_MAX (!).  Caller changed.

	env: prefer xpalloc to xrealloc
	* src/env.c (extract_varname): Prefer free+xpalloc to
	xrealloc, since the old buffer contents don’t matter.

	shuf: prefer xpalloc to xnrealloc
	* src/shuf.c (RESERVOIR_LINES_INCREMENT): Remove.
	All uses removed.
	(read_input_reservoir_sampling, main):
	Prefer idx_t to size_t for sizes related to xpalloc.
	(read_input_reservoir_sampling): Prefer xpalloc to xnrealloc.

	pwd: prefer xpalloc to xnrealloc
	* src/pwd.c (struct file_name, file_name_prepend):
	Prefer idx_t to size_t for sizes related to xpalloc,
	(file_name_init): Don’t overflow if PATH_MAX == INT_MAX.
	(file_name_prepend): Prefer xpalloc to by-hand resizing.
	Simplify by using memcpy return value.

	du: prefer xpalloc to xnrealloc
	* src/du.c (prev_level, process_file):
	Prefer idx_t to size_t for sizes related to xpalloc,
	and to nesting levels (since that’s what fts_level does anyway).
	(process_file): Prefer xpalloc to xnrealloc.

	df: prefer xpalloc to xnrealloc
	* src/df.c (ncolumns, nrows, print_table, get_header, get_dev):
	Prefer idx_t to size_t for sizes related to xpalloc.
	(ncolumns_alloc, nrows_alloc): New static vars.
	(alloc_table_row, alloc_field): Prefer xpalloc to xnrealloc.

	basenc: prefer xpalloc to xnrealloc
	* src/basenc.c (prepare_inbuf): Prefer xpalloc to xnrealloc.

	ls: prefer xpalloc to xnrealloc
	* src/ls.c (cwd_n_alloc, cwd_n_used, clear_files)
	(extract_dirs_from_files, initialize_ordering_vector)
	(update_current_files_info, sort_files, print_current_files)
	(print_many_per_line, print_horizontal, print_with_separator)
	(init_column_info, calculate_columns):
	Prefer idx_t to size_t for sizes related to xpalloc.
	(main): Let the compiler fold constants.
	(gobble_file, init_column_info): Use xpalloc, not xnrealloc.
	(print_many_per_line): Fix very-unlikely integer overflow.

	df: simplify via xasprintf
	* src/df.c: Include xvasprintf.h.
	(get_header, get_dev): Simplify by using xasprintf and xstrdup
	rather than doing the error checking ourselves.

	csplit: port to IDX_MAX < INT_MAX
	* src/csplit.c (max_out): Defend against unlikely IDX_MAX < INT_MAX.

	pr: prefer xpalloc to x2realloc
	* src/pr.c (buff_allocated, main):
	Prefer idx_t to size_t for sizes.
	(main, store_char): Use xpalloc, not x2realloc.
	(init_store_cols): Check for multiplication overflow ourselves
	and use ximalloc, not xnmalloc.  This is a bit simpler.
	* src/system.h (X2REALLOC): Remove; no longer used.

	od: prefer xpalloc to x2realloc
	* src/od.c (string_min, dump_strings): Prefer idx_t to size_t for
	sizes.  Use xpalloc, not x2realloc.

	fold: prefer xpalloc to x2realloc
	* src/fold.c (fold_file): Prefer idx_t to size_t for sizes.
	Use xpalloc, not x2realloc.

	sort: prefer xpalloc to x2nrealloc
	* src/sort.c (struct buffer, temp_dir_count, temp_dir_alloc)
	(create_temp_file, add_temp_dir, fillbuf):
	Prefer idx_t to ptrdiff_t/size_t for nonnegative directory counts.
	(add_temp_dir, fillbuf): Use xpalloc, not x2nrealloc.
	* src/system.h (X2NREALLOC): Remove; no longer used.

	cut,numfmt: prefer xpalloc to x2nrealloc
	* src/set-fields.c (n_frp, n_frp_allocated, complement_rp, set_fields):
	Prefer idx_t to ptrdiff_t/size_t for nonnegative sizes.
	(add_range_pair): Use xpalloc, not x2nrealloc.

	ptx: prefer xpalloc to x2nrealloc
	* src/ptx.c (line_width, gap_size, WORD, WORD_TABLE)
	(maximum_word_length, reference_max_width, occurs_alloc)
	(number_of_occurs, half_line_width, truncation_string_length)
	(compare_words, search_table, digest_word_file)
	(find_occurs_in_text, fix_output_parameters)
	(generate_all_output, main, find_occurs_in_text)
	(fix_output_parameters, generate_all_output):
	Prefer idx_t to ptrdiff_t/size_t for nonnegative sizes.
	(first, second): Remove macros, replacing them with locals.
	(search_table): Use hi (for highest + 1) to simplify.
	Avoid unlikely overflow by not computing lo + hi.
	(digest_word_file, find_occurs_in_text): Use xpalloc, not x2nrealloc.

	od: prefer xpalloc to x2nrealloc
	* src/od.c (n_specs, n_specs_allocated, write_block, get_lcm, main):
	Use idx_t instead of size_t for some sizes, so that we can
	use xpalloc.
	(decode_format_string): Prefer xpalloc to X2NREALLOC.

	expand: check for colno overflow
	* src/expand-common.c (get_next_tab_column): Check for tab
	stop overflow here.  All callers changed to not check.
	* src/expand.c (expand): Use colno for column number.

	ls: fix aclinfo cache bug
	Found when testing on a new platform with a new file system.
	* src/ls.c (file_has_aclinfo_cache): For failures, also cache
	return value, scontext, and scontext_err, and when using cached
	values make sure buf and size have reasonable values for
	aclinfo_free etc.

	ls: use Gnulib’s unsupported errno list
	* bootstrap.conf (gnulib_modules): Add acl-permissions, which
	supplies acl_errno_valid, and which we are already using
	indirectly via file-has-acl.
	* src/ls.c (errno_unsupported): Remove.  All calls replaced
	by !acl_errno_valid.

	expand: use signed colno
	* src/expand-common.h (colno): Now intmax_t, not uintmax_t.

	expand: refactor to introduce ‘colno’
	* src/expand-common.h (colno): New typedef.
	All uses of uintmax_t for column numbers replaced by colno.
	* src/expand-common.c (add_tab_stop): Use xpalloc
	instead of X2NREALLOC, and use ckd_add to check for overflow.

	expand: prefer xpalloc to x2nrealloc
	* src/expand-common.c (max_column_width, n_tabs_allocated)
	(first_free_tab, add_tab_stop, parse_tab_stops, validate_tab_stops)
	(get_next_tab_column):
	Use idx_t for sizes.  All uses changed.
	(add_tab_stop): Use xpalloc instead of X2NREALLOC.
	Use ckd_add to check for overflow, instead of doing it by hand.

	env: prefer xpalloc to x2nrealloc
	* src/env.c (usvars_alloc): Use idx_t for size.
	(append_unset_var): Use xpalloc instead of x2nrealloc.

	chroot: expand heap a bit less aggressively
	* src/chroot.c (parse_additional_groups, main):
	Prefer idx_t to size_t for sizes.
	(parse_additional_groups): Use xpalloc instead of x2nrealloc.

	maint: expand heap a bit less aggressively
	* gl/lib/heap.c (struct heap, heap_alloc, heap_insert)
	(heapify_down, heapify_up): Prefer idx_t to size_t for sizes.
	(heap_insert): Use xpalloc instead of x2nrealloc.
	(heapify_down): Return void since no caller cares about value.
	* gl/modules/heap: Depend on idx.

2024-11-03  Bruno Haible  <bruno@clisp.org>

	build: Regenerate distributed built files in $(top_srcdir)
	* src/local.mk (src/dircolors.h, src/fs-is-local.h, src/fs.h): Generate
	in $(top_srcdir).

2024-11-02  Pádraig Brady  <P@draigBrady.com>

	cksum: add support for --algorithm=crc32b
	  $ echo -n '123456789' | cksum --raw -a crc32b | basenc --base16
	  CBF43926

	* bootstrap.conf: Explicitly depend on the crc module.
	* doc/coreutils.texi (cksum): Add "crc32b" as an argument to -a.
	* src/cksum.c (crc32b_sum_stream): A new function similar to
	crc_sum_stream, but which does not include the length in
	the CRC calculation.
	* src/cksum.h: Add crc32b_sum_stream prototype.
	* src/digest.c: Add "crc32b" as an argument to -a.
	* tests/cksum/cksum.sh: Refactor to test both crc and crc32b.
	* tests/cksum/cksum-a.sh: Add "crc32b" case.
	* tests/cksum/cksum-base64.pl: Likewise.
	* tests/misc/read-errors.sh: Likewise.
	* NEWS: Mention the new feature.

2024-11-02  Collin Funk  <collin.funk1@gmail.com>

	test: add string operators added by POSIX 2024
	* src/test.c (binop): Recognize the ">" and "<" operators.
	(three_arguments): Likewise.
	(binary_operator): Implement the "<" and ">" operators.
	(usage): Add operators to --help output.
	* tests/test/test.pl (@Tests): Add functionality tests.
	* doc/coreutils.texi (test invocation, String tests): Document new
	operators.
	* NEWS: Mention the new feature.

2024-11-01  Pádraig Brady  <P@draigBrady.com>

	doc: mention new timeout short options in NEWS
	* NEWS: Mention the timeout -f and -p options.

2024-11-01  Collin Funk  <collin.funk1@gmail.com>

	stty: adjust --help to match POSIX 2024
	* src/stty.c (usage): Mark cols, rows, and size as standardized by
	POSIX.
	* doc/coreutils.texi (Special): Likewise.

2024-11-01  Pádraig Brady  <P@draigBrady.com>

	doc: fix timeout --help for -p
	* src/timeout.c (usage): Fix typo of period with comma.
	* tests/timeout/timeout.sh: Only test a single option variant,
	as tests/misc/usage_vs_getopt.sh suffices for basic option validation.

2024-10-30  Pádraig Brady  <P@draigBrady.com>

	timeout: add -f and -p short options as per POSIX 2024
	* src/timeout.c: Support -f and -p short options, corresponding to
	--foreground and --preserve-status respectively.  This adds
	compatability with POSIX 2024 and OpenBSD.
	(usage): Separate translations, and reorder the option descriptions.
	* doc/coreutils.texi (timeout invocation): Adjust accordingly,
	and also reorder the option descriptions alphabetically.
	* tests/timeout/timeout.sh: Also test short option variants.

2024-10-20  Sylvestre Ledru  <sylvestre@debian.org>

	tests: cksum: verify --check with comments
	* tests/cksum/cksum-c.sh: Add a test case with a comment.

	tests: improve ls --dired with symlink testing
	* tests/ls/dired.sh: Verify ls --dired with symlink.

2024-10-14  Pádraig Brady  <P@draigBrady.com>

	maint: add syntax-check to ensure all gl/ files are distributed
	* cfg.mk (sc_gldist_missing): Add a new target to ensure we don't
	forget to distribute any new gl/ files.
	* gl/local.mk: Remove generation comment since it's
	now encapsulated in the syntax-check, which outputs a consumable
	diff to make any future adjustments.
	Also adjust ordering to that of the C locale used in the syntax check.

2024-10-14  Bruno Haible  <bruno@clisp.org>

	build: distribute the gl/ directory in the tarballs
	Suggested by Michael Pratt in
	<https://mail.gnu.org/archive/html/coreutils/2024-10/msg00010.html>.

	* gl/local.mk: New file, based on gettext/gnulib-local/Makefile.am.
	* Makefile.am: Include it.

2024-10-12  Masatake YAMATO  <yamato@redhat.com>

	cp,mv: align the descriptions of long options
	* src/cp.c (usage): Adjust white spaces for --update.
	* src/mv.c (usage): Ditto.
	Fixes https://bugs.gnu.org/73772

2024-10-07  Collin Funk  <collin.funk1@gmail.com>

	chroot,whoami: use uintmax_t for printing uids
	* src/chroot.c (main): Cast the uid to uintmax_t instead of int.
	* src/whoami.c (main): Cast the uid to uintmax_t instead of unsigned
	long int.

2024-10-06  Bernhard Voelker  <mail@bernhard-voelker.de>

	maint: adjust check-ls-dircolors to recent change in ls.c
	'make distcheck' would fail since commit 75b34c77e43a, because the
	comparison by check-ls-dircolors fails.

	* Makefile.am (check-ls-dircolors): Adjust sed(1) expression to the
	changed data initialization.

2024-10-03  Pádraig Brady  <P@draigBrady.com>

	ls: fix spurious output with -Z
	* src/ls.c (gobble_file): Only output an error if there actually
	was an error.

	tests: ls: don't always skip a capability test
	* tests/ls/no-cap.sh: Move to being a root only test, since
	commit v9.5-132-g2a6bed933 we now need to call setcap
	to make the test effective.  Otherwise we would have always
	just skipped the test.

2024-10-03  Paul Eggert  <eggert@cs.ucla.edu>

	ls: tune usage of getxattr/stat syscalls
	Update gnulib submodule to latest.  This changes the file_has_aclinfo
	API, so at the same time do the following changes to ls.c, which
	adjusts to these changes among other things.
	* src/ls.c (filetype_d_type, d_type_filetype): New static constants.
	(format_needs_capability): New static var.
	(main): Set and use it.  Don’t set format_needs_stat merely
	because print_scontext, as we needn’t call stat to get the
	scontext.  Instead, set format_needs_type if print_scontext but
	not format_needs_stat.
	(print_dir): Use new static tables to determine filetype
	more efficiently.
	(file_has_aclinfo_cache): Adjust to Gnulib file_has_aclinfo API change.
	(gobble_file): Check stat if format_needs_type but the type is
	unknown.  Be conservative, and when deciding whether to check stat
	but the type is unknown, assume it might be directory.  Similarly
	for normal files when classifying; if the type is unknown assume
	it might be normal.  Use new static constants and IFTODT to
	compute filetype more straightforwardly.  Get ACLs and check for
	capability less often.
	(get_color_indicator): Omit unnecessary call to is_colored (C_CAP),
	since f->has_capability can be true only if is_colored (C_CAP).

	ls: omit cast from gobble_file
	* src/ls.c (gobble_file): Minor refactoring.  Last arg is now null
	pointer, not "", for no directory.  All callers changed.
	Avoid need for cast from char const * to char *.

	ls: check FILETYPE_INDICATORS cardinality
	* src/ls.c (filetype_cardinality): New constant.
	(filetype_letter): Omit unnecessary trailing NUL.
	(FILETYPE_INDICATORS): Remove, moving definiens to ...
	(get_color_indicator): ... here, and check its cardinality too.

	ls: tune indicator_name
	* src/ls.c (indicator_name): Simplify type; it is now merely
	a 2-dimensional array of char.  All uses changed.

	ls: omit some unnecessary NULs
	* src/ls.c (BIN_STR): New macro, replacing LEN_STR_PAIR.
	All uses changed.  This avoids the need to store the
	trailing \0 in each string.  This change is more for clarity,
	to make it clear the \0 is not needed.

	ls: tune is_colored
	* src/ls.c (is_colored): Tune.
	This shrinks the machine code considerably on x86-64.

	ls: omit unnecessary test
	* src/ls.c (gobble_file): Omit redundant test of variable that
	must be false here.

2024-10-02  Pádraig Brady  <P@draigBrady.com>

	ls: reinstate capability checking in more cases
	The recent commit v9.5-119-g4ce432ad8 restricted capability checking
	to only files with XATTR_NAME_CAPS set.  If this is done then we need
	to adjust tests/ls/no-cap.sh so that it doesn't always skip.  More
	problematically XATTR_NAME_CAPS was only determined in long listing
	mode, thus breaking capability coloring in short listing mode
	as evidenced by the failing tests/ls/capability.sh test.

	Note capability checking does have a large overhead, but we've
	disabled capability checking by default anyway through the default
	color configuration since v9.0-187-g6b5134770

	So for these reasons revert to checking capabilities as before.

	* src/ls.c (gobble_file): Check for capabilities in all modes
	if enabled in color config.

2024-10-02  Lukáš Zaoral  <lzaoral@redhat.com>

	doc: ls: fix regression in -k description
	The description of -k regressed in coreutils 9.0

	* doc/coreutils.texi (ls invocation): Fix incomplete paragraph
	describing -k introduced by a mistake in commit v8.32-180-g1625916a1.

2024-10-02  Pádraig Brady  <P@draigBrady.com>

	tests: df: avoid false failure due to fuse.portal
	* tests/df/skip-rootfs.sh: Explicitly exclude "fuse.portal"
	file systems as these give EPERM errors from statfs().

2024-10-02  Pádraig Brady  <P@draigBrady.com>

	tests: fix skipping of mtab simulation tests
[--snip--]
