Merge commit 'a685faf3e3de181ca6c795b0062432c74073d024'
* commit 'a685faf3e3de181ca6c795b0062432c74073d024':
Update time zone data to the new version 2010k.
Merge commit 'cd7014fd0634f1337fc3857f1c61e0d39443c4be' into gingerbread-plus-aosp
* commit 'cd7014fd0634f1337fc3857f1c61e0d39443c4be':
Update time zone data to the new version 2010k.
Merge commit '90e83bcc1c41a4d6d310b2bd5cb747a53a88fff3'
* commit '90e83bcc1c41a4d6d310b2bd5cb747a53a88fff3':
Fix undefined reference to dl_iterate_phdr for x86
Merge commit '519763265ec0b634bd9c264a0aca034882458ecc' into gingerbread-plus-aosp
* commit '519763265ec0b634bd9c264a0aca034882458ecc':
libc: Fix sem_post() implementation to wake up all waiting threads.
This also allows us to optimize the case where we increment an
uncontended semaphore (no need to call futex_wake() then).
Change-Id: Iad48efe8551dc66dc89d3e3f18c001e5a6c1939f
With this patch _and_ an upcoming build/ patch, the destruction
of static C++ objects contained in shared libraries will happen
properly when dlclose() is called.
Note that this change introduces crtbegin_so.S and crtend_so.S which
are currently ignored by the build system.
+ move definition of __dso_handle to the right place
(before that, all shared libraries used the __dso_handle
global variable from the C library).
Note that we keep a 'weak' __dso_handle in aeabi.c to avoid
breaking the build until the next patch to build/core/combo/
appears. We will be able to remove that later.
+ move bionic/aeabi.c to arch-arm/bionic/ (its proper location)
NOTE: The NDK will need to be modified to enable this feature in
the shared libraries that are generated through it.
Change-Id: I99cd801375bbaef0581175893d1aa0943211b9bc
Add ip6t_get_target() to kernel_known_generic_statics in
libc/kernel/tools/defaults.py to be able to build ip6tables.
Change-Id: Iadb885db3faa85b2d0070dc2e0ac493af6e62bb6
Merge commit 'fa5755ae980b6f4ac5df37b263ba20f472db31ca' into gingerbread-plus-aosp
* commit 'fa5755ae980b6f4ac5df37b263ba20f472db31ca':
Add clean headers for 7x30 video codec.
Merge commit '50ace4fec5e8cb5afcbc656a4556fa528adfd760' into gingerbread-plus-aosp
* commit '50ace4fec5e8cb5afcbc656a4556fa528adfd760':
Remove compiler warnings when building Bionic.
Merge commit 'e1a739ec38a39fea9e66038dfc7cea364cb6a256'
* commit 'e1a739ec38a39fea9e66038dfc7cea364cb6a256':
Allow static C++ destructors to be properly called on dlclose().
Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.
Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
Merge commit '6a9b888d7c4b246f6f66360789c72b754ff85021' into gingerbread-plus-aosp
* commit '6a9b888d7c4b246f6f66360789c72b754ff85021':
Allow static C++ destructors to be properly called on dlclose().
With this patch, _and_ an upcoming build/ patch, the destruction
of static C++ objects contained in shared libraries will happen
properly when dlclose() is called.
Note that this change introduces crtbegin_so.S and crtend_so.S which
are currently ignored by the build system.
+ move definition of __dso_handle to the right place
(before that, all shared libraries used the __dso_handle
global variable from the C library).
Note that we keep a 'weak' __dso_handle in aeabi.c to avoid
breaking the build until the next patch to build/core/combo/
appears. We will be able to remove that later.
+ move bionic/aeabi.c to arch-arm/bionic/ (its proper location)
Change-Id: Ie771aa204e3acbdf02fd30ebd4150373a1398f39
NOTE: The NDK will need to be modified to enable this feature in
the shared libraries that are generated through it.
When calling sysconf with _SC_NPROCESSORS_ONLN, the value one (1) was
returned on systems with two or more cores, since '/proc/stat' was
incorrectly parsed.
The function line_parser_getc (LineParser* p) read 128 characters of
input for each invocation.
The proper and probably aimed for behavior is to read 128 characters
at the first call, then for each subsequent call only return the next
buffered character until a new read is needed and only then read
another 128 characters.
Due to a flipped comparison between the two variables in_len and
in_pos that track the number of bytes of data read into the input
buffer and how much of it has been parsed, a new group of 128
characters were read at almost every call to line_parser_getc,
overwriting the still unhandled bytes from the previous call to
read. This caused the lines to be read to be sampled more than parsed.
Change-Id: I93eec3c8c9b9f19ef798748579d0977111b5c0bb
Signed-off-by: Christian Bejram <christian.bejram@stericsson.com>
Merge commit '6a09cfd9f916e3a60de707ff0806cdeb143d77a4' into gingerbread-plus-aosp
* commit '6a09cfd9f916e3a60de707ff0806cdeb143d77a4':
wchar.h: improve wchar_t support in Bionic
We simply copy the stuff we need from cutils headers.
A future patch will change cutils to include the private <bionic_atomic_inline.h>
Change-Id: Ib6fd9a03bc9e337ce867bd606dc94c2b4438480a
bionic/libc/include/../include/stdlib.h: In function 'int grantpt(int)':
bionic/libc/include/../include/stdlib.h:138:23: warning: parameter '__fd' set but not used [-Wunused-but-set-parameter]
By adding __attribute((unused)) to __fd, the warning is gone, and this
attribute is compatible with gcc-4.4.0, gcc-4.3.1 gcc-4.2.1.
There is no any side effect.
Change-Id: I385f0f4da1013ffd1499e391eac9123aafe1f7a5
Update ARM atomic ops to use LDREX/STREX. Stripped out #if 0 chunk.
Insert explicit memory barriers in pthread and semaphore code.
For bug 2721865.
Change-Id: I0f153b797753a655702d8be41679273d1d5d6ae7
bionic/libc/include/../include/stdlib.h: In function 'int grantpt(int)':
bionic/libc/include/../include/stdlib.h:138:23: warning: parameter '__fd' set but not used [-Wunused-but-set-parameter]
By adding __attribute((unused)) to __fd, the warning is gone, and this
attribute is compatible with gcc-4.4.0, gcc-4.3.1 gcc-4.2.1.
There is no any side effect.
Change-Id: Id9d2b0aeefdd9c37132da0f00c48387f7d897e83
Added an underscore to _ARM_HAVE_LDREX_STREX to make it match the others.
Added __ARM_HAVE_DMB and __ARM_HAVE_LDREXD when appropriate.
Fixed some typos.
Change-Id: I2f55febcff4aeb7de572a514fb2cd2f820dca27c
... so that each cloned process at the kernel level can be named
independently. Tools like 'top' can display the CPU/memory statistics
for each process's thread if "Show Threads" mode is on.
With this function in place, we can convert dalvik/Thread.c setThreadName()
function over this function. This feature ought to be provided by the
underlying C library and not coded directly in Dalvik.
Change-Id: Ifa997665dbaa114e0b126f8c667708be9a4137fd
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
GDB looks for specific opcode sequences when trying to recognize a stack
frame as a signal trampoline. The sequences it looks for happen to be those
created when SA_RESTORER is set, since glibc always sets a restorer. This
patch does the same here, so that the trampolines can be correctly identified.
Change-Id: I0ac574a68818cb24d939c3527f3aaeb04b853d04
... by removing extraneous NULL check, as free() already does it.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Change-Id: I0445f35c7ad0a049a0e4aee1fbe002ed2f13b94b
... by removing unneeded NULL check, as free() already does it.
By the way, we don't need to set a stack variable back to NULL.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Change-Id: Id90eb8f042b5c922c5ff139b11ff8366fb404566
... by removing unneeded NULL check, as free() already does it.
By the way, we don't need to set a stack variable back to NULL.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Change-Id: Id1f72e872f73366dddcea4abc75885a3d9a318c6
... by checking most probable condition first (elements do differ)
Change-Id: I424eab9c32a6d9eb82b686ca04025ec8c9097035
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Typo assigned prefixlen1 twice instead of to the two different variables
for comparison and difference computation.
Change-Id: I6631b8269ca6aae264c8d7d414127b756838df96
Now that the system properly uses shared condvars when needed, we
can enable the use of private futexes for them too.
Change-Id: Icf8351fc0a2309f764cba45c65bc3af047720cdf
This does not change the implementation of conditional variables
since we're waiting for other system components to properly use
pthread_condattr_init/setpshared before that.
Also remove an obsolete x86 source file.
Change-Id: Ia3e3fbac35b87a534fb04d4381c3c66b975bc8f7
Note that this does not change the implementation of conditional variables
which still use shared futexes, independent on the flags being selected.
This will be fixed in a later patch, once our system is modified to use
pthread_condattr_setpshared(attr, PTHREAD_PROCESS_SHARED) properly.
Change-Id: I935de50964cd41f97a13dbfd6626d3407b0406c3
dladdr() is a GNU extension function, which allows the caller to retrieve
symbol information for a specified memory address. It is useful for things
like generating backtrace information at runtime.
Change-Id: I3a1def1a6c9c666d93e1e97b7d260dfa5b9b79a9
Private futexes are a recent kernel addition: faster futexes that cannot be
shared between processes. This patch uses them by default, unless the PROCESS_SHARED
attribute flag is used when creating a mutex and/or conditional variable.
Also introduces pthread_condattr_init/destroy/setpshared/getpshared.
Change-Id: I3a0e2116f467072b046524cb5babc00e41057a53
To avoid introducing NULL checks everytime a Bigint computation
is performed, introduce a special value (BIGINT_INVALID) and only
check for it when absolutely needed (which means when the code
needs to access the Bigint's internal structure fields).
Change-Id: Ie3954523b0985b6a8cb62340802d8dcf63cbf16f
The problem was that the 'defdname' field of res_state structure
was not properly initialized in __res_vinit(). This field is used
to store the default domain name, which is normally build from
calling gethostname() (see line 549 of res_init.c).
Unfortunately, in the typical Android case, gethostname() returns
an error (the hostname is configured) and a random stack string is
used later to build the DNS search list (see lines 556+ in res_init.c)
For the sake of illustration, let's say the search list is set to
a random value like 'xWLK'.
The end result is that when trying to result an unknown domain name
(e.g. 'www.ptn'), the query fails then the resolver tries to make a
new query with the DNS search list path(s) appended (e.g. 'www.ptn.xWLK').
The patch simply initializes 'defdname' to an empty string to avoid
this when the net.dns.search system property is not set.
Also contains whitespace/formatting fixes
Any of the setuid functions now updates /acct/uid/ with its own tid
before changing users. This is so we can properly account for cpu time
per uid.
Change-Id: I34186cf4d5228cac8439e582a9e26c01ef3011e4
Signed-off-by: Mike Chan <mike@android.com>
Java changes required not to mess up the ordering from bionic will arrive in a
later commit.) In particular, this will give us more correct behavior when on a
6to4 network, in that IPv4 will usually be preferred over 6to4.
Most of RFC 3484 is implemented -- what's not is rule 3 (avoid deprecated
addresses), 4 (prefer home addresses) and 7 (prefer native transport) as they
require low-level access to the kernel routing table via netlink. (glibc also
started out this way, and these rules are primarily useful in pretty obscure
circumstances, so we should be fine for the time being.)
Also, rule 9 (use longest matching prefix) has been modified so it does not try
to sort IPv4 addresses; given current IPv4 addressing practice these rules are
pretty much meaningless. Finally, I've added support for Teredo as a separate
label, with slightly lower preference than 6to4. (Vista puts the preference
below IPv4 by default. glibc puts the preference together with non-tunneled
IPv6.)
Note that this patch removes support for the "sortlist" directive in
resolv.conf; I've never seen it in actual use, it's irrelevant for Android
(since we don't use resolv.conf anyway), and it's not clear how it would be
implemented alongside RFC 3484.
On ARM EABI, 64-bit function parameters must be aligned
to an even/odd register pair. The weird way these stubs
were written (using separate lo/hi parameters) prevented
this alignment from being enforced by the compiler.
It decreases code size:
text data bss dec hex filename
161 0 0 161 a1 strndup-BEFORE.o
153 0 0 153 99 strndup-AFTER.o
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Only provide an implementation for ARM at the moment, since
it requires specific assembly fragments (the standard syscall
stubs cannot be used because the child returns in a different
stack).
The gHardy man pages specify the return type of ptsname_r to be char*, but the
return value to be 0 on success, negative on error and the gHardy stdlib.h
defines extern int ptsname_r(...).
Busybox telnetd fails to run successfully without this change.
Merge commit 'f197147a787d7415e6e0a1bad15566836c55befb'
* commit 'f197147a787d7415e6e0a1bad15566836c55befb':
Revert "Add qsort_r() implementation to the C library."
Merge commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e'
* commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e':
Add qsort_r() implementation to the C library.
Merge commit 'ca07064c9ebd8523ed88fa09e97feaaafb7e9c15' into eclair-mr2-plus-aosp
* commit 'ca07064c9ebd8523ed88fa09e97feaaafb7e9c15':
Revert "Add qsort_r() implementation to the C library."
Merge commit '5f53a18204ec991f5a77872806eeaa185936aa8c' into eclair-plus-aosp
* commit '5f53a18204ec991f5a77872806eeaa185936aa8c':
Revert "Add qsort_r() implementation to the C library."
Merge commit '5f53a18204ec991f5a77872806eeaa185936aa8c' into eclair-mr2
* commit '5f53a18204ec991f5a77872806eeaa185936aa8c':
Revert "Add qsort_r() implementation to the C library."
Merge commit '20b3097d4cc225d948dac38e778a9d3b3b1549db' into eclair-mr2-plus-aosp
* commit '20b3097d4cc225d948dac38e778a9d3b3b1549db':
Add qsort_r() implementation to the C library.
This reverts commit 754c178ae5.
Turns out we don't need it afterall (needed a stable sort anyways).
So, we'll make that change in the dev branch instead.
Merge commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989' into eclair-mr2
* commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989':
Add qsort_r() implementation to the C library.
Merge commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989' into eclair-plus-aosp
* commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989':
Add qsort_r() implementation to the C library.
NOTE: This replaces qsort.c with the FreeBSD version. While
the patch changes the source, it should not alter the
implementation that should use the exact same algorithm.
log_channel_t contains fd member, which is file descriptor for
exact logging channel. change cc05d12716
lacks initialization of this member in __write_to_log_init(), thus
logging code is not working, although not crashable.
Additional details may be found in comments here:
http://review.source.android.com/5617
The file descriptor wasn't getting set, so the writev() call was
silently failing.
There's a parallel implementation over in system/core/liblog, but it's
still using the old approach and didn't have this problem.
Merge commit 'ae77aae80cb78b33f32e65c43a473d5e297b866b'
* commit 'ae77aae80cb78b33f32e65c43a473d5e297b866b':
Rebuild the time zone data files in 32-bit format instead of 64-bit.