Commit Graph
2081 Commits
Author SHA1 Message Date
Jaeyoon Choi 8895b1348f ufshci: install the ioctl header
The passthrough ioctl has a userland ABI header, but nothing installed
it. A program that wanted to use the ioctl had to copy the headers out
of the source tree by hand.

Install ufshci.h and ufshci_ioctl.h under /usr/include/dev/ufshci, the
way nvme installs nvme.h. The ioctl header pulls in ufshci.h, so both
go. Add the directory to the include mtree so installworld creates it.

Reviewed by:	imp (mentor)
Sponsored by:	Samsung Electronics
Differential Revision:	https://reviews.freebsd.org/D59560
2026-09-15 01:44:34 +00:00
Gordon Bergling 16246209d2 arpa/telnet: Fix a typo in a source code comment
- s/ascic/ASCII/

MFC after:	3 days
2026-09-11 18:31:29 +02:00
Faraz Vahedi 72ed6f9c9d libc: Add WCHAR_WIDTH in <wchar.h> as well
Define __WCHAR_WIDTH in sys/_types.h and derive WCHAR_WIDTH from
that, the same way as WCHAR_MIN and WCHAR_MAX, in both <wchar.h>
and <stdint.h> as per C23 §7.31.1 and §7.22.3.4, respectively.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D59385
2026-09-05 14:11:22 +03:30
Faraz Vahedi 733ea4ee58 libc: Add <inttypes.h> C23 feature test macro
Define __STDC_VERSION_INTTYPES_H__ now that the header fully
conforms to C23.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D59382
2026-09-05 12:00:29 +03:30
voidanix 48efb6c4eb gzoned: Introduce Zoned Storage emulator
gzoned(8) is a new GEOM class that exposes a host-managed zoned device
(similar to ZAC/ZBC drives) on top of regular, non-zoned providers.

The created medium is sliced into equally sized zones, by default
sequential-write-required.  Such zones can be turned into conventional
zones if desired.  The zoned drive's state and configuration is
persistent through metadata at the tail of the backing provider, meaning
the zoned device gets recreated at the provider retaste.  Zone state
changes only mark the table dirty with BIO_FLUSH committing it,
mirroring drives whose zone state is volatile until a cache flush.

The new class tries to emulate real zoned drives by incorporating
per-zone write pointers and support for BIO_ZONE management commands.
Fault emulation through zone conditions (RWP recommended, offline, R/O),
URSWRZ bit toggling and concurrent open zone limits are additional
features useful for testing.

While at it, fix zonectl's report of write pointer LBAs for zones that
should have none, remove its forced debug flags and allow the geom(8)
shared subroutines to detect host-managed drives.

ATF-sh tests for gzoned(8) and zonectl(8) (dogfooded by gzoned(8)) are
included, featuring helpers (see zoned_subr.sh) for testing zoned
storage support in other components or GEOM classes.

Reviewed by:	asomers, fuz, ken
Sponsored by:	Google Summer of Code 2026
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2326
2026-09-03 12:27:00 -06:00
Dag-Erling Smørgrav 5076e9b546 libc: Fix C23 version macro visibility
In headers that existed prior to C23, these should be visible only in
C23 or BSD mode.

Fixes:		0fe73dcf7c ("libc: Add <assert.h> C23 feature test macro")
Fixes:		1f09e35429 ("sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macro")
Fixes:		cd0727ec70 ("libc: Add <stdio.h> C23 feature test macro")
Fixes:		fc9d02cb29 ("libc: Add <time.h> C23 feature test macro")
Fixes:		4aeed6e9d2 ("libc: Add <setjmp.h> C23 feature test macro")
Reviewed by:	fuz, kfv, dteske
Differential Revision:	https://reviews.freebsd.org/D59272
2026-08-30 19:56:51 +02:00
Faraz Vahedi 4aeed6e9d2 libc: Add <setjmp.h> C23 feature test macro
Define the __STDC_VERSION_SETJMP_H__ feature test macro as the
header fully conforms to C23.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D59135
2026-08-24 17:18:08 +03:30
Faraz Vahedi fc9d02cb29 libc: Add <time.h> C23 feature test macro
Define the __STDC_VERSION_TIME_H__ feature test macro as the
header fully conforms to C23.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D59134
2026-08-24 17:17:15 +03:30
Faraz Vahedi 2712d1380f libc: Remove incorrectly defined __STDC_VERSION_STDBOOL_H__
C23 does not define __STDC_VERSION_STDBOOL_H__ for <stdbool.h>.
Feature test macros of this form only apply to headers where the
standard explicitly mandates one.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D59136
2026-08-24 16:48:55 +03:30
Faraz Vahedi d59c7ea270 libc: Implement bsearch_s(), document bsearch_b(), and add unit tests
- Implement bsearch_s() as per §K.3.6.3.2 in C23, first specified
  in C11.  It behaves identically to bsearch(), except the callback
  is called with a third argument, context, which is passed through
  from the caller, and it also performs runtime constraint checking
  on its arguments.
- Document bsearch_b(), bsearch_s(), and add history section
- Add rudimentary unit tests for bsearch(), bsearch_b(), and bsearch_s()

Reviewed by:	dteske, fuz
Approved by:    dteske (mentor), fuz (mentor)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D58876
2026-08-22 18:31:27 +03:30
Brooks Davis 95e33099c7 runtime: add the ability to set exterrors in userspace
The UEXTERROR(3) macro is a partial analog to EXTERROR(9) that sets
the current user exterror state and errno.  The main difference is
that it returns no value and sets errno directly since that's the
typical pattern in libraries.

While here move the storage and constructor for single-threaded
program's uexterr to its own file.

Reviewed by:	kib
Effort:		CHERI upstreaming
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D58059
2026-08-20 11:39:00 +01:00
Faraz Vahedi 8d29d24296 libc: Restore prior C23 include guards
To avoid any sort of POLA violation, this commit restores old
guards and defines the C23 feature test macros in addition to
them.  This is to close off whole class of possible breakage,
rather than patching it case by case.

Reported by:	dim
Reviewed by:	dim, dteske, fuz
Approved by:	dim, dteske (mentor), fuz (mentor)
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D58911
2026-08-19 13:51:21 +03:30
Jitendra Bhati 9aed7a7745 fts: add fts_openat() API
Add fts_openat() as a new entry point for fts(3).

When dirfd is AT_FDCWD the behaviour is identical to fts_open().
Passing a pre-opened directory fd allows fts traversal inside
Capsicum capability mode where path-based operations are not
permitted.

Capability mode users should use fts_parent->fts_dirfd + fts_name with
openat(2) to access files.

Reviewed by:	asomers
Relnotes:	yes
Sponsored by:	Google LLC (GSoC 2026)
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2273
2026-08-17 18:17:45 -06:00
Mark Johnston 37bd69d43c sys: Add sys/ckdint.h
We have a C23 stdckdint.h header for userspace, which provides checked
addition, subtraction and multiplication.  We lack similar helpers in
the kernel, where they are regularly needed.

Let's just adopt the C23 macros.  For bonus points, I added a wrapper to
ensure that ignored an return value is raised as an error by the
compiler.

Reviewed by:	kib, emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D58773
2026-08-17 18:41:36 +00:00
Faraz Vahedi cd0727ec70 libc: Add <stdio.h> C23 feature test macro
Define the __STDC_VERSION_STDIO_H__ feature test macro now that
the header fully conforms to C23.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D58842
2026-08-14 23:01:54 +03:30
Faraz Vahedi 10d5a54859 libc: Add _PRINTF_NAN_LEN_MAX per C23
Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Differential Revision: https://reviews.freebsd.org/D58842
2026-08-14 23:01:53 +03:30
Faraz Vahedi d08296c7ab libc: Implement qualifier-preserving standard library functions
Several standard library functions are specified to return an unqualified
pointer while accepting a pointer to a potentially const-qualified object.
N3020 addresses this behaviour, discarding qualifiers due to incompatible
pointer types, by introducing qualifier-preserving macros for the affected
set of standard library functions.

Add `__qualsel()` helper to `<sys/cdefs.h>`, implemented using the generic
selection, and define qualifier-preserving macros for that set of functions
in `<string.h>`, `<wchar.h>`, and `<stdlib.h>`.

Macros are gated on `_STDC_VERSION__ >= 202311L && !__cplusplus`, therefore
there is no behavioural change for earlier C modes or C++ translation units.
The kernel is likewise unaffected, as it does not include userland headers.

As function-like macros, they are transparent except at a call site where
the address-of operator is applied, the macro is suppressed via `#undef`,
or the identifier appears in parenthesised form; all of which cause the
underlying function designator to be used instead.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2288
2026-08-13 20:08:49 +03:30
Faraz Vahedi 1f09e35429 sys/limits.h: Add BOOL_MAX, BITINT_MAXWIDTH, and C23 feature test macro
Add BOOL_MAX and BITINT_MAXWIDTH macros for C23 compliance, and
define the __STDC_VERSION_LIMITS_H__ feature test macro now that
the header fully conforms to C23.

Reviewed by:	fuz
Approved by:	fuz (mentor)
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2352
2026-08-13 13:11:25 +03:30
Jitendra Bhati dd532ad133 fts: reduce fd usage by storing fts_dirfd on directory entries only
Previously fts_build() called _dup(_dirfd(dirp)) for every child
entry, holding N simultaneous fds for a directory with N children.

Redefine fts_dirfd: instead of a fd for the entry's parent
directory, it is now a fd for the entry itself, set only for
directory entries. One dup per directory in fts_build() instead
of one per child.  Close fts_dirfd during the directory post-order
visit, before advancing to its sibling.

To access a file using fd-relative operations, callers should use
openat(ent->fts_parent->fts_dirfd, ent->fts_name, ...) instead of
openat(ent->fts_dirfd, ent->fts_name, ...).  The fd is valid until the
directory's post-order visit (FTS_DP).

Reported by:    Mark Johnston <[email protected]>
Fixes:          4bd01d6ae0 (fts: refactor to use fd-relative operations)
Sponsored by:   Google LLC (GSoC 2026)
Reviewed by:	asomers
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2360
2026-08-10 10:14:16 -06:00
Jitendra Bhati 4bd01d6ae0 fts: refactor to use fd-relative operations internally
Replace all _open() calls with _openat() in __fts_open(), fts_read(),
and fts_children().  Replace statfs() with _fstatfs().

Add fts_dirfd to struct _ftsent, set to the file descriptor of the
parent directory. Callers can use openat(ent->fts_dirfd, ent->fts_name,
...) to access files safely without relying on fts_accpath, which
enables programs in capability mode to open the files described by
_ftsent.

This is a preparatory change for fts_openat() which will allow callers
to provide a pre-opened directory fd, enabling fts(3) traversal inside
Capsicum capability mode.

Mirror all fts_open() changes to fts_open_b().

As a result of expanding _ftsend, publish new ELF symbol versions for
fts_openat and related functions.

Sponsored by:	Google LLC (GSoC 2026)
Reviewed by:	asomers
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2303
2026-08-03 13:12:28 -06:00
Faraz Vahedi f68d7bfc14 libc: Add strfromd, strfromf, and strfroml per C23
strfromd(), strfromf(), and strfroml() are implemented directly
in terms of gdtoa.  If a non-conforming format string is passed,
the string "EDOOFUS" is returned and errno set to EDOOFUS as an
extension.

Reviewed by:	fuz
MFC after:	1 month
Pull-Request:	https://github.com/freebsd/freebsd-src/pull/2301
Signed-off-by:	Faraz Vahedi <[email protected]>
2026-08-02 14:10:02 +02:00
Abdelkader Boudih 5f74217c05 coreboot: Add coreboot firmware table driver
Nexus-attached driver that discovers and parses coreboot's LBIO tables
from physical memory. Exposes firmware metadata (version, build info,
mainboard, serial config, TSC frequency, CBMEM entries) via sysctl
hw.coreboot.*, the firmware console ring buffer via /dev/coreboot_console,
and structured CBMEM entry access via /dev/cbmem ioctl interface.

Tested on:
- Qotom Q535G6 (Kabylake)
- Intel NUC D54250WYK (Haswell)
- Intel NUC D33217GKE (Ivy Bridge)
- Dell 3100 2-in-1 (Gabbiter)
- Dell 3100 (Fleex)
- Lenovo IdeaPad 320s
- Lenovo ThinkPad T480
- HP Chromebook 11 G4
- HP Chromebook 11 G5
- HP Chromebook 11 G6 EE
- HP Chromebook 14 G4
- HP Chromebook 14 G5
- HP Chromebook x360 11 G1 EE
- HP Chromebook x360 11 G2 EE
- HP Chromebook x360 14 G1
- Acer C720
- Acer Chromebook 11
- Lenovo N22

Reviewed by:	ngie, kib, adrian
Differential Revision:	https://reviews.freebsd.org/D55649
2026-07-29 12:12:41 -07:00
Konstantin Belousov e1136fbcab libthr: implement pthread_cond_clockwait(3)
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D58463
2026-07-27 19:17:28 +03:00
Dag-Erling Smørgrav 3f15998d25 resolv.h: Remove unused parts
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D57927
2026-07-06 14:23:50 +02:00
Dag-Erling Smørgrav 55227ef42d Revert "resolv.h: Remove unused parts"
This reverts commit 95978326cb.
2026-06-29 17:53:57 +02:00
Dag-Erling Smørgrav 95978326cb resolv.h: Remove unused parts 2026-06-29 13:49:19 +00:00
Alan Somers bd1c0ff49c Revert "fts: refactor to use fd-relative operations internally"
This reverts commit e03ed9daeb.

The change to the size of struct FTSENT is breaking backwards
compatibility for some binaries.  Jitendra is working on a new version
that will move the new field into a private struct.

Reported by:	bdrewery
Fixes:		e03ed9daeb ("fts: refactor to use fd-relative operations")
Sponsored by:	ConnectWise
2026-06-24 11:00:04 -06:00
Jitendra Bhati e03ed9daeb fts: refactor to use fd-relative operations internally
Replace all _open() calls with _openat() in __fts_open(), fts_read(),
and fts_children().

Add fts_dirfd to FTSENT. Callers can use
openat(ent->fts_dirfd, ent->fts_name, ...) to access files
safely without relying on fts_accpath, which enables:

1. Capsicum capability mode where path-based operations fail
2. Security-sensitive programs that avoid TOCTOU races

Replace statfs(ent->fts_path) with _fstatfs(ent->fts_dirfd) in
fts_ufslinks() when fts_dirfd is valid, falling back to statfs() for
root-level entries where fts_dirfd is -1

This is a preparatory change for fts_openat() which will allow
callers to provide a pre-opened directory fd, enabling fts(3)
traversal inside Capsicum capability mode.

Sponsored by:	Google LLC (GSoC 2026)
Reviewed by:	asomers, jillest
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2278
2026-06-23 08:53:56 -06:00
Dag-Erling Smørgrav 8f750231d4 iconv: Update availability of bool
While here, drop duplicate include.

MFC after:	1 week
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D57733
2026-06-22 15:23:48 +02:00
Faraz Vahedi 694baf88c2 libc: Suppress <stdalign.h> content for C23 and later
C23 deprecates <stdalign.h> and specifies that the header shall
provide no content (§7.15.1).

Signed-off-by:	Faraz Vahedi <[email protected]>
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2223
MFC after:	1 month
Reviewed by:	imp, fuz
2026-06-10 18:14:32 +02:00
Faraz Vahedi 48d20fd1cf libc: Fix assert() sanitiser for C++ contextual bool conversion
Replace the `(bool(*)(bool))` probe in `__assert_sanitize()` with an unevaluated
conditional expression, so types with `explicit operator bool()` that require a
contextually converted constant expression of type `bool` are handled correctly.

Ergo, arity check is now performed separately via `__assert_sanitize_arity()`, a
unary template whose parameter pack must bind to exactly on argument after
`__VA_ARGS__` is substituted into the call.

Also align NDEBUG with C23 requirements.

Reported by:	dim, aokblast
Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	aokblast, fuz
MFC after:	1 week
Fixes:		867b51452e
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2265
2026-06-10 18:14:32 +02:00
Faraz Vahedi 5f732742ad libc: Add free_sized() and free_aligned_sized() as per C23
Add C23 sized deallocation entry points as thin wrappers around free(3).
Implementations may ignore size and alignment hints, so behaviour stays
correct for existing allocations without validating caller metadata yet.

When jemalloc is updated to 5.3.1, rewire these to je_free_sized() and
je_free_aligned_sized() so deallocation can use the allocator's sized
deallocation (free_sized for fast paths and free_aligned_sized for
correct aligned hints.)

Please note this change satisfies the standard interface only. Both
functions should be delegated to jemalloc after the upgrade so callers
get the intended allocator behaviour; until then, hints are unused and
neither sized nor aligned-sized deallocation optimizations apply.

Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2201
MFC after:	1 month
2026-06-07 22:59:19 +02:00
Dag-Erling Smørgrav 641e8e3956 Revert "libc: Constify the getcap API"
This broke cross-building on Linux and macOS.

This reverts commit 823d00b2d4.
2026-06-05 19:15:46 +02:00
Dag-Erling Smørgrav 823d00b2d4 libc: Constify the getcap API
MFC after:	1 week
Inspired by:	NetBSD
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D57252
2026-06-05 00:41:22 +02:00
Olivier Certner 7487932f4f assert.h: style(9): Space after #define, between #endif and comment
style(9) still allows TAB after #define but this is a historical
artifact and by far the minority of uses cases.  Going forward, we would
like to promote the use of a single space, as it allows alignment to
survive line prefixing (such as in diffs).

style(9) also has prescribed a single space between '#else' or '#endif'
and a comment recalling the guard since 2002.

So, commit 157c184689 ("assert.h: Remove leading tabs for whitespace
consistency") was good, and in line with rules about whitespace changes
(since the file was heavily modified by surrounding commits).

This commit is thus basically a revert of 439710cf00 ("assert.h:
Revert "Remove leading tabs for whitespace consistency"), which extended
replacing spaces with TABs in the code introduced in the meantime (after
commit 157c184689).

Reviewed by:    fuz, imp
Fixes:          439710cf00 ("assert.h: Revert "Remove leading tabs for whitespace consistency")
MAC after:      3 days
Differential Revision:  https://reviews.freebsd.org/D57391
2026-06-04 13:49:26 +02:00
Robert Clausecker 439710cf00 assert.h: Revert "Remove leading tabs for whitespace consistency"
This reverts commit 157c184689.

As per style(9), a tab goes after #define.  This should not have been
removed.

Reported by:	kib
Fixes:		157c184689.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2203
2026-05-31 21:49:23 +02:00
Konstantin Belousov 0ac9aac81c ntsync: install headers for userspace consumption
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D57038
2026-05-31 20:14:47 +03:00
Faraz Vahedi 0fe73dcf7c libc: Add <assert.h> C23 feature test macro
Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2203
2026-05-30 15:43:52 +02:00
Faraz Vahedi 867b51452e libc: Add variadic assert in accordance with C23
Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2203
2026-05-30 15:43:51 +02:00
Faraz Vahedi 157c184689 assert.h: Remove leading tabs for whitespace consistency
Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2203
2026-05-30 15:43:51 +02:00
Faraz Vahedi c5c7d18d01 libc: Restrict the static_assert macro to pre-C23 modes
Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2203
2026-05-30 15:43:51 +02:00
Faraz Vahedi 60c11e7c54 rpcsvc: Remove obsolete bool definition from yp_prot.h
`yp_prot.h` has carried a SunRPC-era typedef of `bool` guarded by
`BOOL_DEFINED`, but the header itself does not use it. The YP/RPC
interfaces use `bool_t` for protocol booleans.

Defining `bool` in a public header collides with modern C headers
that provide `bool` as a macro or keyword, such as `<stdbool.h>`
and C23-aware assert handling. Drop the compatibility typedef and
leave `bool` definition to the consumer's language mode.

Signed-off-by:	Faraz Vahedi <[email protected]>
Reviewed by:	fuz
MFC after:	1 month
Pull Request:	https://github.com/freebsd/freebsd-src/pull/2203
2026-05-30 15:43:51 +02:00
Aymeric Wibo aba599a6cc zzz: Rewrite to use new power device
Previous script called acpiconf(8) (or apm(8) if ACPI wasn't supported,
although this was anyway redundant because APMIO just uses ACPI now).

Since a new generic power management interface was introduced, this isn't
sufficient, as this would only work for ACPI systems and for ACPI S3 suspend
(so no way to select suspend-to-idle). Rewrite in C to take advantage of the
new power interface.

We may want to add a switch to manually override the kern.power.suspend sysctl,
which is otherwise what the power device uses to decide which suspend type to
switch to (suspend-to-idle or firmware suspend), but this will require us to
amend the power interface.

Reviewed by:	olce, imp, mhorne, ziaee
Tested by:	mhorne
Approved by:	olce, imp, mhorne, ziaee
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D56918
2026-05-27 00:05:45 +01:00
Konstantin Belousov a2e0822543 libc: add freadlink(3)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56365
2026-05-10 17:53:20 +03:00
Konstantin Belousov 9ca9a79ea6 Revert erronously pushed series of commits, which should not be.
Sorry for the mess.

Revert "sys/vnode.h: remove stale comment"
This reverts commit f193f5a749.

Revert "vfs: convert VFS_OPs from macros to static inlines"
This reverts commit 48bf024f2e.

Revert "vnode: add VIRF_KNOTE flag"
This reverts commit 7fe74a0276.

Revert "vfs: convert vfs_op_thread_* macros to static inlines"
This reverts commit a61a696e78.

Revert "struct vnode: assign v_rl.resv1 as v_vrflag"
This reverts commit d990e8f0e9.

Revert "sys/rangelock.h: explicitly enumerate padding at the end of the structure"
This reverts commit a770638ecf.

Revert "bufspace_wait(): only try to help bufdaemon if there is a chance to help"
This reverts commit 067cfac2e7.

Revert "Add O_SYMLINK emulation"
This reverts commit f9458655e7.

Revert "libc: add freadlink(3)"
This reverts commit ae6a13deb8.

Revert "Add O_SYMLINK emulation"
This reverts commit 2213820b6f.
2026-05-03 23:12:03 +03:00
Konstantin Belousov ae6a13deb8 libc: add freadlink(3)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56365
2026-05-03 22:58:36 +03:00
Kyle Evans 910f78a514 tests: fix remaining test failures under _FORTIFY_SOURCE
The getgroups test is a NetBSD tests, so just apply our larger hammer
and disable the feature entirely.  The audit test can take a more
surgical approach and use __ssp_real() appropriately, since it's a local
one.

PR:		294881
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56735
2026-04-30 21:58:48 -05:00
Kyle Evans d98f4f0698 ssp: fix our gets_s implementation under _FORTIFY_SOURCE
Annex K specifies an interface for handling constraint violations from
gets_s, but we previously broke this for some classes of get_s misuse.

Provide a more nuanced version that tries to dodge errors that would
trigger a constraint handler while still providing value.  Notably, we
don't want to trigger a failure unless the passed-in length reasonably
fits within an RSIZE_MAX, because gets_s will immediately call larger
lengths bogus and fail.

PR:		294881
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D56734
2026-04-30 21:58:48 -05:00
Robert Clausecker c8c9324c94 include/stdbit.h: declare size_t, (u)int*_t, and (u)int_least*_t
These are required by ISO/IEC 9899:2024 § 7.18.1 ¶ 1 but were forgotten
in my initial work.

The current approach leaks intptr_t, uintptr_t, intmax_t, and uintmax_t
through <sys/_stdint.h>.  This could be avoided using a more complicated
approach if desired.

PR:		294131
Fixes:		6296500a85
Reported by:	Collin Funk <[email protected]>
Reviewed by:	imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D56515
2026-04-20 22:59:54 +02:00
Konstantin Belousov f286933c95 unistd.h: _Fork(2) is required by POSIX 2024
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D56362
2026-04-12 23:29:36 +03:00