aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* rpc: Fix the definition of xdr_void()Mark Johnston2024-11-051-1/+1
| | | | | | | | | | | | | xdr_void() should have type xdrproc_t, make it so. Approved by: re (kib) PR: 280514 Reviewed by: brooks, dim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D47340 (cherry picked from commit a5d1cf5e362a2e3c3ebdf6d8f2b86658a6d0b9d6) (cherry picked from commit b698c825f3b6699b278122da776bdfe5f360619f)
* 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
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-0/+1
|
* arpa: garbage collect ns_newmsg/ns_rdata declsVal Packett2023-03-221-40/+0
| | | | | | | | | | | | | | These were brought in by the libbind import, but these functions were never actually implemented anywhere, only header declarations and symbol map entries were imported. Fixes: 046c3635cdb2 ("Bring final version of libbind:") Fixes: e45764721aed ("Update our stub resolver to final version of ...") Reported by: ld.lld 16 being --no-undefined-version by default Sponsored by: https://www.patreon.com/valpackett Reviewed by: emaste Pull request: https://github.com/freebsd/freebsd-src/pull/700 Differential Revision: https://reviews.freebsd.org/D38407
* secure_getenv: Put under __BSD_VISIBLEWarner Losh2023-03-141-1/+1
| | | | | | Sponsored by: Netflix Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D39076
* Add GNU glibc compatible secure_getenvlucy2023-03-141-0/+1
| | | | | | | | | | | | Add mostly glibc and msl compatible secure_getenv. Return NULL if issetugid() indicates the process is tainted, otherwise getenv(x). The rational behind this is the fact that many Linux applications use this function instead of getenv() as it's widely consider a, "best practice". Reviewed by: imp, mjg (feedback) Pull Request: https://github.com/freebsd/freebsd-src/pull/686 Signed-off-by: Lucy Marsh <seafork@disroot.org>
* include: Remove no longer existing netgraph/atmMichael Butler2023-03-091-1/+1
| | | | | Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D39005
* libc: Remove prototype and documentation for tzsetwall().Dag-Erling Smørgrav2023-03-071-1/+0
| | | | | | PR: 269445 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D38481
* include: Fix typosElyes Haouas2023-02-224-4/+4
| | | | Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
* Revert "stdlib.h: Fix qsort_r compatibility with GCC 12."John Baldwin2023-01-271-6/+0
| | | | | | | This reverts commit 43703bc489ec504b947b869045c492ed38c1a69c. Reviewed by: jrtc27 Differential Revision: https://reviews.freebsd.org/D38216
* byteswap.h: Add a glibc/linux compatible byteswap.hWarner Losh2023-01-202-1/+43
| | | | | | | | | | | | For endian.h to work instead of sys/endian.h, some software needs byteswap.h available. It must define {__,}byteswap_{16,32,64}. Included sys/_endian.h to get an appropriate __byteswap16, etc and defines the new macros in terms of them. Enhance _endian.h to allow it to be included from here too. Sponsored by: Netflix Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D32051
* linux: For better compatibility, provide compatible endian.hWarner Losh2023-01-202-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Add endian.h. This includes sys/endian.h and then adds extra defines that glibc defines with double underscores for our _{BIG,BYTE,LITTLE,PDP}_ENDIAN macros. We also define __FLOAT_WORD_ORDER to be the same as _BYTE_ENDIAN since FreeBSD doesn't currently define this, and the default with glibc is exactly this for our platforms. Move common parts of endian.h and sys/endian.h into sys/_endian.h to limit namespace pollution from endian.h All this gives us good compatibility with Linux. There may be one or two upstreams that haven't integrated the patches I tried to send up. There are some minor differences: o The extra glibc macros are not defined. These are all controlled with either __ at the start, or only defined when glibc is being built. We also don't define macros that are used internally in glibc that would pollute the namespace. o For complete compatibility, this change must also be paired with providing a glibc-compatible byteswap.h. Sponsored by: Netflix Reviewed by: mhorne, markj, jhb Differential Revision: https://reviews.freebsd.org/D31962
* stdlib.h: Fix qsort_r compatibility with GCC 12.John Baldwin2023-01-191-0/+6
| | | | | | | | | | | GCC 12 (unlike GCC 9) does not match a function argument passed to the old qsort_r() API (as is used in the qsort_r_compat test) to a function pointer type via __generic. It treats the function type as a distinct type from a function pointer. As a workaround, add a second definition of qsort_r for GCC 12 which uses the bare function type. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D37410
* include: put includes into -dev packagesKyle Evans2022-11-101-7/+7
| | | | | | | | | | | | | | | | | | | The includes build is kind of funky, as we support either copying or symlinking files into /usr/include. For `copies`, we were supplying the include/ ${TAG_ARGS}, which puts packages into `FreeBSD-runtime`, without any consideration to the fact that we're installing headers. Let's copy the approach that the `symlinks` target uses for now, and add ",dev" to the TAG_ARGS so that headers at least end up in FreeBSD-runtime-dev, which is more appropriate. Some of these includes are actually technically supposed to be in *other* packages and their INCSGROUP's PACKAGE setting is actually correct, but this is less trivial to solve. This is a bandaid to fix the immediate problem of some headers ending up in two different packages. PR: 267526 Reviewed by: dfr, manu Differential Revision: https://reviews.freebsd.org/D37256
* libc: Don't warn about RRSIG replies.Dag-Erling Smørgrav2022-11-091-0/+18
| | | | | | PR: 213178 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37303
* getaddrinfo: distinguish missing addrs from unresolvable namesMike Karels2022-11-021-0/+1
| | | | | | | | | | | | | | | | | | | Rework getaddrinfo(3) to return different error values for unresolvable names (same as before, EAI_NONAME) and those without a requested addr (EAI_ADDRFAMILY) when using DNS. This is implemented via an added error in the nsswitch layer, NS_ADDRFAMILY, which is used only by getaddrinfo(). The error is passed through nsdispatch(3), but that routine has no changes to handle this error. The error originates in the getaddrinfo DNS layer called via nsdispatch(), and is processed by the search layer that calls nsdispatch(). While here, add a little style to returns near those that were modified. Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz MFC after: 1 month
* netdb.h: re-enable EAI_ADDRFAMILY, EAI_NODATAMike Karels2022-11-021-4/+7
| | | | | | | | | | | | | | | | | | EAI_ADDRFAMILY and EAI_NODATA are not in RFC 3493, but are available and used in many other systems. It is desirable to have at least one of them in order to distinguish between names that do not resolve and those that do not have the requested address type. A change to getaddrinfo() will use EAI_ADDRFAMILY. Both were "#if 0"; re-enable, conditioned on __BSD_VISIBLE, and update comments. Also add comments and __BSD_VISIBLE conditional for the last three EAI errors, which are not in the RFC or POSIX. Note, all of these are available in NetBSD and OpenBSD, and EAI_ADDRFAMILY and EAI_NODATA are available in Linux (glibc). Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz MFC after: 1 month