summaryrefslogtreecommitdiffstats
path: root/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use std instead of stw to store CR since we use std in sigsetjmp(3) andkettenis2020-06-281-2/+2
| | | | we use ld to load it again in longjmp(3).
* The 2nd and 3rd argument are pointers, so use the appropriate doublewordkettenis2020-06-281-5/+5
| | | | | | instructions. ok drahn@
* Add missing label.kettenis2020-06-271-2/+2
|
* Provide an optimized implementation of ffs(3) in libc onnaddy2020-06-266-6/+55
| | | | | | aarch64/powerpc/powerpc64, making use of the count leading zeros instruction. Also add a brief regression test. ok deraadt@ kettenis@
* Fix TCB_OFFSET_ERRNO. Adjust comments to reflect that powerpc64 uses %r13kettenis2020-06-261-4/+4
| | | | | | as the per-thread register. ok patrick@, drahn@
* Avoid "bare" register numbers.kettenis2020-06-264-26/+26
|
* PowerPC64 libc powerpc sys filesdrahn2020-06-258-0/+368
| | | | | | | | Initial attempt to port powerpc code to powerpc64 Expects TOC loading in ENTRY(), ok kettenis@ (some cleanup required)
* PowerPC64 libc string/net filesdrahn2020-06-252-0/+178
| | | | | | | | | Initial attempt to port powerpc code to powerpc64 Expects TOC loading in ENTRY(), memmove.S is the powerpc 32 bit, optimization is possible for 64 bit and handle len of > 32 bits.
* *** empty log message ***drahn2020-06-251-0/+1
|
* PowerPC64 libc/arch/powerpc/gdtoa filesdrahn2020-06-253-0/+20
| | | | | | This is a almost a direct copy from powerpc with 64 bit mods, with two additions present in 64 arch. NOTE: long double 128 is not supported currently.
* Committed wrong version of file, atomic_lock is 32 bit.drahn2020-06-251-6/+6
|
* PowerPC64 libc gen filesdrahn2020-06-2514-0/+812
| | | | | | | | Initial attempt to port powerpc code to powerpc64 Expects TOC loading in ENTRY(), ok kettenis@
* PowerPC64 libc (libc powerpc top)drahn2020-06-254-0/+176
| | | | | | | | | | Expects ELFv2 TOC loading in ENTRY(), build with -gdwarf-4 Split SYS.h into SYS.h and DEFS.h fix tabs after #define
* 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.