cross-build: Provide mempcpy when building on macOS
We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.
Fixes: ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after: 1 week
(cherry picked from commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd)
cross-build: Provide mempcpy when building on macOS
We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.
Fixes: ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after: 1 week
(cherry picked from commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd)
cross-build: Provide mempcpy when building on macOS
We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.
Fixes: ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after: 1 week
(cherry picked from commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd)
syslogd: Allow killing when in foreground
Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode. Extend that to also apply when running in the
foreground.
MFC after: 1 week
Reviewed by: jfree
Differential Revision: https://reviews.freebsd.org/D55886
(cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
syslogd: Allow killing when in foreground
Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode. Extend that to also apply when running in the
foreground.
MFC after: 1 week
Reviewed by: jfree
Differential Revision: https://reviews.freebsd.org/D55886
(cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
syslogd: Allow killing when in foreground
Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode. Extend that to also apply when running in the
foreground. Take this opportunity to comment the event loop.
MFC after: 1 week
Reviewed by: jfree
Differential Revision: https://reviews.freebsd.org/D55886
(cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
m4: Stop abbreviating builtin names
* Stop abbreviating macro names half-randomly to 8 chars, this is no
longer 1990.
* Likewise for function names (in particular use doindex for a function
that is notably different from the classic index function).
* Rename a few things for more fidelity: eval is the builtin name, not
expr and your maketemp/mkstemp conform to mkstemp semantics for better
security.
* Rewrap a few comments that were ludicrously short.
No functional changes except improved accuracy of some error messages.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55793
(cherry picked from commit f8f6f1cbd576ab5f15cef178cc05251365652f74)
m4: Stop abbreviating builtin names
* Stop abbreviating macro names half-randomly to 8 chars, this is no
longer 1990.
* Likewise for function names (in particular use doindex for a function
that is notably different from the classic index function).
* Rename a few things for more fidelity: eval is the builtin name, not
expr and your maketemp/mkstemp conform to mkstemp semantics for better
security.
* Rewrap a few comments that were ludicrously short.
No functional changes except improved accuracy of some error messages.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55793
(cherry picked from commit f8f6f1cbd576ab5f15cef178cc05251365652f74)
m4: Stop abbreviating builtin names
* Stop abbreviating macro names half-randomly to 8 chars, this is no
longer 1990.
* Likewise for function names (in particular use doindex for a function
that is notably different from the classic index function).
* Rename a few things for more fidelity: eval is the builtin name, not
expr and your maketemp/mkstemp conform to mkstemp semantics for better
security.
* Rewrap a few comments that were ludicrously short.
No functional changes except improved accuracy of some error messages.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55793
(cherry picked from commit f8f6f1cbd576ab5f15cef178cc05251365652f74)
libc/amd64/strrchr.S: rewrite and fix scalar implementation
The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character. It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().
Rewrite the function with logic that actually works. We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.
This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)). The default configuration is not affected.
The bug was unfortunately not caught by the unit test inherited
from NetBSD. An extended unit test catching the issue is proposed
in D56037.
[9 lines not shown]
libc/amd64/strrchr.S: rewrite and fix scalar implementation
The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character. It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().
Rewrite the function with logic that actually works. We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.
This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)). The default configuration is not affected.
The bug was unfortunately not caught by the unit test inherited
from NetBSD. An extended unit test catching the issue is proposed
in D56037.
[9 lines not shown]
rtld: add test for dlopen("#dirfd/path")
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56152
rtld: allow dlopen("#<number>/<path>")
When a specially formatted path is passed to dlopen(), of the form
#number/path
and the number is the valid dirfd file descriptor listed in the
LD_LIBRARY_FDS, interpret it as a relative path name against dirfd
number.
This complements the result returned from dladdr() for such objects
in dli_fname.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56152
kqueue: assert that kqueue knote lists own the knotes
Reviewed by: kevans, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D56212