| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
d329697 is too complicated. Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).
d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit 5f05348c18286a2cea46eae8acf94ed5b7932fac)
Change-Id: I690704552afc07a4dd410277893ca9c40bc13e5f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See the comments for an explanation of how properties are stored.
The trie structure is designed to scale better than the previous
array-based implementation. Searching an array with n properties
required average O(n) string compares of the entire key; searching the
trie requires average O(log n) string compares of each token (substrings
between '.' characters).
Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit 6ac8e6a46d71a51bec16938efa89f275fa89cf7d)
Change-Id: Icbe31908572f33b4d9b85d5b62ac837cbd0f85e0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The property area is initially one 4K region, automatically expanding as
needed up to 64 regions.
To avoid duplicating code, __system_property_area_init() now allocates
and initializes the first region (previously it was allocated in init's
init_property_area() and initialized in bionic). For testing purposes,
__system_property_set_filename() may be used to override the file used
to map in regions.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit d32969701be070c0161c2643ee3c3df16066bbb8)
Change-Id: I038d451fe8849b0c4863663eec6f57f6521bf4a7
|
|
|
|
|
|
|
| |
clang doesn't support __builtin_va_arg_pack(), so we have
to use #define instead.
Change-Id: I2ee75e6267d60cdf997fee6b9b0547bf68f062a1
|
|
|
|
| |
Change-Id: Idcfe08f5afc3dde592416df9eba83f64e130c7c2
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
stdint.h provides macros with incorrect type:
* UINT8_C
* UINT16_C
* UINT8_MAX
* UINT16_MAX
Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: I2d130c782d4485bf6c9e9f068de0bdaa4ba7303f
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
find_nth() will be inefficient on a trie. Since find_nth() is only used
internally and only for enumerating properties, we can add a foreach()
function to do this directly.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
(cherry picked from commit 577418403d68e663fb33c7b0c8a90d862d9c00cf)
Change-Id: Iaca97d1182ce2c28863ba85241cbb5cf6185eb2f
|
| |
| |
| |
| |
| |
| |
| |
| | |
__umask_error -> __umask_invalid_mode
__creat_error -> __creat_missing_mode
__too_many_args_error -> __creat_too_many_args
Change-Id: I4036f344a3a93628e70f2e948ad73cfed3a967ea
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In 829c089f83ddee37203b52bcb294867a9ae7bdbc, we disabled all
FORTIFY_SOURCE support when compiling under clang. At the time,
we didn't have proper test cases, and couldn't easily create targeted
clang tests.
This change re-enables FORTIFY_SOURCE support under clang for a
limited set of functions, where we have explicit unittests available.
The functions are:
* memcpy
* memmove
* strcpy
* strncpy
* strcat
* strncat
* memset
* strlen (with modifications)
* strchr (with modifications)
* strrchr (with modifications)
It may be possible, in the future, to enable other functions. However,
I need to write unittests first.
For strlen, strchr, and strrchr, clang unconditionally calls the
fortified version of the relevant function. If it doesn't know the
size of the buffer it's dealing with, it passes in ((size_t) -1),
which is the largest possible size_t.
I added two new clang specific unittest files, primarily copied
from fortify?_test.cpp.
I've also rebuild the entire system with these changes, and didn't
observe any obvious problems.
Change-Id: If12a15089bb0ffe93824b485290d05b14355fcaa
|
| |
| |
| |
| |
| |
| |
| |
| | |
Define __errordecl and replace __attribute__((__error__("foo")))
with __errordecl. Make sure __errordecl is a no-op on clang, as it
generates a compile time warning.
Change-Id: Ifa1a2d3afd6881de9d479fc2adac6737871a2949
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the implementation of writing to the system property area
from init to bionic, next to the reader implementation. This
will allow full property testing to be added to bionic tests.
Add new accessor and waiting functions to hide the implementation
from watchprops and various bionic users.
Also hide some of the implementation details of the property area
from init by moving them into _system_properties.h, and other details
from everybody by moving them into system_properties.h.
(cherry picked from commit dc1038b7900acb664e99643d2974e1a0f4703781)
Change-Id: I192d3825ee276c5047bc751039fe6cfe226a7cca
|
|
|
|
|
|
|
| |
We were missing SIG_ATOMIC_MAX, SIG_ATOMIC_MIN, SIZE_MAX,
WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.
Change-Id: I2535f36bc220fbaea009b483599b7af811c4cb5c
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit d8627af159c6b1bc40296fb29297c61b30a5a8e2 which caused build breakage:
In file included from bionic/libc/include/limits.h:86:0,
from bionic/libc/include/stdint.h:33,
from bionic/libc/arch-arm/bionic/crtbegin.c:31:
bionic/libc/include/sys/limits.h:30:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [out/target/product/generic/obj/lib/crtbegin_dynamic1.o] Error 1
Change-Id: I128095ecb99df92626e1f57e34c61e08c98a4078
|
|
|
|
|
|
| |
Take two.
Change-Id: I7d08b6d14c82a171312a7f5898270b4441d5cfa2
|
|
|
|
| |
Change-Id: Id27222c24955c83f29ad953933cbdc48b6f1e900
|
|
|
|
|
|
|
|
| |
sigismember, sigaddset, and sigdelset had mixed code and declarations
which are not allowed in C90 and before.
Change-Id: I662af944fc1489e34bed228ce592e41f50d00e17
Signed-off-by: Erik Gilling <konkers@android.com>
|
|
|
|
|
|
|
|
|
|
| |
We keep fixing these one-by-one; let's fix them all at once.
Found thus:
find . -name *.h | xargs grep -L sys/cdefs.h | xargs grep -l BEGIN_DECL | xargs grep -L sys/types
Change-Id: I188842aa2484dc6176e96556d57c38a0f785b59b
|
|
|
|
| |
Change-Id: Ia3fa558a38e0cffe5287bc454e85d5d3bdaa6ba1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The function should take a 'const void*' parameter, instead of 'void*'.
Note that the implementation in upstream-dlmalloc/malloc.c already does
this.
For context, see http://b.android.com/55725
Change-Id: Iefd55cdb8996699189e0545f9195972490306227
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__strcat_chk and __strncat_chk are slightly inefficient,
because they end up traversing over the same memory region
two times.
This change optimizes __strcat_chk / __strncat_chk so they
only access the memory once. Although I haven't benchmarked these
changes, it should improve the performance of these functions.
__strlen_chk - expose this function, even if -D_FORTIFY_SOURCE
isn't defined. This is needed to compile libc itself without
-D_FORTIFY_SOURCE.
Change-Id: Id2c70dff55a276b47c59db27a03734d659f84b74
|
|
|
|
| |
Change-Id: I7e2d270cc722d339d221eaea92747eaff3b51403
|
|
|
|
|
|
| |
(cherry-pick of d1ad4f6dab06189d4d3dcfa19ae4bc301481eb3f.)
Change-Id: I4a8476bff068951533d4188de94097c8b84bc489
|
|
|
|
|
|
| |
(cherry-pick of 04c0ac14a49e0969333008a9522b64046d58fbdc.)
Change-Id: I06d0b6c2a8781602362b81f48faf1cca76b9ec05
|
|
|
|
|
|
|
|
|
|
| |
Add CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, and CLOCK_MONOTONIC_COARSE
as supported by recent linux kernels.
(cherry-pick of 60e5144ca312b210b54ac8e6966108da0c97ff80.)
Bug: 8895727
Change-Id: If79a4d05d1301108f49a37588f9416c4be19277a
|
|
|
|
|
|
| |
(cherry-pick of b928bda83d4413b703329f607e2706602f15293f.)
Change-Id: Ica6aad84299819ffc5e57ae4891e057d2e401fa1
|
|
|
|
|
|
|
|
|
| |
All the cool kids say this is the best thing since sliced bread.
http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
For the most part, these changes match what glibc does.
Change-Id: I176268f27f82800162fe5f2515b08d5469ea2dfe
|
|
|
|
| |
Change-Id: I4c34c2ce22c5092c4446dc1ab55f37604c1c223f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Upgrade the following functions:
* vsnprintf
* vsprintf
* snprintf
* fgets
* strcpy
* strcat
* strncat
* strlcpy
* strlcat
* strlen
* strchr
Change-Id: Icc036fc7f0bb317e05f7c051617887a1601271aa
|
|
|
|
|
|
|
| |
Upgrade sprintf to fortify_source level 2, to catch
additional security bugs.
Change-Id: Ibc957d65e4cb96152de84b3745a04e00fa22659e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for fortify source level 2 to strncpy.
This will enable detection of more areas where strncpy
is used inappropriately. For example, this would have detected
bug 8727221.
Move the fortify_source tests out of string_test.cpp, and
put it into fortify1_test.cpp.
Create a new fortify2_test.cpp file, which copies all
the tests in fortify1_test.cpp, and adds fortify_source level
2 specific tests.
Change-Id: Ica0fba531cc7d0609e4f23b8176739b13f7f7a83
|
|
|
|
|
|
|
|
|
|
| |
- eventfd.cpp and eventfd.s will output to the same file when building libc.a
out/target/product/*/obj/STATIC_LIBRARIES/libc_intermediates/WHOLE/libc_common_objs/eventfd.o
- And then `eventfd` will undefined when statically linked to libc.
Also add a unit test.
Change-Id: Ib310ade3256712ca617a90539e8eb07459c98505
|
|
|
|
|
|
|
|
|
| |
The <asm/unistd.h> files contain the canonical data, and
<sys/glibc-syscalls.h> contain new glibc-compatible names,
and if you #include the standard <sys/syscall.h> you get
both sets of names.
Change-Id: I9919c080931c0ba1660f5e37c6a6265ea716d603
|
|
|
|
|
|
|
|
| |
This lets us move all the ARM syscall stubs over to the kernel <asm/unistd.h>.
Our generated <sys/linux-syscalls.h> is now unused, but I'll remove that in a
later change.
Change-Id: Ie5ff2cc4abce1938576af7cbaef615a79c7f310d
|
|
|
|
|
|
|
| |
Also add a more intention-revealing guard so we don't have loads of
places checking whether our inlining macro is defined.
Change-Id: I168860cedcfc798b07a5145bc48a125700265e47
|
|
|
|
|
|
|
|
|
|
|
| |
<sys/linux-syscalls.h> only contains constants for the syscalls
we're generating stubs for. We want all the syscalls available
on the architecture in question.
Keep using <sys/linux-syscalls.h> on ARM for now because the
__NR_ARM_set_tls and __NR_ARM_cacheflush values aren't in <asm/unistd.h>.
Change-Id: I66683950d87d9b18d6107d0acc0ed238a4496f44
|
|
|
|
|
|
|
|
|
| |
architecture.
Fixes the MIPS and x86 builds. strace tests whether syscalls
are supported using #ifdef of the appropriate SYS_ constant.
Change-Id: I90be118dc42abfdaf5b0f9b1e676e8601f55106e
|
|
|
|
|
|
| |
This helps us remove another external/strace bionic hack.
Change-Id: I3e82c0d2fd27e479be98f096e05b666fd16f8eb3
|
|
|
|
|
| |
Bug: 8253769
Change-Id: I50c7cc20828fc089b83580e039ce9153a6c5a8cc
|
|
|
|
| |
Change-Id: I87b4d76ff8da04109ae53638eec4f11629798960
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: 8253769
Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: If23589c5d85dffd28788e04b010303620fa178ca
|
| |
| |
| |
| |
| |
| |
| | |
Some applications look for sys/signal.h instead of signal.h.
Work around those apps.
Change-Id: I76ac7744ebc56d196b5f0cb9ed381d32817436b9
|
| |
| |
| |
| | |
Change-Id: I3c775d9974e49c3f76a53e46e022659657b89034
|