aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* libc/string: add strdupa(3) and strndupa(3)Konstantin Belousov2025-12-161-0/+28
| | | | (cherry picked from commit a98e5d78500193dc7aa352e1f60ac2c6529e2c38)
* include/stdckdint.h: make the header compatible with C++Konstantin Belousov2025-10-241-3/+3
| | | | | | PR: 290299 (cherry picked from commit 3c052bec12fcf09f81ba0760ebecec38e196d332)
* rpc.h: Remove reference to unimplemented DES ioctlsEd Maste2025-08-291-20/+0
| | | | | | | | | We won't be adding support for hardware DES. Remove the #ifdef notdef block. Sponsored by: The FreeBSD Foundation (cherry picked from commit c143ffbaf787f6c1d7fcbae8f5d9299182ff0b85)
* arm64: lib32: Don't try to install removed <machine/runq.h>Olivier Certner2025-07-281-1/+0
| | | | | | | | | | Reported by: Herbert J. Skuhra (herbert gojira.at) Fixes: 79d8a99ee583 ("runq: Deduce most parameters, remove machine headers") MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation (cherry picked from commit 63c9b018069b58bacb2875c83c676cc8c4f40d69)
* Add sys/stdarg.hBrooks Davis2025-07-021-2/+2
| | | | | | | | | | | | | | | While the type of va_list and implementation of va_*() psuedo functions varies (sometimes greatly) by architecture, they will always be defined by the compiler in a consistant way that does not require machine dependent handling. MFC after: 1 week Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 (cherry picked from commit 2d92a5abefc9cf6aa81fb7d23f8fcca4f1d6026d)
* Don't rely on sys/_types.h including sys/cdefs.hBrooks Davis2025-06-231-0/+1
| | | | | | | | | | | | | | These headers relied in __BEGIN_DECS/__END_DECLS being defined when sys/_types.h was included, but there's not a requirement that this be the case. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595 (cherry picked from commit b01e971fd39d10273a387788019457792873e81c) (cherry picked from commit 4f4c465b45d42ed8d2b65c8b4c909246987ac877) (cherry picked from commit 12913e4ddf710e517f3ae00b7b420b783cca9b37)
* libthr: add stable user interface for sigfastblock(2)Konstantin Belousov2025-05-261-0/+2
| | | | (cherry picked from commit 31760ee65ae3e79434fb257d93e17a6de6021f48)
* pthread_switch_add_np(3): removeKonstantin Belousov2025-05-261-7/+0
| | | | (cherry picked from commit c0fdd2bf944bb646116c6cd9879560579ebaa563)
* include/paths.h: add _PATH_NOSHUTDOWNKonstantin Belousov2025-05-101-0/+1
| | | | (cherry picked from commit 5ab906195b35609c60e05080f7b82cf64437306e)
* Add POSIX psiginfo(3) callRicardo Branco2025-04-241-0/+1
| | | | | | PR: 286133 (cherry picked from commit 3b2f0bfc35167724a41c969c1823be6b1ede15ab)
* fts: Move private flags away from public ones.Dag-Erling Smørgrav2025-04-201-12/+16
| | | | | | | | | | | | | | Renumber the private flags so there is a sizeable gap between them and the public flags, making it easier to add public flags in the future. These private flags are only ever set or read by FTS itself, so there is no compatibility issue. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D49711 (cherry picked from commit 80e06d621ac545ac0a69d4e95e7392be38013a78)
* include: add a userland version of __assert_unreachableKyle Evans2025-03-181-0/+7
| | | | | | | | | | | | | The kernel has had a version of this since c79cee71363d ("kernel: provide panicky version of __unreachable"), and userland can benefit from the same. __unreachable is largely inadequate because it's *not* an assertion of any sort, so we're not really alerted to a problem that we could've anticipated. Reviewed by: emaste, imp, jhb, olce Differential Revision: https://reviews.freebsd.org/D48077 (cherry picked from commit 712f81feea416e9f8aaf040173883876a50a7d34)
* libc: Fix getentropy POSIX 2024 conformance issuesEd Maste2025-02-201-0/+4
| | | | | | | | | | GETENTROPY_MAX should be defined in limits.h. EINVAL is the return value for buflen > GETENTROPY_MAX. PR: 282783 Reviewed by: markj, asomers, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D47689
* Expose POSIX functions incorporated into C23Stephen Hurd2025-01-182-3/+7
| | | | | | | | | | C23 has incoporated a small number of POSIX functions, so these should be exposed for C23, regardless of POSIX. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D47856 (cherry picked from commit 59677aecb67bbedcfa2ee5d7d2b189193cdc4af7)
* fileno(3): set errno when returning -1Konstantin Belousov2024-12-031-4/+0
| | | | | | PR: 283014 (cherry picked from commit 7cd756ff4fe7e65a9a3f588904998bf6f4b37623)
* rpc: Fix the definition of xdr_void()Mark Johnston2024-11-051-1/+1
| | | | | | | | | | | xdr_void() should have type xdrproc_t, make it so. PR: 280514 Reviewed by: brooks, dim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47340 (cherry picked from commit a5d1cf5e362a2e3c3ebdf6d8f2b86658a6d0b9d6)
* Ensure that soft updates are not enabled by default when using mdmfs(8)Kirk McKusick2024-10-121-0/+3
| | | | | | | | | | | | When soft updates began being enabled by default that change carried over to mdmfs(8) which does not want or need them. This fix ensures that they are only enabled in mdmfs(8) when requested with the -U flag. Reported by: Ivan Rozhuk Tested by: Michael Proto PR: 279308 (cherry picked from commit 5b21d4ad060acb06c72e0458daebec9bcbf0cefd)
* vendor/bc: upgrade to version 7.0.0Stefan Eßer2024-09-031-0/+79
| | | | | | | | | | | | | | | | | | | | | | This is a production release to fix three bugs, none of which affects well formed scripts on FreeBSD: The first bug is that bc/dc will exit on macOS when the terminal is resized. The second bug is that an array, which should only be a function parameter, was accepted as part of larger expressions. The third bug is that the value stack for dc was cleared on any error. However, this is not how other dc behave. To bring dc more in line with other implementations, this behavior was changed. This change is why this version is a new major version. (cherry picked from commit 54d20d67e2af28d948ce2df13feb039fa10900fc) MFC after: 3 days (cherry picked from commit 12e0d316644a4f80f5f1f78cf07bd93def43b1ca)
* Remove "All Rights Reserved" from FreeBSD Foundation copyrightsEd Maste2024-08-061-1/+0
| | | | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder. Sponsored by: The FreeBSD Foundation (cherry picked from commit 5c2bc3db201a4fe8d7911cf816bea104d5dc2138)
* sysexits: Tidy deprecated header and manualAlexander Ziaee2024-05-211-3/+4
| | | | | | | | | | | | | | | <sysexits.h> was deprecated in the base system in a1432b4 for FreeBSD 8.0 and is retained only for backwards compatibility. Make that clear, since sysexits(3) suggested using it since it was in style(9) prior to this. MFC after: 1 week Co-authored-by: imp Fixes: a1432b4 Reviewed by: imp, pauamma (previous version) Pull Request https://github.com/freebsd/freebsd-src/pull/1195 (cherry picked from commit 5ccaab1797e5bdc404f2299ebaec1265547a4744)
* libthr: add pthread_sigqueue(3)Konstantin Belousov2024-04-301-0/+7
| | | | | | PR: 278459 (cherry picked from commit 220aa0f450409948b869237e5c4505f992c913ce)
* posix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NPKonstantin Belousov2024-03-111-0/+1
| | | | (cherry picked from commit 822042fdfca79faada89e67110b01dd9ecc05996)
* dumprestore.h: Fix typos in source code commentsGordon Bergling2024-03-031-3/+3
| | | | | | - s/dumpped/dumped/ (cherry picked from commit 8f87d402e32178974038212fbf4b1564447df0e0)
* libc: expose execvpe for Linux compatBrooks Davis2024-02-181-0/+1
| | | | | | PR: 275370 (cherry picked from commit 8ccd0b876e67fda6249f294ff484798cc1e1569f)
* Add kcmp(2) userspace bitsKonstantin Belousov2024-01-301-0/+1
| | | | (cherry picked from commit 211bdd601ee51f90da9b123807ef68ac122116b9)
* resolv: Add a required include to resolv.hJan Beich2024-01-151-0/+1
| | | | | | | | | | Add a required include to resolv.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. PR: 182466 MFC after: 1 week (cherry picked from commit 58cf91d3b72a01777bacf72d66a648a744ae3143)
* endian.h: Remove duplicate wordsJose Luis Duran2024-01-071-3/+3
| | | | | | | Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/920 (cherry picked from commit dff3a80f6dfe88c52326ceb2c154668f132fdb52)
* libc/libc/rpc: refactor some global variablesAlan Somers2023-11-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Combine dg_fd_locks and dg_cv into one array. * Similarly for vc_fd_locks and vc_cv * Turn some macros into inline functions This is a mostly cosmetic change to make refactoring these strutures in a future commit easier. Sponsored by: Axcient Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D42597 (cherry picked from commit a5c2f4e939430f0048136c39fb9fa6093d401905) lib/libc/rpc: switch the per-fd structs in clnt_{dg,vc}.c to RB Trees This saves oodles of memory, especially when "ulimit -n" is large. It also prevents a buffer overflow if getrlimit should fail. Also replace per-fd condvars with mutexes to simplify the code. PR: 274968 Sponsored by: Axcient Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D42597 (cherry picked from commit 24938f9311c9c9acc1ce747f4e6a088c2dbc967d)
* pkgbase: Move headers and libs out of runtime and utilitiesDoug Rabson2023-11-122-1/+3
| | | | | | | | | | | | | | | | | | | | | | Headers from src/include were in the runtime-dev package but subdirectories of src/include ended up in utilities-dev by default. Neither package is a good choice - the headers in src/include are not useful without the libraries contained in clibs-dev. This moves the standard C headers to clibs-dev (C++ headers are already in this package). While working on this, I found that various clang libraries and headers were also bundled into utilities-dev by default so these are also moved to clang-dev. I also added a FreeBSD-build-essential meta package to make it simple to install all the toolchain parts. PR: 254173 Reviewed byb: manu MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41815 (cherry picked from commit 78847e1e592789dc85bddf4d2f1d9a8ce4614ff1)
* Trim various $FreeBSD$John Baldwin2023-10-241-2/+0
| | | | | | | | Approved by: markj (cddl/contrib changes) Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41961 (cherry picked from commit f53355131f65d64e7643d734dbcd4fb2a5de20ed)
* include: Implement N2867.Dag-Erling Smørgrav2023-09-072-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | This adds macros for checked addition, subtraction, and multiplication with semantics similar to the builtins gcc and clang have had for years. Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D41734 (cherry picked from commit e6615b10347caf67f5bc12c9a8e30b8ddd9860ae) include: Add tests for N2867. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D41735 (cherry picked from commit 4fbb9c43aa44d9145151bb5f77d302ba01fb7551) less: We have <stdckdint.h> now. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D41736 (cherry picked from commit cb8dd292c7ec53391dfa25847858dd7ef895f94e) Approved by: re (gjb)
* time.h: Fix visibility check for C11 and C23 features.Dag-Erling Smørgrav2023-09-071-2/+2
| | | | | | | | | | | | | __BSD_VISIBLE is always defined; we need to check if it's true. Fixes: d02489d11aed 9b5d724cad10 MFC after: 3 days Reviewed by: brooks, imp Differential Revision: https://reviews.freebsd.org/D41733 (cherry picked from commit 8091b82e291642f3034dc3fdc8689a4f4ba027da) Approved by: re (gjb)
* libc: Add timespec_getres(3) as per C23.Dag-Erling Smørgrav2023-08-241-1/+7
| | | | | | | This also adds support for TIME_MONOTONIC to timespec_get(3). Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D41524
* Remove $FreeBSD$: one-line xdr patternWarner Losh2023-08-1621-22/+0
| | | | Remove /^\s*%\s*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1615-15/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1624-24/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-1653-53/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-1672-144/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* arm64 lib32: prepare arm64 headers to redirect to armMike Karels2023-07-252-4/+69
| | | | | | | | | | | | | | | | | | | | | | | In order to compile lib32 libraries and other 32-bit code on arm64, <machine/foo.h> needs to be redirected to an arm header rather than arm64 when building with -m32. Ifdef the arm64 headers that are installed in /usr/include/machine and used by user-level software (including references from /usr/include/*.h) so that if __arm__ is defined when including the arm64 version, <arm/foo.h> is included rather than using the rest of the file's contents. Some arm headers had no arm64 equivalent; headers were added just to do the redirection. These files use #error if __arm__ is not defined to guard against confusion. Also add an include/arm Makefile, and modify Makefiles as needed to install everything, including the arm files in /usr/include/arm. fenv.h comes from lib/msun/arm/fenv.h. The new arm64 headers are: acle-compat.h cpuinfo.h sysreg.h Reviewed by: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D40944
* include: Migrate from COMPAT_32BIT to generic COMPAT_libcompatJessica Clarke2023-07-091-2/+2
| | | | | | | | See commit 8fad2cda93c7 ("bsd.compat.mk: Provide new CPP and sub-make variables") for the context behind this change. Reviewed by: emaste, brooks, jhb Differential Revision: https://reviews.freebsd.org/D40924
* elf-hints.h: Allow rtld_paths.h to be included before itJessica Clarke2023-07-091-0/+2
| | | | | | | | | | | | | | | | | Currently rtld_paths.h will #undef _PATH_ELF_HINTS in order to override this to the right value if included afterwards, but the other way round does not work as elf-hints.h tries to define an already-defined macro to a potentially different value. Thus, guard the definition here so that rtld_paths.h's definition continues to take precedence. Note that, although all in-tree uses of _PATH_ELF_HINTS have included rtld_paths.h already, pax-utils wants _PATH_ELF_HINTS from elf-hints.h and so we cannot just drop the define. In-tree uses must just continue to make sure that they include rtld_paths.h to get the right value for libcompat builds as is already required. Reviewed by: kib, brooks, jhb, imp Differential Revision: https://reviews.freebsd.org/D40918
* nvme: Don't install nvme_private.h in /usr/include.John Baldwin2023-06-271-1/+6
| | | | | | Reviewed by: chuck, imp Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D40394
* spdx: Simplify BSD-2-Clause AND BSD-2-ClauseWarner Losh2023-05-121-1/+1
| | | | | | | | | After removing the -FreeBSD and -NetBSD, we're left with a nuber of BSD-2-Clause AND BSD-2-Clause, so tidy that up. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-127-7/+7
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1243-43/+43
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* includes: avoid installing if_wg.h twiceEd Maste2023-05-101-2/+2
| | | | | | | | | | | if_wg.h was installed via dev/wg in LSUBDIRS and also explicitly. We want to install only wg/if_wg.h not the other headers, so add dev/wg to the skip list in the copies and symlinks targets. PR: 271266 Reviewed by: kevans Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40031
* Revert "libc: Implement bsort(3) a bitonic type of sorting algorithm."Hans Petter Selasky2023-04-201-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | Some points for the future: - libc is not the right place for sorting algorithms. Probably libutil is better suited for this purpose or a dedicated libsort. Should move all sorting algorithms away from libc eventually. - CheriBSD uses capabilities for memory access, and could benefit from a standard memswap() function. - Do something about qsort() in FreeBSD's libc like: - Mark it deprecated on FreeBSD, as a first step, due to missing limits on CPU time. - Audit the use of qsort() in the FreeBSD base system and consider swapping to other existing sorting algorithms. Discussed with: brooks@ Differential Revision: https://reviews.freebsd.org/D36493 This reverts commit a7469c9c0a504a5e6e9b89e148cd78df5e67ff7f. This reverts commit 7d65a450cdcc7cc743f2ecd114ba3428a21c0033. This reverts commit 8dcf3a82c54cb216df3213a013047907636a01da.
* libc: bsort_s() requires both __BSD_VISIBLE and __EXT1_VISIBLEHans Petter Selasky2023-04-191-1/+1
| | | | | | | | | | | Fixes build of Python: /usr/include/stdlib.h:409:1: error: unknown type name 'errno_t' errno_t bsort_s(void *, rsize_t, rsize_t, Reported by: vishwin@ MFC after: 1 week Sponsored by: NVIDIA Networking Differential Revision: https://reviews.freebsd.org/D36493
* include: add a check-ldirs targetBrooks Davis2023-04-191-0/+13
| | | | | | | This target ensures all LDIRS, LSUBDIRS, and LSUBSUBDIRS actually exist. Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D39006
* libc: Implement bsort(3) a bitonic type of sorting algorithm.Hans Petter Selasky2023-04-191-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | The bsort(3) algorithm works by swapping objects, similarly to qsort(3), and does not require any significant amount of additional memory. The bsort(3) algorithm doesn't suffer from the processing time issues known the plague the qsort(3) family of algorithms, and is bounded by a complexity of O(log2(N) * log2(N) * N), where N is the number of elements in the sorting array. The additional complexity compared to mergesort(3) is a fair tradeoff in situations where no memory may be allocated. The bsort(3) APIs are identical to those of qsort(3), allowing for easy drop-in and testing. The design of the bsort(3) algorithm allows for future parallell CPU execution when sorting arrays. The current version of the bsort(3) algorithm is single threaded. This is possible because fixed areas of the sorting data is compared at a time, and can easily be divided among different CPU's to sort large arrays faster. Reviewed by: gbe@, delphij@, pauamma_gundo.com (manpages) Sponsored by: NVIDIA Networking Differential Revision: https://reviews.freebsd.org/D36493