Commit Graph

2470 Commits

Author SHA1 Message Date
Elliott Hughes
7b4d77e400 Make abort messages available to debuggerd.
This adds __libc_fatal, cleans up the internal logging code a bit more,
and switches suitable callers over to __libc_fatal. In addition to logging,
__libc_fatal stashes the message somewhere that the debuggerd signal handler
can find it before calling abort.

In the debuggerd signal handler, we pass this address to debuggerd so that
it can come back with ptrace to read the message and present it to the user.

Bug: 8531731

(cherry picked from commit 0d787c1fa1)

Change-Id: I5daeeaa36c1fc23f7f437d73a19808d9d558dd4d
2013-04-05 15:57:53 -07:00
Kito Cheng
9b84824dfd Prevent name conflict for eventfd.cpp and eventfd.s when building libc.a
- 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.

(cherry-pick of 8baa929d5d3bcf63381cf78ba76168c80c303f5e.)

Change-Id: Icd0eb0f4ce0511fb9ec00a504d491afd47d744d3
2013-04-03 11:14:20 -07:00
Elliott Hughes
a69103ffe4 Fix the SYSCALLS.TXT documentation and remove a dead script.
We use the system call constants from the kernel header files now,
so there's no need to check that they've been correctly transcribed
into SYSCALLS.TXT.

This is a work in progress. I've added TODOs to SYSCALLS.TXT explaining
what's left to do.

(cherry-pick of a51916b58b2d211bcf8ffdbe9cf7faa58e57382f.)

Change-Id: I4484acd946b1f548ac3d95327e58add9f98246ab
2013-04-03 11:13:31 -07:00
Elliott Hughes
1fe1137576 Stop using unreasonable numbers of map entries.
(cherry-pick of 4ace92c62ada583b220836d76de2cfcb78d4d48d.)

Bug: 8460659
Change-Id: I1a9dc30cbf6a7a2c68cb3d8000921e9178eedb85
2013-04-02 17:48:35 -07:00
Lorenzo Colitti
309e107f01 Merge "Update getaddrinfo to RFC6724" into jb-mr2-dev 2013-04-02 00:49:29 +00:00
Lorenzo Colitti
e919b116d3 Update getaddrinfo to RFC6724
Currently, our getaddrinfo implementation does not conform to
any IETF standard. It follows draft-ietf-6man-rfc3484-revise-01,
but that draft has expired. Update the policy table to RFC6724.

Bug: 8276725
Change-Id: I03c63abfcad9b2f3a3bab2718bd2fc6440531843
2013-04-01 19:15:43 +09:00
Elliott Hughes
96449b3dc1 Extra logging in pthread_create.
pthread_create returns EAGAIN when it can't allocate a pthread_internal_t,
when it can't allocate a stack for the new thread, or when clone(2) fails
because there are too many threads. It's useful to be able to know why your
pthread_create just failed, so add some logging.

Bug: 8470684

(cherry picked from commit cfa089df23)

Change-Id: Ibfc98a84c1817a931f9ae4c2b88762f0edfb6b79
2013-03-29 16:58:33 -07:00
Nick Kralevich
c01274c4aa resolv_cache: hide some libc private functions
Don't export unnecessary symbols to third party apps.

Bug: 8401049
Change-Id: Ide5abd6ed13e756a85bd1277d93da74d1419addb
2013-03-29 13:56:05 -07:00
Ken Sumrall
887049e46b Merge "Update processed linux/fs.h header file" into jb-mr2-dev 2013-03-27 21:15:29 +00:00
Elliott Hughes
da2c158645 am 8a6abe38: am bd014c2e: Merge "Remove some dead script code and fix a script comment."
* commit '8a6abe380d2ba513bb714e54a74f4289089cbc18':
  Remove some dead script code and fix a script comment.
2013-03-25 14:36:24 -07:00
Elliott Hughes
8a6abe380d am bd014c2e: Merge "Remove some dead script code and fix a script comment."
* commit 'bd014c2e4246d6e64a6523c73b9a72f379255526':
  Remove some dead script code and fix a script comment.
2013-03-25 14:34:06 -07:00
Elliott Hughes
e6ddfc55c8 Remove some dead script code and fix a script comment.
Change-Id: I91ca466d1b6f8a39da50ce61acebc268d0daab3a
2013-03-25 14:09:52 -07:00
Elliott Hughes
999dff0ef3 am a850ad4c: am e51d75a9: Merge "Clarify the dlmalloc USAGE_ERROR."
* commit 'a850ad4cf44e998e24f43df723b6928e42f8294d':
  Clarify the dlmalloc USAGE_ERROR.
2013-03-25 14:05:54 -07:00
Elliott Hughes
a850ad4cf4 am e51d75a9: Merge "Clarify the dlmalloc USAGE_ERROR."
* commit 'e51d75a9acef86008f4d64cf482bbc65e24dc66c':
  Clarify the dlmalloc USAGE_ERROR.
2013-03-25 14:03:38 -07:00
Elliott Hughes
65a8eb606f Clarify the dlmalloc USAGE_ERROR.
Bug: 8468088
Change-Id: I1ff6d51ec17fc74ef56229aa76d2986cbd662874
2013-03-25 13:48:41 -07:00
Dima Zavin
369f92349f Merge "libc/arm: add cortex-a7 cpu variant" into jb-mr2-dev 2013-03-25 19:42:28 +00:00
Elliott Hughes
c82b339a7d am 3c1504d9: am 48f25cef: Merge "Stop generating <sys/linux-syscalls.h>."
* commit '3c1504d9d7d529b8281a447dc69af3ecf6b5ec83':
  Stop generating <sys/linux-syscalls.h>.
2013-03-25 10:24:42 -07:00
Elliott Hughes
9386a33ea0 am 93f3811b: am a4075118: Merge "Unhide __set_errno for backwards compatibility."
* commit '93f3811b744b2100d0f259916876965c242cd3d9':
  Unhide __set_errno for backwards compatibility.
2013-03-25 10:24:42 -07:00
Elliott Hughes
3c1504d9d7 am 48f25cef: Merge "Stop generating <sys/linux-syscalls.h>."
* commit '48f25cef45f8f68567d528a5d833ed45cb760bec':
  Stop generating <sys/linux-syscalls.h>.
2013-03-25 10:22:43 -07:00
Elliott Hughes
93f3811b74 am a4075118: Merge "Unhide __set_errno for backwards compatibility."
* commit 'a40751185f3a7245f73afb45382c23f71dbbcfc3':
  Unhide __set_errno for backwards compatibility.
2013-03-25 10:22:43 -07:00
Elliott Hughes
48f25cef45 Merge "Stop generating <sys/linux-syscalls.h>." 2013-03-25 17:13:26 +00:00
Dima Zavin
0c973d7049 libc/arm: add cortex-a7 cpu variant
Change-Id: I541d665805ea69ca96bb6a5f4d50e56287f8c08c
Signed-off-by: Dima Zavin <dima@android.com>
2013-03-23 01:38:22 -07:00
Elliott Hughes
3198850ea1 Unhide __set_errno for backwards compatibility.
This was in <errno.h>, and people called it :-(

Change-Id: I038490be77eb9372b3f31305ec580fa7b09c983e
2013-03-22 19:12:52 -07:00
Elliott Hughes
1b91c6c11f Stop generating <sys/linux-syscalls.h>.
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
2013-03-22 18:56:24 -07:00
Elliott Hughes
ba61bb55c4 am a3fe475c: am c019345a: Merge "Use the correct names for the __ARM_NR_* syscalls."
* commit 'a3fe475c9ff444f45eb3c4dd7fd462326dfdb13d':
  Use the correct names for the __ARM_NR_* syscalls.
2013-03-22 15:09:13 -07:00
Elliott Hughes
a3fe475c9f am c019345a: Merge "Use the correct names for the __ARM_NR_* syscalls."
* commit 'c019345a3a0f3ee8561e595917b75d6419ee4cc8':
  Use the correct names for the __ARM_NR_* syscalls.
2013-03-22 15:07:06 -07:00
Elliott Hughes
cda62094ef Use the correct names for the __ARM_NR_* syscalls.
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
2013-03-22 13:53:43 -07:00
Elliott Hughes
e0e5b2f6e7 am 65163750: am c37dd599: Merge "Fix builds where _FORTIFY_SOURCE is off."
* commit '65163750b11c814d6a75940ab1ede1e907b14d81':
  Fix builds where _FORTIFY_SOURCE is off.
2013-03-22 11:20:22 -07:00
Elliott Hughes
65163750b1 am c37dd599: Merge "Fix builds where _FORTIFY_SOURCE is off."
* commit 'c37dd599561ac07a895bc435d818f000054a498d':
  Fix builds where _FORTIFY_SOURCE is off.
2013-03-22 11:18:26 -07:00
Elliott Hughes
b826ebf41e am 85598626: am 34895c1b: Merge "Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit '85598626f4ca7914d996371ce0471ab154aa7585':
  Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 11:11:34 -07:00
Elliott Hughes
85598626f4 am 34895c1b: Merge "Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit '34895c1bdfa5df48ee9a7b4368b6def403f24cf1':
  Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 10:59:57 -07:00
Elliott Hughes
890c8ed6ef Fix builds where _FORTIFY_SOURCE is off.
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
2013-03-22 10:58:55 -07:00
Elliott Hughes
34895c1bdf Merge "Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>." 2013-03-22 17:51:43 +00:00
Elliott Hughes
b44f9600a3 am b80a05fa: am 5c5f303e: Merge "Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit 'b80a05fa678b287f46dc596353d285a9a7d09fbc':
  Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:43:28 -07:00
Elliott Hughes
a0dcecc53e am bc0d7f73: am e7cb795c: Merge "Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit 'bc0d7f736c2c66868844f2b5c9e6507d3e7a7982':
  Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:43:28 -07:00
Elliott Hughes
b80a05fa67 am 5c5f303e: Merge "Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit '5c5f303e4c661a71ae8e4c7fd99fc7674360321e':
  Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:41:46 -07:00
Elliott Hughes
bc0d7f736c am e7cb795c: Merge "Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>."
* commit 'e7cb795cb639ef4e04b0417ebf4b16b12ea5dc4e':
  Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
2013-03-22 09:41:46 -07:00
Elliott Hughes
5c5f303e4c Merge "Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>." 2013-03-22 16:30:56 +00:00
Ken Sumrall
d74a0ffba8 Update processed linux/fs.h header file
Need to get the defintion of the FITRIM ioctl().  Also need
to update the blk_types.h header file as fs.h includes it.

Change-Id: I617622b620925942dc5aead9e49f8e17d17e5d74
2013-03-22 02:12:46 -07:00
Elliott Hughes
8794ece296 Replace unnecessary ARM uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
For some reason, socketcalls.c was only being compiled for ARM, where
it makes no sense. For x86 we generate stubs for the socket functions
that use __NR_socketcall directly.

Change-Id: I84181e6183fae2314ae3ed862276eba82ad21e8e
2013-03-21 23:07:11 -07:00
Elliott Hughes
ddda044a81 am 5686bb30: am 3323628d: Merge "The SYS_ constants should cover all __NR_ values."
* commit '5686bb300304f5de0597f356c6da72b8a090a647':
  The SYS_ constants should cover all __NR_ values.
2013-03-21 22:54:49 -07:00
Elliott Hughes
5686bb3003 am 3323628d: Merge "The SYS_ constants should cover all __NR_ values."
* commit '3323628d635d3973965ee458c1fee7d8ab45136f':
  The SYS_ constants should cover all __NR_ values.
2013-03-21 22:53:44 -07:00
Elliott Hughes
56d161bb62 Replace unnecessary MIPS uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
Change-Id: I193a35f9790b82c83fd3b5672e24ac1b2034d0b0
2013-03-21 22:52:25 -07:00
Elliott Hughes
4cdde5f123 Replace unnecessary x86 uses of <sys/linux-syscalls.h> with <asm/unistd.h>.
Change-Id: I9d016ee8e8329cccf244d27c336d9524348af996
2013-03-21 22:48:18 -07:00
Elliott Hughes
5c2772f59d The SYS_ constants should cover all __NR_ values.
<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
2013-03-21 22:26:20 -07:00
Elliott Hughes
c8ded7c6b1 am a3167257: am babb72dc: Merge "Fix pthread_setname_np\'s behavior on invalid pthread_ts."
* commit 'a316725740ac123de65e225f5bfbf99450f66e6b':
  Fix pthread_setname_np's behavior on invalid pthread_ts.
2013-03-21 22:22:49 -07:00
Elliott Hughes
a316725740 am babb72dc: Merge "Fix pthread_setname_np\'s behavior on invalid pthread_ts."
* commit 'babb72dc292a567674f6d7d2ccf7f63edaf77b80':
  Fix pthread_setname_np's behavior on invalid pthread_ts.
2013-03-21 22:20:53 -07:00
Elliott Hughes
a41ba2f0bf Fix pthread_setname_np's behavior on invalid pthread_ts.
Change-Id: I0a154beaab4d164ac812f2564d12e4d79b80a8e8
2013-03-21 20:02:35 -07:00
Elliott Hughes
1e40ace49e am a596aa6a: am 26c815c4: Merge "Drop magic number in strrchr and strchr"
* commit 'a596aa6abfdd8ecdb4bcdd9bcad24a19adcf7525':
  Drop magic number in strrchr and strchr
2013-03-21 19:58:23 -07:00
Elliott Hughes
17a0d1915f am 01c0e19e: am 612333f6: Merge "Don\'t #define SYS_ constants unless they make sense for the current architecture."
* commit '01c0e19e426df5620c5ca822ab546907dbf1fa7d':
  Don't #define SYS_ constants unless they make sense for the current architecture.
2013-03-21 19:58:22 -07:00