Commit graph

2038 commits

Author SHA1 Message Date
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
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
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
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
f6bb5bf498 Merge "Add the glibc-compatible names to <sys/endian.h>." 2013-02-22 21:46:59 +00: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
538f6fc202 Stop advertising rindex(3), which is both deprecated and unimplemented.
Change-Id: I3c775d9974e49c3f76a53e46e022659657b89034
2013-02-21 17:39:06 -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
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
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