aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* libypclnt: Move to yp packageLexi Winter2026-01-061-1/+3
| | | | | | | | | | | | | | | | | | This was previously in runtime, because pam_unix uses it and we don't want to pull in the entire yp package as a dependency of runtime. However, we can now use LIB_PACKAGE here to create a yp-lib package to contain the library, which is a much more reasonable dependency. Since libypclnt clearly belongs in the yp package, move it there. This change moves files between packages so, until we have a proper policy on how to handle this in release/stable branches, it should not be MFC'd. MFC after: never Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D53600
* zstd: Move to a new zstd packageLexi Winter2026-01-061-1/+3
| | | | | | | | | | | | | | | | | | Zstd is a discrete, self-contained system component. To match how we package zlib, bzip2 and xz, move it to its own package, with a separate lib package. Add the new package to the minimal set, since this is a core component that users expect to be installed. This change adds a new package to the system so, until we have a proper policy on how to handle this in release/stable branches, it should not be MFC'd. MFC after: never Reviewed by: bapt Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D53603
* libc/amd64: fix stpncpy.S againRobert Clausecker2026-01-041-6/+3
| | | | | | | | | | | | | | | | | | The previous fix introduced a regression on machines without the BMI1 instruction set extension. The TZCNT instruction used in this function behaves different on old machines when the source operand is zero, but the code was originally designed to never trigger this case. The bug fix caused this case to be possible, leading to a regression on sufficiently old hardware. Fix the code by messing with things such that the source operand is never zero. PR: 291720 Fixes: 66eb78377bf109af1d9e25626bf254b4369436ec Tested by: cy Approved by: markj (mentor) Differential Revision: https://reviews.freebsd.org/D54303
* libgeom: Fix 32-bit gcc buildDag-Erling Smørgrav2026-01-031-2/+5
| | | | | MFC after: 1 week Fixes: 27894e20f140 ("libgeom: Fix segfault in 32-on-64 case")
* libgeom: Improve type safety of xml2tree codeDag-Erling Smørgrav2026-01-031-10/+44
| | | | | | | | | | When resolving references, assert that the type of the object we find is what we expect. This will help prevent memory corruption if two objects of different types somehow end up with the same identifier. MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D54454
* libgeom: Clean up xml2tree codeDag-Erling Smørgrav2026-01-032-50/+52
| | | | | | MFC after: 1 week Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D54453
* libgeom: Fix segfault in 32-on-64 caseDag-Erling Smørgrav2026-01-031-2/+2
| | | | | | | | | | | | | We were using strtoul() to parse object identifiers, which are kernel pointers. This works fine as long as the kernel and userland match, but in a 32-bit libgeom on a 64-bit kernel this will return ULONG_MAX for all objects, resulting in memory corruption when we later pick the wrong object while resolving consumer-producer references. MFC after: 1 week PR: 292127 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D54452
* pf: convert DIOCRCLRASTATS to netlinkKristof Provost2025-12-301-18/+60
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* pf: move DIOCRCLRASTATS into libpfctlKristof Provost2025-12-302-0/+27
| | | | Sponsored by: Rubicon Communications, LLC ("Netgate")
* ioctl.2: Mention EACCESFelix Johnson2025-12-291-1/+4
| | | | | | | | | | ioctls can fail with EACCES, see sys/kern/tty.c PR: 239504 MFC after: 3 days Reviewed by: ziaee Reported by: Brennan Vincent <brennan@umanwizard.com> Differential Revision: https://reviews.freebsd.org/D49072
* tdestroy(3): add testsKonstantin Belousov2025-12-291-0/+65
| | | | | | | Reviewed by: alc, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54365
* tdestroy(3) man pageKonstantin Belousov2025-12-292-3/+25
| | | | | | | Reviewed by: alc, emaste, ziaee Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54365
* libc: add glibc-compatible tdestroy(3)Konstantin Belousov2025-12-293-0/+70
| | | | | | | | | | | The function clears the whole tree. Relnotes: yes Reviewed by: alc, emaste Discussed with: dougm Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54365
* libc/stdlib/Makefile: one line for each source file nameKonstantin Belousov2025-12-291-13/+69
| | | | | | | Reviewed by: alc, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54365
* geom_part: Fix format string issuesDag-Erling Smørgrav2025-12-291-29/+40
| | | | | | | | | This fixes a segfault on i386 and armv7 and numerous style violations. PR: 292008 Fixes: 4f809ffec69c ("gpart: add libxo support for "show" subcommand + man page updates") Reviewed by: js Differential Revision: https://reviews.freebsd.org/D54393
* man pages: provide some description for extended errorsKonstantin Belousov2025-12-291-0/+16
| | | | | | | | | , related functions, and the EXTERROR_VERBOSE environment variable. Reviewed by: emaste, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54380
* exterr: in verbose mode, print the source file nameKonstantin Belousov2025-12-291-4/+17
| | | | | | | Reviewed by: emaste, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54380
* Add automatically generated file libc/gen/exterr_cat_filenames.hKonstantin Belousov2025-12-291-0/+17
| | | | MFC after: 1 week
* exterror: Add EXTERROR_VERBOSE env variable to control verbosityKonstantin Belousov2025-12-291-5/+48
| | | | | | | | | | | | If the variable is set and the process is not suid, __uexterr_format(), used by err(3), prints errno/category/source line/pX always, not only when there is no kernel message provided. Requested by: mckusick Reviewed by: emaste, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54380
* exterror: add support for the format specifiers in the extended error msgKonstantin Belousov2025-12-291-1/+2
| | | | | | | | | | Note that we trust kernel code to only request the printout of integer types, and use the 'j' modifier always. Reviewed by: emaste, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54380
* libc/gen/err.c: remove 'extended error' herald from extended error outputKonstantin Belousov2025-12-291-1/+1
| | | | | | | Reviewed by: emaste, mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D54380
* bsd.sys.mk: add NO_WCHARACTER_CONVERSION and use it for googletestDimitry Andric2025-12-281-0/+3
| | | | | This silences warnings about benign implicit character conversions in googletest's gtest-printers.h.
* 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-35/+72
| | | | | | | | | | | | | 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