locale: tools: Make finalize idempotent
The finalize script renames source files with 3 components in their name
into names with two components with an @modifier, in the process.
Running the script for a second time without cleaning will strip the
@modifier from the files, producing invalid Makefiles and unusable
locales.
Prevent this by adding a guard at the beginning of the script.
Also, use a sub-shell for directory changes to avoid working directory
issues.
Reviewed by: bapt
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53981
(cherry picked from commit 934364da7fc8cd3ba4d030d0478163b41dda1b37)
locale: make posix
Run make posix to generate monetary definition files with the
international parameters missing from localeconv(3)'s lconv struct.
Manually convert the "frozen" non-unicode locales under share/monetdef.
Reviewed by: bapt
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53917
(cherry picked from commit 9df8243a2e0ab1ef027cbfbcb4105f5f0ce108e1)
bpf: convert several boolean natured fields of bpf_d to flags
This shrinks the structure a bit. Should be no functional change.
Differential Revision: https://reviews.freebsd.org/D53870
vt: Allow VT_SETMODE with frsig=0
Linux does not check that any of the signals in vt_mode VT_SETMODE ioctl
(relsig, acqsig, frsig) are valid, but FreeBSD required that all three
are valid. frsig is unusued in both Linux and FreeBSD, and software
typically leaves it unset. To improve portability, allow frsig to be
set to zero.
PR: 289812
Reported by: Dušan Gvozdenović
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52835
(cherry picked from commit 5198c32210039d8dc92554647384eee75688848c)
(cherry picked from commit 224d65015465d085f2e07edccef1f23a8c217b88)
etc/mtree/BSD.include.dist: Remove libmilter-dev
When building with WITHOUT_SENDMAIL this result in a FreeBSD-libmilter-dev
package with only this directory and a dependacy on FreeBSD-libmilter which
doesn't exists.
Differential Revision: https://reviews.freebsd.org/D54193
Fixes: 436618a427b4 ("etc/mtree: Add package tags for /usr/include")
Reviewed by: ivy
Sponsored by: Beckhoff Automation GMbH & Co. KG
splice: Fix leaks that can happen when initiating a splice
- change the state to SPLICE_EXCEPTION to allow so_unsplice() to work
to cleanup failed splices (fixes socket reference leak)
- NULL out sp->dst when unsplicing from so_splice() before so2 has been
been referenced.
- Deal with a null sp->dst / so2 in so_unsplice
- Fix asserts that talked about sp->state == SPLICE_INIT; that state
is not possible here.
Differential Revision: https://reviews.freebsd.org/D54157
Reviewed by: markj
Sponsored by: Netflix
Fixes: c0c5d01e5374 ("so_splice: Synchronize so_unsplice() with so_splice()")
MFC after: 3 days
(cherry picked from commit a837d1fe49e0255d81c670dc271ff245ae960097)
Remove: sys/dts/arm/overlays/spigen-rpi-b.dtso
Remove SPIGEN device tree overlay used with rpi-b (BCM2835/armv6)
Approved by: manu (mentor)
Differential revision: https://reviews.freebsd.org/D54188
*/*: remove recallocarray() compat shims following import into libc
libopenbsd retains recallocarray() during bootstrapping for now
as it is needed for mandoc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D52864
(cherry picked from commit acd546f01e58354af049455472980c6c4a52e18b)
lib/libc: implement C23 memalignment()
This new function computes the alignment of a pointer.
It is part of ISO/IEC 9899:2024, the new C standard.
If the pointer is a null pointer, null is returned.
I have tried to write an implementation that can cope
with traditional address-based architectures, even if
size_t and uintptr_t are of different length. Adjustments
may be needed for CHERI though.
A man page is provided, too. No unit test for now.
Reviewed by: kib, imp, ziaee (manpages), pauamma at gundo.com
Approved by: markj (mentor)
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D53673
(cherry picked from commit 6c57e368eb1777f6097158eeca2fcc175d068dba)
lib/libc: add recallocarray()
This function from OpenBSD is a hybrid of reallocarray() and calloc().
It reallocates an array, clearing any newly allocated items.
reallocarray() ultimately originates from OpenBSD.
The source is taken from lib/libopenbsd, which now no longer has the
function unless when bootstrapping (needed for mandoc).
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D52863
(cherry picked from commit 42664610795bc0a728851ba6223fcf9b93801167)
unionfs: Implement VOP_GETLOWVNODE
This function returns the vnode that will be used to resolve the
access type specified in the 'flags' argument, and is useful for
optimal behavior of vn_copy_file_range(). While most filesystems
can simply use the default implementation which returns the passed-
in vnode, unionfs (like nullfs) ideally should resolve the access
request to whichever base layer vnode will be used for the I/O.
For unionfs, write accesses must be resolved through the upper vnode,
while read accesses will be resolved through the upper vnode if
present or the lower vnode otherwise. Provide a simple
unionfs_getlowvnode() implementation that reflects this policy.
Reviewed by: kib, olce
Tested by: pho
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D53988
unionfs: detect common deadlock-producing mount misconfigurations
When creating a unionfs mount, it's fairly easy to shoot oneself
in the foot by specifying upper and lower file hierarchies that
resolve back to the same vnodes. This is fairly easy to do if
the sameness is not obvious due to aliasing through nullfs or other
unionfs mounts (as in the associated PR), and will produce either
deadlock or failed locking assertions on any attempt to use the
resulting unionfs mount.
Leverage VOP_GETLOWVNODE() to detect the most common cases of
foot-shooting at mount time and fail the mount with EDEADLK.
This is not meant to be an exhaustive check for all possible
deadlock-producing scenarios, but it is an extremely cheap and
simple approach that, unlike previous proposed fixes, also works
in the presence of nullfs aliases.
PR: 172334
Reported by: ngie, Karlo Miličević <karlo98.m at gmail.com>
[4 lines not shown]
cam: Also reduce timeout for wlun probing
wlun probing was added after my initial work on this and was overlooked
in merging forward. Add the timeout here too, for the same reasons as
for REPORT LUNS. This doesn't change the default.
Fixes: 8ac7a3801c6a cam: Reduce overly long timeout values for initial device probing
Sponsored by: Netflix
Reviewed by: jaeyoon
Differential Revision: https://reviews.freebsd.org/D54184
pfind(9): follow-up fixes and improvements
(Found on a branch from a year ago.)
- Adjust NAMEs
- MLINKS: add pfind_any.9, pfind_any_locked.9; remove old zpfind.9
- Reword the description of pfind_any() so that it doesn't imply only
zombie processes are returned
- Fix a comma
- Use .Dv for the macro PRS_ZOMBIE
- Move the (logically separate) final statement to a new paragraph
- .Xr to pget(9)
Reviewed by: 0mp
Fixes: 07d78399eb79 ("pfind(9): Update to recent behavior")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53548
(cherry picked from commit 2ace05b65a2c912888aeec921fc6f990a5c36909)
e1000: Don't enable ASPM L1 without L0s
Reporter noted packet loss with 82583. NVM is down level. The
errata docs mention disabling this, which should be the firmware
default, so I am not sure why we were enabling this bit. Linux and
OpenBSD have the same issue, while NetBSD got it right.
Reported by: Codin <codin at nagi.ftp.sh>
Tested by: Codin <codin at nagi.ftp.sh>
(cherry picked from commit 2ead091715dee327b3e00bc9840e1a95827b8e82)