Other changes to support the new headers:
- Remove the flock64 structure it is defined in the new headers.
- Update the syscalls to correspond with the headers.
Change-Id: I49a6b07e8b2bfffb67be71b07b58e4e6848fcc09
POSIX also says that ucontext_t's uc_sigmask has type sigset_t.
MIPS64 strace needs this.
The #define is to keep chromium off our lawn; otherwise it tries to redefine
all this stuff itself. We should probably clean that up and remove the #define.
Change-Id: I765d6a765a33dca7db33cd8c40f408dc98e5c95b
A lot of third-party code calls the private __get_thread symbol,
often as part of a backport of bionic's pthread_rwlock implementation.
Hopefully this will go away for LP64 (since you're guaranteed the
real implementation there), but there are still APIs that take a tid
and no way to convert between a pthread_t and a tid. pthread_gettid_np
is a public API for that. To aid the transition, make __get_thread
available again for LP32.
(cherry-pick of 27efc48814b8153c55cbcd0af5d9add824816e69.)
Bug: 14079438
Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1
This showed up as open_memstream not being visible in <stdio.h>
if only _GNU_SOURCE was defined.
Bug: 17361504
Change-Id: I38f9843f4e6ee770a6325ad50f779bda5495ffca
This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea3645 there.
It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.
Specifically fixes:
We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.
The __sync implementation was not defining the LOCK_FREE macros.
ATOMIC_VAR_INIT was using named field initializations. These are a
C, not C++, feature, that is not supported by g++ 4.6.
The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation. Don't run that piece
with 4.6.
In L, this is a prerequisite for fixing:
Bug:16880454
Bug:16513433
Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
We already had the POSIX strerror_r, but some third-party code defines
_GNU_SOURCE and expects to get the GNU strerror_r instead.
This exposed a bug in the libc internal logging functions where unlike
their standard brethren they wouldn't return the number of bytes they'd
have liked to have written.
Bug: 16243479
Change-Id: I1745752ccbdc569646d34f5071f6df2be066d5f4
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
Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>. This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.
Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing. This generalizes the bionic header so that it
can be used directly as the prebuilt header as well. So long as they
don't diverge again, that should somewhat improve test coverage.
Use the correct builtin for atomic_is_lock_free.
Fix atomic_flag_init.
Turn on atomic tests even with __GLIBC__, since they now appear to pass.
Include uchar.h in stdatomic.h where needed.
Add a basic memory ordering test.
Fix bit-rotted comments in bionic tests makefile.
Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
Also remove declaration.
The only user is compiler-rt, and they can replace that call with one to
syscall(2). compiler-rt doesn't currently build on mips64 anyway.
Bug: 11156955
Change-Id: Ieae0ba49c8e7aa50253401fc1d7c2d17bc867d39
No one's reported this, but I saw it in an Android port of fuser(1).
We still have lots of problems in our network headers because we
get most of the structs direct from the kernel, and it doesn't use
types like this (which is why we've got away without this one for
so long). One day we should probably look at cleaning that up, but
doing so can wait.
Change-Id: If15edf0cfc32716fa312d7ed97c48321b760d979
This way it's a lot harder for us to screw up (since we should always
be including <sys/cdefs.h> anyway).
Bug: 14659579
Change-Id: I23070fff3296b0d1c683bb5e3a6e214146327d53
Needed for __BEGIN_DECLS/__END_DECLS. Currently fine because it's being
included after other files that do this.
Change-Id: I1f12368fc461f6ef5ca90992cf19f317f0b5d7af
Removes the leading underscores from __android_set_abort_message() and
moves its declaration into a public header file.
Bug: 17059126
Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab
<features.h> is supposed to take user-settable stuff like _GNU_SOURCE
and _BSD_SOURCE and turn them into __USE_GNU and __USE_BSD for use in
the C library headers. Instead, bionic used to unconditionally define
_BSD_SOURCE and _GNU_SOURCE, and then test _GNU_SOURCE in the header
files (which makes no sense whatsoever).
Bug: 14659579
Change-Id: Ice4cf21a364ea2e559071dc8329e995277d5b987
Fix and use __RENAME (and lose ___RENAME --- two underscores should be
enough for anybody). This was the point of this change, because I want
to use __RENAME to support the two basename variants and the two
strerror_r variants.
Lose a bunch of macros that weren't being used.
Lose three dead files from the DNS code.
Change-Id: I3ef645c566b16a52217bc2e68c7d54b37c7c9522
This is an alternate, somewhat simpler, fix that makes it safe to
include both <atomic> and <stdatomic.h> from C++ code in either order.
It means that C code consistently uses one implementation of atomics
and C++ another. We still have to make sure that those two
implementations interoperate correctly at runtime; in particular,
any flavor of atomic object needs to be represented exactly like the
underlying type, with the proper alignment constraint.
Bug:17007799
Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc
Glibc calls theirs __ctype_get_mb_cur_max. Make ours match to cut down
on differences between bionic and glibc.
Bug: 11156955
Change-Id: Ib7231f01aa9676dff30aea0af25d597bfe07bc73
ifuncs now work in i386 and x86_64 when called in the same library as
well as in a different library.
Bug:6657325
Change-Id: Ic0c48b1b0a76cb90f36c20c79f68294cc3fd44a1
This reverts commit 3fb5097a7e.
libvpx is now fixed.
(cherry-pick of 2be1be47aa9b63568fe6ce1e0a4029b37d90764d.)
Bug: 15598056
Change-Id: Icca974e667f92206505f484bd291726eb0150f68
We don't want GCC's fixincludes to touch our <stdio.h> because we
want to support multiple platform versions with one toolchain. Give
them a nice easy unambiguous string to look for.
Bug: http://code.google.com/p/android/issues/detail?id=73728
Change-Id: I15cb9a2c9eb0a44b0965dc2139f224f2b6e68ea1
Previously this was hard coded to 4. This is only the case for UTF-8
locales.
As a side effect, this properly reports C.UTF-8 as the default locale
instead of C.
Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc
Also clean up the implementation of all the pty functions, add tests,
and fix the stub implementations of ttyname(3) and ttyname_r(3).
Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: I0fb36438cd1abf8d4e87c29415f03db9ba13c3c2
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
This doesn't require us to change any of the syscall implementations
because (a) the LP32 ones have sizeof(int) == sizeof(long) anyway,
which is how we never noticed this bug before and (b) the LP64 ones
all use a 64-bit register for the result (and for the syscall number
too).
Bug: https://code.google.com/p/android/issues/detail?id=73952
Change-Id: I9866c3579a7a94de27bfbe80ad7a822c3183c7fb
Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.
Bug: 14292866
Change-Id: Icee7f088b97f88ccbdaf471b98cbac7f19f9210a
Also remove __bionic_name_mem which has exactly one caller, and is only
ever expected to be used in this one place.
Change-Id: I833744f91e887639f5b2d1269f966ee9032af207
Some platform code is apparently compiled with switches that do
not support char16_t and char32_t. This caused stdatomic.h to fail
to compile. This CL makes stdatomic.h usable in those environments.
Change-Id: Ie5a17f20b8b545c97128d00605b4eabd2a6bfe3e
Had intended to remove this one before submitting the locale changes,
but forgot. It isn't a standard ctype function, so we don't need it.
Change-Id: Ie9c09fa6c61b1101b5992fa06da30e373a0c6bf7
Accidentally verified against a dirty tree. Needs the companion change to libc++ to land upstream before I can submit this.
This reverts commit e087eac404.
Change-Id: I317ecd0923114f415eaad7603002f77feffb5e3f
Since we only support the C locale, we can just forward all of these to
their non-locale equivalents for correct behavior.
Change-Id: Ib7be71b7f636309c0cc3be1096a4c1f693f04fbb
Code written for glibc can be sloppy about these types on LP64 and
get away with it. It's probably better for our users if these types
are identical rather than just being the same size.
Change-Id: I3dd116d80569d2d101342a552c55f4a18884025b
This is actually revision 1.33, which is no longer the latest, but it's
as close to head as we can currently reasonably get. I've also switched
to the OpenBSD getentropy_linux.c implementation of getentropy, lightly
modified to try to report an error on failure.
Bug: 14499627
Change-Id: Ia7c561184b1f366c9bf66f248aa60f0d53535fcb
This brings us on par with glibc.
To avoid breaking clients, temporary keep cmsg_nxthdr until the next NDK
refresh.
Bug: 15822452
Change-Id: I24c24e68c31f4f2b8f3d2df7acd575cb75174173
Replacing memmove/memset with their builtin check equivalents fixes an
implicit definition warning when only including strings.h.
Change-Id: I74f03b9506ea37f5c2f9c11498e379a70998b430
getdtablesize(3) was removed fro POSIX 2004. Keep the symbol around in LP32 for
binary compatibility, but remove the declaration from unistd.h.
Bug: 13935372
Change-Id: I1f96cd290bf9176f922dad58bd5a7ab2cae7ef0f
This is the change to export the tty ldisc definitions (like N_TTY)
from Linux uapi kernel header. So bionic is compatbile with glibc
which has its own tty ldisc definition exported through ioctl.h
Change-Id: I44e4c7cc2eba31549e9c9c75f74961a949d4a696
Signed-off-by: Qiming Shi <qiming.shi@intel.com>
Signed-off-by: Yin, Fengwei <fengwei.yin@intel.com>
This is now fixed upstream, but we need to wait for it to come back down
via chromium...
Bug: 15598056
Change-Id: I08f1be4296c391cfc1616a5ff0815be14071594a
These were removed from POSIX 2004. Hides the header declarations for all
targets, and hides the symbols for LP64.
Bug: 13935372
Change-Id: Id592f67e9b7051517a05f536e1373b30162e669c
wait3(2) was removed from POSIX 2004. Keep the symbol around in LP32 for binary
compatibility, but remove the declaration in sys/wait.h.
Bug: 13935372
Change-Id: Ic715fce6781aae43b4ac6d745dc6d1e6b9914e71
libvpx should probably change its assembler to refer to lrand48 directly,
because that will work on old and new versions of Android. This keeps things
building until that happens.
Bug: 15598056
Change-Id: I4a1f59e710a083b9f9a707ceeb9ca0a28141a954
These were both removed from POSIX 2004, and we don't define an
implementation for getw(3). Keep the definition of put(3) on LP32 for
binary compatibility.
Bug: 13935372
Change-Id: Iba384b45093ac6d2d7c2d81f7980cd7701dd6f56
The definitions are still available on LP32 for binary compatibility, but
they're gone on LP64, and the declarations are gone everywhere.
We should probably just make syslog(3) log to the regular Android log,
but that's a job for another day.
Bug: 11156955
Change-Id: I74a98c92f7922ea733549ec6d37c6fa8b7014860
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
The bug here turned out to be that we hadn't increased the constant
corresponding to the maximum number of bytes in a character to match
our new implementation, so any character requiring more than a byte
in UTF-8 would break our printf family.
Bug: 15439554
Change-Id: I693e5e6eb11c640b5886e848502908ec5fff53b1
This function has been removed from POSIX.
Unfortunately, we can't leave #define index(a, b) strchr((a), (b)) in its place
because defining a preprocessor macro for index() breaks a whole lot of code.
Bug: 13935372
Change-Id: Ifda348acde06da61c12e7ee2f8fe6950a3174dd1
mbrtoc32 and c32rtomb get their implementations from mbrtowc and wcrtomb. The
wc functions now simply call the c32 functions.
Bug: 14646575
Change-Id: I49d4b95fed0f9d790260c996c4d0f8bfd1686324
These symbols are still defined for LP32 for binary compatibility, but
the declarations have been replaced with the POSIX recommended #defines.
Bug: 13935372
Change-Id: Ief7e6ca012db374588ba5839f11e8f3a13a20467
- removed extra padding from ucontex_t on x86, x86_64 and mips
- force ucontext_t struct to use 64 bits for the sigmask on all arches
(previsouly wrong since sigset_t on arm and x86 is only 32 bits)
- arm and arm64 continue to use padding to match glibc sigset_t
This brings Bionic on par with the kernel w.r.t ucontext padding.
Bug: 12828904
Change-Id: Ia8915ace694ecb4695603a334e697985f4c3e7aa
typeof() is a gcc builtin and is not always available (such as clang when
-std=c*). Both gcc and clang always expose __typeof__(), so just use that.
Change-Id: I75e2a990acc35f6f39b2c353f6548100ec03c67f
- used underscore_style_for_vars
- extracted time related functionality into a function
- cleaned up style
- removed unused fields from pthread_rwlock_t on LP64
- changed reservation in pthread_rwlock_t so that the size of the
structure equals glibc version
Bug: 8133149
Change-Id: I84ad3918678dc7f5e6b3db9b7e9b0899d3abe9cd
Also hide part of the system properties compatibility code, since
we needed to touch that to keep it building.
I'll remove __futex_syscall4 and futex in a later patch.
Bug: 11156955
Change-Id: Ibbf42414c5bb07fb9f1c4a169922844778e4eeae
There's no need to expose gregset_t and fpregset_t when they
are not used in ucontext_t.
Bug: 12828904
Change-Id: Ieda1edf0ab18015f444c4d385fe9c41c4544017f