Commit graph

4172 commits

Author SHA1 Message Date
Elliott Hughes
79310994d2 Implement <sys/fsuid.h>.
Change-Id: I1e5e50444a1b5a430ba5b5d9b8b1d91219af5e92
2014-07-30 15:19:29 -07:00
Elliott Hughes
c7706a02ad Merge "[MIPSR6] Use C-coded string ops on mips32r6/mips64r6" 2014-07-29 21:36:05 +00:00
Elliott Hughes
40a5217448 Only wipe TLS for user-supplied stacks.
Bug: 16667988
Change-Id: Id180ab2bc6713e1612386120a306db5bbf1d6046
2014-07-30 14:49:40 -07:00
Christopher Ferris
4ad5066e1d Merge "Use libunwindbacktrace for debug malloc code." 2014-07-28 22:45:44 +00:00
Christopher Ferris
861c0ef37b Use libunwindbacktrace for debug malloc code.
Create a method of disabling the debug allocation code paths so that
it's possible to use the libunwindbacktrace library without any
modifications.

Use this path to create and destroy the maps for the process. It's not
stricly necessary in the init code since the symbols are not modified
until after the initialize calls.

Also, remove the debug_XXX source files that doesn't need to be in libc.so.

Fix the maps reading code since it was completely broken for 64 bit.

Bug: 16408686

Change-Id: I6b02ef6ce26fdb7a59ad1029e7cbba9accceb704
2014-07-29 18:10:00 -07:00
Elliott Hughes
a7dc7600fe Merge "Fix linkage of grantpt(3)." 2014-07-28 22:45:44 +00:00
Elliott Hughes
4916706cfe Fix linkage of grantpt(3).
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
2014-07-25 19:55:23 -07:00
Elliott Hughes
f4c1a36a45 Remove declarations for things that don't exist.
The <grp.h> ones prevent gdb from building out of the box.

Change-Id: I0efbffad2215cfcd75b4d442dfc972444b51d97c
2014-07-29 16:57:47 -07:00
Brigid Smith
a406ee6d5f Added a bionic systrace class and tracing to pthread_mutex.cpp.
bionic_systrace.h contains an implementation of tracing that
can be used with systrace.py and its associated viewer.  pthread_mutex
now uses this tracing to track pthread_mutex contention, which can be
enabled by using the "bionic" command line option to systrace.

Bug: 15116468
Change-Id: I30ed5b377c91ca4c36568a0e647ddf95d4e4a61a
2014-07-28 19:38:08 -07:00
Elliott Hughes
50a9630cc2 Merge "Start hiding "private/bionic_time.h"." 2014-07-24 20:55:36 +00:00
Elliott Hughes
905e6d58aa Start hiding "private/bionic_time.h".
Bug: 15765976
Change-Id: Ibd9cf07067ec8dffe9fda6c3d498d4ab90708220
2014-07-25 12:03:51 -07:00
Dan Albert
1abb8bd21d en_US.UTF-8 is also supported.
Change-Id: Ic35fad3596dc5e24ee8ae35543a274a471f27bb2
2014-07-25 11:24:03 -07:00
Elliott Hughes
d6f614a4e1 Merge "Implement twalk(3), add unit tests." 2014-07-24 22:07:52 +00:00
Elliott Hughes
3e424d0a24 Implement twalk(3), add unit tests.
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
2014-07-24 14:55:29 -07:00
Duane Sand
bc5a3ec6df [MIPSR6] Use C-coded string ops on mips32r6/mips64r6
The existing assembler code uses deprecated lwl/lwr/swl/swr ops.
Replacing those with misalignment-forgiving lw/sw ops may
involve careful performance tuning.

Change-Id: I47a042f7b22b87d7d52e46c29c44b1db1ba8b693
2014-07-23 14:00:21 -07:00
Elliott Hughes
21972b61ec syscall(3)'s return type should be long.
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
2014-07-28 12:33:07 -07:00
Elliott Hughes
f1e83cc34a Use vsnprintf(3) in syslog(3).
It seemed like a clever trick to use the internal log message formatting
code in syslog(3), but on reflection that means you can't (for example)
format floating point numbers. This patch switches us over to using good
old vsnprintf(3), even though that requires us to jump through a few hoops.

There's no obvious way to unit test this, so I wrote a little program and
ran that.

(cherry-pick of b1b60c30bf321c0fc02264b953b5c16c49d34457.)

Bug: 14292866
Change-Id: I9c83500ba9cbb209b6f496067a91bf69434eeef5
2014-07-28 09:43:21 -07:00
Elliott Hughes
39d903aea9 Remove localtime_tz and strftime_tz.
This also brings our copy of strftime.c much closer to upstream, though
we still have several GNU extensions and hacks to deal with Android32's
broken time_t.

Bug: 15765976
Change-Id: Ic9ef36e8acd3619504ecc4d73feec2b61fd4dfa1
2014-07-25 15:50:31 -07:00
Duane Sand
ba23bd0a40 [MIPS] Drop soft-fp targets
Change-Id: I583bf8242d3034ebfc48548499cdb3316094c8e3
2014-07-24 18:04:21 +00:00
Elliott Hughes
7d22a45196 Merge "[MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models" 2014-07-23 18:45:08 +00:00
Duane Sand
dd37251c47 [MIPSR6] setjmp supports mips32r6 and FP64A/FPXX reg models
Save and restore floating point registers via 64-bit
load/stores when possible.  Use assembler's builtin macro
ops to generate pairs of 32-bit load/stores on Mips I cpus.

Some cpus or FR modes have only 16 even-numbered dp fp regs.
This is exposed by _MIPS_FPSET, defined by existing compilers.

Change-Id: I7f617a3ffea8da41c402ef3a68ab32c91d3d7622
2014-07-23 13:57:30 -07:00
Elliott Hughes
afe6360627 Fix belated review comments on syslog change.
Bug: 14292866
Change-Id: I3cd92084cb55b5673f6ba62d51952941b79deb51
2014-07-23 11:38:38 -07:00
Elliott Hughes
5d2f86f363 Fix generate-NOTICE to cope better with BSD __COPYRIGHT macros.
Change-Id: I99f9d2e0a28342663cec6aed483e1a23c12e5e87
2014-07-23 11:10:48 -07:00
Elliott Hughes
ea42a6caea Merge "Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files." 2014-07-22 16:25:43 +00:00
Elliott Hughes
3758a244cf Fix a couple of bugs in generate-NOTICE and regenerate the NOTICE files.
Change-Id: Id6fcb74292e661504d0758bfce24abdc18cb8d32
2014-07-22 21:29:00 -07:00
Elliott Hughes
ca70453e84 Remove the unused swab.S.
Change-Id: Id30eac5a21b649d6a039a0d7ca0496177fbfb571
2014-07-22 20:21:31 -07:00
Duane Sand
f541650828 [MIPS] Allow united mipsel and mips64el gcc toolchain
Explicitly tell 32-bit links that they are doing 32-bit links.
This is needed when using united 32-bit and 64-bit toolchains.
This is harmless when using older separate 32-only toolchains.

Change-Id: I70cbd3f5867e59b1f6f829793444242fb0894aa6
2014-07-22 14:27:48 -07:00
Elliott Hughes
4d421901e5 Merge "Use upstream OpenBSD's arc4random." 2014-07-21 15:45:37 +00:00
Elliott Hughes
2b67d7dee0 Use upstream OpenBSD's arc4random.
The getentropy_linux.c is lightly modified to build on Android, but we're now
completely in sync with upstream OpenBSD's arc4random implementation.

Change-Id: If32229fc28aba908035fb38703190d41ddcabc95
2014-07-21 14:38:16 -07:00
Elliott Hughes
925d388e24 Merge "Rewrite syslog(3) to use Android logging." 2014-07-19 23:20:08 +00:00
Elliott Hughes
3ad8ecb64e Rewrite syslog(3) to use Android logging.
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
2014-07-21 16:56:48 -07:00
Dan Albert
ee7f1b5946 There is no _MIN for unsigned types.
Change-Id: I49c38e51197b750210bdbf28c9cf6db30452a206
2014-07-21 17:16:30 -07:00
Dan Albert
1fb90a8aa0 Merge "Fix mbsrtowcs(3)'s handling of len parameter." 2014-07-17 22:34:19 +00:00
Dan Albert
6b55ba54ef Fix mbsrtowcs(3)'s handling of len parameter.
The len parameter is a _maximum_ length. The previous code was treating
it as an exact length, causing the following typical call to fail:

    mbsrtowcs(out, &in, sizeof(out), state); // sizeof(out) > strlen(in)

Change-Id: I48e474fd54ea5f122bc168a4d74bfe08704f28cc
2014-07-21 11:45:48 -07:00
Dan Albert
97e31dedf0 __libc_fatal should print a newline to stderr.
Change-Id: I088dc880d7488a65beac8cda95f530f3db41f112
2014-07-21 11:10:00 -07:00
Elliott Hughes
9c07aee83b Clean up some misinformation around prctl.
prctl shouldn't be in <unistd.h>.

Change-Id: I29609fc91c033e1ad143b75d9b4eb17aefbd63d6
2014-07-18 16:15:32 -07:00
Christopher Ferris
6425327c32 Use the mmap/munmap for allocation routines.
To avoid any issues calling malloc related routines, use mmap/munmap.
Specifically, this avoids any problems when this is compiled into a
malloc debug shared library.

Change-Id: Iae2d197145da43dc103ad6024357d8cc2374378f
2014-07-18 14:16:51 -07:00
Elliott Hughes
d18b87f38d Merge "Remove SIOCKILLADDR from <sys/socket.h>." 2014-07-17 22:33:42 +00:00
Elliott Hughes
8a3d1ca183 Remove SIOCKILLADDR from <sys/socket.h>.
Change-Id: I6b64a9abe01c786a9ec26aee1517cb981a4860fb
2014-07-17 17:10:02 -07:00
Elliott Hughes
9f165d24f0 Remove PR_SET_TIMERSLACK_PID from <sys/prctl.h>.
Change-Id: Ie70f23c80e8473ac9617b74967d7c84709f5b00d
2014-07-17 17:12:35 -07:00
Elliott Hughes
2f9c6e38b8 Fix private/bionic_name_mem.h build breakage.
Change-Id: I8fe9c63dbbb5911721ca56791c0bff4bdf403314
2014-07-17 15:09:17 -07:00
Elliott Hughes
d7453860a6 Remove non-standard prctl constants from <sys/prctl.h>.
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
2014-07-17 14:26:33 -07:00
Hans Boehm
43363ab720 Merge "Define atomic_charN_t only if charN_t is supported." 2014-07-16 23:31:38 +00:00
Hans Boehm
8b002362d9 Define atomic_charN_t only if charN_t is supported.
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
2014-07-16 17:31:05 -07:00
Elliott Hughes
98b088dce7 ptrace(3) should be varargs.
Bug: 16352070
Change-Id: Ied72e6e79eaf912fc93fc49ae7637af321a31a59
2014-07-16 16:07:10 -07:00
Elliott Hughes
625993dfbb Use VDSO for clock_gettime(2) and gettimeofday(2).
Bug: 15387103
Change-Id: Ifc3608ea65060c1dc38120b10b6e79874f182a36
2014-07-16 14:27:43 -07:00
Christopher Ferris
64035c4a4b Merge "Add gen syscalls step to instructions." 2014-07-15 20:47:30 +00:00
Christopher Ferris
ea271fdf26 Add gen syscalls step to instructions.
Also, fix incorrect path to some tools.

Change-Id: I409fc02d7077f0d2811d90be19550e70f5d73c0e
2014-07-15 19:02:33 -07:00
Elliott Hughes
3fa60e10bc Regenerate the syscalls list after the uapi update.
Change-Id: I117c5b18f735376dd3ab5061018dc7db9c046202
2014-07-15 18:39:27 -07:00
Christopher Ferris
27047faf28 Fix BIONIC_ROUND_UP_POWER_OF_2 for 64 bit.
There were two bugs here:

- For 64 bit values, this did not properly round up.
- The macro rounded to the power of 2 less than value, not to the power
  of 2 greater than value.

Change-Id: If8cb41536a9d2f5c1bc213676f1e67a7903a36b0
2014-07-15 12:33:48 -07:00