summaryrefslogtreecommitdiff
path: root/lib/libc/gen
Commit message (Collapse)AuthorAgeFilesLines
* getentropy: Add Git hashes corresponding to SVN referencesEd Maste2024-11-191-5/+5
| | | | | | | | | | | getentropy has a comment about a special case to support kernels between SVN revisions r331280 and r337999. Add the corresponding Git hashes so there's a usable reference after Subversion infrastructure disappears. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4ef07eb0802a6353faf79d58719d8008decabae0) (cherry picked from commit d45fb7b612fdab4172b9d348103c46145108810d)
* dlopen(3): mention fdlopen for capsicum(4)Ed Maste2024-05-131-3/+5
| | | | | | | | | | | | | | Capsicum-sandboxed applications generally cannot use dlopen, as absolute and cwd-relative paths cannot be accessed. Mention that fdlopen is useful for sandboxed applications. PR: 277169 Reviewed by: markj, oshogbo Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45108 (cherry picked from commit d84fd89ecd404ffbf629381d2dde14fd79b39402) (cherry picked from commit f2109683ce37927d02965fc97e5757761caf89ed)
* Update tzcode to 2024a.Dag-Erling Smørgrav2024-04-041-1/+1
| | | | | | | MFC after: 3 weeks Sponsored by: Klara, Inc. (cherry picked from commit 46c599340f187db577b9212ab18022f3c7380c68)
* libc posix_spawn(): explain why rtld can be used after forkKonstantin Belousov2024-03-111-0/+5
| | | | (cherry picked from commit 2ce23b1f76721e44646fc98ba4e24a113a6d5972)
* posix_spawn.c: fix typo in commentKonstantin Belousov2024-03-111-1/+1
| | | | (cherry picked from commit ebaf907114aa6bda49be4204185072571396bb0d)
* posix_spawn(3): document POSIX_SPAWN_DISABLE_ASLR_NPKonstantin Belousov2024-03-112-2/+13
| | | | (cherry picked from commit a725a7a24de585e996f21e190b5af41261ebc774)
* posix_spawn(3): add POSIX_SPAWN_DISABLE_ASLR_NPKonstantin Belousov2024-03-111-2/+11
| | | | (cherry picked from commit 822042fdfca79faada89e67110b01dd9ecc05996)
* posix_spawnattr_setflags(3): validate argumentKonstantin Belousov2024-03-112-2/+9
| | | | (cherry picked from commit 80ac36c3a2a87a19790eba487466bf70d55f566e)
* getpeerid.3: Clarify the 's' argumentGordon Bergling2023-11-211-2/+2
| | | | | | | | | | The argument 's' of getpeerid(3) must be a connected UNIX-domain socket, so document it. PR: 248614 Differential Revision: https://reviews.freebsd.org/D42629 (cherry picked from commit fa9f74220146233b7224da7c94870540dc39ae68)
* Remove "All Rights Reserved" from Foundation copyrightsEd Maste2023-09-257-7/+2
| | | | | | | | Sponsored by: The FreeBSD Foundation (cherry picked from commit 7fde0187cc443468561f0a30d589ff0cfe45eef5) (cherry picked from commit 560e22c8fe460e00d16e5268fe1fbb316ad81101) (cherry picked from commit 5b5fa75acff11d871d0c90045f8c1a58fed85365)
* scandir.3: Fix several typosTrond Endrestøl2023-09-081-5/+4
| | | | | | | | PR: 273480 Reviewed by: markj MFC after: 1 week (cherry picked from commit b7000cadfbf312b6a8acff6b7a3bbbbe55509565)
* libc: fix history for strverscmp(3) and versionsort(3)Mina Galić2023-09-031-2/+2
| | | | | | PR: 273401 (cherry picked from commit 09ec5e67a7a6605e5a58a2e3e82dab243a90609a)
* libc/gen/_pthread_stubs.c: Remove stray whitespacesKonstantin Belousov2023-08-271-2/+2
| | | | (cherry picked from commit 89e17c6ea03f27dfe4734b024d807d12840db226)
* libc: export pthread_getname_np stubMinsoo Choo2023-08-272-0/+14
| | | | (cherry picked from commit 0dc52b72108e321a99022785713c58d278696af2)
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-2370-70/+0
| | | | | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b2c76c41be32)
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-2356-112/+0
| | | | | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit fa9896e082a1)
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit d0b2dbfa0ecf)
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-23153-307/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in main: (cherry picked from commit 1d386b48a555)
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-234-4/+0
| | | | | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/ Similar commit in main: (cherry picked from commit 42b388439bd3)
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-2321-42/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* glob.h: Remove $FreeBSD$Warner Losh2023-08-231-2/+0
| | | | | | | | | | | This likely documented where this file was copied, but the $FreeBSD$ tag was lost as soon as it was committed. Just remove it. Also remove the one that looked like it was intended to track versions. That will simplify the MFC. Sponsored by: Netflix (cherry picked from commit c25155762166bd03329667e525b2e2c1253a4d6a)
* libc dlfcn.c: make dl_iterate_phdr() from libc more usefulKonstantin Belousov2023-08-131-3/+12
| | | | | | PR: 272992 (cherry picked from commit 21a52f99440c9bec7679f3b0c5c9d888901c3694)
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-07-252-2/+2
| | | | | | | | | | | 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 (cherry picked from commit b61a573019428cbdc38ed03be9ecd2482011ea66)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-2541-41/+41
| | | | | | | | | | | 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 (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* syslog.3: MFC: document ident[N] formatEugene Grosbein2023-07-181-1/+6
| | | | | | | | | | | | When libc switched to generation of logs as per RFC 5424, that change broke application ability to insert specific process id using ident[N] format, the feature existed for decades. Some processes rely on it (including logger and syslogd). Later the regression was fixed but the feature remained undocumented. This change documents it. (cherry picked from commit 5aee3e14d4914c7c99bce80da17b3100cb1f4490)
* libc.a: implement _rtld_addr_phdr()Konstantin Belousov2023-07-021-0/+36
| | | | (cherry picked from commit 42ceab3ea1a997db93b65404be0ee4b17b5382d7)
* libc: move declaration of 'char **environ' to common private headerKonstantin Belousov2023-06-125-9/+0
| | | | (cherry picked from commit 0c6f0c0db75ea5a1e89a68a163fc555bdd7d00f5)
* Change kqueue1() to be compatible with NetBSDKonstantin Belousov2023-04-163-0/+54
| | | | (cherry picked from commit 54579376c05e7a039cde5f424c641fa29348835f)
* times: Use modern function definitionsWarner Losh2023-04-091-2/+1
| | | | | | | | | Use the modern ANSI function defition syntax rather than the old K&R syntax for times. Sponsored by: Netflix (cherry picked from commit aec9453fec70864234c70ccd0198c8b612139cf7)
* libc: handle zero alignment in memalign()Paul Floyd2023-03-031-1/+8
| | | | | | | | | | | | | For compatibility with glibc. The previous code would trigger a division by zero in roundup() and terminate. Instead, just pass through to malloc() for align == 0. PR: 269688 Reviewed by: imp, mjg MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/655 (cherry picked from commit 2c709ee70ade9fd8f77b37917a4169d667dda41d)
* cpuset: Adapt sched_affinity compat shims to the stable/13Dmitry Chagin2023-02-202-4/+8
| | | | | | | | | | Use compat shims to run the stable/13 world on a kernels which does not support CPU_WHICH_TIDPID. This is direct commit to the stable/13. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38677
* cpuset: Add compat shim to the sched_affinity functionsDmitry Chagin2023-02-192-2/+27
| | | | | | | | | | | | | To allow to run a newer world on a pre-1400079 kernel a compat shims to the sched_affinity functions has beed added. Reported by: antoine Tested by: antoine Reviewed by: kib Differential revision: https://reviews.freebsd.org/D38555 MFC after: 3 days (cherry picked from commit cbc32e4c5e8427e0f1032d9d3aa5863dd1538c11)
* libc: popen: slightly simplify cloexec logicKyle Evans2023-02-161-1/+1
| | | | | | | | | No need to check the mode again here; we know that `iop` wraps the correct fd. Reviewed by: bapt (cherry picked from commit f123c6c425d4161b06f237996662496abbd78b94)
* tzcode: Resurrect tzsetwall(3) with a deprecation warning.Dag-Erling Smørgrav2023-02-131-5/+9
| | | | | | | | | | | | This function has been around since 4.4BSD but was dropped upstream in 2020. This went unnoticed when tzcode was updated. Bring it back, but prepare for removing it before 14.0 is released. PR: 269445 MFC after: 3 days Reported by: val@packett.cool Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38445 (cherry picked from commit 71e0c8906e1a4ff774f8ae810aeb94af039eedb7)
* cpuset: Fix sched_[g|s]etaffinity() for better compatibility with Linux.Dmitry Chagin2023-02-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | Under Linux to sched_[g|s]etaffinity() functions the value returned from a call to gettid(2) (thread id) can be passed in the argument pid. Specifying pid as 0 will set the attribute for the calling thread, and passing the value returned from a call to getpid(2) (process id) will set the attribute for the main thread of the thread group. Native cpuset(2) family of system calls has "which" argument to determine how the value of id argument is interpreted, i.e., CPU_WHICH_TID is used to pass a thread id and CPU_WHICH_PID - to pass a process id. For now native sched_[g|s]etaffinity() implementation is wrong as uses "which" CPU_WHICH_PID to pass both (process and thread id) to the kernel. To fix this adding a new "which" CPU_WHICH_TIDPID intended to handle both id's. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D38209 MFC after: 1 week (cherry picked from commit c21b080f3dc2f5e91ada608d4385b7ed6538ba9b)
* devname(3): apply S_ISBLK() to type, not dev_tAlexander Naumochkin2023-02-031-1/+1
| | | | | | PR: 269190 (cherry picked from commit 0311fe403d35f6241fa94104c4b92c9d73214cbc)
* Bring our tzcode up to date.Dag-Erling Smørgrav2023-01-311-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Replay 2010[acflm] which had been merged but not recorded. * Merge 2010n. * Reorganize (unsplit) the code to match the upstream layout. * Merge 2022[cdefg]. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit bc42155199b5b0b479311e05b07aee7f6f9c5172) tzcode: Address some compiler warnings. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit d5c85ac6526dcd0ac25ebdb71969c8c788d5e13b) tzcode: Move configuration into separate header. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit 394cf6719a3c665eabe24d96669409e0c5a78076) tzcode: Remove access() again, cf. 02ba1d993fa9. Reported by: Coverity (CID 1250126) MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38035 (cherry picked from commit 3e2e5eebfaa0aebb2790bbde7f35d4c6c52e2596) tzcode: Avoid memory leak if pthread_setspecific() fails. Reported by: Coverity (CID 1018472, 1018474) MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38036 (cherry picked from commit 96e68c393f65046c0cf69d29f89efcfee949e5de) tzcode: Fully initialize structs before use. Reported by: Coverity (CID 1502542, 1502548) MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38037 (cherry picked from commit 55572cff58c4208a9e532356a245676b8eed6a3e) tzcode: Silence warnings. * Ignore failure to remove our temp file. * Avoid a minor memory leak in the -D case. Reported by: Coverity (CID 1502534, 1502535, 1502538) MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38038 (cherry picked from commit 2aad7570f4e11ac94bb06c44cdc83ad1962fb97e) depend-cleanup.sh: handle zic moving one level up. MFC after: 1 week Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D38044 (cherry picked from commit 4a158fc030b5a31efdbad8b30c9a859df553ae3c) libc: Update mktime(3) / timegm(3) tests. Sponsored by: Klara, Inc. Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D38177 (cherry picked from commit d8c9f80891872a54d0b21933136644d915096fe3) zoneinfo: On amd64, include 32-bit data. While there, drop the unnecessary posixrules option. Sponsored by: Klara, Inc. Reviewed by: imp, allanjude Differential Revision: https://reviews.freebsd.org/D38142 (cherry picked from commit 783c318fd1181d46554c31a5039db10e7f5eef49) tzcode: Document zic's -D option. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D38141 (cherry picked from commit a7b1b73935f21a3dcd6fc8d86a37b92f0c9ba93f) zoneinfo: Always produce fat zoneinfo files. These aren't just needed for compatibility with i386 binaries (which need the 32-bit section), but potentially also for compatibility with older binaries on all platforms. Sponsored by: Klara, Inc. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D38194 (cherry picked from commit f1021d27f73efb821213a973e1ab9366278c78f1) Fix cross-build from STABLE or older CURRENT. Previously, zic and tzsetup were both listed as install tools and basic bootstrap tools. Actually, tzsetup is an install tool while zic is a non-basic bootstrap tool. Fixes: 783c318fd118 Sponsored by: Klara, Inc. Reviewed by: jrtc27, emaste Differential Revision: https://reviews.freebsd.org/D38195 (cherry picked from commit 7a4a520064cb7fbff79560113682d6fe1a1ae9ee) Makefile.inc1: Restore adding tzsetup to _basic_bootstrap_tools ITOOLS is only the list of programs to make a copy of during install, it doesn't cause anything to be bootstrapped. Thus, by removing tzsetup from _basic_bootstrap_tools, we end up without it on non-FreeBSD, and so we error out trying to copy it to INSTALLTMP. Note that _basic_bootstrap_tools is only used for BOOTSTRAP_ALL_TOOLS (which is why zic was moved away from it). Should tzsetup evolve such that the host version is insufficient on older FreeBSD it can be moved to be more like zic, but that seems unnecessary for what is likely to remain a simple tool. This partially reverts commit 7a4a520064cb7fbff79560113682d6fe1a1ae9ee. Fixes: 7a4a520064cb ("Fix cross-build from STABLE or older CURRENT.") (cherry picked from commit d4fdfd3f9077216e52f38f7364974959c9e43168)
* syslog: fix PID of forking processEugene Grosbein2023-01-061-1/+1
| | | | | | | | | | | Do not cache PID for a process that does not fabricate it, calls openlog() before forking and does not call exec() thereafter. PR: 268666 Fixes: e9ae9fa93745669b7dd0341d333257ad6cfe8e37 Tested by: kp (cherry picked from commit 2ce3ef55035093cac7839e71e9ff91f5562ebc29)
* libc: remove unneeded sys/types.h include from several synopsesGuilherme Janczak2022-12-068-16/+8
| | | | | | PR: 268028 (cherry picked from commit a6d40b0ad2c51e16a8c99750d5ed6f9aea2be7d4)
* libc: Make elf_aux_info() return an error if AT_USRSTACK* is undefinedMark Johnston2022-10-251-4/+10
| | | | | | | | | | | | | Otherwise we do not fall back to sysctls if the auxv entries are not defined by the kernel. Arguably this is not a bug since we do not support newer libc running on an older kernel, but we can be a bit more gentle for the benefit of Valgrind or any other software which synthesizes the auxv for virtualization purposes. Reported by: Paul Floyd <paulf2718@gmail.com> Reviewed by: brooks, kib (cherry picked from commit a4ee0edc4a0b3f880463021c7ae1bdcf7112f3d6)
* getpagesize(3): cross-reference getpagesizes(3)Mitchell Horne2022-10-241-1/+2
| | | | | | MFC after: 3 days (cherry picked from commit 4a9b1a146385912510ed1b203cd853a327643625)
* scandir(3): Rename alphasort_thunk to scandir_thunk_cmp toXin LI2022-10-052-6/+6
| | | | | | | | | | reflect that it is not alphasort-specific. Reported by: emaste Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D36708 (cherry picked from commit 45ff071ddccac0a158cfeb53285e6bb2df6bc835)
* libc, libthr: use AT_USRSTACK{BASE,LIM} instead of sysctl("kern.usrstack") ↵Konstantin Belousov2022-09-301-11/+16
| | | | | | and get_rlimit(RLIMIT_STACK) (cherry picked from commit e2879ece4314eed2d22fe484bd4adfcbb1009685)
* libthr: use nitems() for mib lengthKonstantin Belousov2022-09-301-2/+2
| | | | (cherry picked from commit ebf7a01594eeb8c2897d1b310069df35da112413)
* auxv.3: Document AT_USRSTACKBASE and AT_USRSTACKLIMKonstantin Belousov2022-09-301-1/+5
| | | | (cherry picked from commit 62b4fb22df04c286fafa198a9ac91fd89454dfab)
* _elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM}Konstantin Belousov2022-09-301-0/+23
| | | | (cherry picked from commit 8f2668b0605e26b04a103f63096cfcc856d950c1)
* libc: Add strverscmp(3) and versionsort(3)Aymeric Wibo2022-08-314-3/+30
| | | | (cherry picked from commit 05c9a0158f6837bb3a3781e4ed75f66115f6415a)
* Document scandirat(3)Konstantin Belousov2022-08-312-1/+49
| | | | (cherry picked from commit a294e679738bb4d2254c0ff416d40f6d6329754a)
* libc: add scandirat(3)Konstantin Belousov2022-08-312-0/+22
| | | | (cherry picked from commit 9fb8e8eede5b48eda7dc39f61d815595c14e5752)
* libc: split scandir() into scandir_dirp() and proper scandir()Konstantin Belousov2022-08-311-8/+28
| | | | (cherry picked from commit cb6e97f4dae6d0b631b65f23baf2d4c67120f672)