The length of the cname is sent in big-endian
order. Thus, it has to be converted before used
in android_getaddrinfo_proxy
Change-Id: I1a0cc12780c47f7493fcf06f690515829f88c01e
Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.
Based on OpenBSD change by guenther@openbsd.orghttp://www.mail-archive.com/source-changes@cvs.openbsd.org/msg01015.html
Bug: 3446659
Change-Id: Ie82116e358c541718d6709ec45ca6796be5a007b
Use system property ro.net.dns_cache_size to set
the size of the cache. If the system property
is not set the default cache size is defined by
CONFIG_MAX_ENTRIES.
The number of entries in the hash table will be equal
to the number of max entries allowed in the cache.
Change-Id: I77d69d7c178937fa483d0b40512483ad29232d28
Added a memmove() variant for Dalvik's System.arraycopy()
implementation. It guarantees 16-bit or 32-bit atomicity depending
on the alignment of the arguments.
Bug 3398352
Change-Id: Ie7bd246305ef0ff8290513663327c5b81680368d
Make the scripts use external/kernel-headers/original by default.
clean_header.py: Document -k<path>, add -d<path>
find_headers.py: Make kernel config files optional
update_all.py: Allow setting the path to kernel headers on the command-line
update_all.py: Better formatting of output on ttys
update_all.py: Automatically perform "git add/rm" on affected files.
SYSCALLS.TXT: Fix typo in __socketcall definition.
checksyscalls.py: Add support for superH architecture in the checks.
gensyscalls.py: Automatically perform "git add/rm" on affected files.
cpp.py: Fixed a bug that prevented certain type definitions to
be kept in the generated clean header (e.g.
struct ethtool_drvinfo in <linux/ethtool.h>)
All scripts will use the content of external/kernel-headers/original by default now.
The generated code removes all empty lines and trailing whitespace. This is useful
to ensure a unified output even if we change the parser again in the future.
The top-level disclaimer has been edited with update instructions to regenerate
the headers when needed.
Also, a warning is now inserted every 8th line in the final output:
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Changes under kernel/arch-arm and kernel/arch-x86 should correspond to whitespace
differences and additionnal struct definitions that were missed by the previous
parser implementation.
Change-Id: Icd1c056bacd766759f3e9b7bb5d63a246f3d656a
WARNING: If you run these script, do not submit the result to gerrit for now.
It seems there are discrepancies between the content of original headers
and those currently commited under bionic/libc/kernel/.
(This problem is the main motivation to insert the warning repeatedly).
Current list of issues:
- Missing SuperH headers (i.e. external/kernel-headers/original/asm-sh)
On ARM there is currently no assembler optimized memmove in libc.
There is however a more optimized bcopy which copies long instead
of bytes where possible. This almost doubles the performance in
best case.
Change-Id: I1f1cd27529443358047c385730deaf938ce4e642
* changes:
Add icmp6.h and ip6.h files from current NetBSD libc.
Include the Linux ipv6.h header from netinet/in.h, to get things like in6_pktinfo.
Add IN6ADDR_LOOPBACK_INIT macro to <netinet/in6.h>, as the kernel headers do not provide it anymore.
Update IPv6 kernel headers with new 2.6.37 headers, cleaned by update_all.py. (It wanted to do many other changes, most of them cosmetic, but I only included the IPv6 changes.)
Fix syntax error in defaults.py.
Use the the TTL of the answer as the time a query
shall remain in the resolver cache.
Added some debugging support as well, i.e.
parse answer and print a la dig.
Change-Id: I724d3392245032592f1912f3ca7a81a8987ebbac
This patch moves the definition of struct user_vfp from <asm/ptrace.h>
to <asm/user.h> for the ARM platform, in order to match the original
kernel headers.
See patches 94519 and 94520 for a description of the problem and a
fix for debuggerd that uses the structure.
This prevented us from properly re-running the kernel headers cleanup
scripts.
Change-Id: I43718a59ae49b9d89fc2d1c8affb65973fb2919c
getaddrinfo only asks DNS for IPv6 addresses if the system
has IPv6 connectivity, but always asks for IPv4 addresses.
Don't ask for IPv4 addresses if there is no IPv4
connectivity.
Change-Id: Iefe9fcb006fabe60b4b11dd4653a7c4a406506f4
to gingerbread.
Implement RFC3484 policy table changes from draft-ietf-6man-rfc3484-revise-01.
The changes in a nutshell:
- Handle v4-mapped as different from v4-compat (this was probably
an existing bug in our code).
- Add policy entries for ULA, above most everything else.
- Put v4-compat, old-style IPv6 site-local and 6bone addresses
way down in the preference table.
The rest is just shuffling numbers around (no actual changes to
priority).
to gingerbread.
Add a new #define IN6_IS_ADDR_ULA, for testing for Universal Local IPv6 Unicast addresses (ULAs). These replace the old site-local IPv6 addresses.
to gingerbread.
Don't treat private IPv4 addresses as being in a non-global scope. The effect of this change is essentially to prefer NATed IPv4 over 6to4.
The changes in a nutshell:
- Handle v4-mapped as different from v4-compat (this was probably
an existing bug in our code).
- Add policy entries for ULA, above most everything else.
- Put v4-compat, old-style IPv6 site-local and 6bone addresses
way down in the preference table.
The rest is just shuffling numbers around (no actual changes to
priority).
Change-Id: Ieb111e0edd705992bc9d066befaaee95a8c1a5df
It adds two functions sigsetjmp and siglongjmp
that fix compiling errors in bluetooth and mksh.
Copy directly from sigsetjmp.S of OpenBSD.
Change-Id: I4696f82ee6f85d1c93cbdd3c9e40f4917d50f3a6
The source file is not part of the C library build, so the Android.mk
is unaffected. In other words, this source file was never compiled.
Change-Id: Idec3d5b6ec30dc9ee38296d12dc6e522997df29a
After this change, SIGRTMAX will be set to 64 (instead of 32 currently).
Note that this doesn't change the fact that our sigset_t is still defined
as a 32-bit unsigned integer, so most functions that deal with this type
won't support real-time signals though.
Change-Id: Ie1e2f97d646f1664f05a0ac9cac4a43278c3cfa8
Add missing declarations:
INET_ADDRSTRLEN
IN6_IS_ADDR_MC_NODELOCAL
IN6_IS_ADDR_MC_GLOBAL
It has been reported that these prevent compilation of the Boost libraries
with the NDK. The corresponding patch has already been performed under
development/ndk/platforms/android-3/include.
Change-Id: I4ac514973daf3c06a8ef5538d7df79142a98e562
This patch improves the handling of 64-bit parameters in syscalls on ARM.
The ARM EABI mandates that 64-bit quantities be passed in even/odd register
pairs, which requires special treatment.
This allows us to simplify our implementations of pread() and pwrite()
and remove the C stubs for pread64() and pwrite64().
Also add ftruncate64() to <unistd.h>
Change-Id: I407e2fd223ba0093dd2d0b04c6152fadfc9ce3ef
Bug 3107933
The second declaration came from an incorrect change in AOSP.
The eventfd stubs are not affected by this, they are already correct.
Change-Id: Icfc7612a68fc37a48dde2687137960a5d1dbc534
asm() conflicts with userland code compiled with -std=c99, the userland
libc should only use __asm__() instead. Therefore, this transformation
has to be applied to all exported headers.
This only changes arch-arm/asm/byteorder.h.
Change-Id: I1cf88c37201c3a91668d387293a18885c316d53c
If compiling userland code with -std=c99, the current header produces an
error. The content of this header originally is a kernel internal header,
where asm() is acceptable. In a header visible to userland, this should be
__asm__ instead.
Change-Id: I4d3188dd96f7836148ca89f5053d0389dd459d6e
This adds the cpu_set_t type definition and related functions
and macros used to handle CPU thread affinity.
sched_getcpu()
sched_setaffinity()
sched_getaffinity()
Change-Id: If382ecafde8926341a88478062b275553645065b
Add a new header that defines __ANDROID_API__ as a constant integer
corresponding to the current native API level. This header is included
by <sys/cdefs.h>
Change-Id: Ib4774e247b395991266245815a24292afc919848
NOTE: This header is already provided by the NDK's platform headers.
for levels 3 to 9.
The mkdtemp() function is implemented in libc/stdio/mktemp.c but not
exposed in stdlib.h. This change adds the prototype to stdlib.h.
Change-Id: I5a98650c665d2e45b2cf6ed3382742f7bdc7c88a
The above prototypes are missing from libc/include/wchar.h but
the functions are present (although with a limited implementation)
in libc.
Change-Id: I1b7c6accfc59ff0f56f3f41a9d3c075e935ac54a
64-bit pread() and pwrite() is needed for ZipFileRO to be able to read
ludicrously large ZIP files just in case someone is crazy enough to do
it.
Also fix a license header that was apparently mangled.
Change-Id: I6819ef8b36e46b63b40749c95717b1ecf9307033
Driver has changed to support transferring > 4 gigabyte files
Change-Id: I9ddca13e8e906a403fe84c9af27ec1fab565be77
Signed-off-by: Mike Lockwood <lockwood@android.com>
Will also need to do gethostinfo, but that's probably about it.
It was cleaner to do it at this level, rather than speaking in terms
of DNS packets.
Change-Id: I047cc459979ffb0170a3eb0d432a7e827fb71c26
Originally, there are _rand48 (in libc/bionic/_rand48.c) and __rand48
(in libc/stdlib/_rand48.c) implemented in bionic. Besides the naming,
the functionality is identical. This patch removes the duplicated
_rand48. Also, drand48 and erand48 are modified accordingly.
Change-Id: Ie5761a0a97f45df8538222a77edacb7c3e0125d7
This change allows an executable to call its destructor functions
(declared with __attribute__((destructor))) to be properly called
when it normally exits.
Note that this is different from calling the destructors of a shared
library when it is unloaded with dlclose() or through program exit,
which are already supported.
Bug: 3106500
Change-Id: I1412ef5407f13b613fc6cb6103e0a691dbee4b1a
Merge commit 'ade2a92991d1c7edc32c4a300bd83d622fa1567d' into gingerbread-plus-aosp
* commit 'ade2a92991d1c7edc32c4a300bd83d622fa1567d':
bionic: stubs: Make internal symbol static
Although header libc/stdio/local.h declares the macros and private
variables of stdio, there are several internal symbols exposed
unexpectedly.
Change-Id: Ie7a07f85b70322fb9cd05b3c8e1bcc416061eb4b
Merge commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a'
* commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a':
Hide the symbol of helper function __libc_android_abort
Merge commit '1aeeeae166920f871c1e4ecd960bb92dcaef0896'
* commit '1aeeeae166920f871c1e4ecd960bb92dcaef0896':
libc: tag missing functions in system headers.
Merge commit 'f67e5211e045af1b12f646448a5a35f96ba5e8f1' into gingerbread-plus-aosp
* commit 'f67e5211e045af1b12f646448a5a35f96ba5e8f1':
Hide the symbol of helper function __libc_android_abort
Merge commit 'b8d2233e8abc30f33be7d7acc7f3ef6e6aabebac' into gingerbread-plus-aosp
* commit 'b8d2233e8abc30f33be7d7acc7f3ef6e6aabebac':
libc: tag missing functions in system headers.
This matches recent changes in the NDK header.
We enclose missing functions in #if 0 .. #endif blocks
with a clear "MISSING" in comments in order to locate
them later.
Change-Id: I87b3a62e777897e75c9243360fb0a82bcc53d9fb
This elimates the makefile warning at the beginning of each build:
libc_common_intermediates/arch-arm/syscalls/eventfd.o' given more than once in the same rule.
Change-Id: I25cc0c373d55b5036dd17811a595c097fd6ca69a
Merge commit '5b81b918173b4bf446c1a85240c094e4dd77231f' into gingerbread-plus-aosp
* commit '5b81b918173b4bf446c1a85240c094e4dd77231f':
libc: optimize memmove() with memcpy() if possible.
The get_malloc_leak_info() currently asssumes that the totalMemory out parameter
was pre-initialized to zero before the routine is called. If it is not then the
accumulated totalMemory value will be incorrect. It is likely that many callers
will simply allocate totalMemory on the stack with no initialization and assume
that get_malloc_leak_info will set the proper value.
As an example, the caller in frameworks/base/core/jni/android_os_Debug.cpp
calls get_malloc_leak_info() with the address uninitiazed stack variable
for totalMemory. It is probably best to fix this in get_malloc_leak_info.
Change-Id: I84c927c3781419585794726115b7d34d8fdd24ae
The change explicitly isolates the assembly-only macros in header
<machine/cpu-features.h> in order to prevent mis-inclusion in C/C++
source files.
Change-Id: I0258e87c5ac3fd24944fb227290ac3b9cac4bfba