summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spelling fix;jmc2020-06-221-2/+2
|
* Extend kqueue interface with EVFILT_EXCEPT filter.mpi2020-06-221-2/+9
| | | | | | | | | | This filter, already implemented in macOS and Dragonfly BSD, returns exceptional conditions like the reception of out-of-band data. The functionnality is similar to poll(2)'s POLLPRI & POLLRDBAND and it can be used by the kqfilter-based poll & select implementation. ok millert@ on a previous version, ok visa@
* In the libc resolver function asr_run(), clear the result buffer everytime,deraadt2020-06-071-1/+3
| | | | | | because there are callers who were inspecting unrelated fields. discussion with eric, otto, solution from semarie this is errata 6.6/031_asr and 6.7/009_asr
* Fix printing long doubles on architectures with hm and lm bits.mortimer2020-05-311-11/+13
| | | | | | Issue reported with initial patch by enh@google.com. ok deraadt@
* Remove an outdated BUGS section.visa2020-05-311-6/+2
| | | | OK mpi@ beck@
* This patch fixes one bug and one instance of undesirable behaviour.schwarze2020-05-271-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug, present since 4.4BSD, was that a trailing dash in an option group, when the dash is not permitted as an option letter, resulted in the whole option group being returned as an argument, even though the previous option in the group was already parsed as an option: OPTS=abc ./getopt-test -a- -c arg ===>> OPT(a)ARG(-a-)ARG(-c)ARG(arg). Instead, treat the dash as an invalid option and continue parsing options: ===>> OPT(a)ERR(?-)OPT(c)ARG(arg). The undesirable behaviour was that allowing the dash as an option letter only allowed isolated dashes ("-") and trailing dashes in groups ("-a-"), but neither middle dashes in groups ("-a-b"), even though that already partially worked in 4.4BSD, nor leading dashes in groups ("--a"), even though that works on all other BSDs and on glibc. Also, while POSIX does not require that the dash can be used as an option letter at all, arguably, it encourages that letters either be fully supported or not supported at all. It is dubious whether supporting an option letter in some positions but not in others can be considered conforming. This patch makes OpenBSD behaviour identical to FreeBSD and NetBSD, improves compatibility with glibc (except that glibc does not support isolated "-"), improves compatibility with DragonFly (except that DragonFly is buggy when the dash option letter can take an optional argument but that argument is not present), improves compatibility with Illumos and Solaris 11 (except those do not support "-" and mishandle "--a"), and restores 4.4BSD behaviour for "-a-b". In no respect i'm aware of is compatibility with any other systems reduced. For the full rationale, see my mail to tech@ on 30 Mar 2020 14:26:41 +0200. Part of the problem was originally reported by an anonymous coward on tech@ on 12 Mar 2020 03:40:24 +0200, additional analysis was contributed by martijn@, and then the OP sent the final version of the patch i'm now committing on 17 Mar 2020 19:17:56 +0200. No licensing problem here because after the commit, the file does not contain a single word written by the OP. Also, the OP told me in private mail that he intends to publish the patch under the ISC license already contained in the file and that he wishes to be known by the pseudonym "0xef967c36". OK martijn@, and no objection when shown on tech@, but commit delayed to stay clear of the release.
* Fix forgotten references to removed mixer.4 manualratchov2020-05-171-4/+2
|
* drop duplicate word;schwarze2020-04-301-3/+3
| | | | reported by Gordon Bergling <gbergling at gmail dot com>
* Minimal maintenance to make this mess slightly less confusing:schwarze2020-04-261-10/+10
| | | | | | | queue -> list; mention "intrusive"; element -> member at one place; delete a bogus remark that maybe referred to a long-gone implementation in VAX assembly code. Much more could be improved, but i don't want to waste too much time here.
* fix the description; from andras farkasjmc2020-04-261-5/+4
| | | | | | ok schwarze kill a Tn while here...
* A comma is not appropriate here, use a semicolonjca2020-04-251-2/+2
| | | | Suggested by Evan Silberman, confirmed by jmc@
* Discourage use of RES_USE_INET6jca2020-04-251-1/+5
| | | | Suggested by eric@, input from deraadt@, ok deraadt@ eric@
* Fix RES_USE_INET6 descriptionjca2020-04-251-7/+9
| | | | | | | | | | The previous wording implied this option does nothing, which is wrong. This option does affect the way gethostbyname(3) works on OpenBSD (return IPv6 addresses if available). On some systems, it also introduces IPv4-mapped IPv6 addresses, a "feature" that we don't support. ok deraadt@ eric@
* Clairify the point at which unveil first makes restricitons on thebeck2020-04-251-9/+4
| | | | | | filesystem, and remove the BUGS section, as this was fixed by making realpath() a system call. ok ingo@ deraadt@
* Remove the deprecation notice for timegm().schwarze2020-04-241-4/+57
| | | | | | | | | | | | | | | | | | | | | The tzcode package marked it dprecated in the late 1980ies but it is universally supported and here to stay. Triggered by a question from Rodrigo <hruodr at gmail dot com> on misc@. William Ahern <william at 25thandclement dot com> listed a number of sound arguments why it shouldn't be considered deprecated, in particular that there is no better alternative, in particular none that is thread-safe. While here, fix the non-standard section name "NOTES", add the missing STANDARDS section and provide additional information in the HISTORY section, based on inspection of C89, C11, POSIX 2008, UNIX v4 and v5 at TUHS, Tahoe and Reno at the CSRG archives, amd the SunOS 3.5 and 4.0 manuals on bitsavers. Reasearch on tzcode and SunOS history done by millert@. OK millert@ on an earlier version of this patch, and deraadt@ agrees with the general direction.
* move mixerctl and audioctl man pages to section 8, as these workderaadt2020-04-211-3/+3
| | | | against root-only device nodes.
* Prevent infinite for loop since i went from ssize_t to size_t. Patch fromdtucker2020-04-211-3/+3
| | | | eagleoflqj via OpenSSH github PR#178, ok djm@, feedback & ok millert@
* Remove AUTHORS section. This follows what is done in strstr.3claudio2020-04-161-4/+2
|
* Replace the simple memmem() implementation with a version that is O(n)claudio2020-04-161-47/+167
| | | | | based on code from musl and now similar to our strstr(). OK tb@ millert@
* Resync our strstr.c with the musl version. Removes some debug code andclaudio2020-04-161-11/+3
| | | | | optimizes one statement in two-way string compare. OK tb@ millert@
* Update ARG_MAX bytes countjca2020-04-101-3/+3
| | | | ok deraadt@
* "eventually" came and went back in 2004.martijn2020-03-301-3/+1
| | | | OK schwarze@
* Anthony Steinhauser reports that 32-bit arm cpus have the same speculationderaadt2020-03-131-3/+3
| | | | | | | | | | | problems as 64-bit models. To resolve the syscall speculation, as a first step "nop; nop" was added after all occurances of the syscall ("swi 0") instruction. Then the kernel was changed to jump over the 2 extra instructions. In this final step, those pair of nops are converted into the speculation-blocking sequence ("dsb nsh; isb"). Don't try to build through these multiple steps, use a snapshot instead. Packages matching the new ABI will be out in a while... ok kettenis
* typo in commentdjm2020-03-131-2/+2
| | | | spotted at https://fossies.org/linux/misc/openssh-8.2p1.tar.gz/codespell.html
* Anthony Steinhauser reports that 32-bit arm cpus have the same speculationderaadt2020-03-111-3/+5
| | | | | | problems as 64-bit models. For the syscall instruction issue, add nop;nop after swi 0, in preparation for jumping over a speculation barrier here later. ok kettenis
* typo; from bryan stensonjmc2020-03-111-3/+3
|
* Now that the kernel skips the two instructions immediately followingkettenis2020-02-181-3/+3
| | | | | | | | a syscall, replace the double nop with a dsb nsh; isb; sequence which stops the CPU from speculating any further. This fix was suggested by Anthony Steinhauser. ok deraadt@
* Some system calls can fail due to an open-ended variety of causesschwarze2020-02-113-10/+10
| | | | | | | | | | | in many underlying subsystems and device drivers. guenther@ pointed out this applies to system calls taking a file descriptor as an argument. deraadt@ warned against attempting to be excessively precise and against spreading fear, uncertainty, and doubt. So apply a minimal patch that merely avoids the misleading wording "will succeed unless", given that the lists aren't really exhaustive, and simply uses a more usual wording. Unfortunate wording reported by <David dot Raymond at nmt dot edu>.
* A getlogin() function which used utmp(5) appeared in v7.jsg2020-02-091-4/+12
| | | | | | | This was replaced by a getlogin() system call which Ingo discovered we incorrectly list as being 4.2BSD when it was introduced in 4.3BSD Reno. ok schwarze@
* correct Research Unix edition "appeared in" use in HISTORYjsg2020-02-085-15/+15
| | | | | | | | | | | | | | | | | Starting from "Combined Table of Contents" in Doug McIlroy's "A Research UNIX Reader" a table of which edition manuals appeared in. Checked against manuals from bitsavers/TUHS and source from TUHS where available. Ingo points out there are cases where something is included but not documented until a later release. bcd(6) v6 v7 printf(3) v2 v4 abort(3) v5 v6 system(3) v6 v7 fmod(3) v5 v6 ok schwarze@
* Instead of opting in to futexes on archs with atomics opt out on archsjsg2020-02-061-8/+5
| | | | | | without atomics, a smaller list. ok mpi@ visa@
* More precision regarding the openlog(3) *ident argument;schwarze2020-02-051-21/+61
| | | | | | | | | direction suggested by Laurence Tratt <laurie at tratt dot net>, part of the wording from deraadt@. While here, add the missing STANDARDS section, correct HISTORY, drop redundant verbiage from RETURN VALUES, and garbage collect .Tn. OK sthen@ jmc@ millert@ and Laurence Tratt, and deraadt@ likes one line of the patch in particular.
* Mention AUDIO_MIXER_{DEVINFO,READ,WRITE} in the "audio" sectionratchov2020-02-051-3/+6
|
* Insert two nop instructions after each svc #0 instruction in userland.kettenis2020-01-261-2/+4
| | | | | | | | The will be replaced by a speculation barrier as soon as we teach the kernel to skip over these two instructions when returning from a system call. ok patrick@, deraadt@
* Document `kern.allowdt' button.mpi2020-01-241-2/+10
| | | | sysctl.2 bits from benno@
* delete wasteful ;;deraadt2020-01-221-2/+2
| | | | ok tedu
* Document how to make getopt_long(3) process arguments in order and stopstsp2020-01-131-2/+18
| | | | | at the first non-option argument. I had to read source code to figure it out.
* It is believed that an implementation of madvise was available injsg2019-12-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SunOS 4.0 based on text from the following papers. "Two 4.2BSD system calls, madvise and mincore, remain unspecified, madvise is intended to provide information to the system to influence its management policies. Since a major rework of such policies was deferred to a future release, we decided to defer full specification and implementation of madvise until that time." R. Gingell, J. Moran, W. Shannon "Virtual Memory Architecture in SunOS" Proceedings of USENIX Summer Conference, June 1987 AUUGN Volume 8 Number 5, October 1987 "Memory management related system calls based on the original 4.2BSD specification that were implemented include mmap, munmap, mprotect, madvise, and mincore." J. Moran "SunOS Virtual Memory Implementation" Proceedings of the Spring 1988 European UNIX Users Group Conference, April 1988 AUUGN Volume 9 Number 3, June 1988 and a reference in "Global Index", Part Number: 800-1758-10, Revision A, of 9 May 1988 bitsavers pdf/sun/sunos/4.0/800-1758-10A_Global_Index_198805.pdf discussed with an ok schwarze@
* Warn that auth_call(3) users should include a "--" argument beforejsg2019-12-211-2/+7
| | | | | | non-optional arguments to stop getopt(3) processing. ok deraadt@
* In "4.2BSD System Manual" (/usr/doc/sysman in 4.2BSD source)jsg2019-12-215-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mmap(), munman(), madvise() and mprotect() are described as planned for later releases. A fully functional mmap(2) supporting shared libraries first appeared in SunOS 4.0 along with msync(2). SunOS 4.1 added madvise(3) and replaced msync(2) with mctl(2) which was was used to implement msync(3), mlock(3) and munlock(3). While some of these functions appear as empty or ifdef'd functions in 4.1cBSD and later it was not until the Mach VM was integrated with Net/2 that most of them were implemented. Though the CSRG releases never supported shared libraries or madvise(). mlock()/munlock() were not in Net/2 as they were added by hibler in 1993, but were in 4.4BSD. madvise(2) was implemented for UVM in NetBSD 1.5 and ported to OpenBSD 2.7. For now instead of trying to accurately describe when interfaces first appeared in other systems correct when they were first available in CSRG or OpenBSD releases, retaining the text in mmap(2) discussing SunOS 4.0. madvise(2) 4.4BSD -> OpenBSD 2.7 mmap2(2) 4.4BSD -> 4.3BSD Net/2 mprotect(2) 4.4BSD -> 4.3BSD Net/2 msync(2) 4.4BSD -> 4.3BSD Net/2 munmap(2) 4.1cBSD -> 4.3BSD Net/2
* drand48(3) returns values in [0.0, 1.0).tb2019-12-201-3/+3
| | | | | | From j@bitminer.ca with input from Andras Farkas, deraadt, joerg@netbsd "fix however you feel best!" jmc
* The mcount.po target is special cased here since mcount.c should not betb2019-12-201-2/+3
| | | | | | | | | compiled with pie or profiling enabled. This was missed when the independent depend target was removed. Align this target with the inference rules in bsd.lib.mk. This now creates mcount.d as it should and fixes 'make clean' which previously left mcount.po.d behind. ok guenther
* The file passed to realpath(3) must exists, adjust man page to newbluhm2019-12-111-3/+3
| | | | | behavior. noticed by hshoexer@; OK beck@
* Remove includes that are no longer neeed after tedu's simplification.millert2019-12-101-4/+1
| | | | OK jca@
* The msync interface first appeared in SunOS 4.0.jsg2019-12-101-3/+4
|
* Adjust history text.jsg2019-12-101-5/+8
| | | | | | | A fully functional mmap() system call first appeared in SunOS 4.0 and has been available since 4.4BSD. wording from and ok schwarze@ input from deraadt@
* tweak previous;jmc2019-12-081-13/+13
|
* Make sure packet destination address matches interface address,sashan2019-12-081-2/+12
| | | | | | | | | where such packet is bound to. This check is enforced if and only IP forwarding is disabled. Change discussed with bluhm@, claudio@, deraadt@, markus@, tobhe@ OK bluhm@, claudio@, tobhe@
* replace links to uvm(9) to uvm_init(9); ok mpijmc2019-12-061-3/+3
|
* Explicitly say that *permissions can be "".schwarze2019-12-061-3/+4
| | | | | | Potential for misunderstanding noticed by Chris Rawnsley <chris at puny dot agency>, wording proposed by deraadt@, patch sent by Chris Rawnsley, OK deraadt@.