aboutsummaryrefslogtreecommitdiffstats
path: root/libc/upstream-netbsd
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-073-50/+129
|\ | | | | | | | | | | https://android.googlesource.com/platform/bionic into cm-13.0 Android 6.0.1 release 3
| * resolve merge conflicts of d676080a37 to lmp-mr1-ub-dev.Christopher Ferris2015-10-213-50/+129
| |\ | | | | | | | | | Change-Id: I56c1bb2adb4b6a48733c928415e788e689b4944e
| | * Sync with upstream NetBSD lib/libc/regex.Elliott Hughes2015-10-193-50/+129
| | | | | | | | | | | | | | | | | | | | | Bug: http://b/22850181 Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904 (cherry-picked from commit 71927a82379f7a72559ea96e6678d6215090937f)
| | * Implement twalk(3), add unit tests.Elliott Hughes2014-07-246-277/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD ones are currently broken for non-circular lists). I've not added the three hash table functions that should be in this header because they operate on a single global hash table and thus aren't likely to be useful. Bug: https://code.google.com/p/android/issues/detail?id=73719 (cherry picked from commit 3e424d0a241f8ae5194514dabc4ad899f5a5416d) Change-Id: I5882a6b48c80fea8ac6b9c27e7b9de10b202b4ff
| | * Fix visibility for a bunch more symbols.Elliott Hughes2014-07-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 11156955 Bug: 15291317 (cherry picked from commit a167eef5482d4a89d4277ec74f57adbe38052813) Change-Id: Ib038ad34ef59631f7b4ed6dff2b7956001b8b159
| | * Implement rand/srand in terms of random/srandom.Elliott Hughes2014-07-141-57/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code developed for glibc or older versions of bionic might expect more randomness than the BSD implementation provides. Bug: 15829381 (cherry picked from commit 76c241b091b4d9d9a9237d40e814e52ce2917f47) Change-Id: If721b3f16efdb21cb67df5ec5034c0ba905bd029
| | * Sync upstream-openbsd.Elliott Hughes2014-07-141-37/+0
| | | | | | | | | | | | | | | | | | (cherry picked from commit 4f0b67a8dbf0e1d8b1dae42358553fb8d14456d4) Change-Id: I8753959853312ab978bc4eb1bbbcdc7d1b007b95
* | | bionic: Let popen fall back to /sbin/shTom Marshall2015-11-031-0/+2
|/ / | | | | | | | | | | minivold in recovery uses popen, where /system/bin/sh is not available. Change-Id: I2136b0ca4188b7b44416f5d79492fc006382d4ad
* | Remove bogus transitive includes.Elliott Hughes2014-12-291-0/+1
| | | | | | | | | | | | | | <signal.h> shouldn't get you the contents of <errno.h>, and <fcntl.h> shouldn't get you the contents of <unistd.h>. Change-Id: I347499cd8671bfee98e6b8e875a97cab3a3655d3
* | Add POSIX lcong48.Elliott Hughes2014-11-061-0/+43
| | | | | | | | Change-Id: I821046816661d77275cb02c8c99d526bb41afb9c
* | Switch to OpenBSD insque/remque/killpg.Elliott Hughes2014-09-233-167/+0
| | | | | | | | Change-Id: Ie02290ad3187b1c1596dd776fd1c8a743a55f7ef
* | Ignore all __weak_alias in OpenBSD libC.Chih-Hung Hsieh2014-08-281-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | GCC assembler allows xyz to be redeclared as weak, by __weak_alias(xyz, _xyz), while _xyz is undefined. Clang does not like that but silently generates no code. It will reject its own .s file if the assembly code is saved first. Since we have no reason to define xyz or _xyz as weak symbol now, and _xyz is a macro to xyz, we simplify libC to have only xyz defined as global. BUG: 17186746 Change-Id: I24b154425838683cae69248cc750c59e26fd5467
* | Fix _BSD_SOURCE/__USE_BSD.Elliott Hughes2014-08-191-3/+3
| | | | | | | | | | Bug: 14659579 Change-Id: I80ec9584f054c02d1078828f6bca759c42bc1d4c
* | Implement twalk(3), add unit tests.Elliott Hughes2014-07-246-277/+111
| | | | | | | | | | | | | | | | | | | | | | | | I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD ones are currently broken for non-circular lists). I've not added the three hash table functions that should be in this header because they operate on a single global hash table and thus aren't likely to be useful. Bug: https://code.google.com/p/android/issues/detail?id=73719 Change-Id: I97397a7b921e2e860fd9c8032cafd9097380498a
* | Fix visibility for a bunch more symbols.Elliott Hughes2014-07-141-0/+3
| | | | | | | | | | | | Bug: 11156955 Bug: 15291317 Change-Id: I664f25cce7c17085a101d6593d8e01525a1f6a90
* | Merge "Implement rand/srand in terms of random/srandom."Elliott Hughes2014-07-141-57/+0
|\ \
| * | Implement rand/srand in terms of random/srandom.Elliott Hughes2014-07-141-57/+0
| |/ | | | | | | | | | | | | | | Code developed for glibc or older versions of bionic might expect more randomness than the BSD implementation provides. Bug: 15829381 Change-Id: Ia5a908a816e0a5f0639f514107a6384a51ec157e
* / Sync upstream-openbsd.Elliott Hughes2014-07-141-37/+0
|/ | | | Change-Id: I5b9961a57e2ff05f63bd218c130bf8347850b9be
* Switch to upstream NetBSD nsap_addr.c.Elliott Hughes2014-06-303-0/+309
| | | | | | | | These symbols should be public (and Firefox uses them), and we'd also probably rather have the upstream thread-safe implementation. Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1030899 Change-Id: I2a5888fbb3198546848398f576fd2195ff3fe00c
* Remove SHA1 from LP64 in favor of libcrypto.Dan Albert2014-06-161-0/+31
| | | | | | | Keep the symbols around on LP32 for binary compatibility. Bug: 11156955 Change-Id: I379a7e0fa3092e9a70daeafcbcb2aacfc314031a
* Get the full set of PRNG functions in <stdlib.h>Elliott Hughes2014-06-123-0/+638
| | | | | Bug: https://code.google.com/p/android/issues/detail?id=58888 Change-Id: I435250bdae302e8bd7e29977d0fde7b9afbfca5e
* Hide rand48 implementation details.Elliott Hughes2014-06-091-4/+4
| | | | | Bug: 11156955 Change-Id: I130272286989487dc22e246fb4ffbee5230225c4
* Rewrite and hide longjmperror.Elliott Hughes2014-06-061-56/+0
| | | | | | | | | This shouldn't be public API, isn't supported on x86/x86_64, and it's unlikely anyone would have actually seen the message before anyway. Using __libc_fatal makes it much more likely to be seen. Bug: 11156955 Change-Id: Icf7f654b22a7dacd89668b60c11e5705c7215c08
* Switch back to OpenBSD inet_ntop now they're FORTIFY clean.Elliott Hughes2014-05-191-231/+0
| | | | Change-Id: I04798a4966c352a8a12feebdff9646e3bad5933f
* Register _cleanup function with atexitDmitriy Ivanov2014-05-151-63/+0
| | | | | | | | | | | | | | | | * Register cleanup function with atexit instead of calling it explicitly on exit() * abort() no longer calls _cleanup: Flushing stdio buffers on abort is no longer required by POSIX. * dlmalloc no longer need to reset cleanup (see above) * Upstream findfp.c makebuf.c setvbuf.cexit.c to openbsd versions. Bug: 14415367 Change-Id: I277058852485a9d3dbb13e5c232db5f9948d78ac
* Use the NetBSD inet_ntop until the OpenBSD bug is fixed.Elliott Hughes2014-05-131-0/+231
| | | | | | | | | Stupidly I found this bug by accident when writing the existing tests, but I didn't think any real code would hit it. It turns out that libcore always uses an INET6_ADDRSTRLEN-sized buffer even when working with AF_INET addresses. Change-Id: Ieffc8e4bbe9b66b49b033e3e7101c896e097e6f8
* Flesh out <arpa/inet.h>.Elliott Hughes2014-05-134-830/+0
| | | | | | | | | | Use the upstream OpenBSD implementations of these functions. Also ensure we have symbols for htonl, htons, ntohl, and ntohs. gtest doesn't like us using the macro versions in ASSERT_EQ. Bug: 14840760 Change-Id: I68720e9aca14838df457d2bb27b999d5818ac2b5
* Clean up and document our hacks for building BSD source.Elliott Hughes2014-04-2110-4/+0
| | | | Change-Id: Ic591e22fa5b363bb68376b9f25814c0e5bd83fbf
* Add lsearch(3) for ltrace.Elliott Hughes2014-04-011-0/+107
| | | | | Bug: 13746936 Change-Id: I833c6ba70a1752c04dab7de389f5bebb741662b3
* Clean up reentrancy cruft.Elliott Hughes2014-03-131-0/+2
| | | | | | | | | | | | | | | | The DNS copy of reentrant.h was unused, so remove it. The strtod implementation can use the upstream-netbsd reentrant.h and get a little closer to what was then upstream. (It's since been replaced by gdtoa, and we'll have to follow at some point, but for now this doesn't make anything any worse.) ANDROID_CHANGES is (now) only used in the DNS code, so push the -D down. The <locale.h> change prevents an LP32 hack from leaking into LP64. Change-Id: Idf30b98a59d7ca8f7c6cd6d07020b512057911ef
* More stdio cleanup.Elliott Hughes2014-03-111-0/+1
| | | | Change-Id: Idc909cd3dc7b072f1edd2ae4980932d6550e8568
* Switch to NetBSD utmp.c.Elliott Hughes2014-03-101-0/+106
| | | | Change-Id: Ibe94888aa48b5b28fea97fd5719a1ed7a23ddeb3
* Moved nameser.h and namser_compat.h to public include dirCalin Juravle2014-03-041-1/+1
| | | | | | | This is part of the upstream sync (Net/Open/Free BSDs expose the nameser.h in their public headers). Change-Id: Ib063d4e50586748cc70201a8296cd90d2e48bbcf
* Clean up our OpenBSD usage.Elliott Hughes2014-02-212-199/+0
| | | | | | | | | Also undo some of the mess where we have OpenBSD <stdio.h> but a mix of different BSD's implementations. In this first pass, I've only moved easy OpenBSD stuff. Change-Id: Iae67b02cde6dba9d8d06fedeb53efbfdac0a8cf6
* Move the upstream-netbsd libc files into the correct directory.Elliott Hughes2014-02-2053-0/+0
| | | | | | | | I screwed up when I originally imported these files; they're in lib/libc/ in the upstream tree; there is no top-level libc/ (though there is a top-level common/, so those files stay where they are). Change-Id: I7c5e2224a4441ab0e33616a855a8c6aacfeac46f
* Implement some of the missing LFS64 support.Elliott Hughes2014-02-181-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This gives us: * <dirent.h> struct dirent64 readdir64, readdir64_r, alphasort64, scandir64 * <fcntl.h> creat64, openat64, open64. * <sys/stat.h> struct stat64 fstat64, fstatat64, lstat64, stat64. * <sys/statvfs.h> struct statvfs64 statvfs64, fstatvfs64. * <sys/vfs.h> struct statfs64 statfs64, fstatfs64. This also removes some of the incorrect #define hacks we've had in the past (for stat64, for example, which we promised to clean up way back in bug 8472078). Bug: 11865851 Bug: 8472078 Change-Id: Ia46443521918519f2dfa64d4621027dfd13ac566
* Clean up various warnings in bionic.Elliott Hughes2014-02-181-0/+1
| | | | Change-Id: Ic57541d0a567fd4ae79f0ad59b2ffde1130eb7d2
* bionic: call stdio cleanup on exitPawit Pornkitprasan2013-11-192-0/+100
| | | | | | | | | | | | | | | As of 61e699a133a4807fe878a6cb0d7190d7c96e21f8, stdio clean up functions are no longer registered in atexit and must be called manually via __cleanup. The issue this fixes is some static binaries linked against bionic cannot output properly when piped or redirected because the buffer is not flushed before closing. This is done by pulling in exit.c (and other dependencies) from netbsd. Change-Id: I193e54a6d08900f291550029fe75ce76394d9e22
* Fix a TODO; we've had SOCK_CLOEXEC for a while now.Elliott Hughes2013-11-061-3/+0
| | | | Change-Id: I4bc39b57f3c33441ead74127f576bf5a4e311566
* Fix the *rand48 functions on LP64.Elliott Hughes2013-10-284-14/+12
| | | | | | | I reported the mrand48 bug upstream, and 'matt' fixed the whole family of functions! Change-Id: I07fbc034e86499ce89599c3026a741738fd0cfc0
* Fix x86_64 build, clean up intermediate libraries.Elliott Hughes2013-10-092-1/+35
| | | | | | | | | | | | | | | | | | | | | | The x86_64 build was failing because clone.S had a call to __thread_entry which was being added to a different intermediate .a on the way to making libc.so, and the linker couldn't guarantee statically that such a relocation would be possible. ld: error: out/target/product/generic_x86_64/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(clone.o): requires dynamic R_X86_64_PC32 reloc against '__thread_entry' which may overflow at runtime; recompile with -fPIC This patch addresses that by ensuring that the caller and callee end up in the same intermediate .a. While I'm here, I've tried to clean up some of the mess that led to this situation too. In particular, this removes libc/private/ from the default include path (except for the DNS code), and splits out the DNS code into its own library (since it's a weird special case of upstream NetBSD code that's diverged so heavily it's unlikely ever to get back in sync). There's more cleanup of the DNS situation possible, but this is definitely a step in the right direction, and it's more than enough to get x86_64 building cleanly. Change-Id: I00425a7245b7a2573df16cc38798187d0729e7c4
* Add more __restricts, clean up __format__ attributes.Elliott Hughes2013-05-141-1/+1
| | | | Change-Id: I7e2d270cc722d339d221eaea92747eaff3b51403
* Upgrade to current NetBSD popen/pclose.Elliott Hughes2013-03-064-1/+272
| | | | | | | | This gets us back to using vfork now our ARM vfork assembler stub is fixed, and adds the missing thread safety for the 'pidlist'. Bug: 5335385 Change-Id: Ib08bfa65b2cb9fa695717aae629ea14816bf988d
* Our strcoll(3) is no different from NetBSD's, so take exactly theirs.Elliott Hughes2013-01-221-0/+59
| | | | Change-Id: I45251047202a229f9175735ecc23c0ebcda71e8d
* Avoid overflow in memccpy.Elliott Hughes2013-01-221-0/+61
| | | | | | | Just take the upstream NetBSD code. Bug: http://code.google.com/p/android/issues/detail?id=43078 Change-Id: Ibbbde9d00e8bc6a09c9503aab2b04b4e3d1f98b0
* libc: Fix alphasort() signature (and implementation).David 'Digit' Turner2012-10-291-59/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The declaration for alphasort() in <dirent.h> used the deprecated: int alphasort(const void*, const void*); while both Posix and GLibc use instead: int alphasort(const struct dirent** a, const struct dirent** b); See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html This patch does the following: - Update the declaration to match Posix/GLibc - Get rid of the upstream BSD code which isn't compatible with the new signature. - Implement a new trivial alphasort() with the right signature, and ensure that it uses strcoll() instead of strcmp(). - Remove Bionic-specific #ifdef .. #else .. #endif block in dirent_test.cpp which uses alphasort(). Even through strcoll() currently uses strcmp(), this does the right thing in the case where we decide to update strcoll() to properly implement locale-specific ordered comparison. Change-Id: I4fd45604d8a940aaf2eb0ecd7d73e2f11c9bca96
* Clean up the implementation of the <dirent.h> functions.Elliott Hughes2012-10-261-0/+59
| | | | Change-Id: I3c647cc9588525afc41fee90ee468d58cd13503a
* More upstream NetBSD upgrades.Elliott Hughes2012-10-2317-0/+2259
| | | | Change-Id: Idb781d37de3b05585271d7d258ecffd5ba87d0b8
* Upgrade more functions to the current upstream NetBSD copy.Elliott Hughes2012-10-239-0/+1297
| | | | Change-Id: Ie0b3f8b3fccef28609eb210434413ebd51d6ef45
* Upgrade seed48 too.Elliott Hughes2012-10-011-0/+49
| | | | | | Missed this in 774c7f54ff375d71106283d42779b0cc5f238f87. Change-Id: Ic24fd67f003d0e2d192cfb08f96f63024ca817eb