summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2024-11-04Ignore extra groups that don't fit in the buffer passed to getgrouplist(3)Jeremie Courreges-Anglas
Our kernel supports 16 groups (NGROUPS_MAX), but nothing prevents an admin from adding a user to more groups. With that tweak we'll keep on ignoring them instead of potentially reading past the buffer passed to getgrouplist(3). That behavior is explicitely described in initgroups(3). ok millert@ gilles@
2024-11-04getgrouplist(3): always return the total number of groups foundJeremie Courreges-Anglas
In case there is not enough storage to store all the groups found, our implementation returned the size passed in *ngroups. This isn't very useful and is different from other implementations. Back in 1999 the NetBSD implementation was changed to return the actual number of groups found; that lets callers allocate a properly sized array, a behavior was later copied by FreeBSD and glibc. So align our implementation. The documentation doesn't need a change. ok millert@ gilles@
2024-10-30CTL_VM defines moved from uvm_param.h to uvmexp.hJonathan Gray
2024-10-10sysctl.2: NET_RT_DUMP defaults to the current rtablelucas
2024-09-20remove unneeded semicolons; checked by millert@Jonathan Gray
2024-09-17getdents(2) was pushed into rpath because it exposes pathnameTheo de Raadt
information, similar to getcwd(2). Move it to the right place, and also say why. report from henryfordkjv@gmail.com
2024-09-03typo in comment; Effectivly -> Effectively; ok gilles@Omar Polo
2024-09-03typo in comment; saveguard -> safeguard; ok gilles@Omar Polo
2024-09-03wild white spaceTheo de Raadt
2024-08-30Revert commitid KcCtsA53F9UQzc0t:Philip Guenther
"Make exit(), fclose(), fflush(), and freopen() comply with POSIX-2008 requirements for setting the underlying file position when flushing read-mode streams, and make an fseek()-after-fflush() not change the underlying file position." Something isn't correct about it and it breaks at least initdb from the postgresql-server package. discussed with tb@, semarie@, and deraadt@
2024-08-21Make sure ai_canonname is set when AI_CANONNAME was requested.Florian Obser
We document, and posix requires, to return a NUL-terminated string on a successful call to getaddrinfo(3) when AI_CANONNAME was set. If the canonical name cannot be determined, return the node name as suggested by posix. OK guenther
2024-08-18Use struct __sFILE instead of FILE in thread locking callbackPhilip Guenther
declarations to reduce <stdio.h> pollution. Declare __isthreaded in thread_private.h where it's really needed. ok deraadt@
2024-08-18Adjust locale/rune*.h files so <stdio.h> and <wchar.h> get pulledPhilip Guenther
into fewer files that don't need them. ok deraadt@
2024-08-18Pull in <stdio.h> (for snprintf()) directly instead ofPhilip Guenther
assuming some local .h will pull it in ok deraadt@
2024-08-13zap extra word;Jason McIntyre
2024-08-12fflush.3: zap trailing whitespaceTheo Buehler
2024-08-12Fix grammar in history sectionTheo Buehler
ok guenther
2024-08-12Add <stdio_ext.h> with the seven APIs needed to have gnulib operatePhilip Guenther
without poking directly into the FILE structure. Repeated testing, "nope, need a few more" feedback, and ok tb@
2024-08-12Make exit(), fclose(), fflush(), and freopen() comply with POSIX-2008Philip Guenther
requirements for setting the underlying file position when flushing read-mode streams, and make an fseek()-after-fflush() not change the underlying file position. Much testing, review, and assistance from tb@ ok tb@ millert@
2024-08-07asprintf() and vasprintf() are in POSIX-2024. Update #includePhilip Guenther
visibility and manpages and add restrict qualifiers in all the specified places to the *printf family. ok millert@
2024-08-07wcslcpy() and wcslcat() are in POSIX-2024. Update #include visibilityPhilip Guenther
and manpages and add restrict qualifiers. ok millert@
2024-08-04ppoll() is in POSIX-2024. Update #include visibility and manpagesPhilip Guenther
and add restrict qualifiers. While here, rename the BUGS section to CAVEATS since they're really "these probably don't do what you want" notes and not things that need fixing. ok millert@
2024-08-03A dozen interfaces in <endian.h> were standardized in POSIX-2024 as expectedPhilip Guenther
2024-08-03The improbable occurred: strlcpy(3) and strlcat(3) are in POSIX-2024.Philip Guenther
memmem(3) was also added. Update #include visibility and manpages and add restrict qualifiers. "never thought I'd see this day" millert@
2024-08-03mkostemp(3) and reallocarray(3) are in POSIX-2024:Philip Guenther
adjust #include visibility and update the reallocarray(3) manpage ok millert@
2024-08-02The {get,set}res[ug]id(2) family are in POSIX-2024's XSI option,Philip Guenther
so adjust the #include visibility and update the manpage. ok millert@
2024-08-02getentropy(2) is in POSIX-2024, so adjust the #include visibility,Philip Guenther
change the "too much" error to EINVAL, add GETENTROPY_MAX to <limits.h> (via sys/syslimits.h), and update the manpage. ok deraadt@
2024-07-22Specify a priority for _libc_preinit() to make sure it runs before otherMark Kettenis
constructors (such as the constructor for libcompiler_rt). ok guenther@
2024-07-18The source of a link (name1) may not be a directory.Todd C. Miller
POSIX says this is implementation-dependent; OpenBSD does not allow it. OK guenther@
2024-07-17Be clear that RUSAGE_CHILDREN only works for terminated children that haveClaudio Jeker
been waited for. If you SIG_IGN SIGCHLD or don't call any of the wait functions then RUSAGE_CHILDREN wont report anything. OK deraadt@ millert@
2024-07-14Fix printf(3) signal safety for wide character strings.Todd C. Miller
The %ls (wide char string) support in printf(3) currently uses malloc(3), which violates the promise in in sigaction(2). This makes it use mmap(2) instead. OK deraadt@
2024-07-14Bump minor after elf_aux_info(3) and wcsnlen(3) additionsJeremie Courreges-Anglas
2024-07-14Add wcsnlen(3), wcslen(3) with a max len argumentJeremie Courreges-Anglas
Missing function hit by fcambus@ some time ago. ok millert@
2024-07-14Add elf_aux_info(3)Jeremie Courreges-Anglas
Designed to let userland peek at AT_HWCAP and AT_HWCAP2 using an already existing interface coming from FreeBSD. Headers bits were snatched from there. Input & ok kettenis@ libc bump and sets sync will follow soon
2024-07-14spellingJonathan Gray
2024-07-14spellingJonathan Gray
2024-07-12Improve signal handlers guidance.Theo de Raadt
ok beck kettenis, earlier versions jmc
2024-07-10Zap warning against __findenv usage, it is not exported by libcJeremie Courreges-Anglas
The comment probably made sense before guenther restricted the symbols exported by libc in 2015.
2024-07-01Remove history of the tms struct. It is tied to the function,Jonathan Gray
and the manual incorrectly claimed it first appeared in 4BSD. ok deraadt@
2024-06-24changing EINVAL from "has no associated size" to "has insufficient size"Theo de Raadt
does a better job of covering the case of partition not configured (size = 0) or other too-small decision the kernel may make
2024-06-23strmode takes a mode_t, not an int; prompted by Collin Funk.Otto Moerbeek
ok kettenis@ deraadt@ tb@
2024-06-22lower parts of the manual page clearly say why using malloc() toTheo de Raadt
allocate sigaltstack regions is bad... so the example code should not use malloc()... ok semarie
2024-06-11reentrant functions were not in 386BSDJonathan Gray
spotted by and ok deraadt@
2024-06-04enable -fret-clean on amd64, for libc libcrypto ld.so kernel, and all theTheo de Raadt
ssh tools. The dynamic objects are entirely ret-clean, static binaries will contain a blend of cleaning and non-cleaning callers.
2024-05-18Add pathconfat(2): pathconf(2) but with at-fd and flags arguments,Philip Guenther
the latter supporting the ability to get timestamp resolution of symlinks. ok deraadt@ millert@
2024-05-07avoid memcpy(malloc(0), ..., 0), which is not portable.Damien Miller
ok florian@
2024-04-30add typedefs for msgqnum_t and msglen_t, required by POSIX.Omar Polo
improvements from kettenis and jca ok millert, jca, guenther
2024-04-29strftime.3: clarify %G and %g descriptionChristian Weisgerber
Clarify that %G and %g produce the rarely needed ISO week-numbering year rather than the Gregorian calendar year. With millert@ and Evan Silberman. Some of the wording is from the upstream version. ok tb@
2024-04-28__sfvwrite: allow writing buffers larger than BUFSIZ or st_blksize.Todd C. Miller
This can vastly improve write performance. For unbuffered writes, we now write up to INT_MAX instead of BUFSIZE. For buffered writes, write the largest multiple of the buffer size (which may be st_blksize). From Apple via enh at google. OK tb@
2024-04-15Add scandirat(3); from freebsdFlorian Obser
To be used in httpd(8) shortly to prevent toctu issues. This makes __fdopendir internally accessible to avoid unnecessary syscalls in scandirat(3). Suggested & diff by guenther suggested by & OK millert tweak & OK guenther OK tb, jca This rides the libc crank.