Commit graph

2662 commits

Author SHA1 Message Date
Elliott Hughes
a33dc57c7c Always use v1 for MIPS TLS access.
Change-Id: Ic2850b90185cfbc5b0eff804c8b74a1c553c0852
2013-06-18 13:26:22 -07:00
Nick Kralevich
ba6c021a53 am e2fb05b4: Merge "libc: Introduce __errordecl()"
* commit 'e2fb05b45b9af7b9af8df0ea15bfec63d331d882':
  libc: Introduce __errordecl()
2013-06-18 13:17:35 -07:00
Nick Kralevich
a641c18f0c libc: Rename fortify error functions.
__umask_error -> __umask_invalid_mode
__creat_error -> __creat_missing_mode
__too_many_args_error -> __creat_too_many_args

Change-Id: I4036f344a3a93628e70f2e948ad73cfed3a967ea
2013-06-18 13:07:18 -07:00
Nick Kralevich
16d1af167f libc: add limited FORTIFY_SOURCE support for clang
In 829c089f83, 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
2013-06-18 12:14:20 -07:00
Nick Kralevich
b24c0637d0 libc: Introduce __errordecl()
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
2013-06-18 12:13:52 -07:00
Colin Cross
f6e6e5e727 am 977a3313: Merge changes Iac00ce10,I192d3825
* commit '977a33137d2be0093f474055f839cf665b82b588':
  bionic: add tests for properties
  bionic: move system property writing from init to bionic
2013-06-17 18:21:37 -07:00
Colin Cross
5cf32de7a0 bionic: move system property writing from init to bionic
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 dc1038b790)

Change-Id: I192d3825ee276c5047bc751039fe6cfe226a7cca
2013-06-17 16:58:43 -07:00
Elliott Hughes
d2dbf16358 am 5995bf88: Merge "don\'t hardcode register r0/v1 when reading the TLS"
* commit '5995bf880e2a7fac249382f0a929b7271c843122':
  don't hardcode register r0/v1 when reading the TLS
2013-06-17 14:53:12 -07:00
Mathias Agopian
b6e340080a don't hardcode register r0/v1 when reading the TLS
this leads to much improved code when calling __get_tls()

Change-Id: I21d870fb33c33a921ca55c4e100772e0f7a8d1e4
2013-06-17 14:50:30 -07:00
Elliott Hughes
afd4e2999c am 657d0da7: Merge "Slight script cleanup; make gensyscalls work from any directory."
* commit '657d0da7513e01b0eb104c8a8a522c28fdbc807d':
  Slight script cleanup; make gensyscalls work from any directory.
2013-06-17 11:18:58 -07:00
Elliott Hughes
18bc975bfe Slight script cleanup; make gensyscalls work from any directory.
Also remove a ton of dead code.

Change-Id: I1315623695a004f643b155f121cbafe24b715b8a
2013-06-17 10:39:33 -07:00
Elliott Hughes
c1e4183c7a am 560e9f7e: Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."
* commit '560e9f7e7a39e02aca96709043ca06f562f75d58':
  Ensure that <stdint.h> defines SIZE_MAX and friends.
2013-06-13 16:21:55 -07:00
Elliott Hughes
7c89506e3a Ensure that <stdint.h> defines SIZE_MAX and friends.
We were missing SIG_ATOMIC_MAX, SIG_ATOMIC_MIN, SIZE_MAX,
WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.

Change-Id: I2535f36bc220fbaea009b483599b7af811c4cb5c
2013-06-13 16:02:53 -07:00
Elliott Hughes
af975b076f am c843a3e7: Merge "Fix the qsort copyright notice (fixed upstream this afternoon)."
* commit 'c843a3e7b215bca5e896e1d56c2fa6332770ea83':
  Fix the qsort copyright notice (fixed upstream this afternoon).
2013-06-12 17:46:57 -07:00
Elliott Hughes
4eeec44e29 Fix the qsort copyright notice (fixed upstream this afternoon).
Change-Id: I786feb42719bceaa7da91565e350c1333b0d301f
2013-06-12 17:42:43 -07:00
Elliott Hughes
ddbf561e5e am c843d766: Merge "Handles spurious wake-ups in pthread_join()"
* commit 'c843d7667ada205ecbaf773531067076ed4ad271':
  Handles spurious wake-ups in pthread_join()
2013-06-12 17:34:17 -07:00
msg555
0f020d18b1 Handles spurious wake-ups in pthread_join()
Removed 'join_count' from pthread_internal_t and switched to using the flag
PTHREAD_ATTR_FLAG_JOINED to indicate if a thread is being joined. Combined with
a switch to a while loop in pthread_join, this fixes spurious wake-ups but
prevents a thread from being joined multiple times. This is fine for
two reasons:

1) The pthread_join specification allows for undefined behavior when multiple
   threads try to join a single thread.

2) There is no thread safe way to allow multiple threads to join a single
   thread with the pthread interface.  The second thread calling pthread_join
   could be pre-empted until the thread is destroyed and its handle reused for
   a different thread.  Therefore multi-join is always an error.

Bug: https://code.google.com/p/android/issues/detail?id=52255
Change-Id: I8b6784d47620ffdcdbfb14524e7402e21d46c5f7
2013-06-12 17:30:58 -07:00
Elliott Hughes
5065eef801 am 6a44d227: Merge "Take some fixed upstream copyright headers and regenerate NOTICE."
* commit '6a44d2271f372d0c65b05a5d3377bd00ce92824e':
  Take some fixed upstream copyright headers and regenerate NOTICE.
2013-06-12 16:16:09 -07:00
Elliott Hughes
2815b1dd45 Take some fixed upstream copyright headers and regenerate NOTICE.
Change-Id: Ifff41d69c13322dbc6f928ce7d4c65f76fe36772
2013-06-12 16:00:41 -07:00
Elliott Hughes
5f4d2df2fc am 55189a0f: Merge "Switch to current upstream stdio makebuf.c and setvbuf.c."
* commit '55189a0fbd26cfd84939d9d3a42a1800a63bd2c5':
  Switch to current upstream stdio makebuf.c and setvbuf.c.
2013-06-12 15:58:41 -07:00
Elliott Hughes
677ee56477 Switch to current upstream stdio makebuf.c and setvbuf.c.
Change-Id: I4761b5e94459815520f01062eef39abf62af621f
2013-06-12 15:24:15 -07:00
Elliott Hughes
dc5f5f857c am f1867d47: Merge "Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work.""
* commit 'f1867d47cbce4225d712a2684da67031f7350909':
  Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."
2013-06-12 15:22:04 -07:00
Elliott Hughes
f1867d47cb Merge "Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."" 2013-06-12 22:19:03 +00:00
Elliott Hughes
9248d3a58c Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."
This reverts commit d8627af159 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
2013-06-12 22:18:47 +00:00
Elliott Hughes
b0a2262c3f am 55c5ec64: Merge "Add SIZE_MAX to <stdint.h> in a way that might actually work."
* commit '55c5ec64bd26d92bd1882a9a4c91445de73ebfa2':
  Add SIZE_MAX to <stdint.h> in a way that might actually work.
2013-06-12 15:06:51 -07:00
Elliott Hughes
55c5ec64bd Merge "Add SIZE_MAX to <stdint.h> in a way that might actually work." 2013-06-12 22:05:10 +00:00
Elliott Hughes
3da47942d3 am 944ea1a3: Merge "Clean up abort."
* commit '944ea1a32018c44d6cb55c9454e670b0e152da6d':
  Clean up abort.
2013-06-12 14:58:32 -07:00
Elliott Hughes
d8627af159 Add SIZE_MAX to <stdint.h> in a way that might actually work.
Take two.

Change-Id: I7d08b6d14c82a171312a7f5898270b4441d5cfa2
2013-06-12 14:54:16 -07:00
Elliott Hughes
61e699a133 Clean up abort.
* A dlmalloc usage error shouldn't call abort(3) because we want to
  cause a SIGSEGV by writing the address dlmalloc didn't like to an
  address the kernel won't like, so that debuggerd will dump the
  memory around the address that upset dlmalloc.

* Switch to the simpler FreeBSD/NetBSD style of registering stdio
  cleanup. Hopefully this will let us simplify more of the stdio
  implementation.

* Clear the stdio cleanup handler before we abort because of a dlmalloc
  corruption error. This fixes the reported bug, where we'd hang inside
  dlmalloc because the stdio cleanup reentered dlmalloc.

Bug: 9301265
Change-Id: Ief31b389455d6876e5a68f0f5429567d37277dbc
2013-06-12 14:14:53 -07:00
Elliott Hughes
834f83de3f am 5cde15eb: Merge "<stdint.h> should expose SIZE_MAX."
* commit '5cde15eb17f4ddc0949c0cbd38a46e6c0bad7019':
  <stdint.h> should expose SIZE_MAX.
2013-06-12 10:58:23 -07:00
Elliott Hughes
2c157aec9b <stdint.h> should expose SIZE_MAX.
Change-Id: Id27222c24955c83f29ad953933cbdc48b6f1e900
2013-06-12 10:28:26 -07:00
Ben Cheng
77f90de728 am fc104f89: Merge "Fix abort(3) to raise SIGABRT rather than causing SIGSEGV."
* commit 'fc104f899d47916f76c91127caf9aeaf7b69d4ef':
  Fix abort(3) to raise SIGABRT rather than causing SIGSEGV.
2013-06-10 17:25:31 -07:00
Ben Cheng
7e6ce1a3c5 Fix abort(3) to raise SIGABRT rather than causing SIGSEGV.
tgkill() needs the .save stack unwinding directive to get the complete
stack trace.

BUG: https://code.google.com/p/android/issues/detail?id=16672

Change-Id: Ifb447dca2147a592c48baf32769dfc175d8aea72
2013-06-10 17:17:46 -07:00
Elliott Hughes
6bcf71c9ac am 2fbc9dda: Merge "bionic/x86: Optimization for string routines"
* commit '2fbc9dda345486005569be4ec586c6aae9d51650':
  bionic/x86: Optimization for string routines
2013-06-07 17:47:33 -07:00
Elliott Hughes
2fbc9dda34 Merge "bionic/x86: Optimization for string routines" 2013-06-08 00:45:07 +00:00
Elliott Hughes
fc6f5a0865 am 157c4299: Merge "Revert "libc x86: Remove strcat.S""
* commit '157c42997b7aa31b36cca63ad03dbb5a601ce347':
  Revert "libc x86: Remove strcat.S"
2013-06-07 17:44:20 -07:00
Elliott Hughes
157c42997b Merge "Revert "libc x86: Remove strcat.S"" 2013-06-08 00:42:44 +00:00
Elliott Hughes
06708df6fb Revert "libc x86: Remove strcat.S"
This reverts commit 4fe461b3a6

Change-Id: Ibeb76e24f054abd7c96ad6899366c2f9bfc2a5ad
2013-06-08 00:42:35 +00:00
Christopher Ferris
83245ba45f am 9647f797: Merge "Implement malloc_usable_size for debug impls."
* commit '9647f797d59222cd91507d4554bf62166ba88e0a':
  Implement malloc_usable_size for debug impls.
2013-06-07 15:16:30 -07:00
Christopher Ferris
885f3b9cad Implement malloc_usable_size for debug impls.
- Implemented chk_memalign.
- Fixed a few bugs in leak_memalign.
- Implemented {leak,fill,check,qemu}_malloc_usable_size.
- Make malloc_usable_size update at run time.
- Add malloc_test.cpp as a small set of tests for the
  malloc debug routines.
- Fix the qemu routines since it's been broken since it moved to C++.
- Add support for the %u format to the out_vformat in libc_logging.cpp.
  This is used by the emulator code.

Tested using the bionic-unit-tests with setprop libc.debug.malloc
set to 1, 5, and 10.

I tested as much as possible on the emulator, but tracing doesn't appear
to be working properly.

Bug: 6143477

Merge change from internal master.

(cherry-picked from commit 3d594c2580)

Change-Id: I4ae00fffba82315a8c283f35893fd554460722fb
2013-06-07 14:55:32 -07:00
Elliott Hughes
e84cfbefd8 am b7b4f5b8: Merge "update signal.h to be C90 compatable"
* commit 'b7b4f5b838cd41407c734af74e8211f5c7da0036':
  update signal.h to be C90 compatable
2013-06-05 18:09:17 -07:00
Elliott Hughes
5a6a0a9445 am 18af4503: Merge "Ensure header files using __BEGIN_DECLS include sys/cdefs.h."
* commit '18af450393b005b4ead896d82cda750e6876fd33':
  Ensure header files using __BEGIN_DECLS include sys/cdefs.h.
2013-06-05 18:06:04 -07:00
Erik Gilling
156ccf42ff update signal.h to be C90 compatable
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>
2013-06-05 18:05:36 -07:00
Elliott Hughes
36fa67bcdd Ensure header files using __BEGIN_DECLS include sys/cdefs.h.
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
2013-06-05 17:58:08 -07:00
Elliott Hughes
b9e2dae427 am c5bfb624: Merge "sys/personality.h: include <sys/cdefs.h>"
* commit 'c5bfb62433751579e86d5fd24cddf3ae28a49b43':
  sys/personality.h: include <sys/cdefs.h>
2013-06-05 17:29:01 -07:00
Elliott Hughes
c5bfb62433 Merge "sys/personality.h: include <sys/cdefs.h>" 2013-06-06 00:28:07 +00:00
Elliott Hughes
ce208f3389 am 8d36050a: Merge "Clean up useless declaration in thread_private.h"
* commit '8d36050ac2bb1c4a6a04462e64c5440e3c23c9f0':
  Clean up useless declaration in thread_private.h
2013-06-05 17:02:29 -07:00
Kito Cheng
328223230b sys/personality.h: include <sys/cdefs.h>
Change-Id: Ia3fa558a38e0cffe5287bc454e85d5d3bdaa6ba1
2013-06-05 11:30:17 +08:00
Kito Cheng
94d0daa2dd Clean up useless declaration in thread_private.h
Change-Id: Ie7bcdc7195a3fcbcd09a95f73b0c49e8897ad50b
2013-06-05 11:26:24 +08:00
Elliott Hughes
4b47d9f978 am 4c001859: Merge "Fix declaration of malloc_usable_size()"
* commit '4c001859feeda27727917c5bd00338e90b801742':
  Fix declaration of malloc_usable_size()
2013-06-04 19:00:03 -07:00
Elliott Hughes
4c001859fe Merge "Fix declaration of malloc_usable_size()" 2013-06-05 01:58:26 +00:00
Ben Cheng
72ce296f28 am 404d491e: Merge "Use bl instead of blx to support interworking properly."
* commit '404d491eb655839bf4260cc168bb79864473e129':
  Use bl instead of blx to support interworking properly.
2013-06-01 08:19:07 -07:00
Ben Cheng
a123b5d319 Use bl instead of blx to support interworking properly.
(cherry picked from commit 9e1905794b in
master)

Change-Id: I9b8c35ea9e201e00f84315f9f105013c23c94d85
2013-05-31 14:39:23 -07:00
Nick Kralevich
027a8fae77 am 8539961f: Merge "FORTIFY_SOURCE: strcat / strncat optimize"
* commit '8539961ff299b05d8feac9be8b119698be22da03':
  FORTIFY_SOURCE: strcat / strncat optimize
2013-05-31 11:14:56 -07:00
Nick Kralevich
cf870199d5 FORTIFY_SOURCE: strcat / strncat optimize
__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
2013-05-31 09:07:46 -07:00
Liubov Dmitrieva
0a490665a3 bionic/x86: Optimization for string routines
Optimized strcpy, strcat,
strncpy, strncat, strlcpy, strlcat,
memchr, memrchr, strchr, strrchr, index,
strnlen, strlen, wcslen, wmemcmp, wcscmp,
wcschr, wcsrchr, wcscpy, wcscat

Change-Id: I82b29132edf9a2e144e0bb3ee4ff5217df8d2a6d
Signed-off-by: Liubov Dmitrieva <liubov.dmitrieva@intel.com>
2013-05-31 13:37:03 +04:00
Nick Kralevich
5630e54c3b am d515f468: Merge "libc x86: Remove strcat.S"
* commit 'd515f46888cf381c1fbbc99a62be727174b30a23':
  libc x86: Remove strcat.S
2013-05-30 16:54:18 -07:00
Nick Kralevich
4fe461b3a6 libc x86: Remove strcat.S
This file is never used.

Change-Id: Iae4bba4a5a12a86a775af05e7477fb7b6511480b
2013-05-30 11:15:40 -07:00
Nick Kralevich
cf34265338 am 8d79fd1c: Merge "libc x86: Remove index.S, strcpy.S, strchr.S"
* commit '8d79fd1c94cb021b6852e6f44e27183ec83fe04c':
  libc x86: Remove index.S, strcpy.S, strchr.S
2013-05-24 11:37:30 -07:00
Nick Kralevich
e4c4ada580 libc x86: Remove index.S, strcpy.S, strchr.S
These files are never used.

Change-Id: Iab8474bdff3bd4d225597c62b3c0f0849f808818
2013-05-24 10:50:05 -07:00
Nick Kralevich
080d2aa8dc am 2317275f: Merge "libc: delete x86 memchr.S"
* commit '2317275f859a685386889139855f2f3314337d53':
  libc: delete x86 memchr.S
2013-05-24 10:43:58 -07:00
Nick Kralevich
615684c256 libc: delete x86 memchr.S
This file is never used.

Change-Id: Ief08ad176713b5194048852609613801969e1364
2013-05-24 08:52:04 -07:00
David 'Digit' Turner
25a87f7641 Fix declaration of malloc_usable_size()
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
2013-05-23 10:02:02 +02:00
Erik Gilling
4c8eba6f2a am 2e317075: Merge "libc/arm: add cortex-a8 cpu variant"
* commit '2e317075b044e94fc75e36d08bec8a7eb5fc31ae':
  libc/arm: add cortex-a8 cpu variant
2013-05-16 13:19:07 -07:00
Rom Lemarchand
22bda4bd67 libc/arm: add cortex-a8 cpu variant
Change-Id: I30e8dd6d4b2e7889aea8f5ed21182a5941bfb489
2013-05-15 20:13:28 -07:00
Elliott Hughes
0a7fe99153 am 5217fb52: Merge "Fix sysconf(3) for _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX."
* commit '5217fb528ca40ece0dbb459dedf7d6fae81dde68':
  Fix sysconf(3) for _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX.
2013-05-14 18:10:45 -07:00
Elliott Hughes
d35106fd55 Fix sysconf(3) for _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX.
Change-Id: Ie16cb21c1a5a2bdce8502b5974e2c4dbb1d679ce
2013-05-14 17:20:34 -07:00
Elliott Hughes
975d4464ce am 6f502bc7: Merge "Add more __restricts, clean up __format__ attributes."
* commit '6f502bc74374804766639e6b1515644875810bda':
  Add more __restricts, clean up __format__ attributes.
2013-05-14 16:56:49 -07:00
Elliott Hughes
20516923f5 am 349ef893: Merge "Pull upstream FreeBSD revision 249810."
* commit '349ef893e82f37632a705f39efc47c0d440f63c7':
  Pull upstream FreeBSD revision 249810.
2013-05-14 16:25:49 -07:00
Elliott Hughes
d04c183979 Add more __restricts, clean up __format__ attributes.
Change-Id: I7e2d270cc722d339d221eaea92747eaff3b51403
2013-05-14 16:08:43 -07:00
Elliott Hughes
b2e1abda05 Pull upstream FreeBSD revision 249810.
Fix license clause numbering.

Convert libc/stdio from K&R to ANSI C.

And add '__restrict' where it appeared in the header prototypes.

Change-Id: I5fdb22f79d3effa2298d03f9aa8412b4b087da04
Upstream: http://svnweb.freebsd.org/base?view=revision&revision=249810
2013-05-14 15:02:16 -07:00
Elliott Hughes
01678789bc am 5b7b2809: Merge "epoll: add EPOLLRDHUP, EPOLLWAKEUP, and EPOLLONESHOT events"
* commit '5b7b2809a2110dad1b2434f1070e13a08085d94b':
  epoll: add EPOLLRDHUP, EPOLLWAKEUP, and EPOLLONESHOT events
2013-05-14 14:59:16 -07:00
Elliott Hughes
562804ff87 am f0f4fa3f: Merge "libc: add timerfd calls"
* commit 'f0f4fa3fb1ea8623b1e1bc59f7967e0470c8e532':
  libc: add timerfd calls
2013-05-14 14:59:16 -07:00
Elliott Hughes
3136623600 am e1c58ab5: Merge "libc: remove obsolete CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR"
* commit 'e1c58ab5bb6284b3e3a2d0e54c295a93780b3f70':
  libc: remove obsolete CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR
2013-05-14 14:59:15 -07:00
Elliott Hughes
91cc8014e8 am 7cb82791: Merge "libc: add clock ids CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM"
* commit '7cb82791cada0283648fedc316171cbffda79af7':
  libc: add clock ids CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM
2013-05-14 14:59:15 -07:00
Todd Poynor
b0a2fc35d6 epoll: add EPOLLRDHUP, EPOLLWAKEUP, and EPOLLONESHOT events
(cherry-pick of d1ad4f6dab06189d4d3dcfa19ae4bc301481eb3f.)

Change-Id: I4a8476bff068951533d4188de94097c8b84bc489
2013-05-14 14:48:43 -07:00
Todd Poynor
4200e6203a libc: add timerfd calls
(cherry-pick of 04c0ac14a49e0969333008a9522b64046d58fbdc.)

Change-Id: I06d0b6c2a8781602362b81f48faf1cca76b9ec05
2013-05-14 14:45:02 -07:00
Todd Poynor
5c4340b2ab libc: remove obsolete CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR
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
2013-05-14 14:43:59 -07:00
Todd Poynor
23b9fd2c1d libc: add clock ids CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM
(cherry-pick of b928bda83d4413b703329f607e2706602f15293f.)

Change-Id: Ica6aad84299819ffc5e57ae4891e057d2e401fa1
2013-05-14 14:43:09 -07:00
Elliott Hughes
509fc80697 am d8a9cccb: Merge "Fix all printf warnings in res_send.c."
* commit 'd8a9cccb4d77eecc36425c9240a12bd305031ee3':
  Fix all printf warnings in res_send.c.
2013-05-14 11:10:23 -07:00
Kito Cheng
bb0b09cad6 Fix all printf warnings in res_send.c.
Change-Id: I4bf959140b5a5475897bd80704e64e3c4645fc3f
2013-05-14 10:09:23 -07:00
Ben Cheng
49f6e97062 am ff220f70: Merge "Remove a spurious FIXME and unnecessary type cast."
* commit 'ff220f70036178aa0d7dcf1cbc4825085a84441e':
  Remove a spurious FIXME and unnecessary type cast.
2013-05-08 13:26:12 -07:00
Ben Cheng
3353e6535a am b9256ada: Merge "Adjust PC value in ARM stack trace."
* commit 'b9256adab3aa7e7628d7bbd015132a511de7a43d':
  Adjust PC value in ARM stack trace.
2013-05-08 13:26:11 -07:00
Nick Kralevich
37cd8800d5 am d541ba17: Merge "Use restrict pointers for various libc functions."
* commit 'd541ba17197fd3ef1f60462e51261c4340369218':
  Use restrict pointers for various libc functions.
2013-05-08 13:26:11 -07:00
Ben Cheng
63dd03cced Remove a spurious FIXME and unnecessary type cast.
Change-Id: I05dcefdec7f047bef7eef5c5ceb7453992d56c24
2013-05-07 16:53:33 -07:00
Ben Cheng
52171b9bdc Adjust PC value in ARM stack trace.
-2 for Thumb BLX(2) or -4 for the rest.

Change-Id: I804fdabfa1db4709bede222d4b432e8d42d53167
2013-05-07 15:44:13 -07:00
Nick Kralevich
1c462b7a04 Use restrict pointers for various libc functions.
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
2013-05-07 10:00:21 -07:00
Nick Kralevich
c9757ac81e am b01f7afd: Merge "Use __predict_false on some fortify methods."
* commit 'b01f7afd5fd5df5f8fe925b4fe493269191b62a2':
  Use __predict_false on some fortify methods.
2013-05-02 14:56:37 -07:00
Nick Kralevich
532d6f09b1 Use __predict_false on some fortify methods.
Give the compiler some hints that these error conditions
are unlikely to occur in practice.

Change-Id: Ifaf7322a12120ef663c8315c1a18c2dcbe4bda23
2013-05-02 14:31:51 -07:00
Nick Kralevich
4f614a7036 am e4ac8feb: Merge "libc: cleanup strchr"
* commit 'e4ac8feb58ed1f963db9a1f32fa74a06a1f594f2':
  libc: cleanup strchr
2013-05-02 14:25:42 -07:00
Nick Kralevich
4f40e511b0 libc: cleanup strchr
Move strchr to a .cpp file, and change to bionic directory.

Change-Id: I64ade7df326c0a9a714aca4caf5647b6833b1c97
2013-05-02 13:58:03 -07:00
Nick Kralevich
8355ab5524 am bee0ab16: Merge "libc: upgrade strrchr to FORTIFY_SOURCE=2"
* commit 'bee0ab16e47086d2f31f6f9ff41328066d5a7128':
  libc: upgrade strrchr to FORTIFY_SOURCE=2
2013-04-30 16:25:23 -07:00
Nick Kralevich
3b2e6bc9ac libc: upgrade strrchr to FORTIFY_SOURCE=2
Change-Id: I4c34c2ce22c5092c4446dc1ab55f37604c1c223f
2013-04-30 14:19:23 -07:00
Nick Kralevich
2ff94a0964 am c4687130: Merge "libc: upgrade some libc functions to _FORTIFY_SOURCE=2"
* commit 'c46871302e7bd099aaf54d91da93a2248acbf733':
  libc: upgrade some libc functions to _FORTIFY_SOURCE=2
2013-04-30 11:56:08 -07:00
Nick Kralevich
9020fd503c libc: upgrade some libc functions to _FORTIFY_SOURCE=2
Upgrade the following functions:

* vsnprintf
* vsprintf
* snprintf
* fgets
* strcpy
* strcat
* strncat
* strlcpy
* strlcat
* strlen
* strchr

Change-Id: Icc036fc7f0bb317e05f7c051617887a1601271aa
2013-04-30 11:31:35 -07:00
Nick Kralevich
aed0c3ac54 am b94b2851: Merge "libc: upgrade sprintf to _FORTIFY_SOURCE=2"
* commit 'b94b2851d72187cc9095864a9c99429ee62d7786':
  libc: upgrade sprintf to _FORTIFY_SOURCE=2
2013-04-29 16:56:29 -07:00
Nick Kralevich
78d6d9888c libc: upgrade sprintf to _FORTIFY_SOURCE=2
Upgrade sprintf to fortify_source level 2, to catch
additional security bugs.

Change-Id: Ibc957d65e4cb96152de84b3745a04e00fa22659e
2013-04-29 16:41:54 -07:00
Nick Kralevich
56a1b492c4 am 382a7753: Merge "strncpy: implement _FORTIFY_SOURCE=2"
* commit '382a7753786646483a8101f4e337f9e3a82ec852':
  strncpy: implement _FORTIFY_SOURCE=2
2013-04-29 16:25:41 -07:00
Nick Kralevich
1aae9bd170 strncpy: implement _FORTIFY_SOURCE=2
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
2013-04-29 15:22:10 -07:00
Nick Kralevich
89357dc730 am c6dc62f0: Merge "[NETFILTER]: Fix iptables ABI breakage"
* commit 'c6dc62f09c814b9688aee83e80dcfe80cb0ef604':
  [NETFILTER]: Fix iptables ABI breakage
2013-04-29 12:51:35 -07:00