summaryrefslogtreecommitdiff
path: root/lib/libc/gen
AgeCommit message (Collapse)Author
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-28delete duplicate .Xr below SEE ALSOIngo Schwarze
2019-05-16More consistently put remarks about the less useful LC_* categoties,Ingo Schwarze
i.e. those other than LC_CTYPE, into the CAVEATS section, and standardize wording somewhat. OK jmc@
2019-05-13The fd used by nlist() isn't application visible, so mark it close-on-execPhilip Guenther
to avoid leaking it ok deraadt@
2019-03-23Remove useless secure_path(3) calls.Todd C. Miller
There is no point in checking permissions of files in root-owned directories. If it even was a problem, secure_path(3) suffers from unsolvable TOCTOU issues. OK deraadt@
2019-03-08remove a sentence that was once helpful when dirname.3 and basename.3Sebastian Benoit
shared one manpage. ok florian@
2019-02-04Make gl_pathc, gl_matchc and gl_offs size_t in glob_t to match POSIX.Todd C. Miller
This requires a libc major version bump. OK deraadt@
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.Todd C. Miller
2019-01-13Restore .Xr to pthread_sigmaskJeremie Courreges-Anglas
Pointed out by naddy@
2019-01-12Move sigwait(3) from libpthread to libcJeremie Courreges-Anglas
POSIX wants it in libc, that's where the function can be found on other systems. Reported by naddy@, input from naddy@ and guenther@. "looks ok" guenther@, ok deraadt@ Note: riding the libc/libpthread major cranks earlier today.
2018-12-28getgruid_r -> getgrgid_rTheo Buehler
from Lauri Tirkkonen
2018-11-05Mention aligned_alloc(), prompted by Brad; ok jmc@Otto Moerbeek
2018-10-31typo; fix from hiltjo posthumaTheo de Raadt
2018-10-30use Mdocdate;Jason McIntyre
2018-10-30Add C11's timespec_get(3); minor bump for libc.Philip Guenther
Tweaked diff from brad@ manpage tweaks florian@ and jmc@ ok deraadt@ millert@
2018-10-09Fix a "copy-and-paste" error that Coverity picked up in the augment codeDavid Gwynne
This brings it back in line with the macros. via Paco A. and the FRRouting project. ok deraadt@ visa@ guenther@ tb@
2018-09-22Correct the uid_from_user() and gid_from_group() comments.Todd C. Miller
2018-09-13missing comma in previous;Jason McIntyre
2018-09-13Add uid_from_user() and gid_from_group(), derived from pax's cache.c.Todd C. Miller
It replaces the existing pwcache.c functions user_from_uid(3) and group_from_gid(3) with the pax equivalents. Adapted from NetBSD (mycroft) changes from our own pax's cache.c. OK guenther@
2018-08-21Use an mmap()'d buffer instead of a static buffer for the contentsTodd C. Miller
of the pointer returned by getpw{ent,nam,uid}(). We unmap the buffer each time to catch callers using a stale passwd struct pointer. As a special case, we do not unmap the buffer if the previous lookup was for the same name or uid. This special case may be removed in the future. OK deraadt@
2018-07-12Add hw.ncpuonline to count the number of online CPUs.cheloha
The introduction of hw.smt means that logical CPUs can be disabled after boot and prior to suspend/resume. If hw.smt=0 (the default), there needs to be a way to count the number of hardware threads available on the system at any given time. So, import HW_NCPUONLINE/hw.ncpuonline from NetBSD and document it. hw.ncpu becomes equal to the number of CPUs given to sched_init_cpu() during boot, while hw.ncpuonline is equal to the number of CPUs available to the scheduler in the cpuset "sched_all_cpus". Set_SC_NPROCESSORS_ONLN equal to this new sysctl and keep _SC_NPROCESSORS_CONF equal to hw.ncpu. This is preferable to adding a new sysctl to count the number of configured CPUs and keeping hw.ncpu equal to the number of online CPUs because such a change would break software in the ecosystem that relies on HW_NCPU/hw.ncpu to measure CPU usage and the like. Such software in base includes top(1), systat(1), and snmpd(8), and perhaps others. We don't need additional locking to count the cardinality of a cpuset in this case because the only interfaces that can modify said cardinality are sysctl(2) and ioctl(2), both of which are under the KERNEL_LOCK. Software using HW_NCPU/hw.ncpu to determine optimal parallism will need to be updated to use HW_NCPUONLINE/hw.ncpuonline. Until then, such software may perform suboptimally. However, most changes will be similar to the change included here for libcxx's std::thread:hardware_concurrency(): using HW_NCPUONLINE in lieu of HW_NCPU should be sufficient for determining optimal parallelism for most software if the change to _SC_NPROCESSORS_ONLN is insufficient. Prompted by deraadt. Discussed at length with kettenis, deraadt, and sthen. Lots of patch tweaks from kettenis. ok kettenis, "proceed" deraadt
2018-04-27<sys/mount.h> and <sys/swap.h> no longer require <sys/param.h>Philip Guenther
ok krw@
2018-03-16improve markup quality in the cases found by the new "--" style messageIngo Schwarze
2018-03-02Return monotonically increasing values.cheloha
The latest POSIX description of times(3) (and all others I can find) suggests that times(3) should return monotonically increasing values and that these values are only useful for real time interval measurement. All extant uses of times(3) confirm that this expectation is shared by application programmers. So, change gettimeofday(2) to clock_gettime(2)/CLOCK_MONOTONIC to ensure the return value increases monotonically, even if the system clock is changed by the superuser. Then update the manpage accordingly. While we're updating the manpage, move the information about the return values to a new RETURN VALUES section to bring times.3 up to speed with other library man pages. Manpage changes kicked around on tech@ with millert@ and jmc@. times.3 ok millert@ tb@ jmc@ times.c ok millert@ tb@
2018-01-12Adjust references for sysctl(3) to sysctl(2)Theo de Raadt
2018-01-12sysctl(3) can now be renamed to sysctl(2)Theo de Raadt
2017-11-07Fix spelling: bet -> net from Scott Bennett, thanksTheo Buehler
2017-10-28No need to include <sys/param.h> before <sys/sysctl.h>.Martin Pieuchot
ok deraadt@, jca@
2017-10-27Use <elf.h> instead of <elf_abi.h>Martin Pieuchot
ok jasper@, jca@, deraadt@
2017-10-17add missing HISTORY; based on CVS logs and release announcementsIngo Schwarze
2017-10-16draft-ietf-tcpm-initcwnd was published as rfc 6928Mike Belopuhov
2017-10-04iscntrl(0) is != 0 at least since Version 7 AT&T UNIX, and POSIXIngo Schwarze
requires that, too (in XBD 7.3.1), even though the C standard leaves it implementation-defined; found during my kcgi audit on behalf of CAPEM; OK deraadt (stupid me forgot to commit before lock).
2017-09-18Document readdir_r() return value and update style of the exampleTodd C. Miller
code. Adapted from a diff by Ross L Richardson.
2017-09-17__progname has type char *, we cannot change its type without causingOtto Moerbeek
havoc all over the place. So add some casts to silence the compiler. ok deraadt@ guenther@
2017-09-12Update the documentation regarding /dev/mem and /dev/kmem;Ingo Schwarze
Theo already clamped down on these devices last year. Triggered by a question from Nan Xiao <xiaonan830818 at gmail dot com>. OK deraadt@
2017-09-10shm_open(), sysconf(), tcflow(), and tcsendbreak() are not permitted to bePhilip Guenther
cancellation points in POSIX, so change them to invoke the non-cancellation point versions of open(), close(), nanosleep(), and write() ok deraadt@ millert@
2017-09-10Fix spelling of 4.3BSD-Net/2.Ingo Schwarze
2017-09-10sysctl strings include the termingating NUL character in both in and out lengthsTom Cosgrove
Prompted by Nan Xiao noticing the redundancy of bzero+termination - thanks. ok deraadt@
2017-09-05Remove unused 32bit version of elf_hash().Martin Pieuchot
Riding previous libc bump. ok kettenis@
2017-09-05New POSIX xlocale implementation written from scratch.Ingo Schwarze
Complete in the sense that all POSIX *locale(3) and *_l(3) functions are included, but in OpenBSD, we of course only really care about LC_CTYPE and we only support ASCII and UTF-8. With important help from kettenis@, guenther@, and jca@. Repeated testing in ports bulk builds by naddy@. Additional testing by jca@, sebastia@, dcoppa@, and others. OK kettenis@ dcoppa@, and guenther@ on an earlier version. Riding guenther@'s libc/librthread major bump.
2017-09-05Add additional errno values required by POSIX.Jonathan Gray
ok jca@ kettenis@ deraadt@
2017-08-29It is confusing to talk about priorities being ordered from highTodd C. Miller
to low when they are actually numbered in the opposite (numerical) order. Use "ordered by decreasing importance" instead. Also try to make it clear that LOG_UPTO uses the numerical priorities where a larger value means a lower priority. OK jmc@
2017-08-29isunordered() returns true if at least one of the arguments is NaNTodd C. Miller
OK espie@
2017-08-12Minimize #includes, particularly to avoid thread_private.hPhilip Guenther
ok tedu@
2017-08-08Stop running nd6_expire every second.Florian Obser
We know when pltime or vltime decrease to zero. Run nd6_expire then. Input & OK mpi, bluhm
2017-08-08Kernel sendsyslog(2), libc syslog(3), and syslogd(8) restrict andAlexander Bluhm
truncate the length of a syslog message to 8192 bytes. Use one global define LOG_MAXLINE for all of them. OK deraadt@ millert@
2017-08-07Since sendsyslog(2) handles the LOG_CONS parameter, the variableAlexander Bluhm
conp in syslog(3) is unused. Remove dead code. OK jca@ deraadt@
2017-08-01add missing and correct misspelled names, most in NAME sections;Ingo Schwarze
found with regress/usr.bin/mandoc/db/dbm_dump; OK jmc@
2017-07-20Rename TBUF_LEN and FMT_LEN to _SIZE as they contain a NUL byte.Alexander Bluhm
Change FMT_SIZE to 1024+1 for consistency. Do not loop over the format string if there is no output space left. OK deraadt@ millert@
2017-07-13Get rid of ip6.maxifprefixes and ip6.maxifdefrouters, the kernel noFlorian Obser
longer tracks prefixes or default routers from router advertisements. Pointed out by jmc. ports tree grepping sthen, who only found nsh OK mpi, sthen