atf-c(3): fill in prototypes for functions
This change fills in prototypes for functions exposed by atf-c(3) to aid
the programmer with using the APIs with the library.
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D50734
fusefs: Fix a panic when unmounting before init
fusefs would page fault due to the following sequence of events:
* The server did not respond to FUSE_INIT in timely fashion.
* Some other process tried to do unmount.
* That other process got killed by a signal.
* The server finally responded to FUSE_INIT.
PR: 287438
MFC after: 2 weeks
Sponsored by: ConnectWise
Reviewed by: arrowd
Differential Revision: https://reviews.freebsd.org/D50799
mandoc: Vendor import of upstream at 2025-04-08
Interesting changes:
+ correct legacy mandoc date typo, reported on our very own bugzilla
+ improve libmandoc manual
+ strengthen recommendations to omit macros from title lines in mdoc(7)
+ improve html5 compliance in html output
+ improve RFC linking in markdown output
+ libmandoc and mdoc manuals have been improved
+ support arithmetic operations in tbl(7) column widths for DocBook
+ define the St -isoC-2023 macro for referencing the C23 spec
Approved by: mhorne (mentor, implicit)
Reviewed by: imp
Discussed with: adrian, bapt, brooks
Closes: https://github.com/freebsd/freebsd-src/pull/1689
manuals: Align our tree with upstream C23 macro
Switch all instances of the -isoC-2024 macro to -isoC-2023 selected by
upstream. Keep -isoC-2024 defined, but deprecated, for backwards compat.
MFC after: 3 days (I will resolve merge conflicts with cdefs)
vm/vm_mmap.c: provide extended errors for most places
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D50792
Makefile.inc1: Cleanup (un)compressed manpages
When switching between compressed and uncompressed manual pages, the
other type is left behind as divots. Compensate by removing the
now-unwanted man pages automatically.
Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1295
rtld amd64: extend osrel check to enable tlsbase op on stable/14
This is a direct commit to stable/14.
Reported by: Mark Millard <marklmi at yahoo.com>
Sponsored by: The FreeBSD Foundation
netinet6: Remove ndpr_raf_ra_derived flag
This flag was introduced at 8036234c72c9361711e867cc1a0c6a7fe0babd84
to prevent the SIOCSPFXFLUSH_IN6 ioctl from removing manually-added
entries. However, this flag did actually not work due to an
incomplete implementation making prelist_update() not handle it before
calling nd6_prelist_add().
This patch removes the flag because a prefix is derived from an RA
always has an entry in the ndpr_advrtrs member in the struct
nd_prefix. Having a separate flag is not a good idea because it can
cause a mismatch between the flag and the ndpr_advrtrs entry. Testing
using LIST_EMPTY() is simpler for the origial goal.
This also removes in a prefix check in the ICMPV6CTL_ND6_PRLIST sysctl
to exclude manually-added entries. This ioctl is designed to list all
entries, and there is no relationship to SIOCSPFXFLUSH_IN6.
Differential Revision: https://reviews.freebsd.org/D46441
Implement CLOCK_TAI
Provide a clock through clock_gettime() that returns the current TAI
time (UTC without leap seconds) as a complement to CLOCK_REALTIME. This
provides compatibility with Linux, which also provides a CLOCK_TAI since
kernel 2.6.26, and this seems to be becoming the standard way to acquire
TAI time. Unlike Linux, this code will return EINVAL if the TAI offset
(set by ntpd, ptpd, etc.) is not known since it seems pathological for
CLOCK_TAI to silently give the wrong (UTC) time if the offset is not
known as it does on Linux.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D46268
rc: Disable pathname expansion when calling run_rc_command()
Variables for command-line options like $foo_flags can contain characters
that perform pathname expansions, such as '[', ']', and '*'. They were
passed without escaping, and the matched entries in the working directory
affected the command-line options. This change turns off the expansion
when run_rc_command() is called.
While this changes the current behavior, an invocation of a service
program should not depend on entries in the working directory.
Differential Revision: https://reviews.freebsd.org/D45855
libcasper: Fix inconsistent error codes of cap_get{addr,name}info()
The get{addr,name}info(3) API is designed to return an API-specific error
code that is independent of errno. The cap_get{addr,name}info() functions
returned either an errno or API-specific error code inconsistently.
This change fixes this mismatch.
When the API returns an errno, the return value itself is set to
EAI_SYSTEM and errno is set depending on the actual error. So, usually
this API is called in the following form:
error = getnameinfo(...);
if (error == EAI_SYSTEM)
perror("getnameinfo");
else if (error)
errx(1, "getnameinfo: %s", gai_strerror(error);
If the above getnameinfo() call is replaced with cap_getnameinfo(),
it breaks the error handling. For example, the cap_get{addr,name}info()
[7 lines not shown]
libcasper: Use __VA_ARGS__ for function-like macros
cap_net.h uses "#define cap_f(chan, a) f(a)" to call the conventional
service function with the first argument of cap_f() dropped for
compatibility with the environment where the casper service is
unavailable. However, this function-like macro does not work when the
arguments contains C99 compound literals, such as f(chan, (int[]){1,2,3}).
The following is a typical example:
error = cap_getaddrinfo(capnet, "192.168.0.1", "100",
&(struct addrinfo){
.ai_family = AF_INET,
.ai_flags = AI_NUMERICHOST
}, &res);
Using cap_f(chan, ...) and __VA_ARGS__ in C99 seems a reasonable solution
for this problem. While there is a workaround using parenthesis around
the compound literal like f(chan, ((int[]){1,2,3})), it is not intuitive
and the above example works when the cap_net is available and f() is
[9 lines not shown]