aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | cuse(3): annotate cuse_init() to suppress thread safety analysisDimitry Andric2025-12-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids warnings from clang 21, similar to: /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis] 111 | TAILQ_INIT(&h_cuse); | ^ /usr/src/lib/libcuse/cuse_lib.c:111:14: error: writing variable 'h_cuse' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis] /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis] 112 | TAILQ_INIT(&h_cuse_entered); | ^ /usr/src/lib/libcuse/cuse_lib.c:112:14: error: writing variable 'h_cuse_entered' requires holding mutex 'm_cuse' exclusively [-Werror,-Wthread-safety-analysis] MFC after: 3 days
* | src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knobDimitry Andric2025-12-233-10/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 2e47f35be5dc libllvm, libclang and liblldb were converted into private shared libraries. This allowed clang, lld, lldb, and other llvm tools to be linked against these shared libraries, which makes them smaller and avoids duplication. However, this also comes at the cost of some performance, since the dynamic libraries are quite large, and contain lots of long symbols (mangled C++ identifiers). Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go back to the previous behavior: libllvm, libclang and liblldb are built as internal static libraries, i.e. only available during buildworld, and fully linked into the various executables such as clang, lld, etc. PR: 287447 Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50956
* | MFV 762f11d98d5cd57ebbe85c36e9e86a557a91fe4e: xz 5.8.2.Xin LI2025-12-231-3/+9
| | | | | | | | MFC after: 7 days
* | Remove debug crutch I accidentally left inDimitry Andric2025-12-221-1/+0
| | | | | | | | | | Fixes: cf1eaaf41cef MFC after: 1 week
* | Reduce number of external symbols in libllvm, libclang and liblldbDimitry Andric2025-12-222-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 2e47f35be5dc libllvm, libclang and liblldb were converted into private shared libraries. This allowed clang, lld, lldb, and other llvm tools to be linked against these shared libraries, which makes them smaller and avoids duplication. However, upstream builds the shared libraries using several visibility options, which reduces the number of external symbols, and makes the libraries a bit smaller. On my test machine: * libprivatellvm.so goes from 75643 to 34706 symbols (~54% reduction) * libprivateclang.so goes from 53250 to 33531 symbols (~37% reduction) * libprivatelldb.so goes from 27242 to 18798 symbols (~31% reduction) Note: to get the full benefit, a clean build is required. Incremental builds should still work, but I didn't want to force a full rebuild on everybody. MFC after: 1 week
* | libpfctl: export a get states variant that takes a pfctl_handleKristof Provost2025-12-212-11/+12
| | | | | | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* | librt/mq_getfd_np.3: Initial manual pageRick Parrish2025-12-182-0/+59
| | | | | | | | | | | | | | | | | | | | The mq_getfd_np function appeared in FreeBSD 11 with no documentation. This function dereferences the mqd_t as a pointer to an int. Relnotes: yes MFC after: 3 days Reviewed by: kib (previous), markj, ziaee Differential Revision: https://reviews.freebsd.org/D43947
* | gpart: add libxo support for "show" subcommand + man page updatesJohan Söllvander2025-12-183-34/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | Added libxo support to `gpart show`, also updated the man pages for geom and gpart to show where you can expect libxo formatted output. PR: 290629 MFC after: 1 week Sponsored by: ConnectWise Reviewed by: asomers, mckusick, phil Approved by: asomers (mentor) Differential Revision: https://reviews.freebsd.org/D53950
* | libpfctl: fix tstats address countKristof Provost2025-12-181-1/+2
| | | | | | | | | | | | Reported by: Marcos Mendoza <mmendoza@netgate.com> See also: https://redmine.pfsense.org/issues/16588 Sponsored by: Rubicon Communications, LLC ("Netgate")
* | bectl: log modifying functions to zpool historyRob Norris2025-12-173-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modeled directly after the method used by the zfs/zpool commands: flag commands with a "please log me" flag, and when there, reconstruct the command line. On success, call the library function to add it to the log. (Majority of the change by Rob; minor edits by kevans@) Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Co-authored-by: Kyle Evans <kevans@FreeBSD.org> Sponsored by: Modirum MDPay Sponsored by: Klara, Inc.
* | vmm: Add ability to destroy VMs on closeBojan Novković2025-12-172-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds the ability to tie a virtual machine's lifecycle to a /dev/vmmctl file descriptor. A user can request `vmmctl` to destroy a virtual machine on close using the `VMMCTL_CREATE_DESTROY_ON_CLOSE` flag when creating the virtual machine. `vmmctl` tracks such virtual machines in per-descriptor lists. Differential Revision: https://reviews.freebsd.org/D53729 Reviewed by: markj Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. MFC after: 3 months
* | lib/msun/tests: xfail remaining failing tests on non-x86 archsSiva Mahadevan2025-12-1711-3/+69
| | | | | | | | | | | | | | | | | | | | | | These are the remaining trivial xfail cases where no other test logic changes are necessary. Signed-off-by: Siva Mahadevan <me@svmhdvn.name> PR: 290099 MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1871
* | lib/msun/tests: xfail failing lrint_test cases on non-x86 archsSiva Mahadevan2025-12-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | Replace ATF_CHECK_* with ATF_REQUIRE_* to fail fast and avoid unexpected aborts. Signed-off-by: Siva Mahadevan <me@svmhdvn.name> PR: 290099 MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1871
* | lib/msun/tests: xfail failing invtrig_test cases on non-x86Siva Mahadevan2025-12-171-7/+19
| | | | | | | | | | | | | | | | | | | | Replace ATF_CHECK_* with ATF_REQUIRE_* to fail fast and avoid unexpected abort. PR: 290099 MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1871
* | lib/msun/tests: Add REQUIRE_ variants of test-utils macrosSiva Mahadevan2025-12-171-15/+30
| | | | | | | | | | | | | | Signed-off-by: Siva Mahadevan <me@svmhdvn.name> MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1871
* | lib/msun/tests: Remove newlines in ATF msgsSiva Mahadevan2025-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes broken test reports with the following message: lib/msun/fe_round_test:fe_round -> broken: Test result contains multiple lines: expected_failure: /usr/src/contrib/netbsd-tests/lib/libm/t_fe_round.c:95: Didn't get the same rounding mode out!<<NEWLINE>>(index 0) fed in 64 rounding mode, got 0 out<<NEWLINE>> [0.079s] Signed-off-by: Siva Mahadevan <me@svmhdvn.name> MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1871
* | lib/msun/tests: Replace remaining printf() with debug()Siva Mahadevan2025-12-172-7/+7
| | | | | | | | | | | | | | Signed-off-by: Siva Mahadevan <me@svmhdvn.name> MFC after: 3 days Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/1871
* | rtld: silence clang's unterminated-string-initialization warningAlex Richardson2025-12-161-1/+2
| | | | | | | | | | | | | | | | | | | | Since the initializer is used in other places where we can't just replace it with a char-by-char initializer, this adds a macro for the nonstring attribute (match the linuxkpi definition). Reviewed by: emaste, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52535
* | libfetch: Fix -Wunterminated-string-initializationAlex Richardson2025-12-161-1/+1
| | | | | | | | | | | | | | | | | | This defaults to an error in clang HEAD, use a char-by-char initializer instead. Reviewed by: emaste, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52532
* | libthr: fix -Wunterminated-string-initializationAlex Richardson2025-12-161-2/+1
| | | | | | | | | | | | Reviewed by: jhb, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D52528
* | libc/amd64: Disable baseline version of stpncpy()Dag-Erling Smørgrav2025-12-161-0/+2
| | | | | | | | | | | | | | | | | | This implementation appears to be broken on some CPUs. Disable it until the issue can be investigated and fixed. PR: 291720 Fixes: 66eb78377bf1 ("libc/amd64: fix overread conditions in stpncpy()") Fixes: 90253d49db09 ("lib/libc/amd64/string: add stpncpy scalar, baseline implementation")
* | libpathconv: Document library in the man pagesArtem Bunichev2025-12-162-2/+4
| | | | | | | | | | Reviewed by: ziaee, imp Differential Revision: https://reviews.freebsd.org/D54213
* | libc/test: fix typoRobert Clausecker2025-12-141-1/+1
| | | | | | | | | | | | | | I misapplied ngie's recommended correction. Fixes: 123c086200491819595abc271d360e605288fd18 Differential Revision: https://reviews.freebsd.org/D54169
* | libc/amd64: fix overread conditions in stpncpy()Robert Clausecker2025-12-141-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to incorrect unit test design, two overread conditions went undetected in the amd64 baseline stpncpy() implementation. For buffers of 1--16 and 32 bytes that do not contain nul bytes and end exactly at a page boundary, the code would incorrectly read 16 bytes from the next page, possibly crossing into an unmapped page and crashing the program. If the next page was mapped, the code would then proceed with the expected behaviour of the stpncpy() function. Three changes were made to fix the bug: - an off-by-one error is fixed in the code deciding whether to enter the runt case or not, entering it for 0<n<=32 bytes instead of 0<n<32 bytes as it was before. - in the runt case, the logic to skip reading a second 16-byte chunk if the buffer ends in the first chunk was fixed to account for buffers that end at a 16-byte boundary but do not hold a nul byte. - in the runt case, the logic to transform the location of the end of the input buffer into a bit mask was fixed to allow the case of n==32, which was previously impossible due to the incorrect logic for entering said case. The performance impact should be minimal. PR: 291359 See also: D54169 Reported by: Collin Funk <collin.funk1@gmail.com> Reviewed by: getz Approved by: markj (mentor) MFC after: 1 week Fixes: 90253d49db09a9b1490c448d05314f3e4bbfa468 (D42519) Differential Revision: https://reviews.freebsd.org/D54170
* | libc/tests/string: improve stpncpy() "bounds" unit testRobert Clausecker2025-12-141-16/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test is extended the same way I previously extended the memccpy() test to fix what is probably the same kind of bug. PR: 291359 Reported by: Collin Funk <collin.funk1@gmail.com> Reviewed by: ngie Approved by: markj (mentor) Fixes: 6fa9e7d8737548ef93c573387ce62402c368d486 (D42519) See also: 61ed5748e4e9c7397fcb2638b442f46ac5c9e7c5 (D46051) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54169 lib/libc/tests/string/stpncpy_test.c: apply ngie's fixes
* | libcasper: fix warnings when _ALIGN preserves typesBrooks Davis2025-12-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | Without the void * casts, the compiler complains about an alignment requirement increase. Reviewed by: kib, markj Obtained from: CheriBSD Effort: CHERI upstreaming Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D53946
* | get*ent: be consistant about _ALIGN(p) - pBrooks Davis2025-12-107-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Add an nscache specific inline function to calculate the misalignment rather than adding and subtracting _ALIGN(p) and p which can take the buffer far out of bound (undefined behavior in C and unsupported on CHERI). Reviewed by: kib Effort: CHERI upstreaming Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D53945
* | libc/string: add strdupa(3) and strndupa(3)Konstantin Belousov2025-12-082-2/+36
| | | | | | | | | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54066
* | libc/string: put source files list one item per lineKonstantin Belousov2025-12-081-23/+121
| | | | | | | | | | | | | | Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54066
* | man typos: Fix pf.conf.5 and jail.2 typosSeth Hoffert2025-12-081-1/+1
| | | | | | | | | | | | MFC after: 3 days Signed-off-by: Seth Hoffert <seth.hoffert@gmail.com> Closes: https://github.com/freebsd/freebsd-src/pull/1919
* | libsysdecode: Use consistent include pathDag-Erling Smørgrav2025-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | mkioctls should look at the same set of headers as mktables does. MFC after: 1 week Fixes: 139d114acc7b ("libsysdecode use MKTABLES_INCLUDEDIR") Sponsored by: Klara, Inc. Sponsored by: NetApp, Inc. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D54106
* | libc/limits_test: add no-op testcase to satisfy kyuaSiva Mahadevan2025-12-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This test suite is purely tested with compile-time assertions, so it needs a dummy runtime test to ensure that kyua reports the file as passing. Pull Request: https://github.com/freebsd/freebsd-src/pull/1915 Sponsored by: The FreeBSD Foundation Reviewed by: fuz Approved by: markj (mentor) MFC after: 1 month Signed-off-by: Siva Mahadevan <me@svmhdvn.name>
* | pf: convert DIOCRGETASTATS to netlinkKristof Provost2025-12-051-12/+80
| | | | | | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* | pfctl: move astats query into libpfctlKristof Provost2025-12-052-0/+25
| | | | | | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* | ncurses: readd "bsdpads"Baptiste Daroussin2025-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | During the import of ncurses 6.5 some bsd specifics configuration where lost and reintroduce quickly after the import, unfortunatly there was a typo in this fix which caused the "bsdpads" to not be enabled in ncurses. Fortunatly only very old programs may be affected by this change, unfortunatly Nethack (in the ports tree is one of them.) PR: 287358 MFC After: 3 days
* | pmc: add alderlaken modelAnaëlle CAZUC2025-12-0411-0/+1865
| | | | | | | | | | | | | | | | | | | | This commit adds alderlaken CPU model to hwpmc/libpmc. JSON event definitions are imported from Intel perfmon version 1.16. Reviewed by: mhorne MFC after: 1 week Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D49229
* | pmc: add emerald rapids modelAnaëlle CAZUC2025-12-0414-0/+23297
| | | | | | | | | | | | | | | | | | | | This commit adds emerald rapids CPU model to hwpmc/libpmc. JSON event definitions are imported from Intel perfmon version 1.06. Reviewed by: mhorne MFC after: 1 week Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D49228
* | libc/stdc_has_single_bit.c: fix gcc warning (-Wparentheses)Robert Clausecker2025-12-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | gcc14 is concerned that the operator precedence between - and & might be confusing. Throw in some redundant parentheses to make it shut up. The LLVM build was fine before this change. Reported by: Martin Filla <freebsd@sysctl.cz> Approved by: markj (mentor) MFC after: 1 month Fixes: 6296500a85c8474e3ff3fe2f8e4a9d56dd0acd64 Differential Revision: https://reviews.freebsd.org/D54057
* | libpcap: Fix dependency definitions for libpcapMark Johnston2025-12-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | Commit 35dd53a9e132 ("librdmacm/libibverbs: Statically bound libbnxtre.so.1 to rping") causes a build failure, since src.libnames.mk declares a depencency on libbnxtre.so, but the libpcap Makefile and prebuild lib dependencies were not updated accordingly. Fix the declarations. Fixes: 35dd53a9e132 ("librdmacm/libibverbs: Statically bound libbnxtre.so.1 to rping") Reviewed by: ssaxena Differential Revision: https://reviews.freebsd.org/D54048
* | ofed: Define SUBDIR_DEPEND_libbnxtreMark Johnston2025-12-031-0/+1
| | | | | | | | Fixes: b42fda6be3fd ("share/mk: Include libbnxtre entry in bsd.libnames.mk")
* | share/mk: Include libbnxtre entry in bsd.libnames.mkSumit Saxena2025-12-031-0/+1
| | | | | | | | | | | | | | | | Add libbnxtre entry in bsd.libnames.mk file. MFC-After: 3 days Reviewed-by: sumit.saxena@broadcom.com Differential-Revision: https://reviews.freebsd.org/D49603
* | libuvmem: provide man page mostly as a pointer to vmem(9)Konstantin Belousov2025-12-022-0/+73
| | | | | | | | | | | | | | Reviewed by: bnovkov, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27220
* | libuvmem: usermode port of vmem(9)Konstantin Belousov2025-12-023-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | The quantum cache is disabled, there is no uma. Intent is to use this for resource allocation in bhyve(8), for start. Addition of -luvmem to bhyve linking was done to test changes to share/mk. Reviewed by: bnovkov, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27220
* | libc: Fix TESTSDIR for new stdbit testsJessica Clarke2025-12-011-0/+2
| | | | | | | | | | | | | | | | | | | | Otherwise the directory created by etc/mtree/BSD.tests.dist, which is where these belong, and referred to by the generated Kyuafile for /usr/tests/lib/libc (via stdbit's existence in TESTS_SUBDIRS), ends up empty with no Kyuafile, which is an error for kyua. Reported by: kp Fixes: 2fb8cbc6ef1b ("libc/tests: add stdbit test framework and unit tests")
* | man/man3: add cross references to stdbit(3)Robert Clausecker2025-11-301-0/+2
| | | | | | | | | | | | | | | | Add cross references to relevant stdbit man pages Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53661
* | libc/tests: add stdbit test framework and unit testsRobert Clausecker2025-11-3018-0/+511
| | | | | | | | | | | | | | | | | | | | | | | | This adds unit tests for all 70 functions in <stdbit.h>. I'm sorry for the test framework, but it makes it so I don't have to write 70 unit tests by hand. Reviewed by: adrian, des Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53660
* | libc/stdbit: add man pages for stdbit functionsRobert Clausecker2025-11-3015-0/+1283
| | | | | | | | | | | | | | | | | | | | | | | | This adds man pages for each group of functions in <stdbit.h>. The man pages have cross references to one-another. Cross references from external man pages to these will be added in a later commit. Reviewed by: pauamma@gundo.com, kib Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53659
* | libc: implement C23 <stdbit.h> functionsRobert Clausecker2025-11-3017-0/+847
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This new header complies with ISO/IEC 9899:2024 (C23). Contrary to glibc, we do not provide inline definitions in <stdbit.h> as we expect our system compiler to soon recognise these as builtins anyway. Relnotes: yes MFC after: 1 month Reviewed by: adrian Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D53657
* | libc/tests: add test for *_MAX, *_MIN, and *_WIDTHRobert Clausecker2025-11-302-0/+102
| | | | | | | | | | | | | | | | | | | | This file checks the correctness of the various _MAX, _MIN, and _WIDTH macros defined for the libc types. It assumes that none of the types have padding bits. Approved by: markj (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D53831
* | libsys: remove armv6 hackMinsoo Choo2025-11-291-6/+2
| | | | | | | | | | | | Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1903