Commit Graph

5978 Commits

Author SHA1 Message Date
Patrick Tjin
a6a0949b1d Fix build error when XLOG is enabled
(cherrypick of 79a49c9857f3949fc13373eeb179f27b6ecdca81.)

Change-Id: I7bb44fd1fe3ef2ddfc115247f328eccfceeb5352
Signed-off-by: Patrick Tjin <pattjin@google.com>
2015-01-20 16:12:45 -08:00
Elliott Hughes
75b99387dd Optimized fread.
This makes us competitive with glibc for fully-buffered and unbuffered reads,
except in single-threaded situations where glibc avoids locking, but since
we're never really single-threaded anyway, that isn't a priority.

Bug: 18593728
Change-Id: Ib776bfba422ccf46209581fc0dc54f3567645b8f
2015-01-20 15:59:17 -08:00
Yabin Cui
b8679a84df am afb488a3: am 6fac2f68: Merge "Fix possible leak in pthread_detach."
* commit 'afb488a3e91c7ac297b4f91e9985fd10c09d6f81':
  Fix possible leak in pthread_detach.
2015-01-15 19:47:35 +00:00
Yabin Cui
19e246dda6 Fix possible leak in pthread_detach.
If pthread_detach() is called while the thread is in pthread_exit(),
it takes the risk that no one can free the pthread_internal_t.
So I add PTHREAD_ATTR_FLAG_ZOMBIE to detect this, maybe very rare, but
both glibc and netbsd libpthread have similar function.

Change-Id: Iaa15f651903b8ca07aaa7bd4de46ff14a2f93835
2015-01-15 10:45:25 -08:00
Andres Morales
6dcbe94239 am 740ac6fe: am 2b15f54a: Merge "bionic: libc: Added path to root ramdisk build properties file."
* commit '740ac6fe7358ac73643189bbe1b7a5e7c76142f3':
  bionic: libc: Added path to root ramdisk build properties file.
2015-01-14 16:05:28 +00:00
Elliott Hughes
7d640183f2 am 5bff8a23: am d986f2e4: Merge "Sync with upstream OpenBSD stdio."
* commit '5bff8a23379ea4034d3112ad5725e91e4b801d5a':
  Sync with upstream OpenBSD stdio.
2015-01-14 12:07:23 +00:00
Andres Morales
9d9ebc5fc9 bionic: libc: Added path to root ramdisk build properties file.
Change-Id: Id850e4e5ef4e91cea7ad53f6858886daf660eeec
2015-01-13 18:07:23 -08:00
Elliott Hughes
01abeacded Sync with upstream OpenBSD stdio.
Mainly to get the __atexit_register_cleanup removals we suggested.

Change-Id: I58d40b8c5b8401bfb6bfffe8f3430ac0718af917
2015-01-13 17:19:21 -08:00
Yabin Cui
5631f47eb6 am 1217d9a3: am c80eb091: Merge "Clean up paths.h."
* commit '1217d9a3d13222f16978282d4488588bfe420233':
  Clean up paths.h.
2015-01-10 05:29:04 +00:00
Yabin Cui
3471fcbb6a Clean up paths.h.
Bug: 18905946
Change-Id: I02cd1ddd5c0b0af165685413bc1fb12ca6bf5f33
2015-01-09 20:04:04 -08:00
Dmitriy Ivanov
dde3d83a6f am 2e44e464: am 9c4783b1: Merge changes I713800ce,I1dea46c3
* commit '2e44e4649a5ebf00e7ab1bc5ff32f6bd79845347':
  Refactor soinfo::relocate
  Add ARM_IRELATIVE relocation
2015-01-09 23:55:42 +00:00
Dmitriy Ivanov
a137f53980 Add ARM_IRELATIVE relocation
Bug: 17399706
Change-Id: I1dea46c3a3c4572558e718283489c323794176c7
2015-01-08 22:22:27 -08:00
Elliott Hughes
857e112443 am e6594658: am 8623dc75: Merge "Fix freeaddrinfo(NULL)."
* commit 'e6594658f7d36172007a2573e345d6ae0d0ac58a':
  Fix freeaddrinfo(NULL).
2015-01-09 02:58:56 +00:00
Elliott Hughes
c62a4b5a7a Fix freeaddrinfo(NULL).
Bug: https://code.google.com/p/android/issues/detail?id=13228
Change-Id: I5e3b126d90d750a93ac0b8872198e50ba047e603
2015-01-08 17:28:46 -08:00
Yabin Cui
f4af806bb7 am 1ecafe3f: am 4c47fc4e: Merge "Make pthread stack size match real range."
* commit '1ecafe3feff42e9c7a171e6c865ae4a5df4f6284':
  Make pthread stack size match real range.
2015-01-08 23:07:22 +00:00
Yabin Cui
917d390510 Make pthread stack size match real range.
Bug: 18908062
Change-Id: I7037ac8273ebe54dd19b1561c7a376819049124c
2015-01-08 14:27:24 -08:00
Elliott Hughes
de97a518d7 am 6ed76e8c: am ac8f2810: Merge "_Unwind_Context is a struct."
* commit '6ed76e8c7d551ae8cf11de57a787169538370369':
  _Unwind_Context is a struct.
2015-01-07 03:15:06 +00:00
Elliott Hughes
ac8f281029 Merge "_Unwind_Context is a struct." 2015-01-07 02:59:26 +00:00
Elliott Hughes
30e59c4c69 _Unwind_Context is a struct.
Change-Id: Iff2c52dc630eb83b931a78fdebc4494d69462db7
2015-01-06 18:48:24 -08:00
Yabin Cui
023b5d1aa5 am 8e8daba1: am 8004f735: Merge "Remove PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK."
* commit '8e8daba18540fc7d5d11b6fb1d85234049086f29':
  Remove PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK.
2015-01-07 02:10:36 +00:00
Yabin Cui
8004f735f1 Merge "Remove PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK." 2015-01-07 01:28:40 +00:00
Yabin Cui
ba8dfc2669 Remove PTHREAD_ATTR_FLAG_USER_ALLOCATED_STACK.
Patch for https://android-review.googlesource.com/#/c/120844/.

Change-Id: Idca5ccd7b28e8f07f1d2d1b6e3bba6781b62f0e0
2015-01-06 17:11:23 -08:00
Elliott Hughes
d27ff239db am 9d8b7d1a: am d3de1dde: Merge "[MIPS64] Add correct mcontext_t for 64-bit MIPS"
* commit '9d8b7d1ac495b2cda848fd6a06088e5654b74ed6':
  [MIPS64] Add correct mcontext_t for 64-bit MIPS
2015-01-06 18:17:42 +00:00
Faraz Shahbazker
e247e1c89e [MIPS64] Add correct mcontext_t for 64-bit MIPS
Change-Id: I76d503860d0e1d937b6913bf2c1c6ebb531617da
2015-01-06 07:58:02 -08:00
Yabin Cui
473a0db7db am 745b236d: am 541b0b18: Merge "Reserve enough user request stack space in pthread_create."
* commit '745b236dc3bc935c1fb581c7f93c3464f2bb8216':
  Reserve enough user request stack space in pthread_create.
2015-01-02 22:48:06 +00:00
Yabin Cui
541b0b187d Merge "Reserve enough user request stack space in pthread_create." 2015-01-02 22:37:56 +00:00
Yabin Cui
6a7aaf4675 Reserve enough user request stack space in pthread_create.
Bug: 18830897
Change-Id: I1ba4aaeaf66a7ff99c5d82ad45469011171b0a3b
2015-01-02 14:33:48 -08:00
Elliott Hughes
db4fe34050 am 46987a94: am 9b6164ca: Merge "Remove bogus transitive includes."
* commit '46987a9490cfe8409ea73e94f36e7f0bb69e43de':
  Remove bogus transitive includes.
2014-12-30 12:21:08 +00:00
Elliott Hughes
40360b379c Remove bogus transitive includes.
<signal.h> shouldn't get you the contents of <errno.h>, and <fcntl.h>
shouldn't get you the contents of <unistd.h>.

Change-Id: I347499cd8671bfee98e6b8e875a97cab3a3655d3
2014-12-29 13:29:50 -08:00
Elliott Hughes
84715cbccb am 52a2df5f: am 0a552407: Merge "Ensure <fcntl.h> defines the S_* constants from <sys/stat.h>."
* commit '52a2df5f2ad445042b31ffef01d6a0fbf18d9a1a':
  Ensure <fcntl.h> defines the S_* constants from <sys/stat.h>.
2014-12-29 19:51:40 +00:00
Elliott Hughes
0a552407ad Merge "Ensure <fcntl.h> defines the S_* constants from <sys/stat.h>." 2014-12-29 19:40:45 +00:00
Elliott Hughes
64d8382394 Ensure <fcntl.h> defines the S_* constants from <sys/stat.h>.
POSIX says "The <fcntl.h> header shall define the symbolic constants for file
modes for use as values of mode_t as described in <sys/stat.h>".

Needed to build ToT strace.

Change-Id: Ia85a51ef6fd86a48084fe48ce24963000a937d37
2014-12-29 11:14:38 -08:00
Elliott Hughes
82e66a3d9d am cc107443: am 50e15a2e: Merge "Remove more BSD cruft from the public headers."
* commit 'cc1074431e46333671875345d4bb26b65fe96dd7':
  Remove more BSD cruft from the public headers.
2014-12-23 20:21:15 +00:00
Elliott Hughes
50e15a2ec7 Merge "Remove more BSD cruft from the public headers." 2014-12-23 20:14:52 +00:00
Elliott Hughes
77707a3d4f am d029db10: am ba09edcb: Merge "Fix nan output in the printf family."
* commit 'd029db10526c2091acfe940d7d008019a309c47c':
  Fix nan output in the printf family.
2014-12-21 06:30:39 +00:00
Elliott Hughes
ba09edcb41 Merge "Fix nan output in the printf family." 2014-12-21 02:54:06 +00:00
Elliott Hughes
1b18aff9ba Fix nan output in the printf family.
Bug: https://code.google.com/p/android/issues/detail?id=82452
Change-Id: I51f226c8b033de6e81baeea5e6db3de6ed196f73
2014-12-20 18:53:08 -08:00
Elliott Hughes
998f2d5a50 Remove more BSD cruft from the public headers.
Change-Id: I1e3097f745b526db448bf72fbc05fb2ba23929a0
2014-12-19 19:30:11 -08:00
Yabin Cui
598f86661d am e4d3161a: am 4c30fedf: Merge "Move gethtnamaddr.c to net/ subdirectory."
* commit 'e4d3161a84c0373d35f43f981559212a9ae44397':
  Move gethtnamaddr.c to net/ subdirectory.
2014-12-20 03:26:19 +00:00
Yabin Cui
a2177c6ccb Move gethtnamaddr.c to net/ subdirectory.
It may be the better place to stay.

Change-Id: I517cc2769f63e1873191768c4732907c14f2c60e
2014-12-19 17:29:04 -08:00
Yabin Cui
66870e1be5 am a62755ad: am 7e202e4e: Merge "Remove t->tls==NULL check in pthread_key_delete."
* commit 'a62755adba509a7cb295d1bc5f9d3447e3943c6a':
  Remove t->tls==NULL check in pthread_key_delete.
2014-12-20 00:51:30 +00:00
Yabin Cui
7e202e4eb1 Merge "Remove t->tls==NULL check in pthread_key_delete." 2014-12-20 00:44:41 +00:00
Yabin Cui
246bcb10b6 Remove t->tls==NULL check in pthread_key_delete.
Change-Id: I6c0c71d30fe9d5b888752a4204abd95d5149bb96
2014-12-19 16:31:03 -08:00
Yabin Cui
a15bd72cf0 am da2317ed: am cdc7ad11: Merge "Use mmap to create the pthread_internal_t"
* commit 'da2317edb36acdaa6a7bc49cef8deba2a42bfb15':
  Use mmap to create the pthread_internal_t
2014-12-20 00:19:25 +00:00
Yabin Cui
cdc7ad11e9 Merge "Use mmap to create the pthread_internal_t" 2014-12-20 00:10:38 +00:00
Yabin Cui
8cf1b30567 Use mmap to create the pthread_internal_t
Add name to mmaped regions.
Add pthread benchmark code.
Allocate pthread_internal_t on regular stack.

Bug: 16847284
Change-Id: Id60835163bb0d68092241f1a118015b5a8f85069
2014-12-19 16:05:29 -08:00
Yabin Cui
b695cb47c3 am be327941: am e28a1864: Merge "Support gethostbyname_r_ERANGE."
* commit 'be32794141e95ea5d65626bbf29be95b9d974d54':
  Support gethostbyname_r_ERANGE.
2014-12-19 23:02:51 +00:00
Yabin Cui
e28a186491 Merge "Support gethostbyname_r_ERANGE." 2014-12-19 22:53:26 +00:00
Yabin Cui
7069256495 Support gethostbyname_r_ERANGE.
Bug: 18802601
Change-Id: Iaa64921e96f91e330f1845c5399ee8aba39d9c10
2014-12-19 14:11:29 -08:00
Dimitry Ivanov
7544631ef6 am c692d3e5: am db314648: Merge "Add support for DT_MIPS_RLD_MAP2 tag."
* commit 'c692d3e50a3af788e9294769fca33e29eb91b139':
  Add support for DT_MIPS_RLD_MAP2 tag.
2014-12-19 21:26:04 +00:00
Raghu Gandham
688157295f Add support for DT_MIPS_RLD_MAP2 tag.
Position Independent Executables cannot communicate with GDB using DT_MIPS_RLD_TAG.
Hence a new tag DT_MIPS_RLD_MAP2 got introduced to fix the issue.

Change-Id: I77ce3faf1ef2e121003b804ecd291abb25cfbb56
Signed-off-by: Nikola Veljkovic<Nikola.Veljkovic@imgtec.com>
2014-12-19 11:13:11 -08:00
Elliott Hughes
a5359bb11a am c400e072: am 7eb9b6c5: Merge "Update bionic NOTICE files."
* commit 'c400e072db8dca8710298bf138c86e30c7b47991':
  Update bionic NOTICE files.
2014-12-19 03:52:15 +00:00
Elliott Hughes
6b2b5856d9 Update bionic NOTICE files.
Change-Id: Ic280872ef3137febd9d4a87d5c7662e264692071
2014-12-18 16:27:30 -08:00
Elliott Hughes
649386ae1a am a5193f2f: am c631bb21: Merge "Fix the types of some of the struct stat fields."
* commit 'a5193f2ffe39ff88f27ffb34a6967e023cb3daee':
  Fix the types of some of the struct stat fields.
2014-12-18 23:45:30 +00:00
Elliott Hughes
c631bb215e Merge "Fix the types of some of the struct stat fields." 2014-12-18 23:38:26 +00:00
Elliott Hughes
3801189b58 am 7cff30c7: am b7f0693a: Merge "Remove bogus #include <endian.h> from <sys/stat.h>."
* commit '7cff30c7c67454e5b0f97c0dcc6261c73ae664c8':
  Remove bogus #include <endian.h> from <sys/stat.h>.
2014-12-18 23:35:21 +00:00
Elliott Hughes
53544f5af6 am 7d4d2297: am 8597c2b3: Merge "Split the shared group data from the shared passwd data."
* commit '7d4d2297856106f132283c4e501b7210fc7b0bd8':
  Split the shared group data from the shared passwd data.
2014-12-18 23:35:20 +00:00
Elliott Hughes
28bba7b488 am e14086a8: am a9c940a6: Merge "Fix struct stat member types for x86-64."
* commit 'e14086a8fc137c9900ad895556710385fc423e10':
  Fix struct stat member types for x86-64.
2014-12-18 23:35:18 +00:00
Elliott Hughes
b7f0693aaa Merge "Remove bogus #include <endian.h> from <sys/stat.h>." 2014-12-18 23:24:26 +00:00
Elliott Hughes
9257c477ae Fix the types of some of the struct stat fields.
Bug: 17062519
Change-Id: I5207867939f3c2876bf6448e565fa4364aa7e4f0
2014-12-18 15:17:42 -08:00
Elliott Hughes
8597c2b3f2 Merge "Split the shared group data from the shared passwd data." 2014-12-18 23:12:45 +00:00
Elliott Hughes
0c92e8c3d1 Remove bogus #include <endian.h> from <sys/stat.h>.
Bug: 17062519
Change-Id: I3dc21ee8b90580f112c73c72aff5d3bec4778026
2014-12-18 15:10:19 -08:00
Elliott Hughes
1c52e6c926 Fix struct stat member types for x86-64.
Bug: 17062519
Change-Id: I93b1e8b1d4b6918ab7c3a985e2f7da277077375e
2014-12-18 15:03:33 -08:00
Elliott Hughes
7874f1d718 Split the shared group data from the shared passwd data.
Found by the toybox id(1) which calls both getpwuid(3) and getgrgid(3) before
looking at either result. The use of a shared buffer in this code meant that
even on a single thread, the data for any of the passwd functions would be
clobbered by the data for any of the group functions (or vice versa).

This might seem like an insufficient fix, but POSIX explicitly says (for
getpwnam) that the result "might be overwritten by a subsequent call to
getpwent(), getpwnam(), or getpwuid()" and likewise for other members of
that group, plus equivalent text for the group-related functions.

Change-Id: I2272f47e91f72e043fdaf7c169fa9f6978ff4370
2014-12-18 15:01:10 -08:00
Yabin Cui
858e239094 am 9a734138: am 370a3e57: Merge "Sync with upstream for gethnamaddr.c."
* commit '9a734138138fcde0a2f0935e86246b9d7ff0ccb1':
  Sync with upstream for gethnamaddr.c.
2014-12-18 21:49:52 +00:00
Yabin Cui
370a3e573d Merge "Sync with upstream for gethnamaddr.c." 2014-12-18 01:06:10 +00:00
Yabin Cui
58d33a51f3 Sync with upstream for gethnamaddr.c.
Bug: 18566967
Change-Id: I37e7410226b49eec67614e20b2c1d5e3e47817a5
2014-12-17 16:19:27 -08:00
Elliott Hughes
50b6dc34f1 am 48bc703a: am 3a50b65f: Merge "Fix <net/route.h>."
* commit '48bc703a3c30512f06f65f2660ed9d2841b0acce':
  Fix <net/route.h>.
2014-12-16 20:35:01 +00:00
Elliott Hughes
3a50b65fd1 Merge "Fix <net/route.h>." 2014-12-16 16:53:25 +00:00
Elliott Hughes
badd7e1a58 Fix <net/route.h>.
Previously it couldn't be included alone. Also add a header and include guard,
and fix its siblings' include guards.

Bug: https://code.google.com/p/android/issues/detail?id=82638
Change-Id: I32139a4bda0a6b015508a2319bf4e1a1453345f2
2014-12-15 18:47:14 -08:00
Elliott Hughes
63978deca9 am 7de05306: am 16ea2790: Merge "Move the generic arm memcmp.S into the generic directory."
* commit '7de05306c6f3b3077b025d5dd3eade2f125535d5':
  Move the generic arm memcmp.S into the generic directory.
2014-12-15 21:32:11 +00:00
Elliott Hughes
c45b108deb am a2bfb531: am ad01c983: Merge "Remove arm assembler not referenced from any makefile."
* commit 'a2bfb53107a7b770e9ad93287be5745271067786':
  Remove arm assembler not referenced from any makefile.
2014-12-15 19:27:20 +00:00
Elliott Hughes
1ef6ec40e1 Move the generic arm memcmp.S into the generic directory.
Change-Id: I48e4d14a0dcddbb246edbac6d0329619574ab44d
2014-12-15 11:06:34 -08:00
Elliott Hughes
f92cc30571 Remove arm assembler not referenced from any makefile.
I also suspect that libc/arch-arm/bionic/memcmp.S is supposed to like in the
generic directory these days, but this change just removes dead code.

Change-Id: I9072488df6e9b7261d79b6014914a0e937cb387b
2014-12-14 17:52:32 -08:00
Yabin Cui
bb3579f878 am 96cd50f2: am 0e32e39d: Merge "Fix pthread key num calculation."
* commit '96cd50f2fc33b0d342f1733894b06fd59a725519':
  Fix pthread key num calculation.
2014-12-13 03:03:51 +00:00
Yabin Cui
0e32e39df0 Merge "Fix pthread key num calculation." 2014-12-13 02:51:27 +00:00
Yabin Cui
6c238f2926 Fix pthread key num calculation.
Bug: 18723085
Change-Id: Iba2c834b350e4cdba0b2d771b221560a3e5df952
2014-12-12 17:00:08 -08:00
Elliott Hughes
1fc1c89810 am 7dc71bb9: am 732d65c1: Merge "[MIPS] Add sgidefs.h for mips64"
* commit '7dc71bb9d5f73dc2ffe6e070efe29e69b88c14a7':
  [MIPS] Add sgidefs.h for mips64
2014-12-13 00:41:40 +00:00
Elliott Hughes
732d65c1b1 Merge "[MIPS] Add sgidefs.h for mips64" 2014-12-13 00:28:57 +00:00
Duane Sand
50a3c6949b [MIPS] Add sgidefs.h for mips64
Sgidefs.h is needed by strace.
Replaced now-duplicate arch-mips64/include directory
by symlink to arch-mips/include.

Change-Id: I7808602cfa452eca3ffbdb94903f4c5bdb33efa3
2014-12-12 16:25:36 -08:00
Christopher Ferris
887a9a485c am 3b811c81: am 3115b34c: Merge "fix runtime issues for scripts"
* commit '3b811c814e4ebe6591992141040ba5997a12407a':
  fix runtime issues for scripts
2014-12-11 18:55:56 +00:00
Elliott Hughes
a70d54786f am 1dff030e: am e7b8bc4e: Merge "Clean up DNS proxying."
* commit '1dff030e6eb527eeb4e7ed163cf19641fdb3872b':
  Clean up DNS proxying.
2014-12-11 18:55:55 +00:00
Christopher Ferris
3115b34c92 Merge "fix runtime issues for scripts" 2014-12-11 18:32:00 +00:00
Elliott Hughes
9773fa3ffd Clean up DNS proxying.
Remove code duplication and fall back to trying directly if the proxy
isn't available. With this, tests still work if netd is dead (perhaps
because you've run "adb shell stop", or because you're running on the host).

Bug: 18547878
Change-Id: Ia4a9aa18b1fc79e09735107246989fa7fc6c8455
2014-12-10 17:14:02 -08:00
Christopher Ferris
4173ebb42a am ca5edfb2: am fec60529: Merge "Fix missing symbol for debug malloc."
* commit 'ca5edfb23ba45176d1e33fba6f38e7834ef33301':
  Fix missing symbol for debug malloc.
2014-12-10 20:45:10 +00:00
Christopher Ferris
fec605294e Merge "Fix missing symbol for debug malloc." 2014-12-10 20:33:52 +00:00
Elliott Hughes
1fd915b9c1 am fa465353: am a53c504e: Merge "Fix arm64 clone stack handling."
* commit 'fa46535316a514e1335836bf065c2deddab1c4f3':
  Fix arm64 clone stack handling.
2014-12-10 19:58:04 +00:00
Elliott Hughes
a53c504e0c Merge "Fix arm64 clone stack handling." 2014-12-10 19:45:48 +00:00
Yabin Cui
b9f67dc0f5 am 1eaf80d6: am 3337435e: Merge "Use machine/timespec.h to separate timespec definition."
* commit '1eaf80d6805352cb74a4ffb392da4bfd17f4caed':
  Use machine/timespec.h to separate timespec definition.
2014-12-10 19:42:15 +00:00
Yabin Cui
3337435ec8 Merge "Use machine/timespec.h to separate timespec definition." 2014-12-10 19:29:24 +00:00
Christopher Ferris
3f61f89b55 Fix missing symbol for debug malloc.
Bug: 18686270
Change-Id: I800a6f0940060218413df652d74aca91f6a339f8
2014-12-10 11:10:00 -08:00
Elliott Hughes
51f5d83237 Fix arm64 clone stack handling.
Make sure we adjust the stack pointer so a signal can't overwrite data.

Bug: 15195265
Change-Id: I5ab9469a82cb214c32f40a713268a1ab74a4c6fa
2014-12-10 11:08:47 -08:00
Elliott Hughes
114cee8c6e am 0eaa218c: am 0952a554: Merge "Use the stmdb instead of str to save the fn/arg"
* commit '0eaa218c2f567af3ed51ac7538ef9179a9318821':
  Use the stmdb instead of str to save the fn/arg
2014-12-10 19:07:36 +00:00
Elliott Hughes
0952a5540e Merge "Use the stmdb instead of str to save the fn/arg" 2014-12-10 18:53:48 +00:00
Jiangli Yuan
c3d1728583 Use the stmdb instead of str to save the fn/arg
Directly save data into stack without properly adjustment
   of stack point is dangous. For example, if a signal comes,
   kernel will put sigframe into userspace's stack, which
   will overwrite the saved data if sp is not adjusted properly.

Bug: 15195265
Change-Id: Iea0cadfd3b94d50cf40252ad52fe5950811b9192
Signed-off-by: Jiangli Yuan <a6808c@motorola.com>
2014-12-10 18:47:01 +00:00
Kyunam Jo
fa343e630d fix runtime issues for scripts
now, some script to update kernel-headers is not working.
because of wrong variable value and test codes.
so this issue is fixed.

Change-Id: Iffae9607858cc3c1c58fa24244be217b5a1ab06e
2014-12-10 07:53:07 +00:00
Yabin Cui
db49903732 Use machine/timespec.h to separate timespec definition.
Bug: 18627763
Change-Id: Ib1c406320f0ecc3705d19183a48f986cdf57c279
2014-12-10 06:36:11 +00:00
Elliott Hughes
f9ee804513 am 18779983: am 6a684524: Merge "Fix ptsname(3) and ttyname(3) to use TLS."
* commit '187799839d317b3a6ee0f32a70a19ce64d41fac5':
  Fix ptsname(3) and ttyname(3) to use TLS.
2014-12-10 04:52:18 +00:00
Elliott Hughes
1f8812b2aa am 938c251e: am 3592743f: Merge "Move BSD stuff together in <sys/endian.h>."
* commit '938c251e94cd6f38433ca5f6a1480cbaef2783d1':
  Move BSD stuff together in <sys/endian.h>.
2014-12-10 04:31:18 +00:00
Elliott Hughes
a381fe8ebc Fix ptsname(3) and ttyname(3) to use TLS.
Be safe by default.

Change-Id: I6c4a3f1fd4eee3a651b3162ce95b7e873de57521
2014-12-09 20:30:23 -08:00
Elliott Hughes
824f914cae Move BSD stuff together in <sys/endian.h>.
Change-Id: I8bb511840f3cd98d5008034e405d82e923bd3203
2014-12-09 19:44:42 -08:00
Elliott Hughes
d0ee182bcf am 4beb28d4: am 3f1c604c: Merge "<net/route.h> should include IPv6 too."
* commit '4beb28d427a61111e53b12cb78c39599ea1afd7b':
  <net/route.h> should include IPv6 too.
2014-12-09 23:29:19 +00:00
Elliott Hughes
0098f245cf am 92fd1774: am 7381e145: Merge "Sync <net/if_types.h> with upstream."
* commit '92fd17748376523e212dae0e606522b67d2c2883':
  Sync <net/if_types.h> with upstream.
2014-12-09 23:20:59 +00:00
Elliott Hughes
a7feda3731 <net/route.h> should include IPv6 too.
Change-Id: I866097d8468aa8f326117d072444ebbc2a690719
2014-12-09 15:08:24 -08:00
Elliott Hughes
1ec05b7c78 Sync <net/if_types.h> with upstream.
Change-Id: I2c2ca47f5a21b78754c03deb3e9467ab79d9d033
2014-12-09 15:03:51 -08:00
Yabin Cui
c5132eb361 am e0601bd4: am 94926f8c: Merge "support _POSIX_REALTIME_SIGNALS"
* commit 'e0601bd49f04e5f248be4ebd976f73b1cb0b5023':
  support _POSIX_REALTIME_SIGNALS
2014-12-09 22:10:11 +00:00
Yabin Cui
94926f8cfa Merge "support _POSIX_REALTIME_SIGNALS" 2014-12-09 20:10:19 +00:00
Yabin Cui
f3d576b1e7 am e906cf68: am b033761c: Merge "Change _POSIX_CPUTIME macro to make it compitable with glibc."
* commit 'e906cf68f07ad8b64ec594a1e4115f5bc261caab':
  Change _POSIX_CPUTIME macro to make it compitable with glibc.
2014-12-09 18:06:13 +00:00
Yabin Cui
b033761cbf Merge "Change _POSIX_CPUTIME macro to make it compitable with glibc." 2014-12-09 17:51:37 +00:00
Yabin Cui
725756045e Change _POSIX_CPUTIME macro to make it compitable with glibc.
Change-Id: I7a8dbb74bd622693c9fef60bd779687207517b7d
2014-12-09 09:16:11 -08:00
Elliott Hughes
19d76adddc am b430e6d6: am 5536044b: Merge "Simplify our endian.h implementation."
* commit 'b430e6d6d21d983b62338950b7c7750c76691068':
  Simplify our endian.h implementation.
2014-12-09 15:03:54 +00:00
Elliott Hughes
fc3d587f91 am c63ddc8b: am aa0002de: Merge "Merge mips setjmp/longjmp family."
* commit 'c63ddc8b8c793c732246cac9b4c95b9c1534ca12':
  Merge mips setjmp/longjmp family.
2014-12-09 14:41:13 +00:00
Elliott Hughes
5a103a5a91 am 09416c9e: am 0b7d9d6f: Merge "Switch arch-mips64/include/machine to a symlink."
* commit '09416c9ec602f8385ad38af4ac0079b9385fbfbc':
  Switch arch-mips64/include/machine to a symlink.
2014-12-09 14:41:12 +00:00
Elliott Hughes
b5e1fa5046 am 3cc8e0e9: am af829f2d: Merge "Use 64-bit units in the aarch64 setjmp implementation."
* commit '3cc8e0e9d5b79e78ec3f2f636e0f527ec8a58519':
  Use 64-bit units in the aarch64 setjmp implementation.
2014-12-09 14:41:11 +00:00
Elliott Hughes
408d8fa464 am 16c93b47: am 86d06dcc: Merge "Switch arm and arm64 over to the x86 style of jmpbuf."
* commit '16c93b47646e2ea5c3e09719bf1698363833676f':
  Switch arm and arm64 over to the x86 style of jmpbuf.
2014-12-09 14:41:10 +00:00
Elliott Hughes
b9abfd25d5 am 65187330: am 515a2ea1: Merge "Fix signal mask save/restore for x86-64."
* commit '6518733033ab076df32564ecb1a782313c993a86':
  Fix signal mask save/restore for x86-64.
2014-12-09 14:41:05 +00:00
Elliott Hughes
2660970708 am b67ff7e3: am 734f0d64: Merge "Fix signal mask save/restore for arm64."
* commit 'b67ff7e37eac39bdbc06478a545b507462fdcee9':
  Fix signal mask save/restore for arm64.
2014-12-09 14:41:04 +00:00
Yabin Cui
634816055f support _POSIX_REALTIME_SIGNALS
Bug: 18489947
Change-Id: I2e834d68bc10ca5fc7ebde047b517a3074179475
2014-12-08 21:52:43 -08:00
Elliott Hughes
56e017306e Simplify our endian.h implementation.
We can rely on the compiler's builtins. Tested on arm, arm64, mips, x86,
and x86-64.

Change-Id: I0f774ed7e85b3c791a3178d8ef17c6500e6a9ace
2014-12-08 20:35:08 -08:00
Elliott Hughes
d27ae2f8d7 Merge mips setjmp/longjmp family.
Bug: 16918359
Change-Id: I9033a7d178d431ddb09f1cfa6e4bf95ae02346e9
2014-12-08 17:07:53 -08:00
Elliott Hughes
2fecbfaeee Switch arch-mips64/include/machine to a symlink.
Imagination already did the work to make the contents of these directories
identical. Let's take advantage of that fact.

Change-Id: Ib101ba39041fb500c9c618fa2020e72aa2ccd9c2
2014-12-08 16:48:34 -08:00
Elliott Hughes
9fa2cfbbdb Use 64-bit units in the aarch64 setjmp implementation.
The use of 32-bit units for 64-bit stores and loads was driving me crazy.

Bug: 16918359
Change-Id: Ifb73aad8f8985a2adfcf5913b783ad9424f23e06
2014-12-08 16:23:10 -08:00
Elliott Hughes
75096226c8 Switch arm and arm64 over to the x86 style of jmpbuf.
Specifically, use the argument to sigsetjmp as a flag in the buffer
to indicate whether or not the signal mask is valid.

Bug: 16918359
Change-Id: I5bb1f1220f14c105c6bc57e0c28c1dc366d1438f
2014-12-08 16:15:59 -08:00
Elliott Hughes
515a2ea1d5 Merge "Fix signal mask save/restore for x86-64." 2014-12-08 21:40:15 +00:00
Elliott Hughes
1c0c0ede57 Fix signal mask save/restore for x86-64.
Bug: 16918359
Change-Id: I30bf61e7d5f1c21daa3a1a21d361e98d77220bf3
2014-12-08 12:46:15 -08:00
Elliott Hughes
7b78e8187e Fix signal mask save/restore for arm64.
Bug: 16918359
Change-Id: Ieb15f7f1658f5accee05665b72ba17831a80ea9d
2014-12-06 11:18:00 -08:00
Elliott Hughes
217f77df48 am ae141c52: am 7d3a99b1: Merge "Clean up the x86-64 and x86 setjmp families."
* commit 'ae141c526f8075f722d16ab6382f94db3a20d46f':
  Clean up the x86-64 and x86 setjmp families.
2014-12-06 06:35:45 +00:00
Elliott Hughes
8d4c55cc74 Clean up the x86-64 and x86 setjmp families.
Bug: 16918359
Change-Id: Ic8ca0af9ea99636bc71f19d46071f1cea6eef982
2014-12-05 22:20:08 -08:00
Elliott Hughes
03f865f037 am 9156e864: am 289f44a4: Merge "Clean up arm setjmp family."
* commit '9156e86466d8c9430608f26f1b28aab66e7ee7a1':
  Clean up arm setjmp family.
2014-12-06 00:04:05 +00:00
Elliott Hughes
b393299b85 Clean up arm setjmp family.
Bug: 16918359
Change-Id: I9b986bdbdbaefe9d9896a820ee8cfe860adfe5c5
2014-12-05 15:39:51 -08:00
Elliott Hughes
8c838ec5f3 am d276faae: am 872da6d3: Merge "Clean up the arm64 setjmp."
* commit 'd276faae7c82cd139e984275b325edc4dbe313f3':
  Clean up the arm64 setjmp.
2014-12-05 23:19:08 +00:00
Elliott Hughes
9fb536de97 Clean up the arm64 setjmp.
Note that this doesn't address the fact that we don't save/restore the
real-time signals. But it does let us pass the tests we currently fail.

Bug: 16918359
Change-Id: I063a6926164289a71026a412da7f5dd2ca9a74b3
2014-12-05 15:05:45 -08:00
Tao Bao
65907a22d8 am cdf9ef0e: am 24214067: Merge "Add cache related sysconf queries"
* commit 'cdf9ef0e55480d74a1b99d942c37b66f2a3f1cf5':
  Add cache related sysconf queries
2014-12-05 18:23:29 +00:00
Tao Bao
2421406711 Merge "Add cache related sysconf queries" 2014-12-05 18:11:53 +00:00
Tao Bao
1f40be97b1 Add cache related sysconf queries
Several cache related queries are added, such as
_SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE and etc. For the
moment, we always return 0 for these queries.

Change-Id: I36f67af8128672d8c1eef49d6f2431cca5a94719
2014-12-04 15:24:28 -08:00
Elliott Hughes
256454b83b am 458d0f1a: am 9e08a7bb: Merge "Restore symbols from <arpa/nameser.h>."
* commit '458d0f1a116776a9f83a19285a954983aea162dd':
  Restore symbols from <arpa/nameser.h>.
2014-12-04 22:45:01 +00:00
Yabin Cui
9c81c996d9 am 59932806: am 295bc2b9: Merge "implement posix_madvise"
* commit '599328061c85f07079a9fd647db1dbb127f88854':
  implement posix_madvise
2014-12-04 22:45:00 +00:00
Elliott Hughes
ecabc635ed am d5320228: am e3e3feaf: Merge "Make the missing symbols script more useful."
* commit 'd532022864768e205997254d9177bc6b59636a84':
  Make the missing symbols script more useful.
2014-12-04 22:44:57 +00:00
Elliott Hughes
c7450f7738 Restore symbols from <arpa/nameser.h>.
Bug: 18627252
Bug: https://code.google.com/p/android/issues/detail?id=81690

(cherry picked from commit 42804c4b30)

Change-Id: Idd33578b31bba9a4afdfd15c7b193d10974aea90
2014-12-04 13:45:22 -08:00
Elliott Hughes
9e08a7bbb8 Merge "Restore symbols from <arpa/nameser.h>." 2014-12-04 21:39:58 +00:00
Yabin Cui
295bc2b970 Merge "implement posix_madvise" 2014-12-04 21:30:43 +00:00
Elliott Hughes
42804c4b30 Restore symbols from <arpa/nameser.h>.
Bug: 18627252
Bug: https://code.google.com/p/android/issues/detail?id=81690
Change-Id: I45b6c09cf2b5aabb80900e267d27cc0ec93d4dd8
2014-12-04 12:39:46 -08:00
Elliott Hughes
f0435506da am 18a470e4: am 230005c4: Merge "Code using neon uses ARCH_ARM_HAVE_NEON."
* commit '18a470e435508a20b9f32a8d516a0da5fc361c81':
  Code using neon uses ARCH_ARM_HAVE_NEON.
2014-12-04 19:51:42 +00:00
Elliott Hughes
50ebeec8b1 am 509317a4: am a18af83b: Merge "Remove __ARM_HAVE_VFP."
* commit '509317a4758fc7177ca2e7ca1151914cd7701268':
  Remove __ARM_HAVE_VFP.
2014-12-04 19:51:41 +00:00
Elliott Hughes
2876478074 am c02d6add: am 6cbc56b8: Merge "Implement <pty.h>."
* commit 'c02d6add2d12ada65cc88db724921d23be6e3310':
  Implement <pty.h>.
2014-12-04 19:51:40 +00:00
Elliott Hughes
0393221f47 Make the missing symbols script more useful.
If something's in POSIX, we don't need to show it in the glibc list.

If something's not implemented by glibc, we don't need to show it in the
POSIX list (because it's probably either a macro or obsolete).

Change-Id: Ied0f8d97d3fffb280c22e9cdf6782430d776c02f
2014-12-04 11:24:48 -08:00
Yabin Cui
5afae64a1b implement posix_madvise
Bug: 18472477
Change-Id: I8183de6c281acf69ed5f7f88351b056b9827b162
2014-12-04 11:01:28 -08:00
Yabin Cui
d756770681 am 0b2aabde: am 1898967e: Merge "change argument type in madvise"
* commit '0b2aabde32db99cffd4d06cda614edeac1112e37':
  change argument type in madvise
2014-12-04 09:22:07 +00:00
Elliott Hughes
1309dcc842 Code using neon uses ARCH_ARM_HAVE_NEON.
Bug: 18556103
Change-Id: Ia8674dda223f81d616d15ee47b402ab4a3f98079
2014-12-03 17:41:26 -08:00
Elliott Hughes
cb4c615bb9 Remove __ARM_HAVE_VFP.
Bug: 18556103
Change-Id: I6d4cc6a1b359ad2df1ce6687fd26f392059f6efd
2014-12-03 17:07:01 -08:00
Elliott Hughes
6cbc56b84b Merge "Implement <pty.h>." 2014-12-04 00:45:42 +00:00
Elliott Hughes
65f0df7873 Implement <pty.h>.
Based on the package/apps/Terminal implementation. I'll switch them over
shortly. This also lets us build the toybox version of netcat.

Change-Id: Ia922a100141a67409264b43b937eeca07b21f344
2014-12-03 15:55:34 -08:00
Yabin Cui
1898967e41 Merge "change argument type in madvise" 2014-12-03 19:57:50 +00:00
Yabin Cui
efbb6fb3f7 change argument type in madvise
Make madvise prototype the same as linux man page.

Bug: 18539500
Change-Id: If3fd0e1d9539b9e10531ab9087bc4040e32b6e9b
2014-12-03 11:11:50 -08:00
Elliott Hughes
308c4d3fb1 am b06e125c: am 91a61f77: Merge "Switch x86 and x86-64 to __builtin_bswap*."
* commit 'b06e125c01ff30cc3835d6c8c025e256a82356bf':
  Switch x86 and x86-64 to __builtin_bswap*.
2014-12-03 17:31:35 +00:00
Elliott Hughes
855916362c am 58543de7: am 244299f4: Merge "Switch aarch64 to __builtin_bswap16."
* commit '58543de7215df81859e8ada22210773d4ab0ea82':
  Switch aarch64 to __builtin_bswap16.
2014-12-03 17:31:34 +00:00
Elliott Hughes
91a61f77e2 Merge "Switch x86 and x86-64 to __builtin_bswap*." 2014-12-03 16:20:06 +00:00
Elliott Hughes
12f35ada43 Switch x86 and x86-64 to __builtin_bswap*.
Bug: 18597513
Change-Id: I0781208efb3b560d7c6fa48f41be7bc6fc83521e
2014-12-02 20:16:05 -08:00
Elliott Hughes
1de2548c8e Switch aarch64 to __builtin_bswap16.
It generates the same code.

Bug: 18597513
Change-Id: I164296da8c676668983dd93697c6dfa05f10ec56
2014-12-02 19:55:38 -08:00
Elliott Hughes
1c27acc32c am 5f48eda7: am baf792bf: Merge "Remove __ARM_HAVE_HALFWORD_MULTIPLY."
* commit '5f48eda760e563e39231b1a0eaba086a5c0403a2':
  Remove __ARM_HAVE_HALFWORD_MULTIPLY.
2014-12-03 02:47:47 +00:00
Elliott Hughes
f6116c5ea1 am 81b5f9f4: am 6bec3484: Merge "Remove __ARM_HAVE_LDREXD."
* commit '81b5f9f42f037690be5fbcb9501bd37e1f8bb3c1':
  Remove __ARM_HAVE_LDREXD.
2014-12-03 02:47:46 +00:00
Elliott Hughes
39bf9593c4 am 52b3cbae: am f840cefa: Merge "Kill <machine/exec.h>."
* commit '52b3cbae58e9069eebb09b913cf51a3a2781813d':
  Kill <machine/exec.h>.
2014-12-03 02:47:45 +00:00
Elliott Hughes
a5602c566e Remove __ARM_HAVE_HALFWORD_MULTIPLY.
Bug: 18556103
Change-Id: I17e498539f77ddf7d1fb980ee93155d3c3ccd85e
2014-12-02 16:58:17 -08:00
Elliott Hughes
6651aa6bc1 Remove __ARM_HAVE_LDREXD.
No one uses this.

Bug: 18556103
Change-Id: Icecc3a7b5cb0a36960f27d030d8f4f8ee471f86c
2014-12-03 00:57:07 +00:00
Elliott Hughes
b514026eb2 Kill <machine/exec.h>.
Bug: 18546535
Change-Id: I479e003deab21e31eb5caa5393067ed1dc558387
2014-12-02 16:16:29 -08:00
Elliott Hughes
66f7b2758f Merge "Remove unnecessary #undefs from AOSP." into lmp-mr1-dev-plus-aosp 2014-12-02 23:00:37 +00:00
Elliott Hughes
27d276f3a6 Avoid pathological behavior in OpenBSD's fread.
(cherry picked from commit 20841a137b)

Bug: https://code.google.com/p/android/issues/detail?id=81155
Bug: 18556607
Change-Id: Ibdfebc20dce4c34ad565014523c9b074e90ea665
2014-12-02 14:54:52 -08:00
Elliott Hughes
6c1e3f6e56 Remove unnecessary #undefs from AOSP.
This is a manual revert of 111461aaae.
git revert does the wrong thing because that patch shares lines (that we
want to keep) with 168667c972 and git
revert just removes them.

Change-Id: I83ac8c95e5c90a4137b7742a9b7536e1627f1ac7
2014-12-02 14:50:20 -08:00
Elliott Hughes
c28e2797a7 am cc7e28f1: am 432f763c: Merge "Avoid pathological behavior in OpenBSD\'s fread."
* commit 'cc7e28f111bfa5cd859ab7ac4eac8f98d9f10af3':
  Avoid pathological behavior in OpenBSD's fread.
2014-12-02 22:49:36 +00:00
Elliott Hughes
20841a137b Avoid pathological behavior in OpenBSD's fread.
Bug: https://code.google.com/p/android/issues/detail?id=81155
Bug: 18556607
Change-Id: Idc60976b79610e2202cc42dc393dcb4ca6c42e05
2014-12-02 14:22:02 -08:00
Yabin Cui
864ba276f9 am 5fea4532: am 4e7d66dd: Merge "Use mmap to create the pthread_internal_t."
* commit '5fea45328f7a596ab2040c8ea2fe227cf1752a07':
  Use mmap to create the pthread_internal_t.
2014-12-02 22:00:39 +00:00
Elliott Hughes
12b7dd0900 am 152e978f: Merge "Put stdin/stdout/stderr symbols in place." into lmp-mr1-dev
* commit '152e978f73fc6cd37d0d82de69f1cf8134b34b90':
  Put stdin/stdout/stderr symbols in place.
2014-12-02 19:16:51 +00:00
Elliott Hughes
152e978f73 Merge "Put stdin/stdout/stderr symbols in place." into lmp-mr1-dev 2014-12-02 18:56:50 +00:00
Yabin Cui
8574a0670b Use mmap to create the pthread_internal_t.
Bug: 16847284
Change-Id: I488fa236f57aa3acb29b4ffbbab2fab51b0653be
2014-12-02 10:39:25 -08:00
Lorenzo Colitti
8a94b864bf am e5477f83: Fail queries fast if no DNS servers are configured.
* commit 'e5477f83b0a639b86d8cbe710f25d9808a8f72af':
  Fail queries fast if no DNS servers are configured.
2014-12-02 07:00:47 +00:00
Elliott Hughes
111461aaae Put stdin/stdout/stderr symbols in place.
To help with future binary compatibility.

Bug: 18553223
Change-Id: Ia8103b4f189c18528b11948ac9e520f61b9ccc0e
2014-12-01 21:27:59 -08:00
Christopher Ferris
8374a54813 Merge "Specify .cpu cortex-a15" 2014-12-02 02:29:52 +00:00
Elliott Hughes
212e0e3824 Build our benchmarks against glibc too.
Bug: 18556607
Change-Id: I455ac8b93c0835836180e549486bc52d393ee6a6
2014-12-01 16:43:51 -08:00
Lorenzo Colitti
e5477f83b0 Fail queries fast if no DNS servers are configured.
When no DNS servers are configured (and thus there is no chance
that the DNS query will suceed), res_nsend returns early, but
it does not tell the cache that the query has failed.
Therefore, if the caller retries the query, it will block for
PENDING_REQUEST_TIMEOUT (= 20 seconds) waiting for the "existing
query" (which isn't actually doing anything) to complete.

Bug: 18240188
Bug: 18327075
Change-Id: I0df13ff4a17ee65e640be96695a3af31b020963a
2014-12-01 20:03:25 +00:00
Yabin Cui
3e6ef3f902 Merge "support _POSIX_CPUTIME" 2014-12-01 17:06:02 +00:00
David 'Digit' Turner
aad1a39dfb libc: Fix headers to allow direct inclusion.
These headers are missing a few #includes to allow their direct
inclusion from C

http://b.android.com/79841

Change-Id: Ifc712c17f4da70b26adb67d4d49ed659f53c3621
2014-12-01 15:44:24 +01:00
Bernhard Rosenkränzer
ce46f5576a Specify .cpu cortex-a15
When building with clang without this change, as errors out saying pldw
is an unsupported instruction (because it isn't part of the ARMv7 core
instruction set).
Let as know using pldw is fine.

Change-Id: Ie1f9c4b873e93ab2b3b374d2d46e476a4e581710
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
2014-11-30 22:17:30 +01:00
Robert Alm
3638a83657 Add error-check when mapping socket to fd
The call to fdopen can fail in several ways.
The fprintf on the next line will then dereference a
NULL-pointer FILE*.
Added a NULL-check, closed the socket, returned system error
and added a comment about it.

Change-Id: I7a6b26aa3c79452b1fdd76af12dfa75da88cbad7
2014-11-27 11:01:50 -08:00
Elliott Hughes
1b66f6e9d7 Move a private x86-64 header file out of the limelight.
Currently this is on everyone's include path and is getting exported
via the NDK.

Change-Id: Ia417839fb65c7e0afddcd9fae3438665dae8e752
2014-11-26 19:31:19 -08:00
Yabin Cui
d5c652756b support _POSIX_CPUTIME
Bug: 18490039
Change-Id: I01fa83b48e1b908de1f227b6e4f98e280bcd50ee
2014-11-26 17:14:50 -08:00
Nicolas Geoffray
5b8ceff5f8 Revert "Use mmap to create the pthread_internal_t."
Unfortunately, this change provokes random crashes for ART, and
I have seen libc crashes on the device that might be related to it.

Reverting it fixes the ART crashes. there is unfortunately no
stack trace for the crashes, but just a "Segmentation fault" message.


This reverts commit cc5f6543e3.

Change-Id: I68dca8e1e9b9edcce7eb84596e8db619e40e8052
2014-11-26 11:56:54 +00:00
Duane Sand
3a4786348e [MIPS] Rewrite of setjmp/longjmp for mips64 and mipsr6
Change-Id: Idcd13413520dd503bc9cf782553675313e500a83
2014-11-25 17:33:10 -08:00
Yabin Cui
cc5f6543e3 Use mmap to create the pthread_internal_t.
Bug: 16847284
Change-Id: Ic8c85f95afac1d8422ecb69674c688d1fecb6a44
2014-11-25 15:25:06 -08:00
Yabin Cui
eb3a5e026e Merge "flesh out sysconf(3) and the _POSIX_* constants" 2014-11-24 01:59:23 +00:00
Elliott Hughes
95a02366f2 Merge "Sync with upstream OpenBSD fts.c." 2014-11-23 18:06:29 +00:00
Dan Albert
806dd9f90c Merge "Move some pthread functions to signal.h." 2014-11-22 22:38:51 +00:00
Elliott Hughes
2818279ace Sync with upstream OpenBSD fts.c.
Change-Id: Ia7e26b603f6461095b5a8d7e8a6cdf4f8279fa84
2014-11-21 19:27:28 -08:00
Yabin Cui
1c19194c9d flesh out sysconf(3) and the _POSIX_* constants
Bug: 17571891
Change-Id: I81036615486bde65969ae5662587fcc88348474e
2014-11-21 19:10:52 -08:00
Elliott Hughes
ee369fb319 Bring our <machine/endian.h> files back in sync.
They'd drifted slightly which led to a compilation error in toybox,
which was assuming pid_t was defined. arm and arm64 were picking it
up via <endian.h> but x86 wasn't.

Change-Id: I58401e6c0066959dfc3b305b020876aaf7074bbf
2014-11-21 18:34:36 -08:00
Dmitriy Ivanov
4ae178f81d Mips: remove arch-specific atexit.h
Change-Id: I687ff4ead6c5e81db44782bf851cb84f87bfe085
2014-11-21 14:42:53 -08:00
Dmitriy Ivanov
e3e8d15f23 Mips: Remove unused files
Change-Id: If98b832ee32f6dcd9f5d7ae21c601c210adfad6b
2014-11-21 14:29:43 -08:00
Dmitriy Ivanov
c619603a31 Mips: Reuse atexit.h from libc/arch-common
Change-Id: Ica1670e6d3d1b6b0c64df93720efa65586e67727
2014-11-21 13:07:36 -08:00
Dan Albert
75ef63d6cf Move some pthread functions to signal.h.
POSIX specifies that pthread_kill(3) and pthread_sigmask(3) are
supposed to live in signal.h rather than pthread.h.

Since signal.h now needs pthread_t and pthread_attr_t, I've moved
those defintions into include/machine/pthread_types.h to keep the
namespace clean. I also sorted some includes. The combination of these
two things seems to have exploded into a cascade of missing includes,
so this patch also cleans up all those.

Change-Id: Icfa92a39432fe83f542a797e5a113289d7e4ad0c
2014-11-21 10:26:09 -08:00
Dan Albert
f664034887 Revert "<sched.h> should offer both __sched_priority and sched_priority."
This was only ever added to keep strace compiling, but strace has
since (actually, prior) fixed their source to use the less ugly name,
so we don't need this anymore (good riddance, #define!).

This reverts commit bbb34f9536.
2014-11-21 10:24:40 -08:00
Elliott Hughes
432f645887 Fix flockfile(3) and friends for stdin/stdout/stderr too.
stdin/stdout/stderr are special; their mutexes are initialized by
__sinit. There's no unit test for this, because __sinit has already
been called by the time the first unit test runs, but you could
reproduce this failure with a trivial main() that calls flockfile
or ftrylockfile on one of the standard streams before otherwise
using stdio.

Bug: 18208568

(cherry picked from commit c48c3e4bb3)

Change-Id: Ia0c43ed4ac69daea8152aee9516415a6e3f8a042
2014-11-19 15:49:09 -08:00
Elliott Hughes
5313c3ff89 Merge "Fix flockfile(3) and friends for stdin/stdout/stderr too." 2014-11-19 23:48:19 +00:00
Elliott Hughes
c48c3e4bb3 Fix flockfile(3) and friends for stdin/stdout/stderr too.
stdin/stdout/stderr are special; their mutexes are initialized by
__sinit. There's no unit test for this, because __sinit has already
been called by the time the first unit test runs, but you could
reproduce this failure with a trivial main() that calls flockfile
or ftrylockfile on one of the standard streams before otherwise
using stdio.

Bug: 18208568
Change-Id: I28d232cf05a9f198a2bed61854d8047b23d2091d
2014-11-19 15:16:51 -08:00
David 'Digit' Turner
c9278b8a17 Merge "libc: Move <sgidefs.h> to libc/arch-mips/" 2014-11-19 14:49:52 +00:00
Yabin Cui
649f78df79 Merge "fix shared gid support in getpwnam/getgrnam" 2014-11-19 04:25:24 +00:00
Yabin Cui
a04c79b9d3 fix shared gid support in getpwnam/getgrnam
Bug: 18374693
Change-Id: I5353403cbbead6f6abac87bee2cf53a60dba408c
2014-11-18 19:58:04 -08:00
David 'Digit' Turner
6e50cb4544 libc: Move <sgidefs.h> to libc/arch-mips/
This is a MIPS-only header, and should not be part of the common
headers. See http://b.android.com/79841 for context.

Change-Id: I610bc3ff626b57e7854dad15a4a2f67e1e5ded75
2014-11-18 20:13:10 +01:00
Elliott Hughes
8eda0a6d69 Merge "libc: Fix mktime returns an uncorrect time in empty TZ case" 2014-11-17 23:14:58 +00:00
Elliott Hughes
bfbf7a4300 Remove remaining bionic support for TARGET_CPU_SMP being false.
Change-Id: I02a0a1c0ae55ccb5c45d17fb99a09c374d71def4
2014-11-17 10:06:20 -08:00
Satoru Takeuchi
154e2026c8 libc: Fix mktime returns an uncorrect time in empty TZ case
The mktime API returned an uncorrect time when TZ is set as empty.
A timezone UTC/GMT+0 should be implied in the empty case. However
mktime keeps previous information about timezone. If mktime was called
with a timezone which has DST before, the "defaulttype" member of
"state" structure wouldn't be 0. Then it would be used next time,
even though UTC/GMT+0 doesn't have DST.

Added initialization of the "defaulttype" in the empty TZ case.

Change-Id: Ic480c63c548c05444134e0aefb30a7b380e3f40b
2014-11-14 18:13:07 -08:00
Yabin Cui
9d93986481 Add functions in sysinfo.h.
Bug: 17703902

Change-Id: I699d12d76a8fc483c919be730c2ac63641b71a1d
2014-11-14 16:22:48 -08:00
Yabin Cui
661423a453 Merge "Increase support of pathconf options." 2014-11-14 23:45:45 +00:00
Yabin Cui
b5e581abfe Increase support of pathconf options.
Bug: 18206366
Change-Id: Ie770e49f5af3631eb9fbd2cd5174edf004c81e00
2014-11-14 23:45:24 +00:00
Elliott Hughes
047d943ee9 sysconf(3) returns long.
On LP32, this makes no difference. Not an ABI change.

On LP64, results are going to be in %rax or x0 whether they're 32- or 64-bit,
and the only difference is going to be whether the top bits are clobbered.

(cherry picked from commit 60d84af172)

Bug: 18390956
Change-Id: I722461498bc5494e2972fb07d5189dffe76e8993
2014-11-14 15:37:49 -08:00
Elliott Hughes
60d84af172 sysconf(3) returns long.
On LP32, this makes no difference. Not an ABI change.

On LP64, results are going to be in %rax or x0 whether they're 32- or 64-bit,
and the only difference is going to be whether the top bits are clobbered.

Bug: 18390956
Change-Id: I0bd4496231bdded34c1fa03e895021ac0df7f8e1
2014-11-14 15:14:44 -08:00
Elliott Hughes
168667c972 Add non-macro stdin/stdout/stderr too.
Various C and C++ standards explicitly say that stdin/stdout/stderr
should be macros, but glibc makes them global variables too. This
means it's possible to write code that uses those names as locals,
but that code (toybox being an example) won't build on bionic.

If we'd done this earlier, we could have hidden __sF for LP64, but
it's too late now.

Change-Id: I90cf8c73f52b66e1760b8fa2e135b9f9f9651230
2014-11-14 14:42:59 -08:00
Christopher Ferris
59b1dea882 Merge "Add missing function prototypes wcpcpy/wcpncpy." 2014-11-14 03:23:35 +00:00
Christopher Ferris
5c7d9584d9 Add missing function prototypes wcpcpy/wcpncpy.
Also add smoke tests for a few of the wchar functions.

Change-Id: Id1be522f55a6708564d444941f42097548f16497
2014-11-13 18:56:12 -08:00
Elliott Hughes
e3c4acf1e3 Fix our <mntent.h> implementation.
Used by toybox.

Change-Id: I36a5053423e5cc54ae02a68f4fe110d75134accd
2014-11-13 15:51:36 -08:00
Daniel Rosenberg
4a50d8ead7 bionic: libc: Added path to vendor build properties file.
Signed-off-by: Daniel Rosenberg <drosen@google.com>

(cherry picked from commit 71d220c1de)

Bug: 18281574
Change-Id: I2843f23ecb4c4ca79b230d8041bbca02dbedeadc
2014-11-13 13:09:59 -08:00
Elliott Hughes
288fa03a5a Merge "Assume glibc >= 2.15." 2014-11-13 18:11:00 +00:00
Elliott Hughes
6229798a7c Merge "Don't receive structs containing pointers over sockets." 2014-11-13 17:56:08 +00:00
Hans Boehm
854c98d636 Merge "Allow stdatomic.h to be included from mingw prebuilt." 2014-11-13 17:49:53 +00:00
Elliott Hughes
55293c1dad Don't receive structs containing pointers over sockets.
Fixes x86-64 netd.

Change-Id: Iee5ef802ebbf2e000b2593643de4eec46f296c04
2014-11-12 22:06:35 -08:00
Elliott Hughes
68d98d832b Assume glibc >= 2.15.
This catches one trivial difference between us and glibc --- the error
returned by pthread_setname_np for an invalid pthread_t.

Change-Id: If4c21e22107c6488333d11184f8005f8669096c2
2014-11-12 21:03:26 -08:00
Dmitriy Ivanov
16db1ae108 Merge "Add support for hash-style=gnu" 2014-11-13 02:10:30 +00:00
Hans Boehm
95f197f998 Allow stdatomic.h to be included from mingw prebuilt.
Define __GNUC_PREREQ if it isn't already defined.
This is a bit ugly, but it seems to be easiest to make this header as
context-independent as possible.  Together with the addition of a symbolic
link to this file from the mingw prebuilt, this appears to unblock
commit e9fa6be333e35d9e7ae435aeb32532875b95fe22.

Change-Id: I97e39cda8d8f9aa108aa61c4121da09eb9739062
2014-11-12 18:08:25 -08:00
Dmitriy Ivanov
ec18ce06f2 Add support for hash-style=gnu
Change-Id: I171434a587420895feac8a9b1ad2342087197568
2014-11-12 16:38:12 -08:00
Christopher Ferris
5d05d025b5 Merge "Add 64-bit slm optimized strlcpy and srlcat." 2014-11-12 23:18:00 +00:00
Yabin Cui
e5cabca516 Merge "implement missing seekdir and telldir" 2014-11-12 20:36:26 +00:00
Elliott Hughes
bbdfa51883 Merge "gethostname.c: change to report ENAMETOOLONG error when buflen is less" 2014-11-12 20:09:59 +00:00
Yongqin Liu
2f954bab2d gethostname.c: change to report ENAMETOOLONG error when buflen is less
change to behaviour the same as glibc for the check about buflen

Change-Id: I98265a8fe441df6fed2527686f89b087364ca53d
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-11-12 12:07:33 -08:00
Elliott Hughes
c05314a0b2 Merge "Fix tzdata update tools for 'backzone'." into lmp-mr1-dev 2014-11-12 17:19:57 +00:00
Varvara Rainchik
2e7145c048 Add 64-bit slm optimized strlcpy and srlcat.
Change-Id: Ic948934d91c83bbfdfd00c05ee8b14952e012549
Signed-off-by: Varvara Rainchik <varvara.rainchik@intel.com>
2014-11-12 17:32:28 +03:00
Elliott Hughes
1ca3350f4c Upgrade bionic to tzdata2014j.
From the release notes:

   Changes affecting current and future time stamps

     Turks & Caicos' switch from US eastern time to UTC-4 year-round
     did not occur on 2014-11-02 at 02:00.  It's currently scheduled
     for 2015-11-01 at 02:00.  (Thanks to Chris Walton.)

   Changes affecting past time stamps

     Many pre-1989 time stamps have been corrected for Asia/Seoul and
     Asia/Pyongyang, based on sources for the Korean-language Wikipedia
     entry for time in Korea.  (Thanks to Sanghyuk Jung.)  Also, no
     longer guess that Pyongyang mimicked Seoul time after World War II,
     as this is politically implausible.

     Some more zones have been turned into links, when they differed
     from existing zones only for older time stamps.  As usual,
     these changes affect UTC offsets in pre-1970 time stamps only.
     Their old contents have been moved to the 'backzone' file.
     The affected zones are: Africa/Addis_Ababa, Africa/Asmara,
     Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
     Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, and
     Indian/Mayotte.

Bug: 18330681

(cherry picked from commit b11d8e057c)

Change-Id: Ifd48e7446e400dccae3afd5cbef96ca843775477
2014-11-11 19:56:09 -08:00
Elliott Hughes
371dcc189f Fix tzdata update tools for 'backzone'.
To maintain the status quo, we need to pull in backzone file. This file
can't be built on its own, so the easiest fix is to give zic(1) all the
files at once.

We also now have a situation where we have links to links, so we need to
dereference them until we find actual data.

Bug: 18330681

(cherry picked from commit 2c2463bd30)

Change-Id: I654b80518a7144038d8b3ea7223f49e2b1d2ad13
2014-11-11 19:55:35 -08:00
Elliott Hughes
b11d8e057c Upgrade bionic to tzdata2014j.
From the release notes:

   Changes affecting current and future time stamps

     Turks & Caicos' switch from US eastern time to UTC-4 year-round
     did not occur on 2014-11-02 at 02:00.  It's currently scheduled
     for 2015-11-01 at 02:00.  (Thanks to Chris Walton.)

   Changes affecting past time stamps

     Many pre-1989 time stamps have been corrected for Asia/Seoul and
     Asia/Pyongyang, based on sources for the Korean-language Wikipedia
     entry for time in Korea.  (Thanks to Sanghyuk Jung.)  Also, no
     longer guess that Pyongyang mimicked Seoul time after World War II,
     as this is politically implausible.

     Some more zones have been turned into links, when they differed
     from existing zones only for older time stamps.  As usual,
     these changes affect UTC offsets in pre-1970 time stamps only.
     Their old contents have been moved to the 'backzone' file.
     The affected zones are: Africa/Addis_Ababa, Africa/Asmara,
     Africa/Dar_es_Salaam, Africa/Djibouti, Africa/Kampala,
     Africa/Mogadishu, Indian/Antananarivo, Indian/Comoro, and
     Indian/Mayotte.

Bug: 18330681
Change-Id: I4b6939b4dcf08c47df5595ae445b6f44f4a03418
2014-11-11 16:44:21 -08:00
Elliott Hughes
440c80ad47 Merge "Fix tzdata update tools for 'backzone'." 2014-11-12 00:42:50 +00:00
Elliott Hughes
2c2463bd30 Fix tzdata update tools for 'backzone'.
To maintain the status quo, we need to pull in backzone file. This file
can't be built on its own, so the easiest fix is to give zic(1) all the
files at once.

We also now have a situation where we have links to links, so we need to
dereference them until we find actual data.

Bug: 18330681
Change-Id: I03f4aa8e6e23802dc35cbff2f74f325eb17d7b2b
2014-11-11 16:30:18 -08:00
Daniel Rosenberg
71d220c1de bionic: libc: Added path to vendor build properties file.
Change-Id: Ia9fc257a82fdd592751cbcde3fcf453a49856f62
Signed-off-by: Daniel Rosenberg <drosen@google.com>
2014-11-11 12:18:22 -08:00
Andreas Gampe
00bbc7f69f Bionic: Make DISALLOW_COPY_AND_ASSIGN conditional
Make the definition of DISALLOW_COPY_AND_ASSIGN conditional. This is
so that the projects that include libnativehelper and bionic macros
do not have to be careful in which order those projects are included.

Bug: 18334516
Change-Id: Ib12a2c2b7ad2e360edcf3b26cb1be626540fadc1
2014-11-11 11:16:57 -08:00
Elliott Hughes
8c79b4ebb5 Add the <dirent.h> feature macros glibc uses.
Change-Id: I4da92b67d410839ea4ef0beaaa6c5cca06b74c0d
2014-11-10 15:17:28 -08:00
Elliott Hughes
e6ac9bb8a0 Remove temporary compatibility hack.
The callers have been fixed.

Bug: 18298106
Change-Id: I65e24032d0a82c4b118abace854d2dcdada881fb
2014-11-10 11:24:51 -08:00
Elliott Hughes
0ac0df84c7 Fix struct stat to match POSIX 2008.
Our representation of sub-second times matched the Linux kernel, and we
provided macros for glibc source compatibility. This change switches us
over to match POSIX 2008, adds the macros they insist on (for compatibility
with earlier versions of POSIX), and also adds macros for compatibility
with any code that expects the kernel or old bionic names.

Unfortunately this breaks strace which defines its own structures using
the kernel names, and thus implicitly assumes that there are no macros with
those names, but this does allow the rest of the tree to build.

Bug: 18298106
Change-Id: Ibfa8c21cb2a2566091ef3dc2019a9f78d2de2991
2014-11-07 19:15:10 -08:00
Elliott Hughes
b86a4c7f65 Add sethostname(2).
Not very useful, but helps building stuff like toybox out of the box.

Change-Id: I110e39030452bd093a84278e019c5752d293718d
2014-11-07 16:48:27 -08:00
Yabin Cui
5ca4a9e2da implement missing seekdir and telldir
Bug: 18266863
Change-Id: I189ee949d4f7ccee099f3341e349cd969d25480f
2014-11-07 10:20:32 -08:00
The Android Open Source Project
2ed9ee1e93 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD 2014-11-06 17:43:39 -08:00
Elliott Hughes
cd30cb3633 am 08a70184: Merge "Add POSIX lcong48."
* commit '08a70184b42ef2963794a56233b0253e0b367253':
  Add POSIX lcong48.
2014-11-07 00:58:34 +00:00
Elliott Hughes
b20c24456e Implement all the POSIX _l functions.
Strictly speaking, this only implements the _l variants of the functions
we actually have. We're still missing nl_langinfo_l, for example, but we
don't have nl_langinfo either.

Change-Id: Ie711c7b04e7b9100932a13f5a5d5b28847eb4c12
2014-11-06 15:52:22 -08:00
Elliott Hughes
274afe8f0e Add POSIX lcong48.
Change-Id: I821046816661d77275cb02c8c99d526bb41afb9c
2014-11-06 14:14:37 -08:00
Elliott Hughes
fa7e13b3af am a80f11ba: Merge "Add support for listing missing POSIX 2013 symbols."
* commit 'a80f11ba99a078515aa7e06dc99db62a475a7b53':
  Add support for listing missing POSIX 2013 symbols.
2014-11-06 06:08:32 +00:00