Commit graph

2233 commits

Author SHA1 Message Date
Elliott Hughes
8ecf225827 Provide glibc-compatible SYS_* aliases for the __NR_* constants.
This helps us remove another external/strace bionic hack.

Change-Id: I3e82c0d2fd27e479be98f096e05b666fd16f8eb3
2013-03-21 18:06:55 -07:00
Elliott Hughes
17a8b0db63 Expose wait4 as wait4 rather than __wait4.
This helps strace(1) compile with one fewer hack.

Change-Id: I5296d0cfec5546709cda990abd705ad33d7c4626
2013-03-21 16:14:06 -07:00
Christopher Ferris
31dea25b8b Create arch specific versions of strcmp.
This uses the new strcmp.a15.S code as the basis for new versions
of strcmp.S.

The cortex-a15 code is the performance optimized version of strcmp.a15.S
taken with only the addition of a few pld instructions.
The cortex-a9 code is the same as the cortex-a15 code except that the
unaligned strcmp code was taken from the original strcmp.S.
The krait code is the same as the cortex-a15 code except that one path
in the unaligned strcmp code was taken from the original strcmp.S code
(the 2 byte overlap case).
The generic code is the original unmodified strmp.S from the bionic
subdirectory.

All three new versions underwent these test cases:

Strings the same, all same size:
- Both pointers double word aligned.
- One pointer double word aligned, one pointer word aligned.
- Both pointers word aligned.
- One pointer double word aligned, one pointer 1 off a word alignment.
- One pointer double word aligned, one pointer 2 off a word alignment.
- One pointer double word aligned, one pointer 3 off a word alignment.
- One pointer word aligned, one pointer 1 off a word alignment.
- One pointer word aligned, one pointer 2 off a word alignment.
- One pointer word aligned, one pointer 3 off a word alignment.
For all cases where it made sense, the two pointers were also tested
swapped.

Different strings, all same size:
- Single difference at double word boundary.
- Single difference at word boudary.
- Single difference at 1 off a word alignment.
- Single difference at 2 off a word alignment.
- Single difference at 3 off a word alignment.

Different sized strings, strings the same until the end:
- Shorter string ends on a double word boundary.
- Shorter string ends on word boundary.
- Shorter string ends at 1 off a word boundary.
- Shorter string ends at 2 off a word boundary.
- Shorter string ends at 3 off a word boundary.

For all different cases, run them through the same pointer alignment
cases when the strings are the same size.
For all cases the two pointers were also tested swapped.

Bug: 8005082

Merge from internal master.

(cherry-picked from commit a9a5870d16)

Change-Id: I4c2b98f8a50804fb98ab67f75e9d660f1315a144
2013-03-20 14:33:54 -07:00
Elliott Hughes
ce532721aa Hide various symbols that shouldn't be exposed.
A mangled symbol in libc.so is a symbol that shouldn't be exported
by libc.so.

Change-Id: Id92d1e1968b3d11d111a5d9ef692adb1ac7694a1
2013-03-15 16:31:09 -07:00
Elliott Hughes
8f2a5a0b40 Clean up internal libc logging.
We only need one logging API, and I prefer the one that does no
allocation and is thus safe to use in any context.

Also use O_CLOEXEC when opening the /dev/log files.

Move everything logging-related into one header file.

Change-Id: Ic1e3ea8e9b910dc29df351bff6c0aa4db26fbb58
2013-03-15 16:12:58 -07:00
Elliott Hughes
2eb44c5aa4 Remove useless workaround for HTC RIL bugs.
HTC's RIL uses the liblog logging, not ours.

Change-Id: I56f9304e833ccb329df4ee55042012d7ad5f73ed
2013-03-15 11:21:15 -07:00
Elliott Hughes
4d696eb49d Merge "Fix a bug in ZoneCompactor that meant the zonetab offset was wrong." 2013-03-15 00:30:48 +00:00
Elliott Hughes
af7f2f2fcf Fix a bug in ZoneCompactor that meant the zonetab offset was wrong.
Bug: 8391426
Change-Id: Ia4a8889b5a613aa96bb3fb5d89a921c913ff7626
2013-03-14 17:10:24 -07:00
Christopher Ferris
306a353825 Remove unused arm defines.
The defines HAVE_32_BYTE_CACHE_LINES and ARCH_ARM_USE_NON_NEON_MEMCPY
are not used by any code. The previous memcpy code that used these
has been split into different architecture versions to avoid the need
for them.

Bug: 8005082

Merge from internal master.

(cherry-picked from commit 6e1a5cf31b)

Change-Id: Ib18fc3f4131b21cdbd19b9dde7697ac25d066fcf
2013-03-14 15:32:18 -07:00
Elliott Hughes
e0175ca7e4 Don't search off the end of the index for bad Olson ids.
In the old code, the index was a file to itself, so it made sense to
read until you hit the end of the file. In the new code, the index is
followed by hundreds of KiB of data, so we need to just search the
index.

Bug: 8368791
Change-Id: Icf5f8b5516cf3a93679fa849c9f6cd1cb100e0f1
2013-03-14 14:38:08 -07:00
Elliott Hughes
ec706c24ac Merge "Use the kernel's MAX_ERRNO in the syscall stubs." 2013-03-13 00:44:33 +00:00
Elliott Hughes
9aceab5015 Use the kernel's MAX_ERRNO in the syscall stubs.
Bug: http://code.google.com/p/android/issues/detail?id=53104
Change-Id: Iaabf7025b153e96dc5eca231a33a32d4cb7d8116
2013-03-12 17:43:58 -07:00
Christopher Ferris
980508b0ea Merge "Break bionic implementations into arch versions." 2013-03-12 22:24:09 +00:00
Christopher Ferris
04954a43b3 Break bionic implementations into arch versions.
Move arch specific code for arm, mips, x86 into separate
makefiles.
In addition, add different arm cpu versions of memcpy/memset.

Bug: 8005082

Merge from internal master (acdde8c1cf).

Change-Id: I04f3d0715104fab618e1abf7cf8f7eec9bec79df
2013-03-12 14:06:08 -07:00
Elliott Hughes
cb2069bf69 Support large errno values on ARM.
Bug: http://code.google.com/p/android/issues/detail?id=53104
Change-Id: Ic6c40be2dc50f0644a3d8b09ceae59c38f2d5b53
2013-03-12 11:55:45 -07:00
Elliott Hughes
53630c0e5b Merge "Cache the most-recently used timezone for mktime_tz and localtime_tz." 2013-03-12 01:28:36 +00:00
Elliott Hughes
4a05bef4c0 Cache the most-recently used timezone for mktime_tz and localtime_tz.
Normally, the C library implicitly caches your timezone by virtue
of the fact that the prehistoric API assumes a single timezone for
the entire process.

The unfortunate mktime_tz and localtime_tz extensions work around
this, but represent timezones as strings to their callers, so code
that makes heavy use of these needs a cache to be able to perform
acceptably until it can hopefully one day be rewritten to use
java.util.Calendar or icu4c.

Bug: 8270865
Change-Id: I92e3964e86dc33ceac925f819cc5e26ff4203f50
2013-03-11 17:17:02 -07:00
Elliott Hughes
4b032ee9b9 Merge "Let bionic use the correct definition of ssize_t." 2013-03-11 17:55:27 +00:00
Elliott Hughes
cdb27f239b Upgrade to tzdata2013b.
From the release notes:

  Changes affecting current and future time stamps:

    Haiti uses US daylight-saving rules this year, and presumably future years.
    This changes time stamps starting today.  (Thanks to Steffen Thorsen.)

    Paraguay will end DST on March 24 this year.
    (Thanks to Steffen Thorsen.)  For now, assume it's just this year.

    Morocco does not observe DST during Ramadan;
    try to predict Ramadan in Morocco as best we can.
    (Thanks to Erik Homoet for the heads-up.)

Change-Id: I98d5290ea5a1d9fb1eeddab1c9e72135dc9e4bd1
2013-03-11 09:41:45 -07:00
Elliott Hughes
b6e22482d4 Let bionic use the correct definition of ssize_t.
Bug: 8253769
Change-Id: I50c7cc20828fc089b83580e039ce9153a6c5a8cc
2013-03-08 15:28:52 -08:00
Elliott Hughes
0493a6f7be Regenerate NOTICE files.
Also clean up some obsolete cruft.

Change-Id: Iec3b36f6607f7a08b72de99294ed5b6cd910dd5f
2013-03-07 11:51:10 -08:00
Elliott Hughes
6b3f49a537 Upgrade to current NetBSD popen/pclose.
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
2013-03-06 16:20:55 -08:00
Elliott Hughes
642331b5dd Fix debug malloc.
This was broken by the change to use AT_RANDOM for the stack guards.

Bug: 7959813
Bug: 8330764
Change-Id: I791900092b72a9a900f16585237fa7ad82aaed9f
2013-03-06 15:03:53 -08:00
Elliott Hughes
69af6e61e1 Upgrade to tzdata2013a.
From the release notes:

    Chile's 2013 rules, and we guess rules for 2014 and later, will be
    the same as 2012, namely Apr Sun>=23 03:00 UTC to Sep Sun>=2 04:00 UTC.
    (Thanks to Steffen Thorsen and Robert Elz.)

    New Zones Asia/Khandyga, Asia/Ust-Nera, Europe/Busingen.
    (Thanks to Tobias Conradi and Arthur David Olson.)

Change-Id: I351e04b3348420ad7df7c648963c235b534033d2
2013-03-05 14:00:38 -08:00
Ben Cheng
133d97e4b0 Merge "Add stack unwinding directives to memcpy." 2013-03-05 21:04:38 +00:00
Elliott Hughes
eb93ebffba Switch to upstream-freebsd for the unmolested wchar code.
Change-Id: I87b4d76ff8da04109ae53638eec4f11629798960
2013-03-01 18:35:56 -08:00
Elliott Hughes
f0777843c0 Move realpath.c to upstream-freebsd.
This is actually a slightly newer upstream version than the one I
originally pulled. Hopefully now it's in upstream-freebsd it will
be easier to track upstream, though I still need to sit down and
write the necessary scripts at some point.

Bug: 5110679
Change-Id: I87e563f0f95aa8e68b45578e2a8f448bbf827a33
2013-03-01 17:11:39 -08:00
Ben Cheng
14283004f5 Add stack unwinding directives to memcpy.
Also include some Android specific header files.

Change-Id: Idbcbd43458ba945ca8c61bfbc04ea15fc0ae4e00
2013-03-01 14:56:04 -08:00
Ben Cheng
c5c6cb3f13 am 66273ac2: Merge "Adding strcmp tuned for Cortex-A15."
* commit '66273ac2b6b8c2042350204575bd290d96dea681':
  Adding strcmp tuned for Cortex-A15.
2013-03-01 10:24:58 -08:00
Ben Cheng
8f149da08d am b3b1ab62: Merge "Adding memcpy tuned for Cortex-A15."
* commit 'b3b1ab6213df15f99c9af3088cfe733428816fd3':
  Adding memcpy tuned for Cortex-A15.
2013-03-01 10:24:58 -08:00
Nick Kralevich
305a999589 am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"
* commit '8fa924e5dff4588cca8586e0e727b9a544db7083':
  unistd.h: don't include sys/capability.h
2013-03-01 10:24:57 -08:00
Ben Cheng
66273ac2b6 Merge "Adding strcmp tuned for Cortex-A15." 2013-03-01 18:18:34 +00:00
Ben Cheng
b3b1ab6213 Merge "Adding memcpy tuned for Cortex-A15." 2013-03-01 18:18:05 +00:00
Nick Kralevich
6524d3cad7 unistd.h: don't include sys/capability.h
Don't pull in unnecessary header files. AFAIK, I've fixed all
the code which didn't include the correct header files.

Change-Id: If0b7bba74e77cb24a0cf9ce8968aa07400855e58
2013-03-01 10:10:55 -08:00
Greta Yorsh
eb149e954e Adding strcmp tuned for Cortex-A15.
The attached patch provides a new implementation of strcmp for ARM,
using LDRD instead of LDR whenever possible.

For older architectures that do not support LDRD, this implementation
uses the same algorithm as before.

Testing and benchmarking:
* Validation: successfully passes a test that compares different strings
of length 1-128 and offsets 0-8 from a word boundary. Checked on
qemu/A15/A9, ARM/Thumb mode, Big/Little Endian.
* Integration with gcc: no regression on qemu for arm-none-eabi --with-cpu
a15/a9 --with-mode arm/thumb.

Change-Id: I9e230e1b99dbdc9119b69ee858a89038c516a4ea
Signed-off-by: Vassilis Laganakos <vasileios.laganakos@arm.com>
2013-03-01 10:41:01 +00:00
Greta Yorsh
5b349fc22e Adding memcpy tuned for Cortex-A15.
The strategy for large block sizes is LDRD and STRD with offset addressing,
where the main loop copies 64 bytes in every iteration, (i.e., 8 calls to
LDRD and STRD pairs), interleaving load and stores (i.e., the pairs of LDRD
and STRD of the same data are consecutive instructions), and the writeback
of an updated address is a separate instruction, which allows us to write
back the accumulated update once per iteration.

This strategy is implemented in memcpy.S. In some configurations, a plain
version of memcpy (included from memcpy-stub.c) is used instead of the
optimized one.

Validation:
* Correctness: checked memcpy using a test harness for block sizes
ranging between 1 to 128, and source and destination buffers alignment
ranging in { 0,1,2,3,4,8,12 } bytes each.
* Performance: benchmarking on Cortex-A15 FPGA indicates that this strategy
is better for A15 than the strategy used by glibc and even slightly better
than using NEON. Benchmarking on Cortex-A9 bare metal and Linux shows
that the proposed strategy is reasonable: not as fast as the version of
memcpy from glibc (which is the best open source strategy for A9), but
comparable with csl and bionic.
* Integration with GCC: no regression for arm-none-eabi --with-cpu
cortex-a15 and cortex-a9.

Change-Id: Ied56354d8992c62ae3e02d582a2bd55585d814b9
Signed-off-by: Vassilis Laganakos <vasileios.laganakos@arm.com>
2013-03-01 10:40:50 +00:00
Elliott Hughes
7fe8229b49 am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."
* commit '9c1912c4bf5eb0edc07bfd333226c4e0b7a629eb':
  Avoid changing the C++ ABI with ssize_t.
2013-02-28 11:43:11 -08:00
Elliott Hughes
e255642dc1 Avoid changing the C++ ABI with ssize_t.
Bug: 8253769
Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
2013-02-28 10:51:31 -08:00
Nick Kralevich
58b997c812 am f5f906c1: Merge "libc: create sys/capability.h"
* commit 'f5f906c184677b8295523231cfeead9ed94661ad':
  libc: create sys/capability.h
2013-02-26 13:50:03 -08:00
Nick Kralevich
7c0dd555c0 libc: create sys/capability.h
Per "man capset", sys/capability.h is the appropriate header file
for the capget / capset definition, not unistd.h. Fixed.

As a short term hack, continue to include sys/capability.h in
unistd.h, until we can fix all the code which uses capget / capset.

Change-Id: I6e7cf55955d761ca785a14c5e4b7a44125d8fc15
2013-02-26 13:27:15 -08:00
Elliott Hughes
406968b244 am c0e9ddd0: Merge "Reimplement scandir(3)."
* commit 'c0e9ddd002f6084c29c26236d741d64d01713c15':
  Reimplement scandir(3).
2013-02-25 14:54:54 -08:00
Elliott Hughes
701bec2af3 Reimplement scandir(3).
The old scandir implementation didn't take into account the varying
size of directory entries, and didn't correctly clean up on its
error exits.

Bug: 7339844
Change-Id: Ib40e3564709752241a3119a496cbb2192e3f9abe
2013-02-25 13:14:31 -08:00
Elliott Hughes
7b8bf68133 am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."
* commit 'f6bb5bf498810d0622f66020059c87b96738c35b':
  Add the glibc-compatible names to <sys/endian.h>.
2013-02-22 14:02:44 -08:00
Elliott Hughes
f6bb5bf498 Merge "Add the glibc-compatible names to <sys/endian.h>." 2013-02-22 21:46:59 +00:00
Elliott Hughes
440bc83d92 am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
* commit '7b2c6385effbb6d6e98bfe29cc6c144211128d9e':
  Fix <memory.h> to be a synonym for <string.h> like in glibc.
2013-02-22 12:10:15 -08:00
Nick Kralevich
cadc858329 am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"
* commit 'bc0e7ee18157c2ffe65644514555689f4259ccfe':
  libc: add sys/signal.h for compatibility
2013-02-22 11:53:05 -08:00
Elliott Hughes
7b2c6385ef Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc." 2013-02-22 19:49:39 +00:00
Elliott Hughes
6f1b7a6407 Fix <memory.h> to be a synonym for <string.h> like in glibc.
Change-Id: If23589c5d85dffd28788e04b010303620fa178ca
2013-02-22 11:11:48 -08:00
Elliott Hughes
cf820d7e96 Add the glibc-compatible names to <sys/endian.h>.
Also remove declarations for functions that don't exist; these
are all macros.

Bug: http://code.google.com/p/android/issues/detail?id=41769
Change-Id: Ia3774ab2ff7d3c535f83774eac61068f9b11e194
2013-02-22 11:04:27 -08:00
Nick Kralevich
b22a684990 libc: add sys/signal.h for compatibility
Some applications look for sys/signal.h instead of signal.h.
Work around those apps.

Change-Id: I76ac7744ebc56d196b5f0cb9ed381d32817436b9
2013-02-22 10:38:28 -08:00
Elliott Hughes
2a5b57db8c am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."
* commit '580a707376d81bfcb39919f0a1203b39a39dbd8a':
  Stop advertising rindex(3), which is both deprecated and unimplemented.
2013-02-21 17:55:28 -08:00
Elliott Hughes
538f6fc202 Stop advertising rindex(3), which is both deprecated and unimplemented.
Change-Id: I3c775d9974e49c3f76a53e46e022659657b89034
2013-02-21 17:39:06 -08:00
Nick Kralevich
398f46dd92 am a0259b42: Merge "libc: remove bcmp prototype"
* commit 'a0259b42eba08e6d71a274fa3f770afccbb93107':
  libc: remove bcmp prototype
2013-02-21 17:39:03 -08:00
Nick Kralevich
a0259b42eb Merge "libc: remove bcmp prototype" 2013-02-22 01:22:35 +00:00
Nick Kralevich
11ebbc8437 libc: remove bcmp prototype
AFAIK, bionic only ever provided an implementation of bcmp
for x86, and even then, the code was never actually compiled.
Remove the prototype.

bcmp() has been obsoleted and replaced by memcmp()

Change-Id: I549d02ab6a9241a9acbbbfade0d98a9a02c2eaee
2013-02-21 17:17:09 -08:00
Elliott Hughes
719d46f8ac am a9ff09d1: Merge "Fix raise(3) so it works in signal handlers."
* commit 'a9ff09d1fc22292adc12cf99d4d44448d619b3cf':
  Fix raise(3) so it works in signal handlers.
2013-02-21 14:17:47 -08:00
Elliott Hughes
fae89fc404 Fix raise(3) so it works in signal handlers.
We could special-case raise(3) in non-threaded programs, but the more
conservative course is to make pthread_kill(3) work in signal handlers
at the cost of a race shared by other C libraries.

Change-Id: I59fb23d03bdabf403435e731704b33acdf3e0234
2013-02-21 11:22:23 -08:00
Jean-Baptiste Queru
818b1423d2 Fix mako builds. Do not merge.
Revert "Regenerate msm_ion.h."

This reverts commit 3fac8f7f49.
2013-02-20 12:47:58 -08:00
Thorsten Glaser
c641cafbc3 use architecture-specific ssize_t definition
after change 32822 was rejected, this is the more light-weight
version of the fix: libc/include/sys/types.h already - via
libc/kernel/common/linux/posix_types.h - includes a definition
of __kernel_ssize_t from libc/kernel/arch-*/asm/posix_types.h
which is architecture-specific, toolchain-agnostic and also
gets rid of the gcc -Wformat warning (which it issues correctly,
since this i̲s̲ indeed a bug in bionic)

Change-Id: Ie4503ab16628bc25815a836d07556f665e9795c7
2013-02-19 14:12:55 -08:00
Elliott Hughes
593abb7b59 Merge "stdlib: atexit: include <sys/cdefs.h>" 2013-02-19 21:58:18 +00:00
Elliott Hughes
9d23e04c43 Fix pthreads functions that should return ESRCH.
imgtec pointed out that pthread_kill(3) was broken, but most of the
other functions that ought to return ESRCH for invalid/exited threads
were equally broken.

Change-Id: I96347f6195549aee0c72dc39063e6c5d06d2e01f
2013-02-19 12:21:41 -08:00
Chirayu Desai
61ba9b526b stdlib: atexit: include <sys/cdefs.h>
Change-Id: Ib9eb167710a021e0a2b5c77a06a9338cdc748e6d
2013-02-16 21:23:27 +05:30
Elliott Hughes
081318e355 dalvik is big enough and ugly enough to handle System.arraycopy itself.
Change-Id: I4b54a15ea101c0c6bab06cfb11e4178f5a57fc05
2013-02-15 14:27:52 -08:00
Elliott Hughes
40eabe24e4 Fix the pthread_setname_np test.
Fix the pthread_setname_np test to take into account that emulator kernels are
so old that they don't support setting the name of other threads.

The CLONE_DETACHED thread is obsolete since 2.5 kernels.

Rename kernel_id to tid.

Fix the signature of __pthread_clone.

Clean up the clone and pthread_setname_np implementations slightly.

Change-Id: I16c2ff8845b67530544bbda9aa6618058603066d
2013-02-15 12:08:59 -08:00
Elliott Hughes
0a2cb81597 Merge "Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces." 2013-02-14 23:50:13 +00:00
Elliott Hughes
fb7eb5e07f Simplify __stack_chk_fail, and fix it so we get debuggerd stack traces.
Bug: 2487269
Change-Id: Iec5e470fc22cd9108404f634a9d4baa2c7b7f58f
2013-02-14 14:37:34 -08:00
Nick Kralevich
0276656daa bionic: Add securebits.h
Change-Id: I2031796b9be117558b80246498b29736492cf269
2013-02-14 14:03:37 -08:00
Elliott Hughes
dc5ec07158 Turn on -Werror for ssp.cpp.
libc_bionic.a is already compiled -Werror, but this one file gets
compiled into its own library because it needs to be compiled with
-fno-stack-protector.

Change-Id: I273c535ab5c73ccaccbcf793fda1f788a2589abe
2013-02-14 11:15:58 -08:00
Nick Kralevich
a261afb7c9 fix compiler warning.
bionic/libc/bionic/ssp.cpp:41:31: warning: converting to non-pointer type 'uintptr_t {aka unsigned int}' from NULL [-Wconversion-null]

Change-Id: Id154ed4a99520cca64ffd3dbe4d743db6e2da28a
2013-02-14 09:44:13 -08:00
Elliott Hughes
d2547040a1 ffs was not being built for x86.
Change-Id: I53e92273664a4d0a13536c2fa1aeb87e1f3cf4e8
2013-02-13 16:31:52 -08:00
Elliott Hughes
6719500dbd Add a bunch more missing ENDs to assembler routines.
This isn't everything; I've missed out those x86 files that are

Change-Id: Idb7bb1a68796d6c0b70ea2b5c3300e49da6c62d2
2013-02-13 15:12:32 -08:00
Elliott Hughes
73964c592c Everyone has CLZ.
Even armv5 had CLZ.

Change-Id: I51bc8d1166d09940fd0d3f4c7717edf26977082c
2013-02-13 14:40:48 -08:00
Elliott Hughes
d8213bb573 Update getnameinfo.c, remove dead code, and fix error reporting.
Also add a unit test for the salen size checking.

Bug: 1889275
Change-Id: I8ec4107df9e2e9a8571e8915525249c6e44b98ad
2013-02-13 13:11:11 -08:00
Elliott Hughes
3002d64bcd Merge "Everyone has a TLS register." 2013-02-13 16:03:32 +00:00
Elliott Hughes
b6032515a0 Fix __pthread_clone and __bionic_clone error handling on x86.
Bug: 3461078
Change-Id: I93c151e27411211dd32717f206745c62c08c21ee
2013-02-12 23:02:33 -08:00
Elliott Hughes
91a9925998 Everyone has a TLS register.
Change-Id: Id7cdf67087aa7d5074c9c59b7e595bc391d9f146
2013-02-12 21:56:42 -08:00
Elliott Hughes
59aeff9417 Merge "Use ENTRY/END in custom x86 assembler too." 2013-02-13 04:01:01 +00:00
Elliott Hughes
4b4a882428 Clean up pthread_create.
Bug: 3461078
Change-Id: I082122a86d7692cd58f4145539241be026258ee0
2013-02-12 17:15:59 -08:00
Elliott Hughes
6d33918207 Simplify pthread_create, using more public API.
Change-Id: I08e65ba88ed01436223e4e528631c9e41ec0e7f4
2013-02-12 16:36:04 -08:00
Elliott Hughes
9f878c2fca Really set errno if __pthread_clone fails.
If r0 == 0, we're the child. If r0 > 0, we're the parent.
Otherwise set errno.

The __bionic_clone code I copy & pasted was wrong. This patch
fixes both.

Bug: 3461078
Change-Id: Ibb7d6cc7e54e666841f2f0dc59a141a0b31982e4
2013-02-12 16:07:06 -08:00
Elliott Hughes
558a8b1d3b Merge "Revert "Revert "More pthreads cleanup.""" 2013-02-13 00:05:24 +00:00
Elliott Hughes
3e898476c7 Revert "Revert "More pthreads cleanup.""
This reverts commit 6f94de3ca4

(Doesn't try to increase the number of TLS slots; that leads to
an inability to boot. Adds more tests.)

Change-Id: Ia7d25ba3995219ed6e686463dbba80c95cc831ca
2013-02-12 15:27:18 -08:00
Dima Zavin
3fa6746536 Merge "add factory property file definition" 2013-02-12 18:33:26 +00:00
Elliott Hughes
bfa199ab40 am fcaf4e9f: Merge "Revert "More pthreads cleanup.""
# Via Gerrit Code Review
* commit 'fcaf4e9f9b735e053469c7ecbf63584e10fd67a7':
  Revert "More pthreads cleanup."
2013-02-11 22:16:56 -08:00
Elliott Hughes
fcaf4e9f9b Merge "Revert "More pthreads cleanup."" 2013-02-12 06:07:32 +00:00
Elliott Hughes
6f94de3ca4 Revert "More pthreads cleanup."
This reverts commit 2a1bb4e646

Change-Id: Ia443d0748015c8e9fc3121e40e68258616767b51
2013-02-12 06:06:22 +00:00
Elliott Hughes
a2a9817f4c am 85f491f9: Merge "More pthreads cleanup."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '85f491f96da3b79d0d7cc5368bc1f649e1a82340':
  More pthreads cleanup.
2013-02-11 18:35:56 -08:00
Elliott Hughes
85f491f96d Merge "More pthreads cleanup." 2013-02-12 02:33:08 +00:00
Elliott Hughes
605cc29358 am 83bf28e6: Merge "Fix MIPS build."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '83bf28e6a38dbf28707147b50d29e81f4b555046':
  Fix MIPS build.
2013-02-11 18:19:34 -08:00
Elliott Hughes
83bf28e6a3 Merge "Fix MIPS build." 2013-02-12 02:08:05 +00:00
Elliott Hughes
ba342c11ad Fix MIPS build.
Change-Id: I4863f21f3c2fd597ea36cb7096fc72db808643a3
2013-02-11 18:06:23 -08:00
Elliott Hughes
8e2b28cb6c am c56be54a: Merge "Use ENTRY/END in ARM __get_sp."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'c56be54a18eff7e1c35c9a19cfc8b84a80780b73':
  Use ENTRY/END in ARM __get_sp.
2013-02-11 17:27:40 -08:00
Elliott Hughes
bdff26df27 Use ENTRY/END in custom x86 assembler too.
Change-Id: Ic2e482e5daff29c65d3b2ab0b2111c996bbc6226
2013-02-11 17:08:16 -08:00
Elliott Hughes
d7a3a403c1 Use ENTRY/END in ARM __get_sp.
Change-Id: If2f159b266f5fa4ad9d188a17d4cd318b605e446
2013-02-11 16:58:34 -08:00
Elliott Hughes
c440d24423 am cae7b2cf: Merge "Fix __pthread_clone on ARM to set errno on failure."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'cae7b2cfb509e7d5d10a8085b1ec319daaef768f':
  Fix __pthread_clone on ARM to set errno on failure.
2013-02-11 16:55:16 -08:00
Elliott Hughes
5e3fc43dde Fix __pthread_clone on ARM to set errno on failure.
MIPS and x86 appear to have been correct already.

(Also fix unit tests that ASSERT_EQ with errno so that the
arguments are in the retarded junit order.)

Bug: 3461078
Change-Id: I2418ea98927b56e15b4ba9cfec97f5e7094c6291
2013-02-11 16:39:10 -08:00
Elliott Hughes
03798dd23c am 1fea0f25: Merge "Clean up ARM assembler files to use ENTRY/END."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '1fea0f258a45d918fe5ae8e9769f45c0348bd095':
  Clean up ARM assembler files to use ENTRY/END.
2013-02-11 16:17:48 -08:00
Elliott Hughes
f94fd3ccc6 Clean up ARM assembler files to use ENTRY/END.
We also don't need legacy syscall support (non-"swi 0").

Change-Id: Id1012e8ca18bf13f3f4e42200f39ba0e2e632cbf
2013-02-11 15:36:59 -08:00
Elliott Hughes
2a1bb4e646 More pthreads cleanup.
POSIX says pthread_create returns EAGAIN, not ENOMEM.

Also pull pthread_attr_t functions into their own file.

Also pull pthread_setname_np into its own file.

Also remove unnecessary #includes from pthread_key.cpp.

Also account for those pthread keys used internally by bionic,
so they don't count against the number of keys available to user
code. (They do with glibc, but glibc's limit is the much more
generous 1024.)

Also factor out the common errno-restoring idiom to reduce gotos.

Bug: 6702535
Change-Id: I555e66efffcf2c1b5a2873569e91489156efca42
2013-02-11 14:56:39 -08:00
Elliott Hughes
6b73d13fa4 am 2d3e7233: Merge "Revert "Revert "Pull the pthread_key_t functions out of pthread.c."""
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '2d3e72336e76180fb00822386da4f14203d117ce':
  Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""
2013-02-11 12:38:30 -08:00
Elliott Hughes
e4b08318c1 am 8397cdba: Merge "Revert "Pull the pthread_key_t functions out of pthread.c.""
# Via Gerrit Code Review
* commit '8397cdba9424febeaed4068829a5b0174ee1138c':
  Revert "Pull the pthread_key_t functions out of pthread.c."
2013-02-11 12:21:50 -08:00
Elliott Hughes
44b53ad681 Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""
This reverts commit 6260553d48

(Removing the accidental libm/Android.mk change.)

Change-Id: I6cddd9857c31facc05636e8221505b3d2344cb75
2013-02-11 12:20:33 -08:00
Elliott Hughes
6260553d48 Revert "Pull the pthread_key_t functions out of pthread.c."
This reverts commit ad59322ae4

somehow my unfinished libm/Android.mk change got into here.

Change-Id: I46be626c5269d60fb1ced9862f2ebaa380b4e0af
2013-02-11 20:18:16 +00:00
Elliott Hughes
024246ec27 am 09e89c3c: Merge "Pull the pthread_key_t functions out of pthread.c."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '09e89c3ced51d846e13c2508fbb6812bb61475cd':
  Pull the pthread_key_t functions out of pthread.c.
2013-02-11 12:05:45 -08:00
Elliott Hughes
ad59322ae4 Pull the pthread_key_t functions out of pthread.c.
This was originally motivated by noticing that we were setting the
wrong bits for the well-known tls entries. That was a harmless bug
because none of the well-known tls entries has a destructor, but
it's best not to leave land mines lying around.

Also add some missing POSIX constants, a new test, and fix
pthread_key_create's return value when we hit the limit.

Change-Id: Ife26ea2f4b40865308e8410ec803b20bcc3e0ed1
2013-02-11 12:00:48 -08:00
Elliott Hughes
8f509e8be1 am 9a9bb243: Merge "Switch to using AT_RANDOM for the stack guards."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '9a9bb243b50be5e3910b8edad72327bc216e72d0':
  Switch to using AT_RANDOM for the stack guards.
2013-02-08 11:22:05 -08:00
Elliott Hughes
9a9bb243b5 Merge "Switch to using AT_RANDOM for the stack guards." 2013-02-08 19:17:33 +00:00
Elliott Hughes
d3920b3a99 Switch to using AT_RANDOM for the stack guards.
Bug: 7959813
Change-Id: I8db4b8912ba649bfe668c6f22aa44690ddd401a2
2013-02-08 11:16:13 -08:00
Nick Kralevich
f156b901b1 am fa75fce5: Merge "update xattr.h"
# Via Gerrit Code Review (1) and Nick Kralevich (1)
* commit 'fa75fce56641255a571b8b472f010863c3095b70':
  update xattr.h
2013-02-07 16:50:08 -08:00
Nick Kralevich
b184d3ba33 update xattr.h
Change-Id: Ibd91167ba56e2692359b92fe3108da271f0c2e38
2013-02-07 16:23:16 -08:00
Elliott Hughes
86e4e23408 am 964886af: Merge "Remove dead code from gensyscalls.py."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '964886afa339959aedad1c09af738df4ffa4091d':
  Remove dead code from gensyscalls.py.
2013-02-07 14:57:41 -08:00
Elliott Hughes
cd6780b167 Remove dead code from gensyscalls.py.
Change-Id: I0df69f8fd990f829ccbfcd5123c17b523d5a4d45
2013-02-07 14:07:00 -08:00
Elliott Hughes
5bb67760f0 am f6afd3b6: Merge "Fix x86 build, remove void* arithmetic."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'f6afd3b670e23f56bf341d12136416aee17ea249':
  Fix x86 build, remove void* arithmetic.
2013-02-07 12:34:24 -08:00
Elliott Hughes
8ddef40dad am 59e9a496: Merge "__progname should be const char*, not char*."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '59e9a496b4341fd2b11d4a01544bf7edf3d00cc5':
  __progname should be const char*, not char*.
2013-02-07 12:34:23 -08:00
Elliott Hughes
f6afd3b670 Merge "Fix x86 build, remove void* arithmetic." 2013-02-07 20:27:40 +00:00
Elliott Hughes
646e058136 Fix x86 build, remove void* arithmetic.
Change-Id: Idc7f14af2e094ac33de315e808176237af063bb8
2013-02-07 12:16:10 -08:00
Elliott Hughes
e4ccf5a138 __progname should be const char*, not char*.
Change-Id: I8e846872c30a712fbc05c8da59ffa1cec1be31a4
2013-02-07 12:06:44 -08:00
Elliott Hughes
6f67cd224e am 2f41531f: Merge "Clean up the argc/argv/envp/auxv handling."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '2f41531ff9f48dbdaf2ba711e14c669031728e99':
  Clean up the argc/argv/envp/auxv handling.
2013-02-07 11:56:57 -08:00
Elliott Hughes
2f41531ff9 Merge "Clean up the argc/argv/envp/auxv handling." 2013-02-07 19:48:17 +00:00
Elliott Hughes
42b2c6a5ee Clean up the argc/argv/envp/auxv handling.
There's now only one place where we deal with this stuff, it only needs to
be parsed once by the dynamic linker (rather than by each recipient), and it's
now easier for us to get hold of auxv data early on.

Change-Id: I6314224257c736547aac2e2a650e66f2ea53bef5
2013-02-07 11:44:21 -08:00
Elliott Hughes
4e9d9e4df8 am d4187efd: Merge "Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'd4187efd7f9c30ffaff4738862e3d08be27a52e9':
  Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs.
2013-02-07 09:12:18 -08:00
Elliott Hughes
7582a9c119 Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs.
Also update the x86 asm.h to support this; we need it for libm assembler
anyway.

Also clean up the _FBSDID hack in <sys/cdefs.h>.

Change-Id: Iababd977b8110ec022bf7c93f4d62ece47630e7c
2013-02-06 17:08:15 -08:00
Elliott Hughes
df8c72e510 am d7ff139f: Merge "Remove bogus extra alignment from sbrk."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'd7ff139fec5cec08793523aa97503ade2b13c38e':
  Remove bogus extra alignment from sbrk.
2013-02-05 17:09:55 -08:00
Elliott Hughes
428f5567be Remove bogus extra alignment from sbrk.
Bug: https://code.google.com/p/android/issues/detail?id=37349
Change-Id: I970c7b6be7bb7fbe6bbbe2c332f05816aeb0e09f
2013-02-05 16:10:59 -08:00
Elliott Hughes
3cbcb87bd1 am a4f88fdc: Merge "Document the mallinfo struct, add missing attributes."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'a4f88fdcf0e9be084d04048ad65671716298c3c2':
  Document the mallinfo struct, add missing attributes.
2013-02-04 13:59:15 -08:00
Elliott Hughes
24fad01755 Document the mallinfo struct, add missing attributes.
Change-Id: Ia97acce1f6a83bd8b3ba8dd20efd962bc96f35a9
2013-02-04 13:44:14 -08:00
Elliott Hughes
ada6de673b am a1821f01: Merge "Regenerate msm_ion.h."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'a1821f015306e221e6a51e5acc27176ae2d72f6b':
  Regenerate msm_ion.h.
2013-02-04 10:52:16 -08:00
Elliott Hughes
3fac8f7f49 Regenerate msm_ion.h.
Bug: 8000377
Change-Id: If496d9972cb8aebfc996ac641aa762220aa71f3b
2013-02-01 18:21:08 -08:00
Elliott Hughes
16444e0f85 am 3dc6b57c: Merge "Don\'t claim there were no leaks if we weren\'t even checking."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '3dc6b57cf54b15a756551deeda33df5715e519bb':
  Don't claim there were no leaks if we weren't even checking.
2013-02-01 17:26:56 -08:00
Elliott Hughes
9c81892c2e Don't claim there were no leaks if we weren't even checking.
Bug: 8107016
Change-Id: I9059f1f8374ebcdf00dfc6ac74d3709f501292c9
2013-02-01 17:07:40 -08:00
Elliott Hughes
704d9c5b45 am a9dd3670: Merge "Restore bionic\'s <linux/elf-em.h>."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'a9dd36702f4a9d65d084387050b688b8965b13b3':
  Restore bionic's <linux/elf-em.h>.
2013-02-01 16:19:37 -08:00
Elliott Hughes
a48e1b2aac Restore bionic's <linux/elf-em.h>.
Used by <linux/audit.h>.

Change-Id: Ica4ebb7f52a7fce13c52fdff35e187ded3939382
2013-02-01 16:10:28 -08:00
Elliott Hughes
ff26e25b51 am 44badc70: Merge "Upgrade libm."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '44badc70ccd35d7690bda9f107e3e5da0b80d295':
  Upgrade libm.
2013-02-01 15:24:27 -08:00
Elliott Hughes
44badc70cc Merge "Upgrade libm." 2013-02-01 23:07:49 +00:00
Elliott Hughes
a0ee07829a Upgrade libm.
This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.

It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).

All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.

Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
2013-02-01 14:51:19 -08:00
Elliott Hughes
9743d7fb60 am fb55511e: am e1a124e5: Merge "Say explicitly if there were no leaks."
# Via Android Git Automerger (1) and others
* commit 'fb55511e71900476fd03f9c490dc60269d076d1f':
  Say explicitly if there were no leaks.
2013-01-30 12:11:30 -08:00
Elliott Hughes
fb55511e71 am e1a124e5: Merge "Say explicitly if there were no leaks."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'e1a124e5c93b59e2b6792e4de8a2c72dc0a78be1':
  Say explicitly if there were no leaks.
2013-01-30 12:09:14 -08:00
Elliott Hughes
1d12d57416 Say explicitly if there were no leaks.
Otherwise people trying to use this are left wondering "did I not leak, or did
the leak checking code not get called when I exited?".

Change-Id: If79b225f8a2e24dd69aba1fb836bf9e81bb00efe
2013-01-30 11:38:26 -08:00
Elliott Hughes
9d43c07987 am 4e882503: am a990cf5b: Merge "Clean up trailing whitespace in the kernel headers."
# Via Android Git Automerger (1) and others
* commit '4e8825038e08762dcc973fa435b531f10290ffa8':
  Clean up trailing whitespace in the kernel headers.
2013-01-30 10:31:24 -08:00
Elliott Hughes
4e8825038e am a990cf5b: Merge "Clean up trailing whitespace in the kernel headers."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'a990cf5b3392c5aef767aee1e67b4d7ef651afc6':
  Clean up trailing whitespace in the kernel headers.
2013-01-30 10:28:59 -08:00
Elliott Hughes
a990cf5b33 Merge "Clean up trailing whitespace in the kernel headers." 2013-01-30 18:13:29 +00:00
Elliott Hughes
c95eb57405 Clean up trailing whitespace in the kernel headers.
And fix the scripts so they stop letting trailing whitespace through.

Change-Id: Ie109fbe1f63321e565ba0fa60fee8e9cf3a61cfc
2013-01-30 10:13:07 -08:00
Elliott Hughes
5821e11d0b am 7bc49fcf: am 323287ea: Merge "Fix valgrind build."
# Via Android Git Automerger (1) and others
* commit '7bc49fcfc0de8ce6f386f362cdab6902e6bbe7b4':
  Fix valgrind build.
2013-01-29 18:09:26 -08:00
Elliott Hughes
7bc49fcfc0 am 323287ea: Merge "Fix valgrind build."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '323287ea7fb1d22f64b49d701b33cef9fbaf757d':
  Fix valgrind build.
2013-01-29 18:06:19 -08:00
Elliott Hughes
6fe67c3cf2 Fix valgrind build.
Change-Id: Ie375d32565d10f4c0c56da5422f52b68cb069654
2013-01-29 17:49:12 -08:00
Elliott Hughes
9d995d6721 am 1cc09402: am f6721978: Merge "Fix x86 build to use <elf.h>."
# Via Android Git Automerger (1) and others
* commit '1cc09402e86b91213e06a9a349c5c510cefcf1d5':
  Fix x86 build to use <elf.h>.
2013-01-29 17:04:14 -08:00
Elliott Hughes
0a383883fa am be11de2b: am 5fb409b7: Merge "Bring the NOTICE files back up to date."
# Via Android Git Automerger (1) and others
* commit 'be11de2b52ac5f8cbb5a733821cb27002f2ea975':
  Bring the NOTICE files back up to date.
2013-01-29 17:04:13 -08:00
Elliott Hughes
a7f44b5afe am 172e038f: am f09f6db5: Merge "Use the NetBSD <sys/exec_elf.h>."
# Via Android Git Automerger (1) and others
* commit '172e038f9e5b711a77afe7e8899343215cf25c9e':
  Use the NetBSD <sys/exec_elf.h>.
2013-01-29 17:04:11 -08:00
Elliott Hughes
1cc09402e8 am f6721978: Merge "Fix x86 build to use <elf.h>."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'f67219783fa7c38c1f4f077364290d10d3aa1db4':
  Fix x86 build to use <elf.h>.
2013-01-29 16:58:45 -08:00
Elliott Hughes
be11de2b52 am 5fb409b7: Merge "Bring the NOTICE files back up to date."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '5fb409b7b0b0a4ecca5fd2a6c7dc5ce421f6b7cf':
  Bring the NOTICE files back up to date.
2013-01-29 16:42:04 -08:00
Elliott Hughes
d070df4c74 Fix x86 build to use <elf.h>.
Change-Id: I7b697d5eae69dc08eb31471a42cb8bbe5360be76
2013-01-29 16:40:39 -08:00
Elliott Hughes
172e038f9e am f09f6db5: Merge "Use the NetBSD <sys/exec_elf.h>."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'f09f6db5dd87856bbbb7a3d465187b9d8799a788':
  Use the NetBSD <sys/exec_elf.h>.
2013-01-29 16:26:10 -08:00
Elliott Hughes
448080d372 Bring the NOTICE files back up to date.
Change-Id: I978275cf6604b90595ee79d897c0460eeadc7dc8
2013-01-29 16:25:06 -08:00
Elliott Hughes
a6a3ac5924 Use the NetBSD <sys/exec_elf.h>.
Replace a kernel header file dependency with files from NetBSD.
They're more complete, and ELF is ELF, whether you're on Linux or a BSD.

Bug: 7973611
Change-Id: I83ee719e7efdf432ec2ddbe8be271d05b2f558d7
2013-01-29 15:02:50 -08:00
Elliott Hughes
f5d6238c4b am 3f20ecc2: am 3db2fc5a: Merge "Don\'t collect useless stack frames; do demangle C++ symbols."
# Via Android Git Automerger (1) and others
* commit '3f20ecc20486ae8fe8d9332102b503135f83c62d':
  Don't collect useless stack frames; do demangle C++ symbols.
2013-01-29 12:07:13 -08:00
Elliott Hughes
3f20ecc204 am 3db2fc5a: Merge "Don\'t collect useless stack frames; do demangle C++ symbols."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '3db2fc5acb4894a2cb22533b165a0de1bbafc3f6':
  Don't collect useless stack frames; do demangle C++ symbols.
2013-01-29 12:03:53 -08:00
Elliott Hughes
35b621c5f4 Don't collect useless stack frames; do demangle C++ symbols.
Previously, we'd collect every stack frame and then throw some away
when we came to log them. This meant that stack traces were effectively
shorter than the buffers that had been allocated for them. This patch
only stores frames we'll actually output.

Also dynamically call the C++ demangler so we don't have to try to
read mangled names. Because no one knows the mangling of operator new[]
for int arrays off the top of their head.

Bug: 7291287
Change-Id: I42b022fd7cd61675d05171de4c3b2704d058ef2a
2013-01-29 09:56:31 -08:00
Elliott Hughes
2218b89ca7 am d383ac15: am a0151cbf: Merge "Unit tests for formatting code, fix %%."
# Via Android Git Automerger (1) and others
* commit 'd383ac1570b553d68ed399c74b73bad1498d78f6':
  Unit tests for formatting code, fix %%.
2013-01-28 14:11:54 -08:00
Elliott Hughes
d383ac1570 am a0151cbf: Merge "Unit tests for formatting code, fix %%."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit 'a0151cbfbaa37965dbcd188a55a78d3ad4802b9b':
  Unit tests for formatting code, fix %%.
2013-01-28 14:10:08 -08:00
Elliott Hughes
41b3179c9e Unit tests for formatting code, fix %%.
Also fix <signal.h> and <stdio.h> so they don't cause compiler warnings.

Change-Id: Ib1a746bf01de22d47dbd964de0e6af80a7c96303
2013-01-28 10:36:31 -08:00
Elliott Hughes
d265d36749 am f07db754: am 0a91b11d: Merge "More debug malloc fixes."
# Via Android Git Automerger (1) and others
* commit 'f07db75443cce4ab96c93bdaa0793d7b8e87547e':
  More debug malloc fixes.
2013-01-25 18:09:45 -08:00
Elliott Hughes
f07db75443 am 0a91b11d: Merge "More debug malloc fixes."
# Via Elliott Hughes (1) and Gerrit Code Review (1)
* commit '0a91b11d286446fe7849a6f537b4a21a52f63399':
  More debug malloc fixes.
2013-01-25 18:07:23 -08:00
Elliott Hughes
239e7a0756 More debug malloc fixes.
Include the leaky executable's name in the log output. Fix the "sh" test.
Use uintptr_t instead of intptr_t.

Also fix debug formatting of NULL with %s.

Bug: 7291287
Change-Id: I015bf341cd48d43a247173612e6ccb1bf1243d53
2013-01-25 17:13:45 -08:00
Elliott Hughes
88af723267 am 7ae99845: am 6a94cb74: Merge "arm syscall : for eabi call_default don\'t use stack"
# By Matthieu Castet
# Via Android Git Automerger (1) and others
* commit '7ae998456c2564aff4ecbe6a6df214821f6e26cc':
  arm syscall : for eabi call_default don't use stack
2013-01-25 14:10:02 -08:00
Nick Kralevich
2ebcd19cbc am 27818d2a: am b871e5d6: Merge "system_properties: do more checking of file"
# Via Android Git Automerger (1) and others
* commit '27818d2a16e4972acba15368f55a59cc0ed990f0':
  system_properties: do more checking of file
2013-01-25 14:10:01 -08:00
Elliott Hughes
7ae998456c am 6a94cb74: Merge "arm syscall : for eabi call_default don\'t use stack"
# By Matthieu Castet
# Via Gerrit Code Review (1) and Matthieu Castet (1)
* commit '6a94cb748bf63278c3271b0ab610061b0dc6f04a':
  arm syscall : for eabi call_default don't use stack
2013-01-25 14:08:26 -08:00
Nick Kralevich
27818d2a16 am b871e5d6: Merge "system_properties: do more checking of file"
# Via Gerrit Code Review (1) and Nick Kralevich (1)
* commit 'b871e5d6b3b4a214c7f19bdfca7663f1fe49fda8':
  system_properties: do more checking of file
2013-01-25 14:08:26 -08:00
Elliott Hughes
6a94cb748b Merge "arm syscall : for eabi call_default don't use stack" 2013-01-25 21:57:58 +00:00
Nick Kralevich
c16961b8c3 system_properties: do more checking of file
Check that the permissions on the properties file
are exactly as we expect them to be.

Make sure we close the fd if fstat fails.

Refactor the code slightly.

Change-Id: I5503fd58c3b8093ce7e6d05920748ed70eaf8e2c
2013-01-25 13:07:31 -08:00
Nick Kralevich
151e91e66c am da2d2c61: am 82ef8296: Merge "prctl.h: include sys/cdefs.h"
# Via Android Git Automerger (1) and others
* commit 'da2d2c618c23f212f8dec0c0615bf75d7c18b88d':
  prctl.h: include sys/cdefs.h
2013-01-24 16:11:56 -08:00
Nick Kralevich
da2d2c618c am 82ef8296: Merge "prctl.h: include sys/cdefs.h"
# Via Gerrit Code Review (1) and Nick Kralevich (1)
* commit '82ef8296dc5e25b9cc8e7231f9515f50185dac9d':
  prctl.h: include sys/cdefs.h
2013-01-24 08:59:00 -08:00
Nick Kralevich
8e70b0d5c3 prctl.h: include sys/cdefs.h
prctl.h uses __BEGIN_DECLS but fails to include sys/cdefs.h
(where it's defined).  Code which includes prctl.h without
previously including sys/cdefs.h will fail to compile.

Fixed.

Change-Id: If4c9f3308f08b93596dcd00e351ae786807e9320
2013-01-23 16:49:47 -08:00
Nick Kralevich
b8726037ee am e7d937b5: am b3351f12: Merge "libc: use more secure system properties if available"
* commit 'e7d937b52f183ce84751701c369ffe6a4c81d033':
  libc: use more secure system properties if available
2013-01-23 11:09:40 -08:00
Nick Kralevich
e7d937b52f am b3351f12: Merge "libc: use more secure system properties if available"
* commit 'b3351f12047747b603efb070069e7afdf3040335':
  libc: use more secure system properties if available
2013-01-23 11:07:23 -08:00
Nick Kralevich
32417fb376 libc: use more secure system properties if available
Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Modify system property handling so that we get the properties
from a root owned properties file, rather than using an
environment variable.  Fall back to the environment variable
if the file doesn't exist.

Bug: 8045561
Change-Id: I54f3efa98cf7d63d88788da5ce0d19e34fd7851a
2013-01-23 09:28:35 -08:00
Elliott Hughes
c08ab018ad am 40107623: am 778a68e1: Merge "Don\'t free anything when reporting leaks."
* commit '40107623b05fdc2b6c61d9c885483abd3add486a':
  Don't free anything when reporting leaks.
2013-01-22 22:14:32 -08:00
Elliott Hughes
ce8732b188 am 552e02fa: am 5c8f75ef: Merge "Disable leak checking for mksh; it\'s way too leaky."
* commit '552e02fa9c99fd234c57d756358e3208d11a13ad':
  Disable leak checking for mksh; it's way too leaky.
2013-01-22 22:14:31 -08:00
Elliott Hughes
40107623b0 am 778a68e1: Merge "Don\'t free anything when reporting leaks."
* commit '778a68e1e57408be04806b5bfc3150aade44bcbf':
  Don't free anything when reporting leaks.
2013-01-22 22:11:55 -08:00
Elliott Hughes
552e02fa9c am 5c8f75ef: Merge "Disable leak checking for mksh; it\'s way too leaky."
* commit '5c8f75ef8bd89498de1d1108efa54869a2784738':
  Disable leak checking for mksh; it's way too leaky.
2013-01-22 22:11:54 -08:00
Elliott Hughes
778a68e1e5 Merge "Don't free anything when reporting leaks." 2013-01-23 06:06:21 +00:00
Elliott Hughes
848247a972 Don't free anything when reporting leaks.
We don't know that they're not going to be cleaned up by a
C++ global destructor that runs after us. This is the case with
bootanimation, for example.

Bug: 7291287
Change-Id: Iba402514d1735fdc2ae4bc95b65396d816be46c0
2013-01-22 18:36:28 -08:00
Elliott Hughes
84f8b5f401 Disable leak checking for mksh; it's way too leaky.
When each shell leaks ~240 allocations, you can't see the leaks from
the program you ran with "adb shell".

Bug: 7291287
Change-Id: Ib8780db72ba0114ebdb24768537da74bbb61f354
2013-01-22 18:35:14 -08:00
Elliott Hughes
a8e0f2b956 am b16ec162: am 28f82b26: Merge "Add const for first argument of sigismember for fit POSIX spec"
* commit 'b16ec162881110a30f665ce7bd1432ccefba60b7':
  Add const for first argument of sigismember for fit POSIX spec
2013-01-22 17:29:01 -08:00
Elliott Hughes
b16ec16288 am 28f82b26: Merge "Add const for first argument of sigismember for fit POSIX spec"
* commit '28f82b260c9076aae437dafb57193a174aef1eb3':
  Add const for first argument of sigismember for fit POSIX spec
2013-01-22 17:26:45 -08:00
Elliott Hughes
28f82b260c Merge "Add const for first argument of sigismember for fit POSIX spec" 2013-01-23 01:11:28 +00:00
Elliott Hughes
5f79f75ba6 am 57edf36c: am 8d6302cd: Merge "Our strcoll(3) is no different from NetBSD\'s, so take exactly theirs."
* commit '57edf36c5f83fa7bcf9d8d028cde0acc7ddfadcc':
  Our strcoll(3) is no different from NetBSD's, so take exactly theirs.
2013-01-22 15:33:24 -08:00
Elliott Hughes
57edf36c5f am 8d6302cd: Merge "Our strcoll(3) is no different from NetBSD\'s, so take exactly theirs."
* commit '8d6302cdcff9c53fe3ecd36ab479fdf08318c504':
  Our strcoll(3) is no different from NetBSD's, so take exactly theirs.
2013-01-22 15:31:26 -08:00
Elliott Hughes
2b47307012 Our strcoll(3) is no different from NetBSD's, so take exactly theirs.
Change-Id: I45251047202a229f9175735ecc23c0ebcda71e8d
2013-01-22 15:10:19 -08:00
Elliott Hughes
ad551eaa04 am 5f7b6b83: am 547eba0a: Merge "Avoid overflow in memccpy."
* commit '5f7b6b8301658a834516f05e8e0a9eb4513e6e62':
  Avoid overflow in memccpy.
2013-01-22 15:08:58 -08:00
Elliott Hughes
5f7b6b8301 am 547eba0a: Merge "Avoid overflow in memccpy."
* commit '547eba0a63951d7db93c0542e1ecab891725b9a8':
  Avoid overflow in memccpy.
2013-01-22 15:05:31 -08:00
Elliott Hughes
c51cd764a2 Avoid overflow in memccpy.
Just take the upstream NetBSD code.

Bug: http://code.google.com/p/android/issues/detail?id=43078
Change-Id: Ibbbde9d00e8bc6a09c9503aab2b04b4e3d1f98b0
2013-01-22 14:41:23 -08:00
Elliott Hughes
0dfb2ecaab am 0609c0fe: am 7af7895e: Merge "Use the new non-allocating logging for dlmalloc failures."
* commit '0609c0fe8dae2ec10f1811c46a4d583f557c68f7':
  Use the new non-allocating logging for dlmalloc failures.
2013-01-22 14:35:06 -08:00
Elliott Hughes
0609c0fe8d am 7af7895e: Merge "Use the new non-allocating logging for dlmalloc failures."
* commit '7af7895eeb810ff1a1ca8b60fcda13595d551114':
  Use the new non-allocating logging for dlmalloc failures.
2013-01-22 14:32:02 -08:00
Elliott Hughes
7af7895eeb Merge "Use the new non-allocating logging for dlmalloc failures." 2013-01-22 22:26:35 +00:00
Elliott Hughes
ce4cf90d79 Use the new non-allocating logging for dlmalloc failures.
Change-Id: I88afe0201ee5766a295fc5a9e710fba9d6e0d363
2013-01-22 14:24:52 -08:00
Nick Kralevich
98ae1a85b0 am e652ed30: am 244bee5b: Merge "bionic_auxv.h: fix #define conflict"
* commit 'e652ed30514afcf314b40c69b9cac088602a83da':
  bionic_auxv.h: fix #define conflict
2013-01-22 13:43:46 -08:00
Nick Kralevich
e652ed3051 am 244bee5b: Merge "bionic_auxv.h: fix #define conflict"
* commit '244bee5bb6e0bc12b739c57028ac8af23a18aed0':
  bionic_auxv.h: fix #define conflict
2013-01-22 13:38:53 -08:00
Nick Kralevich
abc21c8056 bionic_auxv.h: fix #define conflict
Both libc/include/sys/auxv.h and libc/private/bionic_auxv.h
use _SYS_AUXV_H_ to see if a header file has already been included.
This prevents both of these files from being included at the same
time.

Fix this name conflict.

Change-Id: Ifaec88aa9779d784b95f8e75145117acf3d5cfc5
2013-01-22 13:09:04 -08:00
Elliott Hughes
04afcd25a3 am 8ef83bc4: am 02f96b9d: Merge "Add missing extern "C"."
* commit '8ef83bc46e06e8fe98e918fcb1c582d6f5807461':
  Add missing extern "C".
2013-01-22 11:34:25 -08:00
Elliott Hughes
8ef83bc46e am 02f96b9d: Merge "Add missing extern "C"."
* commit '02f96b9db0242711fe1dfe0713c0c4e698561da5':
  Add missing extern "C".
2013-01-22 11:32:16 -08:00