Commit Graph

5780 Commits

Author SHA1 Message Date
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
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
Elliott Hughes
6370aedd0e Add support for listing missing POSIX 2013 symbols.
Change-Id: Ic51787890f837f74a22ca63d64a5710474d00cbc
2014-11-05 16:54:53 -08:00
Elliott Hughes
eac625a210 am c13a2044: Merge "Fix newlocale with a NULL locale name."
* commit 'c13a2044e3b4d6084ef7ed32fb35e63e4157a96a':
  Fix newlocale with a NULL locale name.
2014-11-05 02:42:07 +00:00
Chih-Hung Hsieh
45f736b323 am 6c8f2475: Merge "Fix warning of missing field initializer."
* commit '6c8f247581890a25fb899767db220a8245859f71':
  Fix warning of missing field initializer.
2014-11-05 02:41:55 +00:00
Elliott Hughes
c13a2044e3 Merge "Fix newlocale with a NULL locale name." 2014-11-05 02:20:55 +00:00
Elliott Hughes
7e0d0f8572 Fix newlocale with a NULL locale name.
Bug: https://code.google.com/p/android/issues/detail?id=78567
Change-Id: I272dabc12ab186b44a525c7e8ac1846e62334e85
2014-11-04 18:03:44 -08:00
Chih-Hung Hsieh
dc6599e20f Fix warning of missing field initializer.
BUG: 18241135
Change-Id: I91304eb608bc3336ce5fcd5744fbe080d64f1cc2
2014-11-04 12:09:35 -08:00
Dmitriy Ivanov
69c5d108a5 Revert "Add RTLD_NODELETE flag support"
This reverts commit c87f65d2cd.

Bug: 18222321
Bug: 18211780
Change-Id: I00252e26a28a41ab9f1e2dd3b32f0f80d86297f1
2014-11-03 22:15:26 -08:00
Elliott Hughes
90138639a5 am e76ea9bb: Merge "Ensure we initialize stdin/stdout/stderr\'s recursive mutexes."
* commit 'e76ea9bbe0a8bccf97b88d09af13a84fd34a6a76':
  Ensure we initialize stdin/stdout/stderr's recursive mutexes.
2014-11-04 00:53:16 +00:00
Elliott Hughes
d18f4b2578 Ensure we initialize stdin/stdout/stderr's recursive mutexes.
(cherry-pick of 6a03abcfd23f31d1df06eb0059830e22621282bb.)

Bug: 18208568
Change-Id: I9da16ce0f9375bc363d1d02be706d73fd3b1e150
2014-11-03 13:46:41 -08:00
Elliott Hughes
6a03abcfd2 Ensure we initialize stdin/stdout/stderr's recursive mutexes.
Bug: 18208568
Change-Id: I9da16ce0f9375bc363d1d02be706d73fd3b1e150
2014-11-03 12:32:17 -08:00
Dmitriy Ivanov
c87f65d2cd Add RTLD_NODELETE flag support
Bug: 18186310
Bug: https://code.google.com/p/android/issues/detail?id=64069

(cherry picked from commit 1b20dafdbe)

Change-Id: Ic02eec22a7c322ece65eb40730a3404f611526b1
2014-10-31 17:04:00 -07:00
Dmitriy Ivanov
0f47d9c1ce Fix unused DT entry warnings.
DT_STRSZ Implement strtab boundary checks
 DT_FLAGS_1 Warn if flags other than DF_1_NOW|DF_1_GLOBAL are set

Bug: 17552334
Bug: 18186310

(cherry picked from commit 6cdeb5234d)

Change-Id: I7ffc7bc600798308a77ad949a644949b64250ae2
2014-10-31 17:03:59 -07:00
Elliott Hughes
748fbe5c41 Fix a couple more cases of missing CLOEXEC.
The debuggerd case can probably never happen, because you're crashing at this
point anyway. The system property one seems possible though.

Bug: 18186310

(cherry picked from commit 0dc39f9952)

Change-Id: I3e84488fc246f6c28cbd82e96d0cd4343a12c28a
2014-10-31 17:03:21 -07:00
Dan Albert
653263a964 Only use <atomic> for C++11 and newer.
Any pre-C++11 clients of stdatomic.h that use libc++ are being forced
over to <atomic>, which they don't have the language support to use.

Bug:17736764

Change-Id: I62445c1f2541410a1569498c09433c7196635537
(cherry picked from commit 3ce0769aa5)
2014-10-30 13:22:34 -07:00
Elliott Hughes
25f4bb984c am e38bf839: Merge "limits.h: add define for HOST_NAME_MAX"
* commit 'e38bf839837d11542e7d1deb00d81542a0ef55b7':
  limits.h: add define for HOST_NAME_MAX
2014-10-30 16:02:29 +00:00
Elliott Hughes
e38bf83983 Merge "limits.h: add define for HOST_NAME_MAX" 2014-10-30 15:56:44 +00:00
Yongqin Liu
0589777a33 limits.h: add define for HOST_NAME_MAX
according to the rules defined here:
    http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html
add the definition for HOST_NAME_MAX to limits.h file,
and set the default value to _POSIX_HOST_NAME_MAX as 255

Change-Id: Iddd5c6c569f4e0a14994c7a7c54985f3e7809fc4
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-10-30 10:59:24 +08:00
Elliott Hughes
b0693ec582 Merge changes I0feda6b2,I22d13fde,I49d7d09d,Ice490bfe into lmp-mr1-dev
* changes:
  Fix the type of u_ar0 in <sys/user.h>.
  Add greg_t for arm64.
  POSIX says <signal.h> gets you ucontext_t.
  Add in_port_t and move it and in_addr_t to the correct header file.
2014-10-29 23:22:30 +00:00
Elliott Hughes
4c29b1c266 am f362e9fb: Merge "Remove an unused file."
* commit 'f362e9fb33722f89cebe65ddf2f07d2b07e4390e':
  Remove an unused file.
2014-10-29 20:51:27 +00:00
Elliott Hughes
39cd0fa24a Remove an unused file.
We don't have any FreeBSD stdio left.

Bug: 17154680
Change-Id: I145627f564364ac8d4707d431d451cc3115c1c6a
2014-10-29 13:42:23 -07:00
Elliott Hughes
0c4e98adbe Fix the type of u_ar0 in <sys/user.h>.
(cherry picked from commit e03950fa0c)

Bug: 18172268
Change-Id: I0feda6b253882f68f47bcf30fad998286cc7f620
2014-10-29 11:57:36 -07:00
Elliott Hughes
d0fb6a2940 Add greg_t for arm64.
This was already present for the other architectures. I think we skipped
this because glibc seems to have an incorrect definition (int rather than
long), but the kernel has the sane definition (just not in a uapi header).

(cherry picked from commit 8e4d371091)

Bug: 18172268
Change-Id: I22d13fdeb6431ea122dd028a229782dcaf2286b2
2014-10-29 11:56:59 -07:00
Elliott Hughes
ab4d5cf242 POSIX says <signal.h> gets you ucontext_t.
POSIX also says that ucontext_t's uc_sigmask has type sigset_t.

MIPS64 strace needs this.

The #define is to keep chromium off our lawn; otherwise it tries to redefine
all this stuff itself. We should probably clean that up and remove the #define.

(cherry picked from commit 26a8eb50a8)

Bug: 18172268
Change-Id: I49d7d09dabfc6c6926a8e1f4b235d041e2f2fc4d
2014-10-29 11:55:02 -07:00
Elliott Hughes
eedbf70e8e Add in_port_t and move it and in_addr_t to the correct header file.
No one's reported this, but I saw it in an Android port of fuser(1).

We still have lots of problems in our network headers because we
get most of the structs direct from the kernel, and it doesn't use
types like this (which is why we've got away without this one for
so long). One day we should probably look at cleaning that up, but
doing so can wait.

(cherry picked from commit 35d226e05d)

Bug: 18172268
Change-Id: Ice490bfe84afb04722d738128053d4c533b8a664
2014-10-29 11:49:45 -07:00
Christopher Ferris
98d57c95bc Add stpcpy assembler version.
For generic, continue to use the C version of the code.

Bug: 13746695

(cherry picked from commit 7d849ac378)

Change-Id: Iae44785f37f9bb59103ab78fb9f74c92f8a95c7f
2014-10-29 11:07:03 -07:00
Yabin Cui
63edd69e57 am cbb4606a: Merge "change unsigned int to uint32_t for api arc4random/arc4random_uniform"
* commit 'cbb4606ad00f084f984c92a8674400a112ea200e':
  change unsigned int to uint32_t for api arc4random/arc4random_uniform
2014-10-29 12:32:36 +00:00
Elliott Hughes
91bfaed26a am 13dcb88b: Merge "Disable tzdata in ."
* commit '13dcb88b0f8ce238456059fdc0b6c946caed1e3a':
  Disable tzdata in $ANDROID_DATA.
2014-10-29 12:32:23 +00:00
Elliott Hughes
912fe0a6df am f96eaf62: Merge "[x86,x86_64] Fix libgcc unwinding through signal"
* commit 'f96eaf6202351a1b5153cfaad3137e4b63846f8f':
  [x86,x86_64] Fix libgcc unwinding through signal
2014-10-29 12:31:52 +00:00
Christopher Ferris
1c8ea807eb Cleanup arm assembly.
Remove the old arm directives.
Change the non-local labels to .L labels.
Add cfi directives to strcpy.S.

Bug: 18157900

(cherry picked from commit c8bd2abab2)

Change-Id: Ifa1c3d16553d142eaa0d744af040f0352538106c
2014-10-28 18:19:33 -07:00
Christopher Ferris
0cc59dd303 Add __memcpy_chk assembly for 64 bit.
Bug: 17623887

(cherry picked from commit 8cf61dab5f)

Change-Id: I91e66ca0c26f04b50308059f9c89d388d55f6e3a
2014-10-28 16:18:47 -07:00
Elliott Hughes
86d16a053e Clean up the architecture-specific makefiles.
Group things appropriately and name each group.

Bug: 18160821

(cherry picked from commit 7c02d9428c)

Change-Id: I863242515af44058154d03e2d8c34678e682d66a
2014-10-28 15:13:36 -07:00
Elliott Hughes
b378c27226 No arm source refers to SOFTFLOAT.
So why bother #defining it?

Bug: 18160821

(cherry picked from commit b1a6c319c4)

Change-Id: I9cd9c144ba7071fddda12fa16d1232ad861b66be
2014-10-28 15:13:04 -07:00
Yabin Cui
a39f939e0d change unsigned int to uint32_t for api arc4random/arc4random_uniform
Bug: 17894480
Change-Id: Ia4b5a7cd2b2c6002ed70955f86f7780d26d15e26
2014-10-28 13:44:48 -07:00
Elliott Hughes
7dbb1cff0b am 021b6412: Merge "Fix the type of u_ar0 in <sys/user.h>."
* commit '021b6412f7b7ce73b383480b25a8e5d69323f78c':
  Fix the type of u_ar0 in <sys/user.h>.
2014-10-28 19:28:34 +00:00
Elliott Hughes
ee8faa5e74 am 7f164f60: Merge "POSIX says pthread_mutex_trylock returns EBUSY, not EDEADLK."
* commit '7f164f6052b6dcee1c2cc70accdfac4b2c790b19':
  POSIX says pthread_mutex_trylock returns EBUSY, not EDEADLK.
2014-10-28 19:28:32 +00:00
Christopher Ferris
43dc3a9aae Remove the unnecessary generic-neon code.
Bug: 18156619
(cherry picked from commit 2169e17482)

Change-Id: I4a7f5bb9ad4c27b274f3a3c86c1617ca0578b98f
2014-10-28 12:07:25 -07:00
Elliott Hughes
e24bf5d7b9 Disable tzdata in $ANDROID_DATA.
(cherry picked from 4c30130a2155c37e80af4c3b53bf4f6ce832e760.)

Bug: 18139284
Change-Id: I2670dc1791d635139a5d39a438dc08777439476b
2014-10-28 09:34:09 -07:00
Elliott Hughes
1ea31a2901 Merge "Don't mask out SA_RESTORER from sa_flags." into lmp-mr1-dev 2014-10-28 15:36:56 +00:00
Elliott Hughes
cd99bbfd50 Merge "Disable tzdata in $ANDROID_DATA." into lmp-mr1-dev 2014-10-28 15:06:31 +00:00
Elliott Hughes
28ea229bb2 Don't mask out SA_RESTORER from sa_flags.
glibc doesn't do this, and we probably shouldn't either.

Bug: 16703540
Bug: 17436734

(cherry picked from commit afe58ad989)

Change-Id: Iada5d0ae814f438cb276f056b2b5e3675f0e3666
2014-10-28 07:55:53 -07:00
Elliott Hughes
3f5d8a00e4 am cad8d226: Merge "Use mxcr_mask instead of mxcsr_mask to match glibc."
* commit 'cad8d226c3589a65775fda972d4cd3ebd3877dab':
  Use mxcr_mask instead of mxcsr_mask to match glibc.
2014-10-28 04:51:25 +00:00
Elliott Hughes
43ec1fb76c am a4c0b756: Merge "Add mkfifoat(3)."
* commit 'a4c0b7567190968d263bedd1073ea633510f9a45':
  Add mkfifoat(3).
2014-10-28 04:49:11 +00:00
Elliott Hughes
ac5df33e09 am 6c5694b6: Merge "Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3)."
* commit '6c5694b6c8343d740c36adbe904442cecd8030a6':
  Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).
2014-10-28 04:33:09 +00:00
Pavel Chupin
8eb8c39299 [x86,x86_64] Fix libgcc unwinding through signal
This change provides __restore/__restore_rt on x86 and __restore_rt on
x86_64 with unwinding information to be able to unwind through signal
frame via libgcc provided unwinding interface. See comments inlined for
more details.

Also remove the test that had a dependency on
__attribute__((cleanup(foo_cleanup))). It doesn't provide us with any
better test coverage than we have from the newer tests, and it doesn't
work well across a variety architectures (presumably because no one uses
this attribute in the real world).

Tested this on host via bionic-unit-tests-run-on-host on both x86 and
x86-64.

Bug: 17436734
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>

(cherry picked from commit 50321e2e66)

Change-Id: Iba90e36958b00c7cc7db5eeebf888dc89ce4d619
2014-10-27 16:42:49 -07:00
Elliott Hughes
e5e61a0a92 Use the kernel's sa_restorer for aarch64.
gdb was happy with what we had, but libgcc and libunwind weren't.
libgcc is happy with the kernel's restorer (because of the extra nop),
though libunwind looks like it's going to need code changes regardless.

We could make our restorer more like the kernel's one, but why bother
when we can just let the kernel supply the canonical one?

Bug: 17436734

(cherry picked from commit 1cff9a8964)

Change-Id: Ie13d73fd97395e1979a67c2294e036a97c50000d
2014-10-27 16:42:19 -07:00
Elliott Hughes
5054e1a121 Fix 32-bit arm unwinding through signal frames.
gdb was already okay; libgcc and libunwind need a little extra help.

Bug: 17436734

(cherry picked from commit 148dff3ec6)

Change-Id: I2cc997017acc57c930284af5264f353656b98c7b
2014-10-27 16:41:56 -07:00
Elliott Hughes
7dc2b7b30d Fix signal trampolines.
* LP32 should use sa_restorer too. gdb expects this, and future (>= 3.15) x86
  kernels will apparently stop supporting the case where SA_RESTORER isn't
  set.

* gdb and libunwind care about the exact instruction sequences, so we need to
  modify the code slightly in a few cases to match what they're looking for.

* gdb also cares about the exact function names (for some architectures),
  so we need to use __restore and __restore_rt rather than __sigreturn and
  __rt_sigreturn.

* It's possible that we don't have a VDSO; dl_iterate_phdr shouldn't assume
  that getauxval(AT_SYSINFO_EHDR) will return a non-null pointer.

This fixes unwinding through a signal handler in gdb for all architectures.
It doesn't fix libunwind for arm and arm64. I'll keep investigating that...

(cherry picked from commit 36f451a6d9)

Bug: 17436734
Change-Id: Ic1ea1184db6655c5d96180dc07bcc09628e647cb
2014-10-27 16:41:28 -07:00
Pavel Chupin
50321e2e66 [x86,x86_64] Fix libgcc unwinding through signal
This change provides __restore/__restore_rt on x86 and __restore_rt on
x86_64 with unwinding information to be able to unwind through signal
frame via libgcc provided unwinding interface. See comments inlined for
more details.

Also remove the test that had a dependency on
__attribute__((cleanup(foo_cleanup))). It doesn't provide us with any
better test coverage than we have from the newer tests, and it doesn't
work well across a variety architectures (presumably because no one uses
this attribute in the real world).

Tested this on host via bionic-unit-tests-run-on-host on both x86 and
x86-64.

Bug: 17436734
Change-Id: I2f06814e82c8faa732cb4f5648868dc0fd2e5fe4
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
2014-10-27 16:14:55 -07:00
Elliott Hughes
4c30130a21 Disable tzdata in $ANDROID_DATA.
Bug: 18139284
Change-Id: I2670dc1791d635139a5d39a438dc08777439476b
2014-10-27 13:38:21 -07:00
Elliott Hughes
021b6412f7 Merge "Fix the type of u_ar0 in <sys/user.h>." 2014-10-27 17:41:00 +00:00
Elliott Hughes
e03950fa0c Fix the type of u_ar0 in <sys/user.h>.
Change-Id: I9332dea60f7c60b45bc80026686c266bfa7a782c
2014-10-24 20:57:09 -07:00
Elliott Hughes
5b1111a694 POSIX says pthread_mutex_trylock returns EBUSY, not EDEADLK.
Found by unit test.

Change-Id: Iffbd2f04213616927fbd7b5419460031f7a078e9
2014-10-24 19:33:11 -07:00
Elliott Hughes
aa6cd5819c Use mxcr_mask instead of mxcsr_mask to match glibc.
Bug: 18097559

(cherry picked from commit f485547b92)

Change-Id: I242105faa8210abc9635a951b25b127cd64ed23c
2014-10-24 08:43:34 -07:00
Elliott Hughes
96a6f40163 am e516321d: Merge "Update bionic to tzdata2014i."
* commit 'e516321d78162479a4ce17bd5a9ba8c0834abf18':
  Update bionic to tzdata2014i.
2014-10-24 13:01:54 +00:00
Christopher Ferris
274f5e737d am efd2ec8f: Merge "Fix race condition in timer disarm/delete."
* commit 'efd2ec8fbddb99a7a2d7da8e1024655fa08153ca':
  Fix race condition in timer disarm/delete.
2014-10-24 13:01:53 +00:00
Elliott Hughes
f485547b92 Use mxcr_mask instead of mxcsr_mask to match glibc.
Bug: 18097559
Change-Id: Iaca301d7d4c4902989d4699117f72b88d5c4bd78
2014-10-23 20:29:42 -07:00
Elliott Hughes
ca8e84c6ff Add mkfifoat(3).
Looks like I missed one of the *at functions when I added the rest.

Change-Id: If16de82dbf6f9a3ea7bfdcba406ca1c74a3f2279
2014-10-23 19:10:54 -07:00
Derek Xue
ba811120ae Migrate system/extra getaddrinfo test, and fix a bug in getservbyname(3).
This change is to migrate the getaddrinfo tests defined in the old file
system/extras/tests/bionic/libc/common/test_getaddrinfo.c
to the new place bionic/tests/netdb_test.cpp.

The test here is more thorough, and catches a bug in getservbyname(3)
that was breaking getaddrinfo(3)'s ability to look up services by name
without a hint that would cause it to ask for a specific protocol.

Change-Id: Ief5ebd0869496d1bc6a97861dfefa04bdf24bab1
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
2014-10-22 22:23:10 -07:00
Elliott Hughes
8fab8119dd Update bionic to tzdata2014i.
From the release notes:

   Changes affecting future time stamps

     Pacific/Fiji will observe DST from 2014-11-02 02:00 to
     2015-01-18 03:00.  (Thanks to Ken Rylander for the heads-up.)
     Guess that future years will use a similar pattern.

     A new Zone Pacific/Bougainville, for the part of Papua New
     Guinea that plans to switch from UTC+10 to UTC+11 on
     2014-12-28 at 02:00.  (Thanks to Kiley Walbom for the
     heads-up.)

   Changes affecting time zone abbreviations

     Since Belarus is not changing its clocks even though Moscow
     is, the time zone abbreviation in Europe/Minsk is changing
     from FET to its more-traditional value MSK on 2014-10-26 at
     01:00.  (Thanks to Alexander Bokovoy for the heads-up about
     Belarus.)

     The new abbreviation IDT stands for the pre-1976 use of UT+8
     in Indochina, to distinguish it better from ICT (UT+7).

   Changes affecting past time stamps

     Many time stamps have been corrected for Asia/Ho_Chi_Minh
     before 1976 (thanks to Trần Ngọc Quân for an indirect pointer
     to Trần Tiến Bình's authoritative book).  Asia/Ho_Chi_Minh has
     been added to zone1970.tab, to give tzselect users in Vietnam
     two choices, since north and south Vietnam disagreed after our
     1970 cutoff.

     Asia/Phnom_Penh and Asia/Vientiane have been turned into
     links, as they differed from existing zones only for older
     time stamps.  As usual, these changes affect pre-1970 time
     stamps only.  Their old contents have been moved to the
     'backzone' file.

Bug: 18085936

(cherry picked from commit a05c2a2a70)

Change-Id: If0253cc1515e1bc98e99c6e24eec797836ca7c27
2014-10-22 13:45:25 -07:00
Elliott Hughes
e516321d78 Merge "Update bionic to tzdata2014i." 2014-10-22 20:41:44 +00:00
Christopher Ferris
62d84b1935 Fix race condition in timer disarm/delete.
When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.

Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.

Modify the repeat test to finish more quickly than before.

Refactor the Counter implementation a bit.

Bug: 18039727

(cherry pick from commit 0724132c32)

Change-Id: I135726ea4038a47920a6c511708813b1a9996c42
2014-10-22 13:20:39 -07:00
Christopher Ferris
82eeec689f Merge "Fix generic __memcpy_chk implementation." into lmp-mr1-dev 2014-10-22 20:16:18 +00:00
Christopher Ferris
9b7b0d82eb Merge "Fix race condition in timer disarm/delete." into lmp-mr1-dev 2014-10-22 19:43:44 +00:00
Elliott Hughes
a05c2a2a70 Update bionic to tzdata2014i.
From the release notes:

   Changes affecting future time stamps

     Pacific/Fiji will observe DST from 2014-11-02 02:00 to
     2015-01-18 03:00.  (Thanks to Ken Rylander for the heads-up.)
     Guess that future years will use a similar pattern.

     A new Zone Pacific/Bougainville, for the part of Papua New
     Guinea that plans to switch from UTC+10 to UTC+11 on
     2014-12-28 at 02:00.  (Thanks to Kiley Walbom for the
     heads-up.)

   Changes affecting time zone abbreviations

     Since Belarus is not changing its clocks even though Moscow
     is, the time zone abbreviation in Europe/Minsk is changing
     from FET to its more-traditional value MSK on 2014-10-26 at
     01:00.  (Thanks to Alexander Bokovoy for the heads-up about
     Belarus.)

     The new abbreviation IDT stands for the pre-1976 use of UT+8
     in Indochina, to distinguish it better from ICT (UT+7).

   Changes affecting past time stamps

     Many time stamps have been corrected for Asia/Ho_Chi_Minh
     before 1976 (thanks to Trần Ngọc Quân for an indirect pointer
     to Trần Tiến Bình's authoritative book).  Asia/Ho_Chi_Minh has
     been added to zone1970.tab, to give tzselect users in Vietnam
     two choices, since north and south Vietnam disagreed after our
     1970 cutoff.

     Asia/Phnom_Penh and Asia/Vientiane have been turned into
     links, as they differed from existing zones only for older
     time stamps.  As usual, these changes affect pre-1970 time
     stamps only.  Their old contents have been moved to the
     'backzone' file.

Bug: 18085936
Change-Id: I89c065b4788b10ed7530cc4e8cfbc1b65c05c1b7
2014-10-22 12:31:02 -07:00
Christopher Ferris
f13e1eb92f Fix generic __memcpy_chk implementation.
- Clean up the labels (add .L to make them local).
- Change to using cfi directives.
- Fix unwinding of the __memcpy_chk fail path.

Bug: 18033671

(cherry pick from commit 7123d4371a)

Change-Id: Ife93bcbfc1949ef29fc8e2dc515b7120632b82b1
2014-10-22 12:02:13 -07:00
Dmitriy Ivanov
702ab5b37e Rename library_offset to library_fd_offset
replace lseek() and use pread() instead
 add test for library_fd_offset > file_size case

Bug: 17762003

(cherry picked from commit a6c1279098)

Change-Id: Ie117c745081ee33d07db5341115ff6c8e98b0dec
2014-10-22 16:35:04 +00:00
Bill Yi
4b8c96d6cd Merge commit 'bc8745cc3dd94331d008d553a374e733df978963' into HEAD 2014-10-22 08:45:57 -07:00
Christopher Ferris
0724132c32 Fix race condition in timer disarm/delete.
When setting a repeat timer using the SIGEV_THREAD mechanism, it's possible
that the callback can be called after the timer is disarmed or deleted.
This happens because the kernel can generate signals that the timer thread
will continue to handle even after the timer is supposed to be off.

Add two new tests to verify that disarming/deleting doesn't continue to
call the callback.

Modify the repeat test to finish more quickly than before.

Refactor the Counter implementation a bit.

Bug: 18039727
Change-Id: I73192c915cdacf608521b1792c54e5af14a34907
2014-10-21 18:31:02 -07:00
Chih-Hung Hsieh
c89ee272fb Replace ambiguous cmp operator with cmpl.
Clang assembler rejects ambiguous cmp instruction.

BUG: 17302482
Change-Id: Ie8dca7e4f46e0906c47076bba21c1941482ba6b3
2014-10-21 16:25:35 -07:00
Dmitriy Ivanov
54d76360eb Merge "Rename library_offset to library_fd_offset" 2014-10-21 21:06:18 +00:00
Dmitriy Ivanov
de01780f46 Add file_offset parameter to android_extinfo
Bug: 17762003

(cherry picked from commit 07e5bc152d)

Change-Id: I72d527831384ff5dde013a4c8dfe639fbec165f5
2014-10-21 13:52:49 -07:00
Dmitriy Ivanov
a6c1279098 Rename library_offset to library_fd_offset
replace lseek() and use pread() instead
 add test for library_fd_offset > file_size case

Bug: 17762003
Change-Id: I4555f0be635124efe849c1f226985bcba72ffcbd
2014-10-21 13:51:08 -07:00
Dan Albert
ad136624b2 Merge "Never use ASAN." 2014-10-21 18:28:19 +00:00
Dan Albert
5ba672ebcb Never use ASAN.
Unless we completely redo how we build bionic (so that the object
files for libc.so get built separately from libc.a), we can't enable
ASAN here, as libc.a gets linked into static executables.

Change-Id: I2ce4f51248bd51c4213a555ff481b6faabbf53f8
2014-10-21 11:22:26 -07:00
Hans Boehm
c712ceeec4 Make memory_order_acquire visible in global namespace
We were missing that using directive when including <atomic>.

Bug:17736764
Change-Id: Ie8ca92a952749415567bcd5fa21d56629a364660
(cherry picked from commit 76ac4d0853)
2014-10-20 11:41:34 -07:00
Christopher Ferris
bc8745cc3d am 8f41d3d3: Merge "Fix generic __memcpy_chk implementation."
* commit '8f41d3d3bc7cf2375e5dd9202da619fd67a5928f':
  Fix generic __memcpy_chk implementation.
2014-10-20 18:38:27 +00:00
Christopher Ferris
8f41d3d3bc Merge "Fix generic __memcpy_chk implementation." 2014-10-20 18:21:22 +00:00
Chih-Hung Hsieh
042319b908 am 9a740482: Merge "Add -no-integrated-as at local level."
* commit '9a7404824b3dfaad6ba14a41aab5f14132392a92':
  Add -no-integrated-as at local level.
2014-10-20 17:02:32 +00:00
Chih-Hung Hsieh
a371750681 Add -no-integrated-as at local level.
Later we will enable integrated-as as default at the global level.

BUG: 17820427
BUG: 17302991
Change-Id: I233204ca04d7222b2cb1fbd0fa48a482f8b63f6f
2014-10-20 09:09:25 -07:00
Christopher Ferris
7123d4371a Fix generic __memcpy_chk implementation.
- Clean up the labels (add .L to make them local).
- Change to using cfi directives.
- Fix unwinding of the __memcpy_chk fail path.

Bug: 18033671
Change-Id: I12845f10c7ce5e6699c15c558bda64c83f6a392a
2014-10-17 14:44:36 -07:00
Dan Albert
96def860ae am 90aa7e37: Merge "Only use <atomic> for C++11 and newer."
* commit '90aa7e374f9000577cde64c4fb88c5dab8dac62e':
  Only use <atomic> for C++11 and newer.
2014-10-16 16:27:37 +00:00
Dan Albert
3ce0769aa5 Only use <atomic> for C++11 and newer.
Any pre-C++11 clients of stdatomic.h that use libc++ are being forced
over to <atomic>, which they don't have the language support to use.

Change-Id: I62445c1f2541410a1569498c09433c7196635537
2014-10-16 07:52:51 -07:00
Dan Albert
8d87796d19 am 71cbcdcf: Merge "We don\'t actually need all of libc++ here."
* commit '71cbcdcf947835076241b9dd72099f28997eb290':
  We don't actually need all of libc++ here.
2014-10-15 20:10:06 +00:00
Dan Albert
71cbcdcf94 Merge "We don't actually need all of libc++ here." 2014-10-15 19:59:09 +00:00
Dan Albert
a7c2e0bad6 We don't actually need all of libc++ here.
All we're actually interested in is the unwinder. Since that's now a
separate library, just use that.

Change-Id: If86071a0d850da961336a58147b70369ace7bd12
2014-10-14 14:19:34 -07:00
Elliott Hughes
2476691632 am 97df16ba: Merge "Add clock_settime and clock_nanosleep."
* commit '97df16ba5c2911e06d1211781a5724706abd227b':
  Add clock_settime and clock_nanosleep.
2014-10-14 03:26:03 +00:00
Haruki Hasegawa
1816025684 Add clock_settime and clock_nanosleep.
Add the missing prototypes, fix the existing prototypes to use clockid_t
rather than int, fix clock_nanosleep's failure behavior, and add simple
tests.

Bug: 17644443
Bug: https://code.google.com/p/android/issues/detail?id=77372
Change-Id: I03fba369939403918abcabae9551a7123953d780
Signed-off-by: Haruki Hasegawa <h6a.h4i.0@gmail.com>
2014-10-13 17:04:10 -07:00
Dmitriy Ivanov
951e582c68 am c2297050: Merge "Add glibc alias for NT_PRFPREG"
* commit 'c229705051c8b6a06ad81c221ca74ef9aa743e13':
  Add glibc alias for NT_PRFPREG
2014-10-13 22:15:39 +00:00
Christopher Ferris
737b6581c2 am 083769a3: Merge "Return total footprint, not high water mark."
* commit '083769a3dffabfb968a03a700b9f2fd7838bcf75':
  Return total footprint, not high water mark.
2014-10-13 22:10:03 +00:00
Dan Albert
c01a38622a am 94571f9a: Merge "Use LOCAL_CXX_STL to select libc++_static."
* commit '94571f9ade03cfe24bff1bddc4d6c1a320b39b8e':
  Use LOCAL_CXX_STL to select libc++_static.
2014-10-13 22:10:00 +00:00
Dmitriy Ivanov
c229705051 Merge "Add glibc alias for NT_PRFPREG" 2014-10-13 22:08:52 +00:00
Dmitriy Ivanov
a6bee4df4c Add glibc alias for NT_PRFPREG
Also fix comment style for DF_1_ constants

Change-Id: I7c3ed1d834f0a2b85ee8cc8016c79020955084f8
2014-10-13 15:03:27 -07:00
Christopher Ferris
fee09e556f Return total footprint, not high water mark.
The mallinfo usmblks value returned by dlmalloc is a little misleading.
It's not the current max, it's the historical high water mark. This
leads to dumpsys meminfo producing native memory numbers that don't add up.
Change this to the real total footprint, not this high water mark.

Bug: 17265653

(cherry pick from commit f4ada9c9ce)

Change-Id: I2fba10285859dccfe8331063c9be14cc169f2d91
2014-10-13 12:45:35 -07:00
Christopher Ferris
59a02860a4 Merge "Return total footprint, not high water mark." into lmp-mr1-dev 2014-10-13 19:36:56 +00:00
Christopher Ferris
f4ada9c9ce Return total footprint, not high water mark.
The mallinfo usmblks value returned by dlmalloc is a little misleading.
It's not the current max, it's the historical high water mark. This
leads to dumpsys meminfo producing native memory numbers that don't add up.
Change this to the real total footprint, not this high water mark.

Bug: 17265653
Change-Id: Id0293a1b50c9b0be8795405049f537a51ab0e8b7
2014-10-13 12:29:30 -07:00
Dan Albert
90a29db0f4 Use LOCAL_CXX_STL to select libc++_static.
Directly adding the library to LOCAL_STATIC_LIBRARIES thwarts a few
build system checks.

Change-Id: Ib23c43badfa85de21c691f79ccdcc2cbe2a89b33
2014-10-13 11:20:29 -07:00
Christopher Ferris
e0fafb019e am c891e240: Add back symbols to fix Greed for Glory franchise.
* commit 'c891e24073830e07ba7373dee554ff2c70e1d313':
  Add back symbols to fix Greed for Glory franchise.
2014-10-10 20:47:00 +00:00
Elliott Hughes
2f25cf373c Fix pthread_attr_getstack under valgrind.
valgrind seems to mess with the stack enough that the kernel will
report "[stack:pid]" rather than "[stack]" in /proc/self/maps, so
switch to the task-specific file instead to force "[stack]". (There
are two conditions in the kernel code that decides which form to
output.)

Bug: 17897476

(cherry picked from commit 9afb2f2106)

Change-Id: I92c331ef6fb5868af49e75bc595710d290a95f5b
2014-10-10 10:57:48 -07:00