FreeBSD/src f879eb3lib/libc/db/hash hash.c, lib/libc/tests/db dbm_nextkey_test.c

libc/dbm: Differentiate between uninitialized and end-of-db cursors

Commit `3a686b851f8f` fixed a `dbm_nextkey` edge case when using
the function after reaching the end of the database, but it inadvertently
broke the following `R_NEXT` behaviour:
"If the cursor is not yet set, this is the same as the R_FIRST flag."

Fix this by adding a new cursor constant that allows us to differentiate
between an unset cursor and a cursor that overflowed.

Reported by:    ae
Fixes:  3a686b851f8f
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D57670
Reviewed by:    markj
DeltaFile
+33-0lib/libc/tests/db/dbm_nextkey_test.c
+8-4lib/libc/db/hash/hash.c
+41-42 files

FreeBSD/src 43fb5b3sys/dev/efidev efirt.c

efirt(9): in verbose mode, announce the attachment and fw spec version

Reviewed by:    emaste, imp
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D57710
DeltaFile
+8-1sys/dev/efidev/efirt.c
+8-11 files

FreeBSD/src f7b71f8sys/net if_ovpn.c

if_ovpn: Fix a lock leak in an error path

Reviewed by:    kp
MFC after:      1 week
Fixes:          04a7134c1e92 ("if_ovpn: fix use-after-free of mbuf")
Differential Revision:  https://reviews.freebsd.org/D57696
DeltaFile
+1-0sys/net/if_ovpn.c
+1-01 files

FreeBSD/src 8ed580blib/libsys adjtime.2

adjtime(2): document that delta can be NULL

The current verbiage somewhat indicates that always adjusts the time,
which hasn't been true as far back as I had the energy to `git blame`.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D57676
DeltaFile
+12-2lib/libsys/adjtime.2
+12-21 files

FreeBSD/src 57fefbesys/sys capsicum.h

rights(4): fix our representation of the unused bits

The current format seems to be a little confusing, and the version of it
for index 0 was broken by the below-referenced commit.  Break our
UNUSED macros out into one per unused bit to enumerate the entirety of
the space and make it easier to claim an unused one.

Fixes:  b165e9e3ea4e327fc ("Add fchroot(2)")
Reviewed by:    oshogbo (previous version), kib, markj
Differential Revision:  https://reviews.freebsd.org/D57505
DeltaFile
+56-8sys/sys/capsicum.h
+56-81 files

FreeBSD/src 5ec4a7busr.sbin/mixer mixer.c

mixer(8): Retire deprecated control values

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week

(cherry picked from commit de2a1366022d71c1d650832d378964c4cbe65ba7)
DeltaFile
+0-21usr.sbin/mixer/mixer.c
+0-211 files

FreeBSD/src c27779esys/compat/linuxkpi/common/include/linux string.h

linuxkpi: Change `strscpy()` and `strscpy_pad()` to make their `len` argument optional

The previous implementation always took the `len` but now, it is
optional and defaults to the size of `dst`.

The DRM drivers started to use `strscpy()` without the `len` in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57585
DeltaFile
+13-2sys/compat/linuxkpi/common/include/linux/string.h
+13-21 files

FreeBSD/src af187b2sys/compat/linuxkpi/common/include/linux args.h

linuxkpi: Define `COUNT_ARGS()` and `CONCATENATE()`

`COUNT_ARGS()` counts the number of arguments it is passed. The
implementation is heavily inspired from the one of `CTR()`.

`CONCATENATE()` is an alias for `__CONCAT()`.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57584
DeltaFile
+17-0sys/compat/linuxkpi/common/include/linux/args.h
+17-01 files

FreeBSD/src 50aa145sys/compat/linuxkpi/common/include/linux file.h

linuxkpi: Add 'fd_empty()`

The DRM drivers generic code started to use it in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57582
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/file.h
+6-01 files

FreeBSD/src 2e10a6bsys/compat/linuxkpi/common/include/linux suspend.h

linuxkpi: Add `pm_resume_via_firmware()`

This function is unimplemented, always return false.

While here, fix the return type of `pm_suspend_via_firmware()`: it
should be a boolean, not an integer.

The amdgpu DRM driver started to use `pm_resume_via_firmware()` in Linux
6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57580
DeltaFile
+8-2sys/compat/linuxkpi/common/include/linux/suspend.h
+8-21 files

FreeBSD/src 53baadcsys/compat/linuxkpi/common/include/acpi video.h

linuxkpi: Define a bunch of constants in <acpi/video.h>

`ACPI_VIDEO_NOTIFY_PROBE` was already defined. Let's define the whole
set once and for all.

The amdgpu DRM driver started to use `ACPI_VIDEO_DISPLAY_LCD` in Linux
6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57575
DeltaFile
+19-1sys/compat/linuxkpi/common/include/acpi/video.h
+19-11 files

FreeBSD/src 294553bsys/compat/linuxkpi/common/include/linux sysfs.h

linuxkpi: Define `__ATTR_RO_MODE()` and `__ATTR_RW_MODE()`

They are the same as their `__ATTR_RO()` and `_ATTR_RW()` equivalents
but they take the file mode as an extra argument.

We now use these new macros to redefine `__ATTR_RO()` and `__ATTR_RW()`
on top of them.

The amdgpu DRM driver started to use `__ATTR_RW_MODE()` in Linux 6.13.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57574
DeltaFile
+6-3sys/compat/linuxkpi/common/include/linux/sysfs.h
+6-31 files

FreeBSD/src 4831a8dsys/sys ctype.h

sys: Add `isgraph()` to <sys/ctype.h>

Quote from https://pubs.opengroup.org/onlinepubs/7908799/xbd/locale.html:

    "graph": Define characters to be classified as printable characters,
    not including the space character.

Reviewed by:    emaste
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57578
DeltaFile
+6-0sys/sys/ctype.h
+6-01 files

FreeBSD/src d582187contrib/file/magic/Magdir archive firmware, contrib/file/src readelf.c funcs.c

MFV: file 5.47.

(cherry picked from commit e949ce9dc0e6fff26e83904f1008b76d36ba0a37)

file: normalize .result files to ensure trailing newline on install

Some upstream result files introduced in file 5.47 (e.g., bgcode.result)
lack a trailing newline, causing the contrib_file_tests ATF test to
fail with "cmp: EOF on bgcode.result".  Generate normalized copies
of the expected results and install those instead.

Fixes:          e949ce9dc0e6fff26e83904f1008b76d36ba0a37

(cherry picked from commit f7c0bd206fe4f3a956b3ecb4dc11a7386b85fa22)
DeltaFile
+143-74contrib/file/magic/Magdir/archive
+109-96contrib/file/src/readelf.c
+140-5contrib/file/magic/Magdir/firmware
+112-0contrib/file/magic/Magdir/sf3
+77-26contrib/file/src/funcs.c
+101-1contrib/file/magic/Magdir/database
+682-20278 files not shown
+2,054-59784 files

FreeBSD/src 5f5fd36contrib/file/magic/Magdir archive firmware, contrib/file/src readelf.c funcs.c

MFV: file 5.47.

(cherry picked from commit e949ce9dc0e6fff26e83904f1008b76d36ba0a37)

file: normalize .result files to ensure trailing newline on install

Some upstream result files introduced in file 5.47 (e.g., bgcode.result)
lack a trailing newline, causing the contrib_file_tests ATF test to
fail with "cmp: EOF on bgcode.result".  Generate normalized copies
of the expected results and install those instead.

Fixes:          e949ce9dc0e6fff26e83904f1008b76d36ba0a37

(cherry picked from commit f7c0bd206fe4f3a956b3ecb4dc11a7386b85fa22)
DeltaFile
+143-74contrib/file/magic/Magdir/archive
+109-96contrib/file/src/readelf.c
+140-5contrib/file/magic/Magdir/firmware
+112-0contrib/file/magic/Magdir/sf3
+77-26contrib/file/src/funcs.c
+101-1contrib/file/magic/Magdir/database
+682-20278 files not shown
+2,054-59784 files

FreeBSD/src 94d7f7erelease Makefile.gce

GCE: Apply public-image label on GCE images

Update the GCE image creation process to automatically apply the
'public-image=true' label when publishing new images. This aligns
with standard labeling expectations for images hosted in public
projects.

(cherry picked from commit c85542b92acd286d9e4b034b2ab4d6b6cd46c740)
DeltaFile
+1-0release/Makefile.gce
+1-01 files

FreeBSD/src 6c2ea28release Makefile.gce

GCE: Apply public-image label on GCE images

Update the GCE image creation process to automatically apply the
'public-image=true' label when publishing new images. This aligns
with standard labeling expectations for images hosted in public
projects.

(cherry picked from commit c85542b92acd286d9e4b034b2ab4d6b6cd46c740)
DeltaFile
+1-0release/Makefile.gce
+1-01 files

FreeBSD/src 22d6695usr.sbin/ifmcstat ifmcstat.8 ifmcstat.c

ifmcstat: Fixup getopt args to match reality.

Reviewed by:    emaste
Fixes:          ad0e698e642e ("ifmcstat: remove libkvm(3) code")
Event:          BSDCan 2026
DeltaFile
+0-3usr.sbin/ifmcstat/ifmcstat.8
+1-1usr.sbin/ifmcstat/ifmcstat.c
+1-42 files

FreeBSD/src 640ddf8sys/sys stdatomic.h

libc: Enforce lock-free atomic_flag and C23-safe initialisation

Select the `atomic_flag` backing type according to the C standard
requirements that `atomic_flag` operations be lock-free.

C11 §7.17.1.5 defines `atomic_flag` as:

> a structure type representing a lock-free, primitive atomic flag

and §7.17.8.2 further requires:

> Operations on an object of type atomic_flag shall be lock free

Therefore:

- Prefer `atomic_bool` when `ATOMIC_BOOL_LOCK_FREE == 2`
- Fall back to `atomic_uchar` when `ATOMIC_CHAR_LOCK_FREE == 2`
- Trigger a translation failure if neither type is lock-free


    [13 lines not shown]
DeltaFile
+12-4sys/sys/stdatomic.h
+12-41 files

FreeBSD/src 0f8941ftools/regression/include/stdatomic logic.c

tools/regression: Expand stdatomic conformance tests

Extend the existing test utility to cover recent stdatomic
changes and improve validation of interface semantics,
compile-time assertions, and behavioural conformance.

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
DeltaFile
+109-0tools/regression/include/stdatomic/logic.c
+109-01 files

FreeBSD/src 26bf9fcsys/sys stdatomic.h

libc: Fix GCC pointer semantics for atomic_fetch_add/sub

Correct the GCC implementation of `atomic_fetch_add_explicit()`
and `atomic_fetch_sub_explicit()` for atomic pointer types.

The previous implementation passed the operand directly to the
builtins. For pointer objects, this could result in raw byte-wise
address arithmetic rather than the required C atomic pointer
semantics, where the operand is interpreted as a `ptrdiff_t`
element count.

As a result, operations such as `atomic_fetch_sub_explicit(&p, 2, ...)`
could produce an incorrect post-operation pointer value.

Fix this by applying pointer scaling in the GCC path before invoking
the builtin, mirroring the existing legacy fallback implementation.
Pointer operands are now scaled by the size of the pointed-to type,
while integer atomic behaviour remains unchanged.


    [3 lines not shown]
DeltaFile
+6-2sys/sys/stdatomic.h
+6-21 files

FreeBSD/src 54ac231sys/sys stdatomic.h

libc: Fix atomic_init for GCC atomic objects

Add a dedicated `__GNUC_ATOMICS` path that initialises via
`atomic_store_explicit(obj, value, memory_order_relaxed)`.

This ensures the required initialisation semantics without
assuming any particular object representation.

Previously, `atomic_init` on GCC fell through to the legacy
`__val` member path intended only for old struct-backed
atomic objects. For current atomic objects, this caused the
following compilation error:

> error: request for member '__val' in something not a
  structure or union

As a result, valid code such as `atomic_init(&x, 1)` failed
to compile when using GCC.


    [6 lines not shown]
DeltaFile
+3-0sys/sys/stdatomic.h
+3-01 files

FreeBSD/src cb88e7bsys/sys stdatomic.h

libc: Reorder atomic operations to match ISO C standard

Reorder definitions of specified generic operations on atomic types
so they follow the sequence in ISO/IEC 9899:2024 §7.17.7:

1. `atomic_store`
2. `atomic_load`
3. `atomic_exchange`
4. `atomic_compare_exchange`
5. `atomic_fetch`

This aligns the header layout with the standard, making it easier
to cross-check against the normative text and maintain consistency
with the rest of the header.

The behaviour of the macros remains unchanged; this is purely a
reorganisation and documentation improvement.

Signed-off-by: Faraz Vahedi <kfv at kfv.io>

    [2 lines not shown]
DeltaFile
+50-50sys/sys/stdatomic.h
+50-501 files

FreeBSD/src 9d87c1asys/sys stdatomic.h

libc: Add missing kill_dependency macro

Add `kill_dependency` as specified by C11 §7.17.3.1.

The macro is required to break dependency chains in
expressions without affecting the value.

No functional impact beyond providing the required,
value-preserving definition.

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
DeltaFile
+2-0sys/sys/stdatomic.h
+2-01 files

FreeBSD/src 4b14655sys/contrib/dev/rtw88 main.c

rtw88: Fix typo in portability glue

Fix typo in if statement for compiling rtw88 against a Linux target.

Signed-off-by: Lambert Lim <lambert at sanesecurityguy.com>
Reviewed by: imp,ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/2262
DeltaFile
+1-1sys/contrib/dev/rtw88/main.c
+1-11 files

FreeBSD/src 28cecfesys/sys stdatomic.h

libc: Restrict ATOMIC_VAR_INIT for C23 conformance

Omit `ATOMIC_VAR_INIT` when targeting C23, where it has been removed.
Retain it for earlier C standards and for C++ (as it still remains in
C++23, albeit marked as deprecated since C17 and C++20.)

Also separate `atomic_init` definitions from `ATOMIC_VAR_INIT` to
avoid coupling with a deprecated initialisation mechanism.

No functional change intended for `atomic_init`; this is purely a
conformance and cleanup adjustment.

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
DeltaFile
+7-1sys/sys/stdatomic.h
+7-11 files

FreeBSD/src e17fddcsys/sys stdatomic.h

libc: Reorganise memory_order enumeration constants

Place the `memory_order` enumeration constants alongside the corresponding
typedef under the §7.17.3 heading.

The previous layout separated the fallback constant definitions from the
enum, which could obscure their relationship. These fallbacks exist only
to provide values when the compiler does not supply the builtins.

The removed comment encoded implementation-specific assumptions about
compiler-provided definitions and implied a relationship between Clang/GCC
macros and fallback values. In practice, the fallback definitions exist
solely to ensure the enumerators are defined when compiler intrinsics are
absent, and do not depend on any particular numeric mapping.

No functional change; this is a mere structural and clarity improvement.

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
DeltaFile
+4-10sys/sys/stdatomic.h
+4-101 files

FreeBSD/src 85becdasys/sys stdatomic.h

libc: Add atomics C23 feature test macro

Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2185
DeltaFile
+3-3sys/sys/stdatomic.h
+3-31 files

FreeBSD/src 255538clib/libc/powerpc64 _fpmath.h, lib/libcompiler_rt Makefile.inc comparekf2.c

powerpc64le: switch long double to IEEE binary128

Change powerpc64le's long double from 64-bit double to IEEE 754
binary128 (quad, 113-bit mantissa), matching aarch64 and riscv64.

Gated on FreeBSD 16 and powerpc64le only.

Differential Revision: https://reviews.freebsd.org/D57388
Reviewed by:    adrian
Relnotes:       yes
DeltaFile
+59-0lib/libcompiler_rt/Makefile.inc
+43-0lib/libcompiler_rt/comparekf2.c
+43-0lib/msun/powerpc/ld128_compat.c
+36-0lib/msun/powerpc/Symbol_f128.map
+24-5lib/libc/powerpc64/_fpmath.h
+17-0sys/powerpc/include/float.h
+222-515 files not shown
+292-2021 files

FreeBSD/src 7386c06share/mk dirdeps.mk meta2deps.py

Update dirdpes.mk et al

Update to latest dirdeps related makefiles.

dirdeps.mk tweaks useful for universe among other corner cases.
           also additional filtering for bogus paths ending in /

gendirdeps.mk allow more debugging
           also additional filtering for bogus paths ending in /

install-new.mk fix bug when isPOSIX_SHELL is true

meta2deps.?? handle file names with spaces by ignoring them

Reviewed by: stevek
Differential Revision:  https://reviews.freebsd.org/D57683
DeltaFile
+19-9share/mk/dirdeps.mk
+16-9share/mk/meta2deps.py
+13-2share/mk/meta2deps.sh
+10-4share/mk/gendirdeps.mk
+2-2share/mk/install-new.mk
+60-265 files