summaryrefslogtreecommitdiff
path: root/lib/libc
AgeCommit message (Collapse)Author
2018-01-18Move to ffs(3) for bitmask scanning. I played with this earlier,Otto Moerbeek
but at that time ffs function calls were generated instead of the compiler inlining the code. Now that ffs is marked protected in libc this is handled better. Thanks to kshe who prompted me to look at this again.
2018-01-18Instead of trying to handle ffs() with the normal rename-mark-hidden-and-aliasPhilip Guenther
dance, mark it protected. This works better for both gcc and clang: gcc blocks overriding of internal calls, while clang permits inlining again. ok otto@
2018-01-14Add two more ARM EABI aliases that I missed in the previous libc minorMark Kettenis
bump. "just go ahead -- crank" deraadt@
2018-01-13tweak previous;Jason McIntyre
2018-01-13introduce a filter called EVFILT_DEVICE that can be used to notifyRobert Nagy
listeners of device state changes. currently only supports NOTE_CHANGE that will be used by drm(4) ok kettenis@
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
2018-01-08Move SC_* defines into <machine/setjmp.h>, and rename them,Visa Hankala
so that <machine/signal.h> is not needed in setjmp.S. Suggested by kettenis@ long ago, OK deraadt@
2018-01-08optimization and some cleanup; mostly from kshe (except the unmap() part)Otto Moerbeek
2018-01-08TIOCUCNTL is now allowed by promise "tty".Martin Pieuchot
Reminded by jmc@
2018-01-06Remove dead gettimeofday calls and timevals.cheloha
ok jca@
2018-01-02some grammar fixes; from dholland@netbsd, -r1.68Jason McIntyre
2018-01-01Only init chunk_info once, plus some moving of code to group related functions.Otto Moerbeek
2017-12-27step one in avoiding unneccesary init of chunk_info;Otto Moerbeek
some cleanup; tested by sthen@ on a ports build
2017-12-26Add ARM EABI runtime aliases to the GCC runtime functions that we includeMark Kettenis
in libc. ok patrick@, jsg@, guenther@
2017-12-25memcpy from the right place. at this point, the used variable is notTed Unangst
relevant. from Mark Karpilovskij. ok millert
2017-12-24Fix one possible buffer overflow and one underflow. Also some minorTodd C. Miller
cleanups. From Jan Kokemueller. OK deraadt@
2017-12-18let's not try to document the number of items in a list...Jason McIntyre
2017-12-18Add the CLOCK_BOOTTIME clockid for use with clock_gettime(2)cheloha
and put it to use in userspace in lieu of the kern.boottime sysctl. Its absolute value is the time that has elapsed since the system booted, i.e., the system uptime. Use in top(1), w(1), and snmpd(8) eliminates a race with settimeofday(2), adjtime(2), etc. inherent to deriving the system uptime via the kern.boottime sysctl. Product of a great deal of discussion/revision with jca@, tb@, and guenther@. ok tb@ jca@ guenther@ dlg@ mlarkin@ tom@
2017-12-16Move __cxa_thread_atexit* to its own .c file to avoid pulling the codePhilip Guenther
(w/ _dlctl reference) into static executables. It's all Mark's code so put his preferred copyright on it. ok kettenis@
2017-12-16Don't use _libc_ prefix when referencing "builtin" symbols with clang.Mark Kettenis
Slightly tweaked diff from guenther@
2017-12-14Simplify and unify timespec variables used in those event loopsJeremie Courreges-Anglas
ok millert@
2017-12-14Use CLOCK_MONOTONIC for the rpc event loopsJeremie Courreges-Anglas
From Scott Cheloha, ok deraadt@ tb@
2017-12-12Consistently use .Va for "errno";Ingo Schwarze
patch from Jan Stary <hans at stare dot cz>; "I think it makes sense to speak about errno as a variable (.Va)" jca@.
2017-12-12space required between macro arg and punctuation;Jason McIntyre
2017-12-12pledge()'s 2nd argument becomes char *execpromises, which becomes theTheo de Raadt
pledge for a new execve image immediately upon start. Also introduces "error" which makes violations return -1 ENOSYS instead of killing the program ("error" may not be handed to a setuid/setgid program, which may be missing/ignoring syscall return values and would continue with inconsistant state) Discussion with many florian has used this to improve the strictness of a daemon
2017-12-08Fix the return value of fwscanf(3) when encountering an early matchingKevin Lo
failure. This change brings fwscanf(3) back in line with fscanf(3). From FreeBSD; ok deraadt@, millert@
2017-12-05Remove DEF_STRONG(__cxa_thread_atexit_impl). This produces an unwantedMark Kettenis
_libc___cxa_thread_atexit_impl reference on gcc architectures that breaks the build.
2017-12-05Implement __cxa_thread_atexit to support C++11 thread_local scope. TheMark Kettenis
interface is also made available as __cxa_thread_atexit_impl to satisfy the needs of GNU libstdc++. ok guenther@, millert@
2017-12-01Redo the calculation of the alignment and placement of static TLS data toPhilip Guenther
correctly take into account the segment p_align. Previously, anything with a size belong the natural alignment or with alignment larger than the natural one would either not be intialized correctly, be misaligned, or result in the TIB being misaligned. Problems reported by Charles Collicutt (charles (at) collicutt.co.uk) ok kettenis@
2017-12-01Consistently .Xr the corresponding wide char functions from char- andIngo Schwarze
string-handling <stdio.h> functions, like we already do it for <string.h>. Includes a smaller patch from <kshe59 at zoho dot eu>, OK jmc@.
2017-12-01add missing argument name; from <kshe59 at zoho dot eu>; OK jmc@;Ingo Schwarze
while here, consistently use .Fo to cure execessive line lengths
2017-11-29clang doesn't propagate attributes like "asm labels" and "visibility(hidden)"Philip Guenther
to builtins like mem{set,cpy,move} and __stack_smash_handler. So, when building with clang, instead mark those as protected visibility to get rid of the PLT relocations. We can't take the address of them then, but that's ok: it's a build-time error not a run-time error. ok kettenis@
2017-11-28Add the missing STANDARDS section (kettenis@ noticed that these areIngo Schwarze
POSIX functions) and turn the weird DIAGNOSTICS section into a normal RETURN VALUES section while here.
2017-11-28GNU ld has prefixed the contents of .gnu.warning.SYMBOL sectionsTheo Buehler
with "warning: " since 2003, so the messages themselves need not contain the prefix anymore. From Scott Cheloha ok jca, deraadt
2017-11-28Delete fktrace(2). The consequences of it were not thought throughPhilip Guenther
sufficiently and at least one horrific security hole was the result. ok deraadt@ beck@
2017-11-22Avoid .align 0 here as well. Also fix a .word that should be a .quad.Mark Kettenis
ok patrick@
2017-11-21Avoid .align 0. Clang's integrated assembler actually honors this directiveMark Kettenis
and the resulting byte-alignment triggers unaligned access. ok patrick@, deraadt@
2017-11-21Use a simple forward search to find '%' in the format string instead ofTheo Buehler
using mbrtowc(3). Thus, we now treat the format string as a bytestring, not as a multibyte character string. We think that ANSI C made a small error when adding wide characters: The committees essentially replaced "characters" with "wide characters" in the existing printf documentation, which was written before the concept of processing was established. Doing processing on the format string would break some 8-bit format strings in the wild, and that isn't something these committees gave themselves license to do. Based on the "10x printf speedup" commit from android found by tedu: https://github.com/aosp-mirror/platform_bionic/commit/5305a4d4a723b06494b93f2df81733b83a0c46d3 Thanks to millert and schwarze for digging into the history and testing *printf behavior on other platforms. ok deraadt, millert
2017-11-16Add error checking to some calls to __find_arguments(). Matches similarTheo Buehler
changes by schwarze to vfprintf.c r1.71. Cherrypicked from android: https://github.com/aosp-mirror/platform_bionic/commit/5305a4d4a723b06494b93f2df81733b83a0c46d3 ok millert
2017-11-07Fix spelling: bet -> net from Scott Bennett, thanksTheo Buehler
2017-11-04Revert recent changes to unbreak ports/net/sambaJeremie Courreges-Anglas
While it is not clear (to me) why that ports ends up with corrupted shared libs, reverting those changes fixes the issue and should allow us to close p2k17 more smoothly. Discussed with a bunch, ok ajacoutot@ guenther@
2017-11-02's' should include 'f'; from Jacqueline JolicoeurOtto Moerbeek
2017-10-31Argh: put back some linker-supplied symbols to avoid triggering a bugPhilip Guenther
in binutils that results in uninitialized .dynsym entries in shared objects in the samba port. problem reported by naddy@ ok jca@ kettenis@
2017-10-30fix oob read; form llvm via Vlad Tsyrklevich; ok millert@Otto Moerbeek
2017-10-29Stop exporting _memcpy, an implementation detail of bcopy/memcpy/memmovePhilip Guenther
ok kettenis@ deraadt@
2017-10-28Remove __builtin_saveregs: gcc hasn't used it for years.Philip Guenther
suggested by miod@ ok kettenis@
2017-10-28Typo: 'end' should have been '_end', which is already exported/imported.Philip Guenther
Also, '_memcpy' and '_stack' were specific to arm and should not have been copied here
2017-10-28Eliminate some more linker generated symbols that aren't needed.Philip Guenther
ok kettenis@
2017-10-28If the init_routine used with pthread_once() is canceled, then we need toPhilip Guenther
unlock the mutex inside the pthread_once_t. Push a cleanup wrapper for that. Diff from Scott Cheloha <scottcheloha@gmail.com> ok mpi@