History log of /bionic/libc/include/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1543fdf616ddebee7819214437527f380e5c743b 08-Oct-2014 Elliott Hughes <enh@google.com> Work around a bug in Immersion's libImmEmulatorJ.so.

This library calls pthread_mutex_lock and pthread_mutex_unlock with a NULL
pthread_mutex_t*. This gives them (and their users) one release to fix things.

Bug: 17443936

(cherry picked from commit 7d3f553f989f830976efa92ddc3c84661d4d42aa)

Change-Id: Ie26bbecd3a74d61113b51c18832872499b97ee86
(cherry picked from commit b5e7eba6d1b97e471996fcfe7dbde7cbba7512ef)
thread.h
086bb382db3de7459bc5fad6bb1c257ca331b0e8 24-Sep-2014 Dan Albert <danalbert@google.com> Fix incorrect parameter types for locale funcs.

strtoll(3), strtoull(3), wcstoll(3), and wcstoull(3) all take an _int_
as a base, not a size_t. This is an ABI compatibility issue.

Bug: 17628622
Change-Id: I17f8eead34ce2112005899fc30162067573023ec
(cherry picked from commit 3c5037f1b3b747e79d17a5f717d9f9c365132d33)
tdlib.h
char.h
27efc48814b8153c55cbcd0af5d9add824816e69 12-Sep-2014 Elliott Hughes <enh@google.com> Add pthread_gettid_np and re-expose __get_thread for LP32.

A lot of third-party code calls the private __get_thread symbol,
often as part of a backport of bionic's pthread_rwlock implementation.
Hopefully this will go away for LP64 (since you're guaranteed the
real implementation there), but there are still APIs that take a tid
and no way to convert between a pthread_t and a tid. pthread_gettid_np
is a public API for that. To aid the transition, make __get_thread
available again for LP32.

Bug: 14079438
Change-Id: I43fabc7f1918250d31d4665ffa4ca352d0dbeac1
thread.h
00008263782e484020420c606f7d145fe7d0a4d8 11-Sep-2014 Elliott Hughes <enh@google.com> Add posix_fadvise(3).

Bug: 12449798
Change-Id: I07cbf3f670a0d1304b68148325a774f266b5c433
cntl.h
f0e9458ea596227720fa745df15f5357f6c0c8f6 06-Sep-2014 Elliott Hughes <enh@google.com> Don't expose non-standard basename_r and dirname_r in LP64.

Bug: 17407423
Change-Id: I47fe499a4c396bf09d7b78fd828728d04777398b
ibgen.h
9ac60bf82b1f0e316666b862e9924f90caa60342 29-Aug-2014 Hans Boehm <hboehm@google.com> Make stdatomic.h work with gcc4.6 host compiler

This is needed to make L work correctly, and bionic tests pass
again, after applying the equivalent of
commit 00aaea364501b3b0abe58dae461136159df1e356 there.

It makes the preexisting code that uses __sync implementations
much more useful, although we should no longer be exercising that
code in AOSP.

Specifically fixes:

We were invoking __has_extension and __has_builtin for GCC compilations.
They're clang specific. Restructured the tests.

The __sync implementation was not defining the LOCK_FREE macros.

ATOMIC_VAR_INIT was using named field initializations. These are a
C, not C++, feature, that is not supported by g++ 4.6.

The stdatomic bionic test still failed with 4.6 and glibc with our
questionable LOCK_FREE macro implementation. Don't run that piece
with 4.6.

In L, this is a prerequisite for fixing:

Bug:16880454
Bug:16513433

Change-Id: I9b61e42307f96a114dce7552b6ead4ad1c544eab
(cherry picked from commit 32429606bf696d3b2ca555f132a0d60c566d0bd0)
tdatomic.h
2b10e2f12262c5ac5d8dac4f0bfc16b1848cbfec 27-Aug-2014 Hans Boehm <hboehm@google.com> Undefine _Atomic before redefining

Stdatomic.h was potentially redefining _Atomic, in spite of a
prior definition by <atomic>. This could cause g++ builds that
included <stdatomic.h> with an available <atomic> header to break.

A functional stdatomic.h is a prerequisite for fixing the
following bugs. This is the middle of 3 AOSP updates to
bionics stdatomic.h that are needded to get there.

Bug:16880454
Bug:16513433

Change-Id: I562c7115118c0587d594d4d5b62d25101e47bfd8
(cherry picked from commit 3e4a0099a179d7acee63d78c8fc4c3cc7b0bae42)
tdatomic.h
c8cf3513ecb265ba3aadc846aa2113290a504c44 20-Aug-2014 Hans Boehm <hboehm@google.com> Fix, generalize stdatomic.h; improve test.

We seem to use this stdatomic.h sometimes, and slightly different prebuilts
at other times, making them all difficult to test, and making it unclear
which one we're testing. This generalizes the bionic header so that it
can be used directly as the prebuilt header as well. So long as they
don't diverge again, that should somewhat improve test coverage.

Use the correct builtin for atomic_is_lock_free.

Fix atomic_flag_init.

Turn on atomic tests even with __GLIBC__, since they now appear to pass.

Include uchar.h in stdatomic.h where needed.

Add a basic memory ordering test.

Fix bit-rotted comments in bionic tests makefile.

Prerequisite for fixing b/16880454 and

Bug:16513433

Change-Id: If6a14c1075b379395ba5d93357d56025c0ffab68
(cherry picked from commit 00aaea364501b3b0abe58dae461136159df1e356)
tdatomic.h
b2eb09a9ed9e08d9e49f4245d1959b2ca3fbaaf8 30-Aug-2014 Elliott Hughes <enh@google.com> Use __GNUC_PREREQ rather than __GNUC_PREREQ__ to match glibc.

Bug: 16874785

(cherry picked from commit e0c56efddf55ad40cb35b2c22e1dd9b4b50df159)

Change-Id: I9c922ba019f648766fc399d1c4e35e789e25acd4
tdatomic.h
ys/cdefs.h
2d80400a9e8454038a3ec29959436184be0c4c65 20-Aug-2014 Elliott Hughes <enh@google.com> Fix some 32-bit-isms in <stdio.h>.

Bug: 17157793
Change-Id: I8290e240b92e5617f4c12c0eacad6e622e677b6a
tdio.h
1506fc178e9dcd873eaf95535ac7625ebb59388f 18-Aug-2014 Dan Albert <danalbert@google.com> Expose android_set_abort_message().

Removes the leading underscores from __android_set_abort_message() and
moves its declaration into a public header file.

Bug: 17059126
Change-Id: I470c79db47ec783ea7a54b800f8b78ecbe7479ab
(cherry picked from commit ce6b1abbb1da797e716d8ec03da4e3b6304fd11d)
(cherry picked from commit 3a25ab952befbe908f6df45805683ebe3bf65863)
ndroid/set_abort_message.h
f0f66c0264eb4b6ee56072af34c91a78a9184f23 15-Aug-2014 Hans Boehm <hboehm@google.com> Have stdatomic.h punt to C++ atomic when possible

This is an alternate, somewhat simpler, fix that makes it safe to
include both <atomic> and <stdatomic.h> from C++ code in either order.
It means that C code consistently uses one implementation of atomics
and C++ another. We still have to make sure that those two
implementations interoperate correctly at runtime; in particular,
any flavor of atomic object needs to be represented exactly like the
underlying type, with the proper alignment constraint.

Bug:17007799
Change-Id: Iffcfc5220d8fa150f89dd083a121b24d23f268fc
(cherry picked from commit 019d3958118b7dc3ec8444ad2accca50c268b737)
tdatomic.h
bafee43161b9e38ca6c941eb3646df20ec6da759 14-Aug-2014 Dan Albert <danalbert@google.com> Change name of MB_CUR_MAX implementation function.

Glibc calls theirs __ctype_get_mb_cur_max. Make ours match to cut down
on differences between bionic and glibc.

Bug: 11156955
Change-Id: Ib7231f01aa9676dff30aea0af25d597bfe07bc73
tdlib.h
6035e6cc8317600c3100fdf1070890c3e42715a7 30-Jul-2014 Dan Albert <danalbert@google.com> Proper MB_CUR_MAX.

Previously this was hard coded to 4. This is only the case for UTF-8
locales.

As a side effect, this properly reports C.UTF-8 as the default locale
instead of C.

Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc
(cherry picked from commit 1aec7c1a35b2d03038b194967d5ebdc8e2c24b80)
tdlib.h
7aa27e1c1a53afe28f6180fd1fc50d096cabea7b 06-Aug-2014 Dehao Chen <dehao@google.com> Workaround b/16818336 which fails build under aggressive inlining.

Change-Id: Ifcd596714c427a2ec39502b9c0af9082ded91884
tring.h
4f76469e88e255bab1f8264e9ff8b95bff84365f 31-Jul-2014 Elliott Hughes <enh@google.com> Implement <sys/fsuid.h>.

(cherry picked from commit 79310994d2b3826a10598f7e7795acb5edb42a20)

Change-Id: I47688273691e5c95e5e9302eba254ccaaaad40ca
ys/fsuid.h
1242f7eb67c678922b55e2077d9cf2d5cdc85b15 30-Jul-2014 Elliott Hughes <enh@google.com> Remove declarations for things that don't exist.

The <grp.h> ones prevent gdb from building out of the box.

(cherry picked from commit f4c1a36a4500bc7f12e3065be3da4e8669ee011d)

Change-Id: I6958f2f1731de8c03df20b383decd414b78100aa
rp.h
tdio.h
tdlib.h
nistd.h
d0a80a927f874472f5397a02a818eb2e6fce9456 22-Jul-2014 Dan Albert <danalbert@google.com> There is no _MIN for unsigned types.

Change-Id: I49c38e51197b750210bdbf28c9cf6db30452a206
(cherry picked from commit ee7f1b5946dffa3aa95394b8cf6f15527f1068eb)
tdint.h
2ea0a58e01c1ed6db1da9dd0314ee053f5a32026 26-Jul-2014 Elliott Hughes <enh@google.com> Fix linkage of grantpt(3).

Also clean up the implementation of all the pty functions, add tests,
and fix the stub implementations of ttyname(3) and ttyname_r(3).

Bug: https://code.google.com/p/android/issues/detail?id=58888

(cherry picked from commit 4916706cfe590eb06c9b5bd4bd402ce056034d51)

Change-Id: I5cb7a1c17b156456e4c4818e65f256eb8d045424
tdlib.h
nistd.h
2be1be47aa9b63568fe6ce1e0a4029b37d90764d 29-Jul-2014 Elliott Hughes <enh@google.com> Revert "Add a hack to <stdlib.h> until we can fix libvpx."

This reverts commit 3fb5097a7eec40404760c304b36c8b657b374cab.
libvpx is now fixed.

Bug: 15598056
Change-Id: Icca974e667f92206505f484bd291726eb0150f68
tdlib.h
78e4f8fed2c162f8ada55180e48487ef2180cf93 28-Jul-2014 Elliott Hughes <enh@google.com> syscall(3)'s return type should be long.

This doesn't require us to change any of the syscall implementations
because (a) the LP32 ones have sizeof(int) == sizeof(long) anyway,
which is how we never noticed this bug before and (b) the LP64 ones
all use a 64-bit register for the result (and for the syscall number
too).

Bug: https://code.google.com/p/android/issues/detail?id=73952
Bug: 16568314

(cherry picked from commit 21972b61ec0572395c5684eebc6cc7b3a4c9e3be)

Change-Id: Ifbc424be29e5650ec72a24df25dd35f24fdd5b3c
ys/syscall.h
708c11205443cda14cfb21138d441106aa77a5f9 25-Jul-2014 Elliott Hughes <enh@google.com> Start hiding "private/bionic_time.h".

Bug: 15765976

(cherry picked from commit 905e6d58aaf515bf237e62078f8a321920fe4c6b)

Change-Id: Ic7435308e8b521886f42ac7bf59531924921ea67
ys/cdefs_elf.h
b902641d7303d2ea24c10f6d6e7ff49e7ee75611 24-Jul-2014 Elliott Hughes <enh@google.com> Implement twalk(3), add unit tests.

I've also added insque(3) and remque(3) (from NetBSD because the OpenBSD
ones are currently broken for non-circular lists).

I've not added the three hash table functions that should be in this header
because they operate on a single global hash table and thus aren't likely
to be useful.

Bug: https://code.google.com/p/android/issues/detail?id=73719

(cherry picked from commit 3e424d0a241f8ae5194514dabc4ad899f5a5416d)

Change-Id: I5882a6b48c80fea8ac6b9c27e7b9de10b202b4ff
earch.h
4126c129613e27717c110626070c44ea7e3f29ce 23-Jul-2014 Elliott Hughes <enh@google.com> Fix belated review comments on syslog change.

Bug: 14292866

(cherry picked from commit afe6360627ef3f0e9bc8f45535fbfae3354f3ae0)

Change-Id: I8e3cc6b37b2539e51a27261ffb5d6e58266ce11d
yslog.h
b76613627d045acd3bdb7294f424f14c21584872 22-Jul-2014 Elliott Hughes <enh@google.com> Rewrite syslog(3) to use Android logging.

Since we don't have syslogd on Android and you can't run one on a non-rooted
device, it's more useful if syslog output just goes to the regular Android
logging system.

Bug: 14292866

(cherry picked from commit 3ad8ecb64e9dd5614169232b84a93eb3b8aa32d7)

Change-Id: I3038855ca4f22532bf6d2c45d3f8028b866975f9
yslog.h
ed68221a8225a6696d2b0b1607ef0b2de1c1b3aa 16-Jul-2014 Hans Boehm <hboehm@google.com> Define atomic_charN_t only if charN_t is supported.

Some platform code is apparently compiled with switches that do
not support char16_t and char32_t. This caused stdatomic.h to fail
to compile. This CL makes stdatomic.h usable in those environments.

(cherry picked from commit 8b002362d996859ebfc8588d6859a9a79203dc27)
Change-Id: Ie5a17f20b8b545c97128d00605b4eabd2a6bfe3e
tdatomic.h
de24f1ac00924b9a523d06784867bc8c9312335d 19-Jul-2014 Elliott Hughes <enh@google.com> Clean up some misinformation around prctl.

prctl shouldn't be in <unistd.h>.

(cherry picked from commit 9c07aee83b4ebbf2dba8e23d6896683187b9724e)

Change-Id: I70cda886fbf4d58d82dc70adaa981506ebff9949
ys/prctl.h
nistd.h
291da8d3533b3ee47f8d742c72d789d3149d15da 18-Jul-2014 Elliott Hughes <enh@google.com> Remove SIOCKILLADDR from <sys/socket.h>.

(cherry picked from commit 8a3d1ca183e19d849728318fe8b0d36856fa000f)

Change-Id: Idb5cc4cff3ece7fa8740db12a19438d1a1c9a6a8
ys/socket.h
b5bef263b37b1f0def2a6c4e8e714ab871452b72 18-Jul-2014 Elliott Hughes <enh@google.com> Remove PR_SET_TIMERSLACK_PID from <sys/prctl.h>.

(cherry picked from commit 9f165d24f00c3bd4337ef719105bfb36bfa00a8b)

Change-Id: I009d3742cefbf36115f09824f267a0265ae215bf
ys/prctl.h
d648f557f116513263aa2f86bba552d2f72660f1 17-Jul-2014 Elliott Hughes <enh@google.com> Remove non-standard prctl constants from <sys/prctl.h>.

Also remove __bionic_name_mem which has exactly one caller, and is only
ever expected to be used in this one place.

(cherry picked from commit d7453860a6b06e7d4a960c20792ce6f0b6cc5f3a)

Change-Id: I26b7638609e9d4eaf4f21ae29721ea27d4176702
ys/prctl.h
9a7fdb2dae8f0ae0f9c5b0596bb2710f782925aa 17-Jul-2014 Elliott Hughes <enh@google.com> ptrace(3) should be varargs.

Bug: 16352070

(cherry picked from commit 98b088dce70a2625d5cfa1872e427af5f06bfd99)

Change-Id: I6193ef44df9a5668020916eaca90b47fc4c8ab77
ys/ptrace.h
a446505874ba52eb6ddb893c0d9c9321a73b235d 16-Jul-2014 Dan Albert <danalbert@google.com> Merge "Remove isascii_l(3)." into lmp-dev
97ba2a5cc4cf098938bb0a2c19ff01eb57c5536c 16-Jul-2014 Elliott Hughes <enh@google.com> Regenerate the syscalls list after the uapi update.

(cherry picked from commit 3fa60e10bcbfb8c7d94aeefc427640371683c920)

Change-Id: Id545a5b0b0953967effd819177f0dadb134f2011
ys/glibc-syscalls.h
da8accfefece3a436de68f1b750791fbf0974076 15-Jul-2014 Dan Albert <danalbert@google.com> Remove isascii_l(3).

Had intended to remove this one before submitting the locale changes,
but forgot. It isn't a standard ctype function, so we don't need it.

Change-Id: Ie9c09fa6c61b1101b5992fa06da30e373a0c6bf7
type.h
f6968e3c0822b27e9aa584c3490573f34b1725c1 12-Jul-2014 Elliott Hughes <enh@google.com> Define SIOCKILLADDR which isn't in the common kernel uapi headers.

(cherry picked from commit 2ba2888cac2f04daff7bbaf032d0df7a095b00c3)

Change-Id: I3845871bb44dae94d9a0428af0f562ddfb8bd660
ys/socket.h
263325d4b0c4c0e2933cb6428475ced16f0a86d5 12-Jul-2014 Elliott Hughes <enh@google.com> Define three prctl constants that went missing from uapi.

Change-Id: Ib81846ddefe9a75e02151c6592ed99b1f8ec5858
ys/prctl.h
10cf0d8c1f06d528f173e837ee9b7eab14247d7a 11-Jul-2014 Elliott Hughes <enh@google.com> EM_ARM and EM_AARCH64 are now in the uapi header.

Change-Id: Ice73403daff75ea45b24e02351269f6c012df6c1
lf.h
dfb5ce42bcc5a275af49211c0bbe64c5ec3d2668 10-Jul-2014 Dan Albert <danalbert@google.com> Revert "Revert "Add locale aware APIs.""

This reverts commit 063e20c26943ec82ef1d53a544545e79054e93d3.

Change-Id: Ib8c9004efefe75a5346b3af50dfe37952d91eb21
type.h
tdlib.h
tring.h
ime.h
char.h
ctype.h
2f61fba72b359fc169374cccb5040aab771d09a1 11-Jul-2014 Elliott Hughes <enh@google.com> The err family allow null format strings.

Also remove declarations for the _* variants that were never implemented in bionic (or glibc).

Change-Id: I4ea1f17bbb377e70632c10dd218f47110cabc27b
rr.h
063e20c26943ec82ef1d53a544545e79054e93d3 10-Jul-2014 Dan Albert <danalbert@google.com> Revert "Add locale aware APIs."

Accidentally verified against a dirty tree. Needs the companion change to libc++ to land upstream before I can submit this.

This reverts commit e087eac404b0e30de427392065e2750acf92bd4a.

Change-Id: I317ecd0923114f415eaad7603002f77feffb5e3f
type.h
tdlib.h
tring.h
ime.h
char.h
ctype.h
e087eac404b0e30de427392065e2750acf92bd4a 09-Jul-2014 Dan Albert <danalbert@google.com> Add locale aware APIs.

Since we only support the C locale, we can just forward all of these to
their non-locale equivalents for correct behavior.

Change-Id: Ib7be71b7f636309c0cc3be1096a4c1f693f04fbb
type.h
tdlib.h
tring.h
ime.h
char.h
ctype.h
3a8646fc5d9f1a9304251a1d1c8ff9e523d81b40 08-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Change android_dlextinfo flags to uint64_t

Change-Id: Id27e8f8e58dbcf6ae79644f2ad3af3dd0aef9ae7
ndroid/dlext.h
2d94ee29f4be528167f1de328226cac259aac738 07-Jul-2014 Dan Albert <danalbert@google.com> Merge "Revert "Revert "Hide _tolower_tab_ and _toupper_tab_ on LP64."""
04dc91ae763adc403a14c88b4c46f77b3d2d71a3 01-Jul-2014 Dmitriy Ivanov <dimitry@google.com> Load library using file handle.

* This patch enables dlopen by file descriptor
instead of path/name.

Bug: 15984217
Change-Id: Ib39051e00567fb97070bf96d8ce63993877c0a01
ndroid/dlext.h
f79ee064b64af54bce6d3931f4112761edb7d3a9 02-Jul-2014 Dan Albert <danalbert@google.com> Revert "Revert "Hide _tolower_tab_ and _toupper_tab_ on LP64.""

This reverts commit 715242fd0f69e73a6aca19e32b8979fa0f384788.

Change-Id: Ia9892fa3b03287129aa72a49974cef9fd94ae735
type.h
ys/cdefs_elf.h
a3117041035c72b843d7b59a0d1b33f70caad368 30-Jun-2014 Elliott Hughes <enh@google.com> Restore <nsswitch.h> which is BSD API, not private.

Also make nsdispatch non-hidden. Firefox uses it.

Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1030899
Change-Id: Iaccc1ec813d196ec91ac475fcc4ae9dca756861d
sswitch.h
93e7b9f3eaf19aee6eac24b095982f5e25313535 26-Jun-2014 Raghu Gandham <raghu.gandham@imgtec.com> asm/sigcontext.h is required to build unwind-dw2.c in gcc-4.9.

Change-Id: Ie36b68d1260a656056f66a67750232a7da78c61f
Signed-off-by: Steve Ellcey <steve.ellcey@imgtec.com>
ignal.h
00fb5f97be5d6d8da10dbaf047004917b9f8c7e4 25-Jun-2014 Elliott Hughes <enh@google.com> Change the LP64 off_t/loff_t/off64_t definitions to reduce warnings.

Code written for glibc can be sloppy about these types on LP64 and
get away with it. It's probably better for our users if these types
are identical rather than just being the same size.

Change-Id: I3dd116d80569d2d101342a552c55f4a18884025b
ys/types.h
3f525d41c2acde2ae3309cf839d83d7f41ab2fe6 25-Jun-2014 Elliott Hughes <enh@google.com> Add splice, tee, and vmsplice.

Change-Id: I5f43380b88d776a8bb607b47dbbc5db5a2fe6163
cntl.h
52f9b051c8bcb3d723b023a74d7d89ee45cf754c 24-Jun-2014 Elliott Hughes <enh@google.com> Merge "Sync to current upstream arc4random."
0468feb28696751efcddada8de69a622afffdba8 21-Jun-2014 Elliott Hughes <enh@google.com> Sync to current upstream arc4random.

This is actually revision 1.33, which is no longer the latest, but it's
as close to head as we can currently reasonably get. I've also switched
to the OpenBSD getentropy_linux.c implementation of getentropy, lightly
modified to try to report an error on failure.

Bug: 14499627
Change-Id: Ia7c561184b1f366c9bf66f248aa60f0d53535fcb
tdlib.h
63fa660b52f1e9717f0a2105d4861a4b48c330b1 24-Jun-2014 Calin Juravle <calin@google.com> Merge "Prefix cmsg_nxthdr with "__"."
096b4eb752aa7a5392875cb2f2faf0d67c676ac1 19-Jun-2014 Calin Juravle <calin@google.com> Prefix cmsg_nxthdr with "__".

This brings us on par with glibc.

To avoid breaking clients, temporary keep cmsg_nxthdr until the next NDK
refresh.

Bug: 15822452
Change-Id: I24c24e68c31f4f2b8f3d2df7acd575cb75174173
ys/socket.h
0d7415fb225573c37ff9e880957cd2044dd658ce 21-Jun-2014 Dan Albert <danalbert@google.com> Merge "Remove SHA1 from LP64 in favor of libcrypto."
8ca440089f37a11260a8a765acf50fb38fa08da4 22-Jun-2014 Dan Albert <danalbert@google.com> Use __builtin_*_chk for bcopy/bzero.

Replacing memmove/memset with their builtin check equivalents fixes an
implicit definition warning when only including strings.h.

Change-Id: I74f03b9506ea37f5c2f9c11498e379a70998b430
trings.h
06366724d572ef005f5bc0ddd8ad46794cbfad3b 20-Jun-2014 Elliott Hughes <enh@google.com> Expose tzname, daylight, and timezone.

These were accidentally hidden.

Bug: 11156955
Change-Id: I380f00bdafa547aea13d4634f3de9ec6f0b50a6f
ime.h
d10db8261949e4d84b65f5c369153d0ca86ab22c 19-Jun-2014 Elliott Hughes <enh@google.com> Build tzcode with hidden visibility.

Bug: 11156955
Change-Id: Ib98d837b56cbbdfd01687cb3054fe3103eec0da9
ime.h
char.h
715242fd0f69e73a6aca19e32b8979fa0f384788 19-Jun-2014 Dan Albert <danalbert@google.com> Revert "Hide _tolower_tab_ and _toupper_tab_ on LP64."

This reverts commit dd4ad5c463c9bd479e8acf81227708717aafe204.

Change-Id: If3c9771825e460ce68604082f4feb0ca783e56c6
type.h
ys/cdefs_elf.h
dd4ad5c463c9bd479e8acf81227708717aafe204 18-Jun-2014 Dan Albert <danalbert@google.com> Hide _tolower_tab_ and _toupper_tab_ on LP64.

We can't hide them on LP32 because they appeared in NDK headers.

Bug: 11156955
Change-Id: I22bf5a0f4d330c04b49565bc598cd0568128d4fc
type.h
ys/cdefs_elf.h
9635046e53e14ff44348853a9cacdffd444b35ae 18-Jun-2014 Dan Albert <danalbert@google.com> Hide declaration of gets(3) for C11 and later.

gets(3) was removed from C11.

This reverts commit 1291680c2a0c23b2163198d27e00261ca206298b.

Bug: 14500800
Change-Id: I5e5146bdbb80f2be818a17f287b112bab37d1f6d
tdio.h
1ef3ba2b4fd2408cdd78828ec2930ce31ce8cee7 18-Jun-2014 Dan Albert <danalbert@google.com> Merge "Revert "Hide declaration of gets(3) for C11 and later.""
1291680c2a0c23b2163198d27e00261ca206298b 18-Jun-2014 Dan Albert <danalbert@google.com> Revert "Hide declaration of gets(3) for C11 and later."

Breaks stlport. checkbuild lied to me?

This reverts commit c0ce5908277a9bf18628946629dba4277e9a2281.

Change-Id: I72fb21aba7eaea96a7c3208236fd03411527fa5e
tdio.h
c0ce5908277a9bf18628946629dba4277e9a2281 18-Jun-2014 Dan Albert <danalbert@google.com> Hide declaration of gets(3) for C11 and later.

gets(3) was removed from C11.

Change-Id: I4040a8a6c6d5d2a86878e8a80ca67964fbbb82a8
tdio.h
185c399c581f867ad288737b5f824a1fda1f6aaf 18-Jun-2014 Dan Albert <danalbert@google.com> Merge "Hide declaration of gets(3) for C11 and later."
4ac22649441339d0a81e0fc6428ac7f1867ffe6f 17-Jun-2014 Elliott Hughes <enh@google.com> Merge "Add <linux/tty.h> to libc/include/sys/ioctl.h"
c82c0b7e072491da4818e7de37411fbb2055fce1 17-Jun-2014 Dan Albert <danalbert@google.com> Remove SHA1 from LP64 in favor of libcrypto.

Keep the symbols around on LP32 for binary compatibility.

Bug: 11156955
Change-Id: I379a7e0fa3092e9a70daeafcbcb2aacfc314031a
ha1.h
ys/sha1.h
ac6467587e864d199377f14281da4641f979a68a 05-Jun-2014 Dan Albert <danalbert@google.com> Revert "Revert "Remove ftime from bionic LP64""

This reverts commit 0921204660b9597de795065d0350a787035ad589.

Change-Id: I749af8d7d429cda9f9d09a75bd30df54e6b1dd65
ys/timeb.h
462abab12b074c62c0999859e65d5a32ebb41951 14-Jun-2014 Dan Albert <danalbert@google.com> Removes getdtablesize(3) from LP64.

getdtablesize(3) was removed fro POSIX 2004. Keep the symbol around in LP32 for
binary compatibility, but remove the declaration from unistd.h.

Bug: 13935372
Change-Id: I1f96cd290bf9176f922dad58bd5a7ab2cae7ef0f
nistd.h
0069f310662c1ec7013f841a278a492432d66425 05-Jun-2014 Qiming Shi <qiming.shi@intel.com> Add <linux/tty.h> to libc/include/sys/ioctl.h

This is the change to export the tty ldisc definitions (like N_TTY)
from Linux uapi kernel header. So bionic is compatbile with glibc
which has its own tty ldisc definition exported through ioctl.h

Change-Id: I44e4c7cc2eba31549e9c9c75f74961a949d4a696
Signed-off-by: Qiming Shi <qiming.shi@intel.com>
Signed-off-by: Yin, Fengwei <fengwei.yin@intel.com>
ys/ioctl.h
e61919ad11fc0ca6749ee4d6855bc8b2c316a8f9 13-Jun-2014 Elliott Hughes <enh@google.com> Fix x86-64 libvpx build.

This is now fixed upstream, but we need to wait for it to come back down
via chromium...

Bug: 15598056
Change-Id: I08f1be4296c391cfc1616a5ff0815be14071594a
tdlib.h
72dc1c22dc6a92dea925398c9e3880364ab29c1c 14-Jun-2014 Dan Albert <danalbert@google.com> Merge "Revert "Backing this one out since the counterpart needs to be sent upstream.""
e5fdaa4f9d102461a4d8a865e6ca84666893b9e7 14-Jun-2014 Dan Albert <danalbert@google.com> Revert "Backing this one out since the counterpart needs to be sent upstream."

This reverts commit a04d2bc28e7d7fcaf34ad71e4a6608a13cf84197.

Change-Id: I1b49165ca5d4bafdba7948818256a6167a363aca
alloc.h
a04d2bc28e7d7fcaf34ad71e4a6608a13cf84197 14-Jun-2014 Dan Albert <danalbert@google.com> Backing this one out since the counterpart needs to be sent upstream.

This reverts commit 5ee320dd35fafc11eaf90c62198e08c6670e35b4.

Change-Id: I1a9c6b06c3aca595f01c629f7649be743dc48e77
alloc.h
5ee320dd35fafc11eaf90c62198e08c6670e35b4 12-Jun-2014 Dan Albert <danalbert@google.com> Hides valloc(3)/pvalloc(3) on LP64.

These were removed from POSIX 2004. Hides the header declarations for all
targets, and hides the symbols for LP64.

Bug: 13935372
Change-Id: Id592f67e9b7051517a05f536e1373b30162e669c
alloc.h
b84783ecaa71f9450152f8d9b5f97e1b07f05ef6 14-Jun-2014 Dan Albert <danalbert@google.com> Merge "Backing this one out since the counterpart needs to be sent upstream."
65b1c90a32036cbb06ff610fbae545b65ae8b72d 14-Jun-2014 Dan Albert <danalbert@google.com> Merge "Hides valloc(3)/pvalloc(3) on LP64."
8229ae46f4fb165a18da4dca1be74c4c099c3ee7 14-Jun-2014 Dan Albert <danalbert@google.com> Removes wait3(2) from LP64.

wait3(2) was removed from POSIX 2004. Keep the symbol around in LP32 for binary
compatibility, but remove the declaration in sys/wait.h.

Bug: 13935372
Change-Id: Ic715fce6781aae43b4ac6d745dc6d1e6b9914e71
ys/wait.h
ff17671bc630d294903aa2827b76156590b09629 13-Jun-2014 Elliott Hughes <enh@google.com> Merge "Add a hack to <stdlib.h> until we can fix libvpx."
3fb5097a7eec40404760c304b36c8b657b374cab 13-Jun-2014 Elliott Hughes <enh@google.com> Add a hack to <stdlib.h> until we can fix libvpx.

libvpx should probably change its assembler to refer to lrand48 directly,
because that will work on old and new versions of Android. This keeps things
building until that happens.

Bug: 15598056
Change-Id: I4a1f59e710a083b9f9a707ceeb9ca0a28141a954
tdlib.h
564222e3384eb1c649bc75650deb847c40ec7da3 13-Jun-2014 Elliott Hughes <enh@google.com> Merge "Use default hidden visibility to build libc_dns."
8563802b04347951d8878747a830987e5ca145f5 16-May-2014 Elliott Hughes <enh@google.com> Use default hidden visibility to build libc_dns.

Bug: 11156955
Change-Id: Ia443705f5fbee0681039d4480abc89850968f475
etdb.h
esolv.h
346fa721ca20e481a624930425d823d452e11dfe 12-Jun-2014 Elliott Hughes <enh@google.com> Merge "Get the full set of PRNG functions in <stdlib.h>"
a0beeeabbc8735bc830544cbbb1d920122b8d958 12-Jun-2014 Elliott Hughes <enh@google.com> Get the full set of PRNG functions in <stdlib.h>

Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: I435250bdae302e8bd7e29977d0fde7b9afbfca5e
tdlib.h
37b845f9e410e326f24fa8c820774d92eafa4dd3 12-Jun-2014 Dan Albert <danalbert@google.com> Merge "Remove declaration for putw(3)/getw(3)."
8e613cf342b369f7985135dbe11ebdbf8c736157 11-Jun-2014 Dan Albert <danalbert@google.com> Remove declaration for putw(3)/getw(3).

These were both removed from POSIX 2004, and we don't define an
implementation for getw(3). Keep the definition of put(3) on LP32 for
binary compatibility.

Bug: 13935372
Change-Id: Iba384b45093ac6d2d7c2d81f7980cd7701dd6f56
tdio.h
2c02d0057c93bfa6db4b30d8646baeb55d076062 12-Jun-2014 Elliott Hughes <enh@google.com> Merge "Add __pure2 to a few more functions, most notably gettid and pthread_self."
b27a840f4b520bfa095db99b0a2e5205634b0003 11-Jun-2014 Elliott Hughes <enh@google.com> Add __pure2 to a few more functions, most notably gettid and pthread_self.

Change-Id: I7eee9f26f45130038af09d8285782b07f70a996f
rrno.h
thread.h
tdlib.h
nistd.h
cd32219c5b3c402c99d3ad7d1997d42b5f04015e 11-Jun-2014 Dan Albert <danalbert@google.com> Remove declarations related to cuserid(3).

cuserid(3) was removed from POSIX 2004, and we don't have an
implementation anyway.

Bug: 13935372
Change-Id: I7ac7cde931ba802d0d5b917c22f5116618b21d2f
tdio.h
a382a792a456fe2710dd3a7be623180ed85a8dce 10-Jun-2014 Elliott Hughes <enh@google.com> Hide non-standard syslog API.

The definitions are still available on LP32 for binary compatibility, but
they're gone on LP64, and the declarations are gone everywhere.

We should probably just make syslog(3) log to the regular Android log,
but that's a job for another day.

Bug: 11156955
Change-Id: I74a98c92f7922ea733549ec6d37c6fa8b7014860
yslog.h
47ba295b0679148970bbffc9b76a3651efea9502 07-Jun-2014 Elliott Hughes <enh@google.com> Rewrite and hide longjmperror.

This shouldn't be public API, isn't supported on x86/x86_64, and it's
unlikely anyone would have actually seen the message before anyway.
Using __libc_fatal makes it much more likely to be seen.

Bug: 11156955
Change-Id: Icf7f654b22a7dacd89668b60c11e5705c7215c08
etjmp.h
3d5cb30d23cfc6a72f01c00246e69a2c614c8228 06-Jun-2014 Elliott Hughes <enh@google.com> Remove getdents from bionic.

Bug: 11156955
Change-Id: I6c306989801be552d85fba8a50dcdc79282fb9d2
irent.h
c3bdc792be78d788663ff9b5e019b4af852dc6f7 06-Jun-2014 Elliott Hughes <enh@google.com> Merge "Fix the printf family for non-ASCII."
69f05d291d848de654c72e5278de8ca06fbf5d2f 06-Jun-2014 Elliott Hughes <enh@google.com> Fix the printf family for non-ASCII.

The bug here turned out to be that we hadn't increased the constant
corresponding to the maximum number of bytes in a character to match
our new implementation, so any character requiring more than a byte
in UTF-8 would break our printf family.

Bug: 15439554
Change-Id: I693e5e6eb11c640b5886e848502908ec5fff53b1
imits.h
tdlib.h
40fca0f08b1eb87e283d6f634d9759ed3161f517 04-Jun-2014 Dan Albert <danalbert@google.com> Removes index() from bionic.

This function has been removed from POSIX.

Unfortunately, we can't leave #define index(a, b) strchr((a), (b)) in its place
because defining a preprocessor macro for index() breaks a whole lot of code.

Bug: 13935372
Change-Id: Ifda348acde06da61c12e7ee2f8fe6950a3174dd1
tring.h
trings.h
205dd7d9b3ba314ef8601e4613823c2d62a0605b 04-Jun-2014 Dan Albert <danalbert@google.com> Remove bsd_signal and sysv_signal from bionic LP64.

bsd_signal was removed in POSIX 2008, sysv_signal was never POSIX.

Bug: 13935372
Change-Id: I7688e5cc317247ff075dcf99b598f515fb4f15c4
ignal.h
0921204660b9597de795065d0350a787035ad589 05-Jun-2014 Dan Albert <danalbert@google.com> Revert "Remove ftime from bionic LP64"

Breaking some build... will look in to it later.

This reverts commit 26d6799bbe170b0955f564974b584c1471efdca1.

Change-Id: I35fa770221be3a181bd37c6c3dce1bf37a69a4a1
ys/timeb.h
26d6799bbe170b0955f564974b584c1471efdca1 05-Jun-2014 Dan Albert <danalbert@google.com> Remove ftime from bionic LP64

Bug: 13935372
Change-Id: I5dd31147143b23a090a3b75b846dc5354e599121
ys/timeb.h
001f8f041bf21c53d4a0b919ef2c859b047bac0a 04-Jun-2014 Dan Albert <danalbert@google.com> Removes wcswcs from bionic for LP64.

Bug: 13935372
Change-Id: I0deb15e769da4fa81bb65a87f3c86db5163a5796
char.h
452e09130010b641904e7411e0c539590a654022 04-Jun-2014 Dan Albert <danalbert@google.com> Merge "Adds functionality specified by uchar.h"
7a7f9952c12b216fbf91fc4cdbb97045e8861115 02-Jun-2014 Dan Albert <danalbert@google.com> Adds functionality specified by uchar.h

mbrtoc32 and c32rtomb get their implementations from mbrtowc and wcrtomb. The
wc functions now simply call the c32 functions.

Bug: 14646575
Change-Id: I49d4b95fed0f9d790260c996c4d0f8bfd1686324
char.h
ce9ce28e5d760e32ab6c894dfaf7b8dad6de7ff6 03-Jun-2014 Dan Albert <danalbert@google.com> Removes bcopy and bzero from bionic.

These symbols are still defined for LP32 for binary compatibility, but
the declarations have been replaced with the POSIX recommended #defines.

Bug: 13935372
Change-Id: Ief7e6ca012db374588ba5839f11e8f3a13a20467
trings.h
b4e099c6f741835b11ecb6f8fd0861b1892ff182 30-May-2014 Elliott Hughes <enh@google.com> Remove issetugid.

Bug: 14569474
Change-Id: I752c77ed53c724f144f0b618443eb95e87f2929a
nistd.h
bdca3802c9c9d033fbc553ed24b92ac78859a463 28-May-2014 Calin Juravle <calin@google.com> Remove unnecessary padding in ucontext_t

- removed extra padding from ucontex_t on x86, x86_64 and mips
- force ucontext_t struct to use 64 bits for the sigmask on all arches
(previsouly wrong since sigset_t on arm and x86 is only 32 bits)
- arm and arm64 continue to use padding to match glibc sigset_t

This brings Bionic on par with the kernel w.r.t ucontext padding.

Bug: 12828904
Change-Id: Ia8915ace694ecb4695603a334e697985f4c3e7aa
ys/ucontext.h
a7821b7121933b361554b28a2f9455783a330591 22-May-2014 Dan Albert <danalbert@google.com> Use __typeof__() instead of typeof()

typeof() is a gcc builtin and is not always available (such as clang when
-std=c*). Both gcc and clang always expose __typeof__(), so just use that.

Change-Id: I75e2a990acc35f6f39b2c353f6548100ec03c67f
nistd.h
e6c57fcb05b0dcbfa8129bb6f7d99093f4819370 24-May-2014 Elliott Hughes <enh@google.com> Add C11 <stdatomic.h>.

Bug: 14903517
Change-Id: I631dbfdaa698cf7fea8e3b5e18a32586383e62a5
tdatomic.h
ys/cdefs.h
c3f909630bd299de807f8edb31eaef140d70ffed 23-May-2014 Elliott Hughes <enh@google.com> Remove <sys/atomics.h>.

Bug: 14903517
Change-Id: I6de1d9d3624922517fdc37922097abbc3b41f661
ys/atomics.h
92687e41bcf108957944dafa80a9bfda219bfb0f 22-May-2014 Calin Juravle <calin@google.com> Cleaned up pthread rwlocks implementation.

- used underscore_style_for_vars
- extracted time related functionality into a function
- cleaned up style
- removed unused fields from pthread_rwlock_t on LP64
- changed reservation in pthread_rwlock_t so that the size of the
structure equals glibc version

Bug: 8133149

Change-Id: I84ad3918678dc7f5e6b3db9b7e9b0899d3abe9cd
thread.h
254fa8857f5d88a4140cea2ee05056eae7f102b1 22-May-2014 Calin Juravle <calin@google.com> Merge "Switch to POSIX dprintf/vdprintf."
fcac8ff97f6b6cced6546e0096cadc1039b68b5e 22-May-2014 Elliott Hughes <enh@google.com> Switch to POSIX dprintf/vdprintf.

Bug: 11156955
Change-Id: I734bd02db514367ab119a48304aae9767958e367
tdio.h
d1dc009c56f650ae4e990b00613f1c2ff93ed3ba 22-May-2014 Calin Juravle <calin@google.com> Merge "Add padding to mips ucontext_t."
156c7d3d0ac4457a051ac7d81ff8541636e0864f 22-May-2014 Calin Juravle <calin@google.com> Merge "Clean up ucontext.h TODOs."
172167163af5412c316a8be2f29ca8622984df32 22-May-2014 Calin Juravle <calin@google.com> Merge "Mutex-free implementation of pthread_rwlock"
76f352eec12d8938101e5ae33429c72797c3aa23 19-May-2014 Calin Juravle <calin@google.com> Mutex-free implementation of pthread_rwlock

Bug: 8133149
Change-Id: Id6775010d95f2634b173daa55d87a59a3cf4131b
thread.h
d5ed63a6a8290de88802172ce178656fbafe70c6 22-May-2014 Elliott Hughes <enh@google.com> Hide most of the private futex functions.

Also hide part of the system properties compatibility code, since
we needed to touch that to keep it building.

I'll remove __futex_syscall4 and futex in a later patch.

Bug: 11156955
Change-Id: Ibbf42414c5bb07fb9f1c4a169922844778e4eeae
ys/atomics.h
ae0f8f1e48a464b227fc3b68e0817a246e73db9b 20-May-2014 Calin Juravle <calin@google.com> Add padding to mips ucontext_t.

Bug: 12828904
Change-Id: I49e7adcebf769a9c30dc43def36501260369b1ac
ys/ucontext.h
eb454522da53759ef74180b9c623206040b17df0 20-May-2014 Calin Juravle <calin@google.com> Clean up ucontext.h TODOs.

There's no need to expose gregset_t and fpregset_t when they
are not used in ucontext_t.

Bug: 12828904
Change-Id: Ieda1edf0ab18015f444c4d385fe9c41c4544017f
ys/ucontext.h
b648a8a57ee42533a5bf127225a252f73ca2cbbc 20-May-2014 Dmitriy Ivanov <dimitry@google.com> Add RTLD_NOLOAD support and some related changes.

* Aligned RTLD_ values with glibc for lp64
* dlopen supports RTLD_NOLOAD flag
* soinfo_unload calls find_library(.., RTLD_NOLOAD)
instead of naive find_loaded_library_by_name()
* dlopen changed to add child to caller soinfo instead
of somain.

Bug: https://code.google.com/p/android/issues/detail?id=64069
Change-Id: I1a65f2c34f3e0edc6d2c41a2e408b58195feb640
lfcn.h
0e85fb6121cf365207ee737314130a526dbe0eac 19-May-2014 Calin Juravle <calin@google.com> Add uc_regspace to arm's ucontext_t

Bug: 12828904
Bug: 12875898
Change-Id: Ic5d532bd0ef58cad9e36a99fc2995c4b069121b2
ys/ucontext.h
a6ab968ca0af18d84620a692f76af0d8e857c9c8 13-May-2014 Calin Juravle <calin@google.com> Fill in missing bits in x86(_64) ucontext_t

Bug: 12828904
Bug: 12875898
Change-Id: I0ec0dfe16af80bfb3153f3c3b1b3d180eff30f39
ys/ucontext.h
9b5b40b4dfe0e2b89dbaf2229a3737f79c81d595 15-May-2014 Andrew Hsieh <andrewhsieh@google.com> Rename user_i387_struct -> user_fpregs_struct in sys/ucontext.h

See 93e1907ae1794068c1018750603c9206cb700d1b

Change-Id: Icb207f4e17cfffdd6d37500656434adf1cc34427
ys/ucontext.h
ea5248ee1bc5d031e0b1e70a311f450a741c1e99 15-May-2014 Christopher Ferris <cferris@google.com> Increase minimum thread size for 64 bit.

Bug: 14468519
Change-Id: I642a5515acf5fbed46e77e176f6b5dd3b7c7bd45
thread.h
bac795586bbc5dcbe886d8d781710f60c4c19d9b 14-May-2014 Ross McIlroy <rmcilroy@google.com> Merge "Fix x86_64 user_fpregs_struct to use the same name for the tag word as glibc."
0c8a5f82e6e77dfafba7f6054b2d6be0d82c45cb 14-May-2014 Ross McIlroy <rmcilroy@google.com> Fix x86_64 user_fpregs_struct to use the same name for the tag word as glibc.

Glibc calls the tag pointer in user_fpregs_struct ftw instead of twd.

Change-Id: I4a8dab777fa889de0b9927035cd18557ae6f3263
ys/user.h
a7318774061b508e7f769fb0e122cfb40cbb94c9 14-May-2014 Calin Juravle <calin@google.com> Merge "Change wctype_t from int to long."
fd3171b465184b8eac16dfc88b954b2d6748b2ce 14-May-2014 Calin Juravle <calin@google.com> Merge "Change wctype_t from enum to int"
135b103fd9ac404e9499fe40c725c33f34f86af7 14-May-2014 Elliott Hughes <enh@google.com> Fix <sys/endian.h> uint32_t build failures.

Change-Id: I833b51318f0bf7749073859b7ffacc668c27558e
ys/endian.h
17f8ef87b565d88c3b391d6d8de8818dec74c4d5 14-May-2014 Elliott Hughes <enh@google.com> Merge "Flesh out <arpa/inet.h>."
6a41b0fb0e589c4afc4ecbcf7c425f0aa40eaea4 14-May-2014 Elliott Hughes <enh@google.com> Flesh out <arpa/inet.h>.

Use the upstream OpenBSD implementations of these functions.

Also ensure we have symbols for htonl, htons, ntohl, and ntohs.
gtest doesn't like us using the macro versions in ASSERT_EQ.

Bug: 14840760
Change-Id: I68720e9aca14838df457d2bb27b999d5818ac2b5
rpa/inet.h
ys/endian.h
eed3d0d1f35de202abea838c48aa25083cb36e56 14-May-2014 Elliott Hughes <enh@google.com> We don't need two copies of <nsswitch.h>.

Change-Id: I3f874326d96f41249f5c9b1b3c2885f858589029
sswitch.h
eb664e24c074b88539b743668109d8b4eaa925bd 13-May-2014 Elliott Hughes <enh@google.com> Add getmntent_r to our collection of <mntent.h> compatibility stubs.

This helps build 'external/flo' out of the box.

Bug: 14841211
Change-Id: I30dde77239cceaf1f5743163744eb3604d27a266
ntent.h
f34f0ccb0e1d1c6df5f60bbfc44983263f89164d 13-May-2014 Calin Juravle <calin@google.com> Merge "Use __LP64__ instead of __LP32__ in sched.h"
dd09699fae94e1d9d326c78cc6aa769701219bc7 13-May-2014 Calin Juravle <calin@google.com> Use __LP64__ instead of __LP32__ in sched.h

Gcc defines only __LP64__ so testing __LP32__ will always be false.

Bug: 14881256
Change-Id: Ic63c1d562be09c3eb4b9e17c9e5ef2d9e404db80
ched.h
b55f2631dc89a386b3f6bd9ce6911c4c12e121b2 13-May-2014 Calin Juravle <calin@google.com> Change wctype_t from int to long.

On LP64 this brings us on par with the other libcs where wctype_t is 8
bytes.

Bug: 12875898
Change-Id: Ice4f538ccf0634ef6667a8d90d0f7f09cec9e1b0
char.h
0c472479a2b34f67b606e6419c506ddfdcf1a403 13-May-2014 Calin Juravle <calin@google.com> Change wctype_t from enum to int

This increases bionic source compatibility with other libcs where
"wctype_t foo = 0;" is valid without -fpermissive.

Bug: 14646243
Change-Id: Ia9bd0785bc42c7b46e2bb6c3d9b9a9d3f769d983
char.h
f963da22ecc25c51971d802037736ae540321441 13-May-2014 Calin Juravle <calin@google.com> Undef private *_BODY defines after use

Bug: 14865741
Change-Id: I1398f7b3f64e3c94f2714cede5b61205dfa78a24
irent.h
ys/stat.h
ys/vfs.h
15a6310e4b745add324b07a5d3d297aa95a56f59 08-May-2014 Calin Juravle <calin@google.com> Support mb sequences across calls to mb*to*wcs* functions

Bug: 13077905
Change-Id: I5abdc7cc3c27c109b7900c94b112f18a95c35763
char.h
d67c6af2f6767b057546e80cb90818e0efccce96 12-May-2014 Calin Juravle <calin@google.com> Merge "Reserve space for the future in statvfs(64)"
7bec1212c715871046108fc06c87091925981cdc 09-May-2014 Calin Juravle <calin@google.com> Reserve space for the future in statvfs(64)

The kernel struct has some spare space at the end too, and some extra
fields, so having a bit of flexibility in statvfs might be worthwhile.

Bug: 14681331
Bug: 12875898
Change-Id: I5b502c5dd9d2e3bb8f34804f83c02669cefce01e
ys/statvfs.h
4d695bf5606f2cf4029a7ff4e6dd61073407d3b0 12-May-2014 Calin Juravle <calin@google.com> Merge "Align struct passwd definition with other variations of libc"
c768874c667794bee278b9fbf207b5ca5df4e7a6 09-May-2014 Calin Juravle <calin@google.com> Align struct passwd definition with other variations of libc

Add pg_gecos ("real name") field to struct passwd.

Bug: 14679430
Bug: 12875898
Change-Id: I833ec2c46f6a6259b7232a8e3f7942968ef0b50d
wd.h
4aa2e6a32a1ab90dc5baa626f6efc0feb9082716 07-May-2014 Elliott Hughes <enh@google.com> Give bionic's __ANDROID_API__ a more reasonable value.

This matches what frameworks/base does with Build.VERSION and means that
bionic's version number will always sort >= than any released version.
This should prevent confusion in code that builds both against bionic
and the NDK.

(Note that <sys/cdefs.h> drags this in, so it's always in the namespace.)

Bug: 14613709
Change-Id: I91fb745920e848a6b20f2f5797c0a7d6cde6c032
ndroid/api-level.h
e292875cf55265bea7f78049e31d50c15a3a34e0 07-May-2014 Calin Juravle <calin@google.com> Merge "Reserve some space in sem_t for the future."
b6c48b20e4aa9a0e0068980eb305dc522a680900 07-May-2014 Calin Juravle <calin@google.com> Merge "Allow for better utmp logging."
fc2af0ca47cd5017838b495687784c82c080f9d2 07-May-2014 Calin Juravle <calin@google.com> Merge "Fix ino_t and suseconds_t"
6726862e9a250e7ade32ba7d150d73352b4ef5c8 06-May-2014 Calin Juravle <calin@google.com> Fix ino_t and suseconds_t

Align ino_t and suseconds_t definitions with kernel
and OpenBSD upstream.

Bug: 14583346
Bug: 12875898
Change-Id: I0d97c6b4fc85b261472575290e6f6f2df1c8a36a
ys/types.h
0686d5e26fd1949fbfd33a2441f750791bc87091 06-May-2014 Calin Juravle <calin@google.com> Reserve some space in sem_t for the future.

Reserve 12 more bytes in sem_t to give room for future implementation
improvements. This gets us to a 16 bytes sem_t. Glibc uses 32 bytes (16
actual use + 16 reserved), while OpenBSD has 16 bytes (out of which 4
are for padding).

Bug: 14587103
Bug: 12875898
Change-Id: Id835cc5abf874c651e6b5ad5b8f29c9d6ab08d5a
emaphore.h
7d8f3033539e81475b52e791a0693b30bb7e2e68 06-May-2014 Calin Juravle <calin@google.com> Allow for better utmp logging.

Increase (UT_NAMESIZE,UT_LINESIZE,UT_HOSTSIZE) to (32,32,256).

Nobody writes utmp on Android but it would be nice to be aligned
with others who use 32,32,256 (like glibc). If ever used it will produce
nicer logging. There is no consensus in BSDs for these values.

Bug: 14584341
Bug: 12875898

Change-Id: I94af10b982b8f9fcaea897c4cf968563f38403f9
tmp.h
7c435f2415f4cdc97fbb7739f70ae5e84f2e2cb0 06-May-2014 Calin Juravle <calin@google.com> Leave more space for extensions in pthread_rwlockattr_t

Change pthread_rwlockattr_t from int to long. On LP64 this gives us more
room for extensibility since longs are 8 bytes. glibc also reserves 8
bytes for this.

Bug: 14582681
Bug: 12875898
Change-Id: I55d599be0fdbbf0cb55957ec0ea62ab042bdee94
thread.h
9ded07cff6c73bd3ea1bbc874180139d3a5d6f0c 25-Feb-2014 Philip Hatcher <philip.hatcher@intel.com> bionic: make epoll_event structure packed

Description: In the kernel the epoll_event structure is packed
in 64 bit kernel builds to allow the structure to be more easily
compatible with 32 bit user space. As a result, when user space
is 64-bit the structure must be packed as well.

Add unit test to show the ptr alignment issue.

Change-Id: I2c4848d5e38a357219091f350f9b6e3da05090da
Signed-off-by: Philip Hatcher <philip.hatcher@intel.com>
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
Reviewed-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
Tested-by: Hazarika, Prodyut <prodyut.hazarika@intel.com>
ys/epoll.h
52defb7c702306d4e81c7089cbadd7a6da1d7b6b 06-May-2014 Elliott Hughes <enh@google.com> Remove the non-standard time64 stuff for LP64.

We need a workaround in strftime as long as we still need to support
64-bit times on LP32.

Change-Id: I8ffb616f6312d4063fb9ea3c36b52653e8f4c5f8
ime64.h
0990d4fda898ada86e557f872f5cb7d16b138e3c 30-Apr-2014 Elliott Hughes <enh@google.com> Make SIGRTMIN hide the real-time signals we use internally.

__SIGRTMIN will continue to tell the truth. This matches glibc's
behavior (as evidenced by the fact that we don't need a special case
in the strsignal test now).

Change-Id: I1abe1681d516577afa8cd39c837ef12467f68dd2
ignal.h
77473e408504a7e298816b4071cd6902065b03d8 30-Apr-2014 Calin Juravle <calin@google.com> Merge "Fix cpu_set_t"
4566731772f3121c7c9b47bb6de44d5a9123fc11 30-Apr-2014 Dan Albert <danalbert@google.com> Merge "Adds quick_exit(3) and at_quick_exit(3) from freebsd"
b743790ccabd9b0b93355ff693066478d10dae0d 29-Apr-2014 Calin Juravle <calin@google.com> Fix cpu_set_t

- extend CPU_SETSIZE for LP64
- fix CPU_(AND|OR|XOR) macros
- fix CPU_OP_S macro
- fix __sched_cpucount
- tidy up the code

Change-Id: I741afff4d0c473e8a1ee6b4141981dc24467e0d4
ched.h
d4ae59dcf228cf602189c6d5e69fb65640b353e3 30-Apr-2014 Calin Juravle <calin@google.com> Merge "Reserve space in mbstate to allow for proper wchar support"
b8425c549a0bfe08b01b5906b95603d8523c1b16 30-Apr-2014 Dan Albert <danalbert@google.com> Adds quick_exit(3) and at_quick_exit(3) from freebsd

Change-Id: I4fe88abd8f7b8aa45e58aeb2529d59a8d555d338
tdlib.h
01ae00f3170ad0e36c1657f6ff8c89dfa730fd37 30-Apr-2014 Elliott Hughes <enh@google.com> Switch to the OpenBSD implementations of the wide scanf functions.

This also gets us the C99 wcstoimax and wcstoumax, and a working fgetwc and
ungetwc, all of which are needed in the implementation.

This also brings several other files closer to upstream.

Change-Id: I23b025a8237a6dbb9aa50d2a96765ea729a85579
nttypes.h
char.h
3d7a0d9b08ecab054b2dff8332507644de3690b0 29-Apr-2014 Elliott Hughes <enh@google.com> Switch to the OpenBSD wcsto* functions.

This replaces a partial set of non-functional functions with a complete
set of functions, all of which actually work.

This requires us to implement mbsnrtowcs and wcsnrtombs which completes
the set of what we need for libc++.

The mbsnrtowcs is basically a copy & paste of wcsnrtombs, but I'm going
to go straight to looking at using the OpenBSD UTF-8 implementation rather
than keep polishing our home-grown turd.

(This patch also opportunistically switches us over to upstream btowc,
mbrlen, and wctob, since they're all trivially expressed in terms of
other functions.)

Change-Id: I0f81443840de0f1aa73b96f0b51988976793a323
char.h
eab395e4a88ee8ca7eeb7b6b2d6dfde364afbfcc 29-Apr-2014 Calin Juravle <calin@google.com> Reserve space in mbstate to allow for proper wchar support

Bug: 14382788
Change-Id: If023ac9bb65f95135cae7ebe89147e3985a69a96
imits.h
char.h
b1cacd42454822a4a42b68bfed32b9538210aa25 23-Apr-2014 Calin Juravle <calin@google.com> Reserve space in pthread structures for future extensibility.

Make our structures equal in size with glibc structures. This should
give us plenty of space to implement any missing feature.

Bug: 13278744
Bug: 12875898
(cherry picked from commit cf83fd77caa3128ecb6ac935e342cb0ea258b9ee)

Change-Id: I76968d31024eb51bc73887687e5ac492eb02a27f
thread.h
ab290718e376795a51e1a09c7eb20e79b39efee8 24-Apr-2014 Greg Hackmann <ghackmann@google.com> Merge "Revert "Reserve space in pthread structures for future extensibility.""
6b64000ef0ac6e9476e5f0420b4c09844e65d51f 24-Apr-2014 Greg Hackmann <ghackmann@google.com> Revert "Reserve space in pthread structures for future extensibility."

This reverts commit cf83fd77caa3128ecb6ac935e342cb0ea258b9ee.

Change-Id: I4f69e86ffe1c267a9018eb489d909237534c6cf9
thread.h
477d14b09202db5c009005b622fdcdefd780b955 24-Apr-2014 Calin Juravle <calin@google.com> Merge "Reserve space in pthread structures for future extensibility."
cf83fd77caa3128ecb6ac935e342cb0ea258b9ee 23-Apr-2014 Calin Juravle <calin@google.com> Reserve space in pthread structures for future extensibility.

Make our structures equal in size with glibc structures. This should
give us plenty of space to implement any missing feature.

Bug: 13278744
Bug: 12875898
Change-Id: I980017fd5942411ebc5ac32b2673a10a20db68c8
thread.h
532ad903d2febc400e23d66c5f4d836d1e5f11fc 23-Apr-2014 Elliott Hughes <enh@google.com> Merge "Switch to the upstream OpenBSD getenv/putenv/setenv implementation."
eae5902e73dc4381811e08fd2334bf4a9300a928 23-Apr-2014 Elliott Hughes <enh@google.com> Remove strntoimax and strntoumax from the future.

Where do these turds come from?

Change-Id: Id9ad2cc85c6128aa63b5d56ff2aa455bde39a5eb
nttypes.h
58d9e280d459225aa8dc4533e883182b08215f7d 23-Apr-2014 Elliott Hughes <enh@google.com> Switch to the upstream OpenBSD getenv/putenv/setenv implementation.

This fixes all the bugs found by the new tests.

Change-Id: Id5a5f9f39a0620208bafa053f871a044725b4795
tdlib.h
nistd.h
8d77bce185d04c531bd9bf34d38e5cbbe644d3a3 22-Apr-2014 Elliott Hughes <enh@google.com> LP64 shouldn't include the non-standard <time64.h> cruft.

This patch includes just enough to keep external/chromium_org building
until they switch 64-bit Android over to using the regular non-Android code.

Change-Id: Iecaf274efa46ae18a42d5e3439c5aa4f909177c1
ime64.h
cce36c187896fb0d4bd36519c4b2e90c502137dc 22-Apr-2014 Elliott Hughes <enh@google.com> Use -fvisibility=hidden to build libc_gdtoa.

Bug: 12177745
Change-Id: Ia4ac71e1a3a237e764c809cc591622f8952ed642
tdlib.h
ys/cdefs_elf.h
c5eea6d386c23bde6f0400a8959ed21081d8365b 22-Apr-2014 Elliott Hughes <enh@google.com> Merge "Fix WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN."
b1bfa7956c56c28b8c914e6606df191e094e7b42 22-Apr-2014 Torne (Richard Coles) <torne@google.com> Merge "Allow sharing the RELRO section via a file."
c363e5dd0a15aac9036b453f655a3a0ae5cd32cd 22-Apr-2014 Torne (Richard Coles) <torne@google.com> Merge "Support loading libraries to a reserved address."
16f6429c38c24236418cf127a4c11c5d8a2fd47b 22-Apr-2014 Torne (Richard Coles) <torne@google.com> Merge "Add android_dlopen_ext() interface to linker."
83c07b5e50207458445262ed10b79aa6b2d2d0ce 22-Apr-2014 Elliott Hughes <enh@google.com> Fix WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.

GCC tells us everything we need to know. clang does its usual half-assed job.

Change-Id: Id4d664529b10345274602768cd564d3df717e931
achine/wchar_limits.h
tdint.h
char.h
db68e569974efcda19c97ecd154c3d6db5ed34ae 18-Apr-2014 Dan Albert <danalbert@google.com> Brings LC_* defs into line with POSIX

POSIX requires that LC_* constants be defined as macros, and libc++ is testing
for this. Source: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html

Change-Id: Id0653e54d74f12179ef88cadf7b5d6ba1bae3cdb
ocale.h
0e351e4011bc98cacc3e37292bfb0e86c3a3bb5b 18-Apr-2014 Dan Albert <danalbert@google.com> Merge "Changes our ctype identifiers to match the BSDs"
779585fb26f6ee25833e3bf1bb86e8578a9289f7 16-Apr-2014 Dan Albert <danalbert@google.com> Changes our ctype identifiers to match the BSDs

This is to make it possible to adopt the BSDs' implementations for a few locale
APIs in libc++ rather than writing our own, nearly identical, code.

Change-Id: I482acd4ece83aa4ec9eb0c7acf48f3686794bcc3
type.h
183ad9df536ab04ef35a397a1f4724e4e401d11f 27-Feb-2014 Torne (Richard Coles) <torne@google.com> Allow sharing the RELRO section via a file.

Add flags and a file descriptor to android_dlopen_ext() to allow writing
the RELRO section of the loaded library to a file after relocation
processing, and to allow mapping identical pages from the file over the
top of relocated memory in another process. Explicitly comparing the
pages is required in case a page contains a reference to a symbol
defined in another library loaded at a random base address.

Bug: 13005501
Change-Id: Ibb5b2d384edfaa5acf3e97a5f8b6115c10497a1e
ndroid/dlext.h
12bbb9164578b6512b8b07a3fb093858244b7c7b 06-Feb-2014 Torne (Richard Coles) <torne@google.com> Support loading libraries to a reserved address.

Add flags and parameters to android_dlopen_ext() to allow loading a
library at an already-reserved fixed address. If the library to be
loaded will not fit within the space reserved, then the linker will
either fail, or allocate its own address space as usual, according to
which flag has been specified. This behaviour only applies to the
specific library requested; any other libraries loaded as dependencies
will be loaded in the normal fashion.

There is a new gtest included to cover the functionality added.

Bug: 13005501
Change-Id: I5d1810375b20fc51ba6a9b3191a25f9792c687f1
ndroid/dlext.h
012cb4583a5f8564059142bb1900ea3a31e7cfa9 06-Feb-2014 Torne (Richard Coles) <torne@google.com> Add android_dlopen_ext() interface to linker.

Add a function "android_dlopen_ext()", defined in <android/dlext.h>.
This is an extended version of dlopen() which takes a struct for passing
additional parameters for Android-specific functionality. This will be
used to support RELRO section sharing between separate processes.

Bug: 13005501
Change-Id: I9c99b2f2a02ee329dedaeba09ef3a1113b17b2d6
ndroid/dlext.h
cb65cc3fb4a8d7dfbbcbdfdb9140ab59baada28e 17-Apr-2014 Elliott Hughes <enh@google.com> Clean up <machine/ieee.h>.

The upstream intention was for this to be architecture-dependent, but it's a
lot clearer if we just have one copy.

Change-Id: I4e8310496145f9f411cd2e847c8cd023b1d758e9
achine/ieee.h
40b05791278f9ac6ff842670e80899c7cd15276f 15-Apr-2014 Elliott Hughes <enh@google.com> Add iswblank for libcxx.

We have similar degenerate implementations for all the other isw* functions,
so it's weird to exclude just one.

Change-Id: I659b97930e68598826c4882bb59f4146870fb6a0
char.h
93e1907ae1794068c1018750603c9206cb700d1b 10-Apr-2014 Elliott Hughes <enh@google.com> Use the glibc name user_fpregs_struct.

Instead of the kernel name user_i387_struct.

Bug: 13889008
Change-Id: Ideec2e1ce36c1faa4b5b2db1999ad2b23757ca4d
ys/user.h
c5992a036ba380f56e5be3d2d6b1abb34064b20e 09-Apr-2014 Elliott Hughes <enh@google.com> Fix mcontext_t for x86-64.

Change-Id: I1ac0e7f44bcdd06a07862993e92c3048a7474a8b
ys/ucontext.h
a5d83312bdeae2062a45160f54ce86c4b7b164e0 09-Apr-2014 Calin Juravle <calin@google.com> Merge "Use glibc structure for __cmsg_nxthdr."
b52a4ab4e281c7adae35b3d7ae8d99b5753b870d 09-Apr-2014 Elliott Hughes <enh@google.com> Merge "Flesh out <locale.h>."
c4936e20a3a8772cc393423037be36091e68acc2 09-Apr-2014 Elliott Hughes <enh@google.com> Flesh out <locale.h>.

This is a trivial implementation that only supports the C/POSIX locale.

Change-Id: Ib11cea4249e1862aca96a8b94d58ea9a418cbe75
ocale.h
locale.h
9f525644df99cb2f7f81a23ca23840f0a8f82275 09-Apr-2014 Elliott Hughes <enh@google.com> Implement _Exit(3).

Change-Id: Ida6ac844cc87d38c9645b197dd8188bb73e27dbe
tdlib.h
ff64831b0965c16c95c9f81a148f30a6ef3a6c64 07-Apr-2014 Calin Juravle <calin@google.com> Use glibc structure for __cmsg_nxthdr.

Bug: 13418328
Change-Id: I7e656b373e53e80d708325321e48dcedacf5086d
ys/socket.h
5363a45f2b6d4eeb054710d0886bbadea8a15273 08-Apr-2014 Elliott Hughes <enh@google.com> Clean up localeconv(3).

The OpenBSD doesn't support C99, and the extent to which we support
locales is trivial, so just do it ourselves.

Change-Id: If0a06e627ecc593f7b8ea3e9389365782e49b00e
ocale.h
ys/localedef.h
48501af98f3cdf0115a469ee8d773cf74c42958d 14-Mar-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Fix flock64 for LP64.

On LP64 systems F_GETLK64, F_SETLK64 and F_SETLKW64 definitions should
map onto the F_GETLK, F_SETLK and F_SETLKW definitions, respectively.
LP64 also doesn't have a struct flock64.

Change-Id: Ibdfed9645d9e946999acd6efa8b96ea6238ed5bf
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
cntl.h
41059d764f347baa28b8da653a88c772daa9b738 08-Apr-2014 Christopher Ferris <cferris@google.com> Merge "Add stpcpy/stpncpy."
950a58e24d1019eb9d814dbb16f111a6b61e3f23 04-Apr-2014 Christopher Ferris <cferris@google.com> Add stpcpy/stpncpy.

Add tests for the above.

Add the fortify implementations of __stpcpy_chk and __stpncpy_chk.

Modify the strncpy test to cover more cases and use this template for
stpncpy.

Add all of the fortify test cases.

Bug: 13746695
Change-Id: I8c0f0d4991a878b8e8734fff12c8b73b07fdd344
tring.h
efbdb53f84f4e1faf38f3c1a4cb60a83b9885ef4 08-Apr-2014 Elliott Hughes <enh@google.com> Remove a non-standard turd: strtotimeval.

Change-Id: I1b1e40746cb573e3fb73a5276969b40c5da36d15
ime.h
5f149f1bdef31d198c0e84fd8c904204d263e825 07-Apr-2014 Elliott Hughes <enh@google.com> Merge "Implement wctomb(3) for ltrace."
50249bca00d2c7d237e67d4d276057bb59508804 07-Apr-2014 Elliott Hughes <enh@google.com> Fix build: __unused isn't unused!

Change-Id: I57f2b755d1b2509f9c5504b12a5ff6c50b78b375
ys/ucontext.h
77e944fd46728075fe632bcb5211da9daf5b7e68 05-Apr-2014 Elliott Hughes <enh@google.com> Implement wctomb(3) for ltrace.

This is an implementation in the style of the rest: char == byte.

We might want to come back and implement UTF-8, but this is enough for ltrace.

Bug: 13747066
Change-Id: Ib2b63609c9014fdef9a8491e067467c4fc5ae3cc
tdlib.h
char.h
5c7bda5c612746266d8ae0d1a8240c7aee4ad9ae 07-Apr-2014 Elliott Hughes <enh@google.com> Fix aarch64 struct ucontext.

Change-Id: I6f0959723a753e8c788275709e7245c103ff88d1
ys/ucontext.h
caa15bfe2d6c065d2caff48583f18351bd96915f 03-Apr-2014 Elliott Hughes <enh@google.com> Define __WORDSIZE like glibc.

Requested by Google Breakpad, but seems to be assumed to be defined
in various places in the AOSP tree already; iputils, wpa_supplicant,
et cetera.

Change-Id: I1f7833c98e0af4c77e49744c08b8239061c9a571
ys/cdefs.h
804b95e5356a9fbb075c528fb781dd99a3be7277 03-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "bionic: Replace iface with opaque netid in resolver."
1b0dc40980c259aa0d9a416cd1ccf497e6efe138 02-Apr-2014 Elliott Hughes <enh@google.com> Remove <machine/limits.h>.

Change-Id: I7f9e9538517f726d4f08bf1f4b8d57c54d3f1676
imits.h
ys/limits.h
ea9bf6788144b83cc51c454b2bfe6b980d6e947c 14-Feb-2014 Szymon Jakubczak <szym@google.com> bionic: Replace iface with opaque netid in resolver.

Replace iface cache key with netid.

Replace _mark with netid.

Mark sockets used to test IPv4/IPv6 support as well as sockets
used to determine source address for rfc6724 sort.

Remove pid/uid mappings (functionality moved to system/netd).

Do not create resolv_cache when it does not exist, but rather only
when DNS configuration is supplied.

Clean up unused functions.

Change-Id: I9ccfda2902cc0943e87c9bc346ad9a2578accdab
etdb.h
7f3a272ae327c647db4caeaea2a3c7af50bd73b5 01-Apr-2014 Elliott Hughes <enh@google.com> Add lsearch(3) for ltrace.

Bug: 13746936
Change-Id: I833c6ba70a1752c04dab7de389f5bebb741662b3
earch.h
9cea3775056d0a8d04d49c3983440b89d82a462b 31-Mar-2014 Christopher Ferris <cferris@google.com> Small accept4 fixes.

Put the accept4 test in the sorted order, and put the accept4 define in
sorted order.

Also add the missing SYS_RECVMMSG and SYS_SENDMMSG defines.

Change-Id: Iba55354975e0d5027dbee53f6de752c2df719493
ys/socket.h
ys/socketcalls.h
50282f72bb9be6b49212a3978faec70786e9f97f 25-Mar-2014 Pavel Chupin <pavel.v.chupin@intel.com> Add lconv declaration and localeconv(3)

lconv is taken from ndk/sources/android/support/include/locale.h and
matches
bsd/glibc upstream.
Keep old declaration for 32-bits for compatibility.
localeconv.c and deps are taken from openbsd upstream.
Changed strtod.c accordingly.

Change-Id: I9fcc4d15f5674d192950d80edf26f36006cd31b4
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ocale.h
ys/localedef.h
bc475bc8d1d202baa48f6c9829fe1cced9122332 26-Mar-2014 Christopher Ferris <cferris@google.com> Merge "Add accept4() syscall"
ecbf00bda2fcee65e4e6385772022529ffeeed91 26-Mar-2014 Calin Juravle <calin@google.com> Merge "Clean up CMSG_*HDR in <sys/socket.h>"
8f2a30a92ab6981cccbc1a9e17b738f7542ae33f 26-Mar-2014 Andrei Emeltchenko <andrei.emeltchenko@intel.com> Add accept4() syscall

Add accept4() using SYSCALLS.TXT and gensyscall

Change-Id: I6f19f29144186d15d46423e10f2cc4b4223719c6
ys/socket.h
ys/socketcalls.h
f1de90b3a26d6ec46c0f1c741ef93509fe69f942 19-Mar-2014 Calin Juravle <calin@google.com> Clean up CMSG_*HDR in <sys/socket.h>

Removed __CMSG_NXTHDR, __CMSG_FIRSTHDR and cmsg_nxthdr.

Bug: 13418328
Change-Id: I6b1ed58b41b3f37d41e070c4f222b5bfa512bc48
ys/socket.h
9e8a8dc18cb3162858feef2d4baaf3fa357aa3d2 24-Mar-2014 Calin Juravle <calin@google.com> Merge "Remove ALIGNBYTES and ALIGN from <sys/param.h>"
c20de902875dcaebde0ccd0b7a8351598f254d4c 20-Mar-2014 Calin Juravle <calin@google.com> Remove ALIGNBYTES and ALIGN from <sys/param.h>

There are only three users of bionic definition of ALIGN and keeping it
in sys/param.h polutes the namespace.

I inline the definition in the the three places that's used.

Bug: 13400663
Change-Id: I565008e8426c38ffb07422f42cd8e547d53044e9
ys/param.h
7eb28b59c7665654255640e3fac4ccd5a9e1cbab 19-Mar-2014 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: don't define s?printf macros if already defined

Clang specific: Don't #define sprintf and snprintf macros if they
are already defined.

Change-Id: I30fc507d898377e1b8a57a65a147926229e0f9e2
tdio.h
205c7887add8b8c85434c35158138f16265beb28 14-Mar-2014 Elliott Hughes <enh@google.com> Clean up reentrancy cruft.

The DNS copy of reentrant.h was unused, so remove it.

The strtod implementation can use the upstream-netbsd reentrant.h and
get a little closer to what was then upstream. (It's since been replaced
by gdtoa, and we'll have to follow at some point, but for now this doesn't
make anything any worse.)

ANDROID_CHANGES is (now) only used in the DNS code, so push the -D
down.

The <locale.h> change prevents an LP32 hack from leaking into LP64.

Change-Id: Idf30b98a59d7ca8f7c6cd6d07020b512057911ef
ocale.h
f2cea021ab2c6d7d7feeb40cca098aa132605876 13-Mar-2014 Elliott Hughes <enh@google.com> Clean up <stdio.h> macros.

Also neuter __isthreaded.

We should come back to try to hide struct FILE's internals for LP64.

Bug: 3453512
Bug: 3453550
Change-Id: I7e115329fb4579246a72fea367b9fc8cb6055d18
tdio.h
5a8173860d65182af022be88fed0c5d8d5dcb69d 13-Mar-2014 Elliott Hughes <enh@google.com> Ensure we always have symbols for atof, strtof, strtold.

We'll need a better implementation of strtold for LP64, but all our
long double functions are currently broken for LP64 anyway so this
isn't a regression.

Change-Id: I2bdebac11245d31521d5fa09a16331c03dc4339c
tdlib.h
2282e16d76c6691968bd62a4c4bb3ecefabc98ca 12-Mar-2014 Elliott Hughes <enh@google.com> Merge "Use [u]int32_t instead of __[u]int32_t in sys/types.h"
2725ca95b23bc59ac7e7d7d52362c369db180671 12-Mar-2014 Pavel Chupin <pavel.v.chupin@intel.com> Use [u]int32_t instead of __[u]int32_t in sys/types.h

Avoid this error in -ffreestanding mode:
sys/types.h:45:1: error: unknown type name '__uint32_t'

Change-Id: I826b36873862d1d70b47401f31f4369a77666b8e
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ys/types.h
8d4b5849f21dc4115ad66944dc11df838b3faa52 12-Mar-2014 Elliott Hughes <enh@google.com> Clean up our termios implementation.

It's safe to fix our constant definitions because we know we never
had symbols before, so can't be passing the bad old constants to the new
functions, or the correct new constants to the old inlines.

Change-Id: I858fc680df39bdd3ba471e867833bdfa71f6224e
ermios.h
cccfe1e17c47799deee67fa23f48d8c860390ac8 11-Mar-2014 Elliott Hughes <enh@google.com> Reimplement clock(3) and switch to OpenBSD time(3).

The new implementation is a better approximation to the processor time used
by the process because it's actually based on resource usage rather than just
elapsed wall clock time.

Change-Id: I9e13b69c1d3048cadf0eb9dec1e3ebc78225596a
ys/times.h
a4eafa6dbc98378f3fa759fec8590871e2b5ae29 10-Mar-2014 Calin Juravle <calin@google.com> Removed pthread_attr_getstackaddr/pthread_attr_setstackaddr

Moved existing definitions to ndk_cruft to preserve NDK compatibility.

Bug: 13281069
Change-Id: I6f260de69afa55a6274f0d13145c19ac6517b9d5
thread.h
247dc91889ffc8b71fc3371edba9d834afab96ab 11-Mar-2014 Elliott Hughes <enh@google.com> Take ownership of various simple syscall wrappers.

None of these trivial functions is something we're going to get from BSD.

Change-Id: Iee1d1281b73db67da5ec303da7a49748121464bf
ys/socket.h
152b9de19ade833ada124390ef153e53d3d3e2ed 10-Mar-2014 Elliott Hughes <enh@google.com> Remove non-standard memswap.

Change-Id: I06548dda339987b755ef7139c590ca3e1f9fe0a9
tring.h
333e2ae87dac85d6420786e9e12ffd7ea84dae38 08-Mar-2014 Elliott Hughes <enh@google.com> Merge "Add si_timerid to <signal.h>."
4d46c940315af2d93efb44e751b69ea6880a5d65 08-Mar-2014 Elliott Hughes <enh@google.com> Merge "Rewrite the POSIX timer functions."
4b558f50a42c97d461f1dede5aaaae490ea99e2e 05-Mar-2014 Elliott Hughes <enh@google.com> Rewrite the POSIX timer functions.

This is a much simpler implementation that lets the kernel
do as much as possible.

Co-authored-by: Jörgen Strand <jorgen.strand@sonymobile.com>
Co-authored-by: Snild Dolkow <snild.dolkow@sonymobile.com>
Change-Id: Iad19f155de977667aea09410266d54e63e8a26bf
ys/types.h
a0cd9bc3392f56ca488bea61269d7468ae6c5dce 08-Mar-2014 Elliott Hughes <enh@google.com> Add si_timerid to <signal.h>.

The kernel uses the very misleading name "si_tid", but glibc uses the more
intention-revealing "si_timerid". We should let people use that.

(Added because I wanted to improve SI_TIMER siginfo_t dumping in strace.)

Change-Id: Ib626cdd3b57a6afb276a15753a237b4e81ec45e3
ignal.h
d9ba757ef4546ef931cfa2fff4e206b36c955ead 07-Mar-2014 Calin Juravle <calin@google.com> Merge "Sync up nameser with upstream(2014.03.05)"
fcb502e3ec032497bba7f8634fb214e0c05394d8 05-Mar-2014 Calin Juravle <calin@google.com> Sync up nameser with upstream(2014.03.05)

Bug: 13219633

Change-Id: I8ee4ddf270710e9eea415fa3db984af7719a8dd4
rpa/nameser.h
rpa/nameser_compat.h
252ee1e1124ae8aef2bde0c365c9ac6d59282bc8 04-Mar-2014 Narayan Kamath <narayan@google.com> Stop defining HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC.

No code is using this definition.

Change-Id: I188db63f38d62baf1cb57d0a36fcda540ad98492
thread.h
0e714a5b41451e84c5ded93a42c9a4b0a9440691 04-Mar-2014 Elliott Hughes <enh@google.com> Implement POSIX pthread_mutex_timedlock.

This replaces the non-standard pthread_mutex_lock_timeout_np, which we have
to keep around on LP32 for binary compatibility.

Change-Id: I098dc7cd38369f0c1bec1fac35687fbd27392e00
thread.h
569fb9887d00104509df79fa77d92e3cf9afe7db 04-Mar-2014 Calin Juravle <calin@google.com> Moved nameser.h and namser_compat.h to public include dir

This is part of the upstream sync (Net/Open/Free BSDs expose the
nameser.h in their public headers).

Change-Id: Ib063d4e50586748cc70201a8296cd90d2e48bbcf
rpa/nameser.h
rpa/nameser_compat.h
51e6cb33e3d7c2f44864d356a2a8e66317688f55 03-Mar-2014 Narayan Kamath <narayan@google.com> Implement pthread_condattr_{get,set}clock.

We only support CLOCK_REALTIME and CLOCK_MONOTONIC for now,
so we us a single bit from pthread_cond_t->value to denote
the clock type. Note that this reduces the width of the counter
to 30 bits, but this should be large enough for all practical
purposes.

bug: 13232338

Change-Id: I857e7da64b3ecbb23eeac7c9f3fbd460f60231bd
thread.h
e4ab19c67d00b526a3f8c1af4e8e8153c2867294 03-Mar-2014 Elliott Hughes <enh@google.com> Remove deprecated and unused constants from <sys/klog.h>.

Change-Id: I23d54b5eaf918859480f927534a3f9e3af602311
ys/klog.h
a8b1eb3fcf13fab029a16fa3b6636218a64c4583 01-Mar-2014 Elliott Hughes <enh@google.com> Fix build.

Change-Id: I71cde79263d5f5a8382865b8151f65c5c05ea17b
ys/socket.h
2ec592c338f5c5021f127e92212d156cd909c617 01-Mar-2014 Elliott Hughes <enh@google.com> Merge "Add recvmmsg and sendmmsg syscalls."
692207eb457f9b4bf6cb4301d710d19b6e85c902 01-Mar-2014 Elliott Hughes <enh@google.com> Add getprogname/setprogname for BSD compatibility.

This is one less change we have to make when porting BSD code.

Bug: https://code.google.com/p/android/issues/detail?id=34898
Change-Id: If9b1a8d16996c7a19abcce8d3a456afc3e105a41
tdlib.h
6ff0c75c838e73d2aeccc0102ab58a7b865172ca 10-Feb-2014 Guillaume Ranquet <guillaumex.ranquet@intel.com> Add recvmmsg and sendmmsg syscalls.

Also add the corresponding constant, struct, and function declarations
to <sys/socket.h>, and perfunctory tests so we know that the symbols
actually exist.

Signed-off-by: Guillaume Ranquet <guillaumex.ranquet@intel.com>
Change-Id: Ib0d854239d3716be90ad70973c579aff4895a4f7
ys/socket.h
3434727b3ece18d90894c3f8d9ffd000a00c9c50 26-Feb-2014 Elliott Hughes <enh@google.com> Ensure that <fcntl.h> has the SYNC_FILE_RANGE_* constants.

Needed to build strace at their tip of tree.

Change-Id: I64db00a332088e08e25bc30357293a9308b8a226
cntl.h
5c7816f425cb70ca6920e816aba33ce3d691ef10 25-Feb-2014 Elliott Hughes <enh@google.com> Merge "More OpenBSD cleanup (primarily string)."
a92b57c7f8230661d911f2fd6dd67a81e9a90cef 25-Feb-2014 Calin Juravle <calin@google.com> Merge "Added ftw64, nftw64"
7c1efffc249283b47309846abba8795f3fb91555 25-Feb-2014 Calin Juravle <calin@google.com> Merge "Added mkstemp64"
53e43292aac91bf62995788cd5ca2ceb7caea283 25-Feb-2014 Elliott Hughes <enh@google.com> More OpenBSD cleanup (primarily string).

This patch removes the string/ and wchar/ directories.

Change-Id: Ia489904bc67047e4bc79acb1f3eec21aa3fe5f0d
tring.h
char.h
0e44bc3baeb1677e5fbdda87a737b9c508c95132 25-Feb-2014 Elliott Hughes <enh@google.com> Remove <asm/page.h>.

If we have PAGE_SIZE/PAGESIZE, POSIX says they should be in <limits.h>.

Change-Id: I3c2d574ea2aea81f524874a156361411a4ffa18e
sm/page.h
imits.h
ys/mman.h
ys/user.h
d4934a70e69365c97b1378820152e134a0089b5e 24-Feb-2014 Calin Juravle <calin@google.com> Added ftw64, nftw64

Bug: 13076637
Change-Id: I5b926526f935b00bba14c2807b61d85f95089c33
tw.h
fe317a3775e16d466bb884a8e054fd77f7087bb3 21-Feb-2014 Calin Juravle <calin@google.com> Added mkstemp64

Bug: 13076637
Change-Id: I41bf28ab3e6c7325470781e9323eeec023483df5
tdlib.h
c9ae21a5c3b2e1baafe50f752e2e07e343d39530 19-Feb-2014 Narayan Kamath <narayan@google.com> Move system_properties over to C++.

This change constitutes the minimum amount of
work required to move the code over to C++, address
compiler warnings, and to make it const correct and
idiomatic (within the constraints of being called
from C code).

bug: 13058886

Change-Id: Ic78cf91b7c8e8f07b4ab0781333a9e243763298c
ys/_system_properties.h
9150dfb1c6928ceef228e640412c3653d5e87a10 22-Feb-2014 Elliott Hughes <enh@google.com> Merge "Clean up our OpenBSD usage."
0133944b09d1c0a35041f7a41eb6bfb660144f4f 21-Feb-2014 Elliott Hughes <enh@google.com> Clean up our OpenBSD usage.

Also undo some of the mess where we have OpenBSD <stdio.h> but a mix of
different BSD's implementations.

In this first pass, I've only moved easy OpenBSD stuff.

Change-Id: Iae67b02cde6dba9d8d06fedeb53efbfdac0a8cf6
nistd.h
da030de702b756077fec536ed139e7ea38b51022 20-Feb-2014 Calin Juravle <calin@google.com> Fixed int fast types for LP64

Bug: 13110474
Change-Id: Id5591603ad4ba7e149c0852f4abb25e4e5a5d065
tdint.h
6b5559315d959347fcc01781669f771746cbb2ee 19-Feb-2014 Elliott Hughes <enh@google.com> Use uid_t and gid_t for st_uid and st_gid in struct stat.

Change-Id: Ide62dc714d76d881e3aa79e7a59ee6533a23dd00
ys/stat.h
db1ea3474899ebbd783aba872d3005f95a816d0f 18-Jan-2014 Elliott Hughes <enh@google.com> Implement some of the missing LFS64 support.

This gives us:

* <dirent.h>
struct dirent64
readdir64, readdir64_r, alphasort64, scandir64

* <fcntl.h>
creat64, openat64, open64.

* <sys/stat.h>
struct stat64
fstat64, fstatat64, lstat64, stat64.

* <sys/statvfs.h>
struct statvfs64
statvfs64, fstatvfs64.

* <sys/vfs.h>
struct statfs64
statfs64, fstatfs64.

This also removes some of the incorrect #define hacks we've had in the
past (for stat64, for example, which we promised to clean up way back
in bug 8472078).

Bug: 11865851
Bug: 8472078
Change-Id: Ia46443521918519f2dfa64d4621027dfd13ac566
irent.h
cntl.h
ys/stat.h
ys/statvfs.h
ys/vfs.h
671e236d5fd2cae169c2a31d0a35e66c4fcc5556 13-Feb-2014 Elliott Hughes <enh@google.com> Restore sys_signame for LP64.

mksh is using this, and we probably build as much BSD source as glibc source.

Change-Id: I400d255a67f9614ca9e57090e3a2e49d2b10cba4
ignal.h
aa0ebdafc71e1ceac78e0929b94f3bb117d0c8e9 12-Feb-2014 Elliott Hughes <enh@google.com> Clean up sys_signame and sys_siglist a little.

We don't need quite so much duplication because we already have a way
to get the signal number from its name, and that already copes with the
fact that the mips/mips64 numbers are different from everyone else's.

Also remove sys_signame from LP64. glibc doesn't have this BSD-ism.

Change-Id: I6dc411a3d73589383c85d3b07d9d648311492a10
ignal.h
ys/_sigdefs.h
199346a2abd8b6ba282e1fe291cc3766fa921f40 12-Feb-2014 Elliott Hughes <enh@google.com> Fix NSIG.

Our sigset_t definition hasn't been tied to our NSIG definition since we
switched to uapi headers, so we can now fix it without breaking the LP32 ABI.
The kernel uapi headers define and use _NSIG, so we need to have our scripts
rename the kernel's definitions out of the way, then we can define _NSIG
and NSIG in terms of the kernel's off-by-one value.

Bug: 12938442
Change-Id: Ic7c86fd5be5ad1d822f7b2b1d88c8a0d70a1ac0f
ignal.h
a6ecba4d233d7b769a05ee81ae908c9105352624 11-Feb-2014 Elliott Hughes <enh@google.com> Clean up cacheflush.

No cacheflush for LP64; use the GCC builtin instead. Clean up the
32-bit MIPS implementation now we no longer need to worry about
old versions of GCC.

Bug: 12924756
Change-Id: Ie23955b3ec194e226c4b2bce35b11d5e061f4753
nistd.h
0266ae5f884d72da58f33a072e865ba131234a5e 11-Feb-2014 Elliott Hughes <enh@google.com> Switch <elf.h> over to linux uapi under the covers.

Remove the linker's reliance on BSD cruft and use the glibc-style
ElfW macro. (Other code too, but the linker contains the majority
of the code that needs to work for Elf32 and Elf64.)

All platforms need dl_iterate_phdr_static, so it doesn't make sense
to have that part of the per-architecture configuration.

Bug: 12476126
Change-Id: I1d7f918f1303a392794a6cd8b3512ff56bd6e487
lf.h
ys/exec_elf.h
3a9c5d66dc8d41272f51482b713717af7049697e 10-Feb-2014 Elliott Hughes <enh@google.com> Fix <link.h>.

Also move some of the stuff that should be in <link.h> out of the
private "linker.h", to make it clearer that these are public API
known to gdb that we can't change.

Bug: 12554197
Change-Id: I830e1260d3d8b833ed99bc1518f1c6b6102be8af
ink.h
ebd90b9ba99cdd49a4a4eea38b1b8654af942e97 08-Feb-2014 Elliott Hughes <enh@google.com> Fix socklen_t (on LP64 only).

Too late to fix LP32 :-(

Bug: 12935461
Change-Id: Ib056ca1eaf9ae8712f88ae21ff94e91b08cf588b
ys/types.h
c16a4532917259fabc8018d681cdd1ad1b1b5e08 08-Feb-2014 Elliott Hughes <enh@google.com> Merge "Remove <sys/_types.h>."
9f87a0b285128542a221f2b69d3b959a4e33c054 07-Feb-2014 Elliott Hughes <enh@google.com> Remove <sys/_types.h>.

Bug: 12213562
Change-Id: I0d10664f9da60739bdbad0408be0dd61eea3c1fe
earch.h
tdint.h
ys/_types.h
ys/socket.h
ys/types.h
ys/un.h
645d0312c2d6b6492cc4b3891bc1a91908dc24b7 06-Feb-2014 Chris Dearman <chris.dearman@imgtec.com> [MIPS64] libc/libm support

libc/libm support for MIPS64 targets

Change-Id: I8271941d418612a286be55495f0e95822f90004f
Signed-off-by: Chris Dearman <chris.dearman@imgtec.com>
Signed-off-by: Raghu Gandham <raghu.gandham@imgtec.com>
ys/stat.h
ys/vfs.h
9afe2884c7fe11f862982fd550a2ead688f2044d 05-Feb-2014 Elliott Hughes <enh@google.com> Kill <machine/_types.h>.

Most of <machine/_types.h> was either unused, wrong, or identical across
all 32-/64-bit architectures.

I'm not a huge fan of <sys/_types.h> either, but moving the bits we need
up into there is a step forward.

Bug: 12213562
Change-Id: Id13551c78966e324beee2dd90c5575e37d2a71e6
rr.h
ys/_types.h
ys/endian.h
f64b8ea09db3bdd84eed59f7721301743332b3fe 04-Feb-2014 Elliott Hughes <enh@google.com> Add fallocate/fallocate64/posix_fallocate/posix_fallocate64.

Bug: 5287571
Bug: 12612860
Change-Id: I4501b9c6cdf9a830336ce0b3afc4ea716b6a0f6f
cntl.h
8d60cc63163df81938305632e1b7474aeda17d52 04-Feb-2014 Elliott Hughes <enh@google.com> Use __inline__ for fortify.

libunwind has #define inline /* empty */ which breaks our fortified headers.
glibc uses __inline but our BSD-derived headers often override that. __inline__
is the third alternative understood by GCC that -- as far as I know -- neither
the C library itself nor third-party code tries to mess with.

Bug: 12871594
Change-Id: I6677e70ea531bb7d4c46021b43af760d4ad8ecf7
ys/cdefs.h
7b95807fa086174cbab146cbd7c60a6d2e386917 31-Jan-2014 Ross McIlroy <rmcilroy@google.com> Add missing ucontext_t definition to bionic for arch-arm64.

Change-Id: I1ee15230c63e00f01d2063cfffcffe7f1a1eeb6a
ys/ucontext.h
3614424e107849c53759ef93b9166e69a76818df 30-Jan-2014 Elliott Hughes <enh@google.com> Make ARM <user.h> more glibc-compatible.

Change-Id: I681930ad7f80a5e7bc40eb0f36872e415445f0f9
ys/user.h
02c661b88384a4a0cd5dd2b32123968bd992873f 30-Jan-2014 Elliott Hughes <enh@google.com> Add mips <sys/ucontext.h>.

Change-Id: I2821f523f0c3bb4400b2ad5d36e21e5a3d6d777c
ys/ucontext.h
4e72fcc3c2b8bcaab653732dfd3edd137602c648 30-Jan-2014 Elliott Hughes <enh@google.com> Add arm <sys/ucontext.h>.

Change-Id: I14d435f9e3e82f77d8a7e886ff88c18f5d09d14a
ys/ucontext.h
677a07cb9a3f5964e9ead4d37b9f775d971c61e0 30-Jan-2014 Elliott Hughes <enh@google.com> Add x86 <sys/ucontext.h>.

Change-Id: I43e72604f7a932f134733b78094b577415a5edb7
ys/ucontext.h
e61d106008f7d77fa1c0de43ac27311320225135 27-Jan-2014 Pavel Chupin <pavel.v.chupin@intel.com> Add x86_64 ucontext.h for better compatibility

As suggested here: https://android-review.googlesource.com/#/c/71267/
it may be used for x86_64 libunwind enabling.

Change-Id: I21623261a48ea7099e030d33932556e294d226ff
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ys/ucontext.h
context.h
e2a292d278b94fec3d078b1f1b27c1f89942c276 25-Jan-2014 Elliott Hughes <enh@google.com> Remove __STDC_FORMAT_MACROS and __STDC_LIMIT_MACROS guards (and fix SIZE_MAX for LP64).

The various committees decided that everyone should get all these macros,
all the time.

Bug: 12708004
Change-Id: Ib56010dcba9b0656e5701546fefb7f78dc0bf916
nttypes.h
tdint.h
323d4b6f6839b472ac02c31105727147660dc4db 13-Jan-2014 Vadim Markovtsev <gmarkhor@gmail.com> Add "__noreturn" to assert and assert2

These functions should print assertion violation messages and then
call abort(). They do really not return control flow afterwards.
Consider the declaration of the similar __assert_fail from glibc:

extern void __assert_fail (const char *__assertion,
const char *__file,
unsigned int __line,
const char *__function)
__THROW __attribute__ ((__noreturn__));

Bionic has __noreturn defined in sys/cdefs.h to be that GNU
noreturn attribute.

This patch has a practical value. Consider the following function:

void check(void* ptr) {
assert(ptr != NULL);
}

Without this patch applied, gcc (and presumably clang) shows even in
debug mode:

warning: unused parameter 'ptr' [-Wunused-parameter]

In release mode, NDEBUG is defined and assert() becomes a no-op, as
one should expect. Thus, the warning is shown correctly then.

Another code sample:

float array[2];
int i = 3;
...
assert(i < 2);
array[i] = 0;

gcc says,

warning: array subscript is below array bounds [-Warray-bounds]

In other words, without noreturn attribute, assertions do not
allow a compiler's static analyzer to properly understand
the preconditions.

Change-Id: I3be92e99787c528899cf243ed448c4730c00c45b
Signed-off-by: Vadim Markovtsev <gmarkhor@gmail.com>
ssert.h
ae189740de6b03f06a06214122183a3774f5cb62 11-Jan-2014 Elliott Hughes <enh@google.com> Merge "Add some more headers."
c835c35727e473758903e1c44c7a72aa6b9965fc 11-Jan-2014 Elliott Hughes <enh@google.com> Add some more headers.

This patch adds trivial implementations of the missing sys headers
needed by strace. All strace needs are the constants and structures,
so this is enough for now. We can come back and add the functions
if/when we ever need them.

Change-Id: Idb87c1a8b6b1c62f6e16ae94f147e1169722b48e
ys/msg.h
ys/sem.h
ys/shm.h
ys/timex.h
4e9cb032d1eab7ceaef47f4d5104d2c42d556ce2 09-Jan-2014 JP Abgrall <jpa@google.com> Add extra libc stubs for mntent related functions.

This adds stubs for setmntent() and endmntent().

Change-Id: I6ccaa044145405cd7226c1c54a25d435c96a2308
ntent.h
33c3e8d3b2312be3a3eb9d2632c4a570969e1624 10-Jan-2014 Elliott Hughes <enh@google.com> Merge "Add NT_PRSTATUS to <elf.h>."
1272dbd1d76c979358fff3beae9de0c1462345af 10-Jan-2014 Elliott Hughes <enh@google.com> Add NT_PRSTATUS to <elf.h>.

Needed by aarch64.

Bug: 12476126
Change-Id: I7764664459a06cf4f2a60e707bd968d321a78430
lf.h
8e6bf35a16532f9e90ce85b0674a0ff19dbef557 09-Jan-2014 Elliott Hughes <enh@google.com> Merge "Add <sgidefs.h>."
f8b2b3c81ea4cebf1f9adbb47cc9dfb81a1ed309 09-Jan-2014 Elliott Hughes <enh@google.com> Fix x86 user_regs_struct.

I fixed x86-64 yesterday, but didn't fix x86 at the same time.

Change-Id: I5c081f5956dfedb9389af303369b841dd0fc1953
ys/user.h
1c2cf23a0c54619e7a362e1b82b0fb37ec9dd11a 09-Jan-2014 Elliott Hughes <enh@google.com> Add <sgidefs.h>.

Change-Id: I543d502a81dcb8d5969f814b8a9a9c819bc4fa2c
gidefs.h
a8a3178445e8a229671977411f44c04844dcc1ab 09-Jan-2014 Elliott Hughes <enh@google.com> Add the glibc-compatible d_fileno.

d_ino is the POSIX name, but glibc also offers d_fileno, and
that's what strace is using.

Change-Id: I3fadbe7a64700b42e78c7f4631620e864d43147b
irent.h
0f461e35f63200641fc53bba222845a84589c024 09-Jan-2014 Elliott Hughes <enh@google.com> Fix <sys/resource.h>.

The situation here is a bit confusing. On 64-bit, rlimit and rlimit64 are
the same, and so getrlimit/getrlimit64, setrlimit/setrlimit64,
and prlimit/prlimit64 are all the same. On 32-bit, rlimit and rlimit64 are
different. 32-bit architectures other than MIPS go one step further by having
an even more limited getrlimit system call, so arm and x86 need to use
ugetrlimit instead of getrlimit. Worse, the 32-bit architectures don't have
64-bit getrlimit- and setrlimit-equivalent system calls, and you have to use
prlimit64 instead. There's no 32-bit prlimit system call, so there's no
easy implementation of that --- what should we do if the result of prlimit64
won't fit in a struct rlimit? Since 32-bit survived without prlimit/prlimit64
for this long, I'm not going to bother implementing prlimit for 32-bit.

We need the rlimit64 functions to be able to build strace 4.8 out of the box.

Change-Id: I1903d913b23016a2fc3b9f452885ac730d71e001
ys/resource.h
8276d2875f64587e266567f5bb2c5e0c70ef0a5d 09-Jan-2014 Elliott Hughes <enh@google.com> Merge "Our dirent is a dirent64."
38f0ef3ff7143ae22c07763f23860f445b9ddacb 09-Jan-2014 Elliott Hughes <enh@google.com> Our dirent is a dirent64.

Change-Id: Idc9ebfd900fddd4f7c7ac95bc9b74401ebc801a3
irent.h
5b17e4da39a4f6b6fde1560fe7e4c335297aef02 09-Jan-2014 Elliott Hughes <enh@google.com> Add <sys/reg.h>.

This describes the offsets into ptrace's returned arrays of registers
for x86 and x86-64.

Change-Id: I044f03e286673999a298b73a813d4ad366625845
ys/reg.h
8a6eec38eb19b5af317b57c15459f9786df83eba 09-Jan-2014 Elliott Hughes <enh@google.com> Merge "Fix x86_64 register names in <sys/user.h>."
eddc8ece3de370fc321d7b974f6565db3a91543b 09-Jan-2014 Elliott Hughes <enh@google.com> Fix x86_64 register names in <sys/user.h>.

Change-Id: Ieb327247a41f6195589716170e324d1cd1251b96
ys/user.h
155b0764204934de4b81f95c57f957a059a82a32 09-Jan-2014 Elliott Hughes <enh@google.com> We shouldn't have a <sys/dirent.h> that's a subset of <dirent.h>.

glibc has no <sys/dirent.h>. If we do have to bring this back, we
should probably just have one file #include the other.

Change-Id: I5c0bf9c03769daf3b23f69778e9f01f81c3de9ec
ys/dirent.h
4c8caf0ad39768e614fb4c1f5ef415aab223adb2 08-Jan-2014 Elliott Hughes <enh@google.com> Merge "<sched.h> should offer both __sched_priority and sched_priority."
4faf76ca114a11cd264b0f5907e517add4585b27 08-Jan-2014 Elliott Hughes <enh@google.com> Merge "<fcntl.h> should get you the POSIX_FADV_* constants."
bc4e135a8ec0a72d07b2d74a082067e8e56c1f62 08-Jan-2014 Elliott Hughes <enh@google.com> Merge "Add SWAP_FLAG_* constants to <sys/swap.h>."
65c6f3099e95ece2f0322569c1a101faa8d53942 08-Jan-2014 Elliott Hughes <enh@google.com> Add SWAP_FLAG_* constants to <sys/swap.h>.

Bug: 9336527
Change-Id: I679be4d8425ba177dd782e714f465caf9daa976c
ys/swap.h
bbb34f9536db8234b0b43bd5333256fa4accc50e 08-Jan-2014 Elliott Hughes <enh@google.com> <sched.h> should offer both __sched_priority and sched_priority.

If glibc hadn't already done things this way round, I'd have
called the field sched_priority and the macro __sched_priority
since that would seem less likely to cause trouble, but glibc
source compatibility is probably more important.

Change-Id: I8a8a477f2aa87cae641069c5c84b4fcab3152a82
ched.h
01e505ac9c321307eedcb7f34fb1dabac8949184 08-Jan-2014 Elliott Hughes <enh@google.com> <fcntl.h> should get you the POSIX_FADV_* constants.

Change-Id: I9de8b840570b228308c12d72b7617b8758237fb8
cntl.h
abfc88fed79fced91b3b2cd8f3eb20f98c03452d 08-Jan-2014 Elliott Hughes <enh@google.com> Define fsid_t as well as __fsid_t.

Change-Id: Ib8efbd913a0e6bfe27b88c1342bd5cec926dd74e
ys/vfs.h
b235f8c8773c08569a97b0ff7e4c709b216c8478 06-Jan-2014 Elliott Hughes <enh@google.com> Merge "Fix dev_t (for LP64)."
338e6102a60a33661812753f03f1d426ab1a7fe1 04-Jan-2014 Elliott Hughes <enh@google.com> Add TCPOPT_* constants.

Adds the TCPOPT_* constants from NetBSD. Note that the BSDs also have
TCPOPT_SIGNATURE, but Linux calls that TCPOPT_MD5SIG and glibc doesn't
have any corresponding constant yet, so let's wait until we see which name
wins out.

Change-Id: If53cdada5595285d9a7e7248ef74cd7502d804c0
etinet/tcp.h
894f8cb1395d3409bb995d18abc1b3409c557d01 03-Jan-2014 Elliott Hughes <enh@google.com> Fix dev_t (for LP64).

32-bit Android's dev_t was wrong too. We can't fix that without ABI breakage,
but we can at least fix 64-bit Android. And add tests.

Bug: https://code.google.com/p/android/issues/detail?id=54966
Change-Id: Ie2e42cc042b78b669a1a44e55f959dbd9c52c5c9
ys/_types.h
ys/types.h
887e1140fe7596fa1239a0bc802d2cdb51c57d3c 02-Jan-2014 Elliott Hughes <enh@google.com> Clean up <sched.h>.

This patch switches to using the uapi constants. It also adds the missing
setns system call, fixes sched_getcpu's error behavior, and fixes the
gensyscalls script now ARM is uapi-only too.

Change-Id: I8e16b1693d6d32cd9b8499e46b5d8b0a50bc4f1d
ched.h
ys/glibc-syscalls.h
68d89c7d65678871cb4ce629765193f956944730 21-Dec-2013 Elliott Hughes <enh@google.com> Remove some old kernel header cruft not needed with uapi.

Change-Id: If543b056ae40f0eb660be4a0629ad22f4c4cb92f
ignal.h
aa267685c9da11502c4ec50f86f78a7075b6809c 20-Dec-2013 Elliott Hughes <enh@google.com> Merge "Allow GCC-built fortified code to run on a clang-built bionic."
b8fa5b1ca9fc9b8b92875d2d9f33df3c8310aa09 20-Dec-2013 Elliott Hughes <enh@google.com> Fix struct stat for aarch64.

Another kernel, another struct stat.

Change-Id: Ia5ee553d4a2ffc878d2fed82a763ff64c02b12e8
ys/stat.h
cd0609f4fcec9bdcb99a2127137c5570b18c499c 19-Dec-2013 Elliott Hughes <enh@google.com> Allow GCC-built fortified code to run on a clang-built bionic.

Even though code built with clang won't be fully fortified
and won't contain calls to our various helpers, binaries built
with GCC will.

Change-Id: I389b2f1e22a3e89b22aadedc46397bf704f9ca79
cntl.h
tdio.h
ad8842f5c67dea52a2b4ce280b612f41846cd2ef 18-Dec-2013 Elliott Hughes <enh@google.com> Don't use __kernel_ulong_t.

Change-Id: Ifdfbac0ac6da647276a84bd64bb342bb5a07ad61
ys/types.h
2b333ea31ec5b5b4627f14b22253b017b346638a 18-Dec-2013 Elliott Hughes <enh@google.com> Remove <machine/kernel.h>.

Bug: 12175484
Change-Id: I127f7f91f36bd879109d653e0c56ec56e2529d4d
ys/types.h
c13fb75ceabb47f8292be206db80b93889fccf66 18-Dec-2013 Elliott Hughes <enh@google.com> Move bionic over to GCC's 'warning' attribute.

This is a better solution than the old __warn_references because it's
a compile-time rather than link-time warning, it doesn't rely on something
that doesn't appear to be supported by gold (which is why you only used
to see these warnings on mips builds), and the errors refer to the exact
call site(s) rather than just telling you which object file contains a
reference to the bad function.

This is primarily so we can build bionic for aarch64; building libc.so
caused these warnings to fire (because link time is the wrong time) and
warnings are errors.

Change-Id: I5df9281b2a9d98b164a9b11807ea9472c6faa9e3
tdio.h
tdlib.h
ys/cdefs.h
ys/cdefs_elf.h
c2f082f65528a889aca7cde4b343aaf36199ba82 13-Dec-2013 Elliott Hughes <enh@google.com> Make <sys/param.h> more glibc-like.

In particular, add MAX and MIN, needed by elfutils.

Bug: 11864683
Change-Id: I1b876732cdf68cdf5b930319e5ef5b5647586718
ys/param.h
ed45970ac5a182e512669cfa5c15b9f4fa783ad7 03-Dec-2013 Christopher Ferris <cferris@google.com> Add cfi directives to all arm assembly.

Since the ENTRY/END macros now have .cfi_startproc/.cfi_endproc, most of the
custom arm assembly has no unwind information. Adding the proper cfi directives
for these and removing the arm directives.

Update the gensyscalls.py script to add these cfi directives for the generated
assembly. Also fix the references to non-uapi headers to the proper uapi
header.

In addition, remove the kill.S, tkill.S, tgkill.S for arm since they are not
needed at all. The unwinder (libunwind) is able to properly unwind using the
normal abort.

After this change, I can unwind through the system calls again.

Bug: 11559337
Bug: 11825869
Bug: 11321283

Change-Id: I18b48089ef2d000a67913ce6febc6544bbe934a3
ys/glibc-syscalls.h
ab797cb4fded31cd30f4cd778f0b850c6801e7db 27-Nov-2013 Elliott Hughes <enh@google.com> Finish <sys/user.h>.

Change-Id: I1d97d7fa3d5be2ff4728571ed5376705a27091ec
ys/user.h
e96d4bffe5eadd6f70eaefef1d6efcb00f6b23be 25-Nov-2013 Elliott Hughes <enh@google.com> Make <sys/timerfd.h> standalone.

There's no uapi timerfd.h.

Bug: 11559337
Change-Id: I77a4b1365fdcf2c9f18673b11341a165e54b4bbd
ys/timerfd.h
dd1d4f1cfd6c4c6eca27cc2f7f477e0518dc0924 23-Nov-2013 Christopher Ferris <cferris@google.com> am 985c3fbb: Merge "Move arm user.h definitions to sys/user.h."

* commit '985c3fbb3b1dabfa799e2a8c102867349bcb5a76':
Move arm user.h definitions to sys/user.h.
363390eaffaf991b13c9666bb82af7ab793976f6 23-Nov-2013 Christopher Ferris <cferris@google.com> Move arm user.h definitions to sys/user.h.

There is no uapi user.h file for arm, it was included by accident.
Move the user struct definition into the file to follow the pattern
used by the other architectures.

Change-Id: Ib9cea0deca551c9268382ddd6de9202fd32ef941
ys/user.h
f00c938c7f5887981d724bf2dd9989ee0af08332 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit '811b0cdb2d6e4a697dbc63a678712759dd0db242' into HEAD

Change-Id: I786944f80fb1a2d502fed51dc2c391ed5db66761
880d0e6c64eb49736125648d1539726629308316 21-Nov-2013 Elliott Hughes <enh@google.com> Merge "Remove hidden __reboot from header"
811cba00af83c72673c079cc433f72a652814bcf 21-Nov-2013 Pavel Chupin <pavel.v.chupin@intel.com> Remove hidden __reboot from header

This change is required:
https://android-review.googlesource.com/#/c/70570

Change-Id: Idb991f96a424aa5b0f9e06d9fb787fe8c8530750
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ys/reboot.h
9c67d4307c6be91618a75f0255e701fc69f3b55f 21-Nov-2013 Elliott Hughes <enh@google.com> Fix useconds_t for LP64.

Change-Id: I869e60484999c1feda3dcdb86bee5b5373e6b3df
ys/types.h
ab61eb366ac48addf2bca6093a34455193f5c8df 21-Nov-2013 Elliott Hughes <enh@google.com> Switch to upstream sleep(3) and usleep(3).

Also fix the signature of usleep, and the definition of useconds_t which
should be unsigned, as the 'u' in its name implies.

This patch also cleans up the existing FreeBSD hacks by moving the libm
stuff from <sys/cdefs.h> to a libm-private header, and adding comments
about the hacks we use to build FreeBSD source.

Change-Id: Ibe5067a380502df94a0a3a7901969b35411085b6
ys/cdefs.h
ys/types.h
nistd.h
d8482b6c7eae54c37bc769030d60c2a5af187f89 20-Nov-2013 Elliott Hughes <enh@google.com> Fix <signal.h> for mips uapi.

Bug: 11559337
Change-Id: I4c6080f162d74ee78c81d698c7b50470b0e09586
ignal.h
e888de81df66036903cde08402ab8e93c910e337 20-Nov-2013 Elliott Hughes <enh@google.com> Provide <sys/user.h>.

strace wants this, for example.

Change-Id: Icb4d64bde392abbc091fa3375a4fa19b2707b12c
ys/user.h
2ecc164ae9b8062e29faf5eca491669e2741cab3 08-Nov-2013 Elliott Hughes <enh@google.com> Remove the dependency on the non-uapi __kernel_nlink_t.

The kernel doesn't have an nlink_t; it just uses the equivalent of
uint32_t. We already had a usable __nlink_t in the C library, so
let's just define our nlink_t in terms of __nlink_t, which is what
__nlink_t was meant for anyway.

Note that our struct stat just follows the kernel, and doesn't refer
to nlink_t anyway.

Change-Id: I2a56e418e42404b1741b08c50554b03c11caebae
ys/types.h
61fb3fc770566c7bafe7af8fb93590bcad387fbb 07-Nov-2013 Elliott Hughes <enh@google.com> Prepare to switch to the uapi <linux/signal.h>.

<time.h> didn't need to copy the cruft from <signal.h>, and
<signal.h> only needs the uid_t hack when it's not using
uapi headers.

pthread_exit.cpp should include what it uses.

Change-Id: I836c36abe0f0a781d41fc425b249d1c7686bb124
ignal.h
ime.h
40596aa0054bcfa76148f55321bf4b979e2242be 05-Nov-2013 Elliott Hughes <enh@google.com> Make cpp.py less braindead.

The old code ignored operator precedence (!), despite having two tables
of operator precedence. The code's still pretty awful, but I've cleaned
it up enough to fix this, the most important bug.

This patch lets us correctly clean the uapi unistd.h, stat.h, and swab.h files,
and also fixes the mess we were already making of various old kernel
header files. I've added a bunch more tests, fixed the existing tests that
the existing script was already failing (!), and changed the script so that
the tests are run every time the script is run.

We can probably remove some of the old kernel header files that we were
parsing incorrectly, but we can worry about that later.

Bug: 11253477
Change-Id: Ie66c65b3a7ae13b4e98ed8038a6a534f06eae0e5
ys/_types.h
3503ce2177a56a8807887ee540abc68377483393 05-Nov-2013 Elliott Hughes <enh@google.com> Fix <sys/select.h> for LP64, clean up <time.h>.

The 64-bit uapi headers don't define FD_CLR and friends, so this
patch updates libc/kernel/common/linux/time.h after the change
b934bbec145e9e084bf48149a3a94ae3dd132157 in external/kernel-headers,
then fixes <sys/select.h> to work in this new world, and removes
some now-unnecessary duplication from <time.h> (with other cruft
cleaned up while I'm here).

Change-Id: Ifd26f901b4d200c65065b3e6ef1b74055127e052
ys/select.h
ime.h
c3f114037dbf028896310609fd28cf2b3da99c4d 30-Oct-2013 Elliott Hughes <enh@google.com> <pthread.h> fixes and pthread cleanup.

<pthread.h> was missing nonnull attributes, noreturn on pthread_exit,
and had incorrect cv qualifiers for several standard functions.

I've also marked the non-standard stuff (where I count glibc rather
than POSIX as "standard") so we can revisit this cruft for LP64 and
try to ensure we're compatible with glibc.

I've also broken out the pthread_cond* functions into a new file.

I've made the remaining pthread files (plus ptrace) part of the bionic code
and fixed all the warnings.

I've added a few more smoke tests for chunks of untested pthread functionality.

We no longer need the libc_static_common_src_files hack for any of the
pthread implementation because we long since stripped out the rest of
the armv5 support, and this hack was just to ensure that __get_tls in libc.a
went via the kernel if necessary.

This patch also finishes the job of breaking up the pthread.c monolith, and
adds a handful of new tests.

Change-Id: Idc0ae7f5d8aa65989598acd4c01a874fe21582c7
thread.h
126405039e408ac58567cff76d923c37794ea30f 29-Oct-2013 Elliott Hughes <enh@google.com> Update <sys/exec_elf.h> to include EM_AARCH64.

Upstream added the constant for us.

Change-Id: I197e32d2e5b3fd499d069546ccfcc1d35d65e0a0
ys/exec_elf.h
7f8863dc07377544c1289efd0aaf787f5a4ecc04 11-Oct-2013 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Autogenerated syscalls for AArch64

This patch adds AArch64 syscalls, autogenerated using:
./libc/tools/gensyscalls.py

Change-Id: I1cc60430423ecb52a35448bf2c358b82136b2f16
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
ys/glibc-syscalls.h
74ce45972d88604aa759040cfd2570674cfb439d 28-Oct-2013 Elliott Hughes <enh@google.com> Update <sys/exec_elf.h> to get the DF_* flags.

Change-Id: Ia9e785f6b95122f94ee3b01a312db1d5bb91a72e
ys/exec_elf.h
e4d792adb8d6f9228b9ac9dc1ad7f43b271f085f 28-Oct-2013 Elliott Hughes <enh@google.com> Don't allow text relocations on 64-bit.

I've also updated our <sys/exec_elf.h> to match upstream.

Change-Id: I52f9fce3167541811208d273ff23ceaa112f7135
ys/exec_elf.h
27586ebe1a7f2f45651b855a26b3203d63d015d6 28-Oct-2013 Elliott Hughes <enh@google.com> Fix utime/utimes when passed a NULL pointer.

Bug: 11383777
Change-Id: If944a42f3adfa8a6ce91c167c249e009ed63300a
time.h
11952073af22568bba0b661f7a9d4402c443a888 25-Oct-2013 Elliott Hughes <enh@google.com> Remove dependencies on obsolete __ARCH_WANT_SYSCALL_DEPRECATED system calls.

(aarch64 kernels don't have these system calls.)

Change-Id: I6f64075aa412f71520f2df71c3d69b647f91c1ca
oll.h
ys/epoll.h
93de3d881d8c24eddadf0c5b5dce0754fcca67ae 23-Oct-2013 Elliott Hughes <enh@google.com> Fix header file dependencies.

MIPS' asm/fcntl.h assumes a bunch of __kernel_* types are already declared.

Change-Id: Iff701bbb5ede9667a78230c2de3a8f4fe41371c5
ys/epoll.h
ys/inotify.h
cac7b9d6ec1a09814bc028e2f768db732f018891 23-Oct-2013 Elliott Hughes <enh@google.com> Remove dependencies on obsolete __ARCH_WANT_SYSCALL_NO_FLAGS syscalls.

(aarch64 kernels only have the newer system calls.)

Also expose the new functionality that's exposed by glibc in our header files.

Change-Id: I45d2d168a03f88723d1f7fbf634701006a4843c5
ys/epoll.h
ys/eventfd.h
ys/inotify.h
nistd.h
f8fcfbc85a3ce3e195626b90736d3a484331494b 22-Oct-2013 Elliott Hughes <enh@google.com> Move away from the __ARCH_WANT_SYSCALL_NO_AT system calls.

Modern architectures only get the *at(2) system calls. For example,
aarch64 doesn't have open(2), and expects userspace to use openat(2)
instead.

Change-Id: I87b4ed79790cb8a80844f5544ac1a13fda26c7b5
tdio.h
ys/stat.h
nistd.h
debc021491530ff014166d48232b906d66a62b54 08-Oct-2013 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Fix definitions for STDINT_LIMITS

This patches fixes the definitions for STDINT_LIMITS on __LP64__
systems.

Change-Id: I5eb1664e9ef7c303432a2b041c99cec663816b75
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
tdint.h
594b1a4af204aa9de2b4913182f4556e38d71648 22-Oct-2013 Elliott Hughes <enh@google.com> Make sure we have a mkfifo symbol.

Bug: https://code.google.com/p/android/issues/detail?id=58888
Change-Id: Ic0a883a5f30beb82cb7be3c4e81b6d693d5fbb4d
ys/stat.h
c7fdee72ddfe950594e20a527bfb199866428c17 19-Oct-2013 Elliott Hughes <enh@google.com> Fix struct statfs for LP64.

Change-Id: I9649d881588931a1d672b65ddcf94009daadb0ef
ys/vfs.h
f68fac8c0030e56dfaab60c5a3a7c3c5afca80cc 18-Dec-2012 Pavel Chupin <pavel.v.chupin@intel.com> x86_64: Fix sys/stat.h

Add 64-bit stat structure mapping 64-bit stat syscall.

Change-Id: Ice517616391bee1d556b6c03e7f5ee610050e6c6
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ys/stat.h
43d2137af0e2f65b7febf4414e10b979aa0007bf 14-Oct-2013 Andrei Emeltchenko <andrei.emeltchenko@intel.com> Add SOCK_CLOEXEC and SOCK_NONBLOCK socket flags.

SOCK_CLOEXEC is used to atomically set close-on-exec flag for the new
descriptor(s), and SOCK_NONBLOCK is used to mark descriptor(s) as
non-blocking.

Change-Id: I8ba6a70543d23759e3ddcc7ff9c21b567184d681
ys/socket.h
e989399dc2b17013c9a7f12f1e4765d383e6e771 17-Oct-2013 Elliott Hughes <enh@google.com> O_CLOEXEC is always defined for arm, mips, x86, and x86_64.

I built all four, just to be sure.

Change-Id: I5c818575c8142fccfc8fb163468832807a535e90
cntl.h
c7e9b2331771e5e87c34a8ee3dc6cc41d35b02fe 17-Oct-2013 Elliott Hughes <enh@google.com> Fix sigaction(3) for 64-bit.

Also clean up <signal.h> and revert the hacks that were necessary
for 64-bit in linker/debugger.cpp until now.

Change-Id: I3b0554ca8a49ee1c97cda086ce2c1954ebc11892
ignal.h
b2386fed555d63417af9a4db5c4d9d8f3f22441e 17-Oct-2013 Elliott Hughes <enh@google.com> am 4346bd9f: am bffe261a: Merge "Sort the syscalls.mk files, give all generated files the same header."

* commit '4346bd9fbcfe4144df7ac0e920bdda274d523fc4':
Sort the syscalls.mk files, give all generated files the same header.
6b9321b85875dd8938d0a5064ea3e9fdebe5c623 17-Oct-2013 Elliott Hughes <enh@google.com> am d6e117b6: am 1f29c2f5: Merge "Switch sigpending over to rt_sigpending."

* commit 'd6e117b64bdfbf8d793eb59ea9604b806608ec75':
Switch sigpending over to rt_sigpending.
103ccde8fe2f2c8abde914a8ba736b2e9cb8d20b 16-Oct-2013 Elliott Hughes <enh@google.com> Sort the syscalls.mk files, give all generated files the same header.

No non-comment changes to the .S files.

Change-Id: Iafcfd004c3ea92b64268f80ab16df615b97cefac
ys/glibc-syscalls.h
40d105ccb3e6283566ce54b693b3088f31aa4f26 16-Oct-2013 Elliott Hughes <enh@google.com> Switch sigpending over to rt_sigpending.

Change-Id: I7b28984796b5fb343cfbcc47e0afc3a84293d417
ignal.h
8161b236891de223b0ebe9b76db57147d50a20f5 12-Oct-2013 Stephen Hines <srhines@google.com> am 4691325d: am abeafbd6: Merge "Wrap sprintf()/snprintf() macros to prevent expansion errors."

* commit '4691325d48406033632fe84a944ac9c3bd2e5097':
Wrap sprintf()/snprintf() macros to prevent expansion errors.
6e38072addd556e3894284b5bd040ac64fffa72e 11-Oct-2013 Stephen Hines <srhines@google.com> Wrap sprintf()/snprintf() macros to prevent expansion errors.

Previously, FORTIFY_SOURCE used single macros to define these standard
functions for use with clang. This can cause conflicts with other macros used
to call these functions, particularly when those macros expand the number of
arguments to the function. This change wraps our macro definitions, so that
expansion properly takes place for programmer arguments first.

Change-Id: I55929b1fd2a643b9d14a17631c4bcab3b0b712cf
tdio.h
49bb53c8e20ff37a1965ba4af645464ea4b8f8fa 10-Oct-2013 Nick Kralevich <nnk@google.com> am 95de0df8: am eda2679e: Merge "FORTIFY_SOURCE: fortify read()"

* commit '95de0df8c2daeefca358010f2d15c3346a5284f1':
FORTIFY_SOURCE: fortify read()
b036b5ca36c1e12b075909b3eca6eab73ee611cf 10-Oct-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: fortify read()

Change-Id: Ic7de163fe121db13e00560adb257331bc709814d
nistd.h
b8771d9fd844fd28b6e5e6fe429ef40c097b32a6 10-Oct-2013 Nick Kralevich <nnk@google.com> am b35ebe3d: am 848efa9d: Merge "Revert "FORTIFY_SOURCE: fortify read()""

* commit 'b35ebe3d7097899fd4498ebb2b93e48fd836ebcf':
Revert "FORTIFY_SOURCE: fortify read()"
8d2532763981d132b02df157e4cc363c39330090 10-Oct-2013 Nick Kralevich <nnk@google.com> Revert "FORTIFY_SOURCE: fortify read()"

This change reverts
* fb3f956d075676c0438f2ee2bf3a5be659dfc04b.
* 65c99de2cb7a569ea17ca35e2f8f1e033421864b

Change-Id: Id5774eeede41130579115cf67a72ee914f2b47d5
nistd.h
45e3076cdc03efe7d37178fbd4366d5632d50cba 10-Oct-2013 Nick Kralevich <nnk@google.com> am 731ced6b: am c147478c: Merge "FORTIFY_SOURCE: fortify read()"

* commit '731ced6b289629a552b5841561fdcccf08d8c43a':
FORTIFY_SOURCE: fortify read()
65c99de2cb7a569ea17ca35e2f8f1e033421864b 09-Oct-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: fortify read()

Change-Id: I3d7b4ec86d04efb865117ce7629a2e26917f3331
nistd.h
e769368d76ce86e1d166d551436204a5821d0849 09-Oct-2013 Elliott Hughes <enh@google.com> am c8bd2c2e: am 458076c3: Merge "Fix the ALIGN and ALIGNBYTES macros for LP64."

* commit 'c8bd2c2e45c93b999a40449e4c6f44470f010367':
Fix the ALIGN and ALIGNBYTES macros for LP64.
78df45e1d104be0d9a2c7784df07a4d7843e6c16 09-Oct-2013 Elliott Hughes <enh@google.com> Fix the ALIGN and ALIGNBYTES macros for LP64.

Change-Id: I3a361255afce375ab1cefa449721f0aea4d47919
ys/param.h
9258c7b23edbc761bf4a5cec2f57f83574d6aec6 05-Oct-2013 Elliott Hughes <enh@google.com> am b7d77a9e: am 56777421: Merge "Add arch-x86_64/include/machine."

* commit 'b7d77a9eb1effd5f0472dff14a8fe77d9da2c7a2':
Add arch-x86_64/include/machine.
72645164b6840806d1681f48565bb3b54efc4628 05-Oct-2013 Elliott Hughes <enh@google.com> Add arch-x86_64/include/machine.

This is basically the other half of I5de76f6c46ac87779f207d568a86bb453e2414de
from Pavel Chupin <pavel.v.chupin@intel.com>, but taking the exact upstream
_types.h instead of the modified version. (I was confused when I suggested
otherwise.)

I've also cleaned up the internal_types.h situation; we weren't gaining
anything from these empty files, and there is no upstream internal_types.h
for x86_64.

Change-Id: I802a9a6a8df1c979e820659212c75a47c2ef392e
ys/limits.h
6f103689268a8f6c6177b9c17d72436776a27b22 04-Oct-2013 Nick Kralevich <nnk@google.com> am 2e819c58: am 2ff3c746: Merge "Check memory size on FD_* functions"

* commit '2e819c58c9396eec3e4311ef2c9bdcadd107f001':
Check memory size on FD_* functions
7943df62f70f686b0c77532f6617b47255d75763 03-Oct-2013 Nick Kralevich <nnk@google.com> Check memory size on FD_* functions

Make sure the buffer we're dealing with has enough room.
Might as well check for memory issues while we're here,
even though I don't imagine they'll happen in practice.

Change-Id: I0ae1f0f06aca9ceb91e58c70183bb14e275b92b5
ys/select.h
5634373320d7dac30fa68feeb4d3b883566461ac 03-Oct-2013 Nick Kralevich <nnk@google.com> am 8598cd68: am f741e1c2: Merge "FORTIFY_SOURCE: Add __FD_* checks"

* commit '8598cd6888366008033286113bd633b44c70b7dd':
FORTIFY_SOURCE: Add __FD_* checks
90201d5eca050414d50a433866ccb580415bb0d4 03-Oct-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: Add __FD_* checks

Add FORTIFY_SOURCE checks for the following macros:

* FD_CLR
* FD_ISSET
* FD_SET

Bug: 11047121
Change-Id: I3c5952136aec9eff3288b91b1318677ff971525c
ys/select.h
944ce989f8d9c4fa1c8211ac5aa46693346e1fe0 02-Oct-2013 Nick Kralevich <nnk@google.com> am f7da611b: am 00d51c9f: Merge "Use alloc_size attribute on *alloc functions"

* commit 'f7da611b3dedaf9951e08b0296daf67eda8228c0':
Use alloc_size attribute on *alloc functions
b91791d71c58d14309cd4d842d222f5d36b3a5a8 02-Oct-2013 Nick Kralevich <nnk@google.com> Use alloc_size attribute on *alloc functions

malloc and family were not declared with __attribute__((alloc_size)).
This was (sometimes) preventing FORTIFY_SOURCE related functions
from knowing the size of the buffer it's dealing with, inhibiting
FORTIFY_SOURCE protections.

Add __attribute__((alloc_size))

Information about the alloc_size attribute can be found
at http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Change-Id: Ia2f0a445f0170a7325f69259b5e7fb35a9f14921
alloc.h
a0a5a5015210585abc426a79e51b8cb70e28569d 02-Oct-2013 Elliott Hughes <enh@google.com> am 2e2a4f97: am 4bbf3a8b: Merge "Remove #define _BITSIZE 32."

* commit '2e2a4f97bfbb7b94d12690395c5cbcf7d7d1edc7':
Remove #define _BITSIZE 32.
5e72c513bf034bb4f657380aec567e3ebce447a2 02-Oct-2013 Elliott Hughes <enh@google.com> Remove #define _BITSIZE 32.

I've no idea what _BITSIZE was supposed to be, glibc doesn't have it,
the BSDs don't have it, and no code is currently using it. But having
it set unconditionally to 32 sounds like a bad idea.

Change-Id: I900235c1489afba891fff0bc3b43e9d593249a4f
tdint.h
35336777f1115ead63559d2ce91cc9c9481cb0c8 01-Oct-2013 Elliott Hughes <enh@google.com> am 67e0214d: am 232dff3a: Merge "Regenerate the system call stubs (to get x86_64)."

* commit '67e0214d0f620df7a7928ef0fa1a9c0aac326a20':
Regenerate the system call stubs (to get x86_64).
e4ffd9f2341f42c9281b4a93df76768580535edd 01-Oct-2013 Elliott Hughes <enh@google.com> Regenerate the system call stubs (to get x86_64).

This touches the x86 stubs too because arm, x86, and x86_64 now
all share the same header (at a source level), which causes a
reordering of the #include lines.

Change-Id: If9a1e2b2718bd41d8399fea748bce672c513ef84
ys/glibc-syscalls.h
d4e6961041942c6c01e6205db7d81368b39a4d1e 01-Oct-2013 Elliott Hughes <enh@google.com> am 1a46de67: am f281fd02: Merge "Better statfs/fstatfs glibc compatibility."

* commit '1a46de67b3f78ce44ddf622bcf5918fe758dd4d4':
Better statfs/fstatfs glibc compatibility.
58413fe73561e8f230092a2b83db64e58fcb061d 01-Oct-2013 Elliott Hughes <enh@google.com> am 4b5a0e1a: am 693bd73f: Merge "Remove 32-bit assumptions from the ELF code."

* commit '4b5a0e1ad76d76d6a8793f61e3c0902ea4628ce7':
Remove 32-bit assumptions from the ELF code.
f281fd02e9eebea3de9c07412c5b66647ca0c290 01-Oct-2013 Elliott Hughes <enh@google.com> Merge "Better statfs/fstatfs glibc compatibility."
01a700e5d2ee9b5bd61546faffcb453fd1d6325c 01-Oct-2013 Elliott Hughes <enh@google.com> Better statfs/fstatfs glibc compatibility.

Change-Id: I069d169c96cd71b75a045ec911fb4bd484c6b2c9
ys/vfs.h
5d641bcf70d36caa22ff2c7d3e3f252abf541bed 01-Oct-2013 Elliott Hughes <enh@google.com> am f5dcdfc4: am 6dee3b9a: Merge "Add x86_64 to the bionic headers."

* commit 'f5dcdfc438684bbe93e398b6551f915fe3fe10bf':
Add x86_64 to the bionic headers.
c620059479c47a78d57086d73726c9adc2f337ad 01-Oct-2013 Elliott Hughes <enh@google.com> Remove 32-bit assumptions from the ELF code.

Change-Id: I2c1f3d34c33685799aade8866eec44479ff9f963
lf.h
ink.h
d3e64a3f403918abf2cc3f9f0f9a2204a420ec96 01-Oct-2013 Elliott Hughes <enh@google.com> Add x86_64 to the bionic headers.

Manual changes:

cpp.py: cope with macros that refer to other macros.

defaults.py: x86 no longer always implies __i386__; use __i386__ to replace
the kernel CONFIG_X86_32 flag.

asm/page.h: the upstream page.h isn't a uapi header and no longer includes
the stuff we were using it for. Let's just have our own static file, since
it's the same for all our architectures (both 32- and 64-bit).

sys/select.h: we used to use the various FD_SET-related macros from the
kernel header files, but they've gone. Adjust by adding trivial equivalent
definitions.

Automated changes:

libc/kernel/arch-x86, libc/kernel/common: regenerated from
external/kernel-headers.

Change-Id: I84fc0ed52dc742e043b4ae300fd3b58ee99b7fcd
sm/page.h
ys/select.h
b27750909579926ad8154218b53f4d1765db7d28 01-Oct-2013 Elliott Hughes <enh@google.com> am 34284954: am 76218efb: Merge "Fix inttypes.h and stdint.h for 64-bit (and C++11)."

* commit '34284954b3b43010d87c6f99a50dc673a55fbb04':
Fix inttypes.h and stdint.h for 64-bit (and C++11).
a9a02acc9f5d7b13c742172fe1763840eecd8578 30-Sep-2013 Elliott Hughes <enh@google.com> Fix inttypes.h and stdint.h for 64-bit (and C++11).

Change-Id: I394630348413c9aafcac137ce1ca5f0a93d9ab6f
nttypes.h
tdint.h
cadc6aaf41e29ffcca0e4b801ffa294e6cea968e 28-Sep-2013 Nick Kralevich <nnk@google.com> am f56e0e4b: am 6aed6077: Merge "Fix unnecessary call to __strncpy_chk2"

* commit 'f56e0e4b5e97f4e7fed6e06dde30053ea687716e':
Fix unnecessary call to __strncpy_chk2
d13c2b1ba6681fdbee73a044d988c3f9e1172d30 27-Sep-2013 Nick Kralevich <nnk@google.com> Fix unnecessary call to __strncpy_chk2

If "n" is smaller than the size of "src", then we'll
never read off the end of src. It makes no sense to call
__strncpy_chk2 in those circumstances.

For example, consider the following code:

int main() {
char src[10];
char dst[5];
memcpy(src, "0123456789", sizeof(src));
strncpy(dst, src, sizeof(dst));
dst[4] = '\0';
printf("%s\n", dst);
return 0;
}

In this code, it's clear that the strncpy will never read off
the end of src.

Change-Id: I9cf58857a0c5216b4576d21d3c1625e2913ccc03
tring.h
9a622f874ceb90431623af140ca9a78eadc96dcb 27-Sep-2013 Nick Kralevich <nnk@google.com> am cc362291: am 8427b745: Merge "libc: fortify recvfrom()"

* commit 'cc362291362f8183431eccb19267c8a625f36006':
libc: fortify recvfrom()
60f4f9a5b99a0a66817f50edfc2194a49f8b5146 25-Sep-2013 Nick Kralevich <nnk@google.com> libc: fortify recvfrom()

Fortify calls to recv() and recvfrom().

We use __bos0 to match glibc's behavior, and because I haven't
tested using __bos.

Change-Id: Iad6ae96551a89af17a9c347b80cdefcf2020c505
ys/socket.h
e74f77f92d80f11616da699ac908fd5d1913e996 20-Sep-2013 Elliott Hughes <enh@google.com> am 48a909c9: am aad3c52e: Merge "Ensure we have the off64_t variant of every function that takes an off_t."

* commit '48a909c9fd6dbe9be5655ad172d1083fa69c4107':
Ensure we have the off64_t variant of every function that takes an off_t.
b4f7616fd618875768b8fffc122b58bdb84a9969 20-Sep-2013 Elliott Hughes <enh@google.com> Ensure we have the off64_t variant of every function that takes an off_t.

Change-Id: Ib2eee0cf13162be3b62559b84e90c6dcf5aab1c3
ys/sendfile.h
ys/types.h
nistd.h
a5a508a9b6c51259950bab3e628355632ad17fee 19-Sep-2013 Elliott Hughes <enh@google.com> am 35cfcc11: am f8e71bac: Merge "Add mmap64()"

* commit '35cfcc11fa923c75ead9356c71466ecabfafcc42':
Add mmap64()
afcc0cccdafef0c67600cbbc72cee0e7a41f3f04 18-Sep-2013 Daniel Leung <daniel.leung@intel.com> Add mmap64()

This adds mmap64() to bionic so that it is possible to have
large offset passed to kernel. However, the syscall mechanism
only passes 32-bit number to kernel. So effectively, the
largest offset that can be passed is about 43 bits (since
offset is signed, and the number passed to kernel is number
of pages (page size == 4K => 12 bits)).

Change-Id: Ib54f4e9b54acb6ef8b0324f3b89c9bc810b07281
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
ys/mman.h
44fd0d92d6e65d0d003103d402240d28d26ae639 19-Sep-2013 Elliott Hughes <enh@google.com> am 94c325fb: am 269851bf: Merge "Declare __page_shift and __page_size with C linkage."

* commit '94c325fb3bd8844dcc58640afb8f33668b684bc1':
Declare __page_shift and __page_size with C linkage.
9ae59c02ca68da5bb45152c85c4cab6fd6f7aba2 18-Sep-2013 Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> Declare __page_shift and __page_size with C linkage.

__page_shift and __page_size were accidentally declared in unistd.h with
C linkage - their implementation needs to use the same linkage.

Going forward, though, let's stop the inlining madness and let's kill
the non-standard __getpageshift(). This patch takes getpagesize(3) out
of line and removes __getpageshift but fixes __page_shift and __page_size
for backwards binary compatibility.

Change-Id: I35ed66a08989ced1db422eb03e4d154a5d6b5bda
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
nistd.h
5cb04369309856f2d2960fe3fbd517ce4e403605 06-Sep-2013 Christopher Ferris <cferris@google.com> am 1a88ca08: am 98c726ec: Merge "Add the dl_iterate_phdr function to libdl for arm."

* commit '1a88ca08046ea510bfc8d3de6875537f124b3ce3':
Add the dl_iterate_phdr function to libdl for arm.
24053a461e7a20f34002262c1bb122023134989d 20-Aug-2013 Christopher Ferris <cferris@google.com> Add the dl_iterate_phdr function to libdl for arm.

Bug: 8410085

Merge from internal master.

(cherry-picked from cb491bc66dc0abc145930b09086eb9189a30f6c2)

Change-Id: I94ed51bc5d4c626df7552c0e85c31ccee2d6568f
ink.h
eb31e1c558766315201907171ebd72ca4eaaeb7c 03-Sep-2013 Elliott Hughes <enh@google.com> am 1e96d49a: am afa31042: Merge "Fix strchr for basic non-sse case on x86"

* commit '1e96d49a7d4d1af8f3bd6630e4ec9369813f18e7':
Fix strchr for basic non-sse case on x86
3c4b50fd8cce143d9ba8f03a93f0fccba4e54d14 26-Jul-2013 Pavel Chupin <pavel.v.chupin@intel.com> Fix strchr for basic non-sse case on x86

Fix source location. Move declaration of __strchr_chk out of
ifdef __BIONIC_FORTIFY which should be available for strchr.cpp
compilation when __BIONIC_FORTIFY is not defined.

Change-Id: I552a6e16656e59b276b322886cfbf57bbfb2e6a7
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
tring.h
4d0fbf9b0742e6c98af708641c2cb4318082bce7 28-Aug-2013 Nick Kralevich <nnk@google.com> am 89dcc10c: am 4e3ed44d: Merge "cdefs.h: introduce __bos0"

* commit '89dcc10c320c032faef83c4940a57949ade01dba':
cdefs.h: introduce __bos0
bd8e6749b78567af62ec126d7cc057386ebee25a 28-Aug-2013 Nick Kralevich <nnk@google.com> cdefs.h: introduce __bos0

Introduce __bos0 as a #define for __builtin_object_size((s), 0).
This macro is intended to be used for places where the standard
__bos macro isn't appropriate.

memcpy, memmove, and memset deliberately use __bos0. This is done
for two reasons:

1) I haven't yet tested to see if __bos is safe to use.
2) glibc uses __bos0 for these methods.

Change-Id: Ifbe02efdb10a72fe3529dbcc47ff647bde6feeca
tring.h
ys/cdefs.h
2c87c3ff021571e82684a865609a1146830338fb 28-Aug-2013 Nick Kralevich <nnk@google.com> am cfd0d72d: am eb8f3622: Merge "FORTIFY_SOURCE: introduce __strncpy_chk2"

* commit 'cfd0d72da8641087f9c4015ee586614da9f7320a':
FORTIFY_SOURCE: introduce __strncpy_chk2
93501d3ab81156bcef251bb817a49e9ca46a6ec1 28-Aug-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: introduce __strncpy_chk2

This change detects programs reading beyond the end of "src" when
calling strncpy.

Change-Id: Ie1b42de923385d62552b22c27b2d4713ab77ee03
tring.h
34cd499875a266f6d2a58dcc85c8b7bb15525428 13-Aug-2013 Elliott Hughes <enh@google.com> am fd61eccf: am ff9b7aa6: Merge "Make ctype.h a little less unhygienic."

* commit 'fd61eccf6b909ee6374ad43164f0e9bcd4b3547c':
Make ctype.h a little less unhygienic.
5e9b20f7212c23110693a4bd1f122ccac3fece80 13-Aug-2013 Elliott Hughes <enh@google.com> Make ctype.h a little less unhygienic.

This caused trouble for stlport.

Change-Id: Id40787c5a2b7a3a4e12fb557efe549778a01cbbd
type.h
c1772397f96e82e142dd082da4747824e7c8a839 12-Aug-2013 Elliott Hughes <enh@google.com> am ff8dcd4a: am c933493a: Merge "Fix our missing abs/labs/llabs/imaxabs (and imaxdiv) symbols."

* commit 'ff8dcd4a1056257b454da71e1ea1371bb73d3a79':
Fix our missing abs/labs/llabs/imaxabs (and imaxdiv) symbols.
aec2ffbc5a7b45368ceab3663265fbb659968fe7 12-Aug-2013 Elliott Hughes <enh@google.com> Fix our missing abs/labs/llabs/imaxabs (and imaxdiv) symbols.

Change-Id: I94c411c22634e43184445c82e7388e51fc46a8cc
nttypes.h
tdlib.h
840a114eb12773c5af39c0c97675b27aa6dee78c 09-Aug-2013 Elliott Hughes <enh@google.com> Add futimens.

(cherry picked from commit d0be7c8f9a06b3ca8ea7647ea35c8f9dc63f0fe1)

Bug: 10239370
Change-Id: I0087e85a94d83b6ce68ec6a0768c44cbe4bd0132
ys/stat.h
d0be7c8f9a06b3ca8ea7647ea35c8f9dc63f0fe1 09-Aug-2013 Elliott Hughes <enh@google.com> Add futimens.

Bug: 10239370
Change-Id: I518340084103dc339ef8a065d4837d6258a1381d
ys/stat.h
e66ffef900f2193d6918d9b2c08ce5f815e153a1 06-Aug-2013 Elliott Hughes <enh@google.com> am cd927519: Merge "Fix stdint.h intptr_t/uintptr_t for x86_64/x32"

* commit 'cd927519a94939f2ebc307544f827baade529bc9':
Fix stdint.h intptr_t/uintptr_t for x86_64/x32
28e0ec8d619770265619250e502e17fb541e1044 06-Aug-2013 Elliott Hughes <enh@google.com> am a0473d77: Merge "syslog needs a valid socket path for _PATH_LOG"

* commit 'a0473d77b2d3a6f26e29cc8c2fdaeb2a4b3ab8f8':
syslog needs a valid socket path for _PATH_LOG
cd927519a94939f2ebc307544f827baade529bc9 05-Aug-2013 Elliott Hughes <enh@google.com> Merge "Fix stdint.h intptr_t/uintptr_t for x86_64/x32"
a0473d77b2d3a6f26e29cc8c2fdaeb2a4b3ab8f8 05-Aug-2013 Elliott Hughes <enh@google.com> Merge "syslog needs a valid socket path for _PATH_LOG"
0a9c615a899daa37b671711acc2c9be0a245919f 18-Dec-2012 Pavel Chupin <pavel.v.chupin@intel.com> Fix stdint.h intptr_t/uintptr_t for x86_64/x32

Patch is required in NDK headers as well to be able to build multilib
GCC with libgomp support.
It's here: https://android-review.googlesource.com/#/c/62982

Change-Id: I2bec25d8cbca0e5ef1a0857008ececd92f4911be
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
tdint.h
abf3638317b4568c7e0c4d6d8c4b70a8e4af6449 30-Jul-2013 Elliott Hughes <enh@google.com> am 101b5e1f: Merge "Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way."

* commit '101b5e1f6cc4e24635760928b3d2c1e51c1e5774':
Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way.
c03e1e74390c1b8a30341399cd85cc869d0842b0 30-Jul-2013 Elliott Hughes <enh@google.com> Define PTHREAD_KEYS_MAX and _POSIX_THREAD_KEYS_MAX in a POSIX-compliant way.

Also make sysconf use PTHREAD_STACK_MIN rather than redefining its
own, different, constant.

Bug: 9997352
Change-Id: I9a8e7d2b18e691439abfb45533e82c36eee9e81d
ys/limits.h
47c7e33ccb9eaadaadc84e7d7e910aba1c07f089 12-Jul-2013 Elliott Hughes <enh@google.com> am ff20b911: am 8a363692: Merge "Add TCP_INFO state enum values."

* commit 'ff20b9110659e67433ce641a6224cdc9ccc01301':
Add TCP_INFO state enum values.
4fa5d6a5dbf5bb064443e73269d2bc8b7670a253 12-Jul-2013 Nick Kralevich <nnk@google.com> am ef49e99d: am d30877ae: Merge "syslog.h: add __printflike to syslog functions"

* commit 'ef49e99d92597a4e9fddbba0e1e3feddc06fee53':
syslog.h: add __printflike to syslog functions
ff20b9110659e67433ce641a6224cdc9ccc01301 12-Jul-2013 Elliott Hughes <enh@google.com> am 8a363692: Merge "Add TCP_INFO state enum values."

* commit '8a363692be45ed1b36e1f1f21707b6f35f5519c8':
Add TCP_INFO state enum values.
ef49e99d92597a4e9fddbba0e1e3feddc06fee53 12-Jul-2013 Nick Kralevich <nnk@google.com> am d30877ae: Merge "syslog.h: add __printflike to syslog functions"

* commit 'd30877ae28f3c308edf142c091b3a8acc4467c6d':
syslog.h: add __printflike to syslog functions
0dff43cab41e4a0bd5bd018584952c68cb224977 12-Jul-2013 Elliott Hughes <enh@google.com> Add TCP_INFO state enum values.

Bug: https://code.google.com/p/android/issues/detail?id=38881
Change-Id: Ie22816c666474e6441e0ec3afd2a6eb04d64a673
etinet/tcp.h
bb17967761f371fa20cc4a6be1a14356ea9bc335 12-Jul-2013 Geremy Condra <gcondra@google.com> Merge "Add marking of DNS sockets for mark based routing"
6b1dd1797e11217fad1f9fb3783678f8a180a3f0 10-Jul-2013 Nick Kralevich <nnk@google.com> syslog.h: add __printflike to syslog functions

Allow the compiler to detect formating bugs.

Change-Id: I6a4af6cae59dc3adf14b075431a41885213a649a
yslog.h
731f7c2d0e531d5e0ecdd771d743053f8d093e16 09-Jul-2013 Elliott Hughes <enh@google.com> am 9d476716: Merge "Add <sys/statvfs.h>."

* commit '9d476716c2bd7bc5a018a71e121257c35e965058':
Add <sys/statvfs.h>.
06040fd75c1edff9e5ffb2b3d3e2a6e66d57c11d 09-Jul-2013 Elliott Hughes <enh@google.com> Add <sys/statvfs.h>.

Bug: 2512019
Change-Id: I6e7fd3fa281977cc4bc270481a95416b5b2dc351
ys/cdefs.h
ys/signalfd.h
ys/statvfs.h
ys/swap.h
ys/vfs.h
c39214e0ac49b9f7de6fd9989331145c6e1cd584 20-Jun-2013 Chad Brubaker <cbrubaker@google.com> Add marking of DNS sockets for mark based routing

Adds an extra mark parameter to android_getaddrinfoforiface,
android_gethostbyaddrforiface and android_gethostbynameforiface that if set
will cause all packets sent by DNS requests to have that mark

Change-Id: I6f72390e4ce5bfc3cc73183f9b2fb3705a11685f
etdb.h
f3f72e7f277215e9fede7c6f6695654cf7aa0c63 09-Jul-2013 Elliott Hughes <enh@google.com> am 4fc8a0c1: Merge "Remove <netinet/icmp6.h> ni_* macros."

* commit '4fc8a0c1165537b693c900ac3e2c61470bd7e484':
Remove <netinet/icmp6.h> ni_* macros.
c2cd33efc4b53495db90ecd2cb9fee698b827aa8 09-Jul-2013 Elliott Hughes <enh@google.com> Remove <netinet/icmp6.h> ni_* macros.

glibc doesn't have these, and they prevent ping from building out of
the box because it assumes it can define them.

Bug: 9671560
Change-Id: I815f2a9c4fd96a0ea2952eb5a71ddf51e0763660
etinet/icmp6.h
233050b15ec3ce0db534ec6cc24a6061559993d2 08-Jul-2013 Elliott Hughes <enh@google.com> am e31c45c9: Merge "Make bionic\'s <netinet/icmp6.h> standalone, like glibc\'s."

* commit 'e31c45c9fa5e0d2853941282e619b753550b82ae':
Make bionic's <netinet/icmp6.h> standalone, like glibc's.
3a040d8379a3b1f9731ae93e1a7118c589f1936e 08-Jul-2013 Elliott Hughes <enh@google.com> Make bionic's <netinet/icmp6.h> standalone, like glibc's.

This removes the need for a bionic-specific hack in external/iproute2.

Bug: 9671560
Change-Id: I9f15be0711d26bca863bd66be9a39606500fb948
etinet/icmp6.h
62bdd03120286708d8c1562eadf5dda00e24911c 08-Jul-2013 Elliott Hughes <enh@google.com> am 6b33f31b: Merge "Fix IPv6 filtering definitions in netinet/icmp6.h."

* commit '6b33f31b0994b8132bed8936685522e2e01754d8':
Fix IPv6 filtering definitions in netinet/icmp6.h.
bfc6a59556fc83875f7f3bd6dc5bb139a94df432 03-Jul-2013 Lorenzo Colitti <lorenzo@google.com> Fix IPv6 filtering definitions in netinet/icmp6.h.

Linux and *BSD kernels use opposite values to indicate pass/block
in ICMPv6 filters, and assign a different value to the
ICMP6_FILTER sockopt.

Bug: 9671560
Bug: 9469682
Change-Id: Ic0f1fcd48891add992acf97632f60aebd172c1d7
etinet/icmp6.h
24400ac1e390615ebcb45deacc1c9213b00f75ff 08-Jul-2013 Elliott Hughes <enh@google.com> am e63ea6ac: Merge "Clean up <sys/mount.h>/<linux/fs.h> duplication."

* commit 'e63ea6aca7d01ba9219b877ed5fab6de5c6037fb':
Clean up <sys/mount.h>/<linux/fs.h> duplication.
e42e51d5637b86f45dd852b70342013d50006220 03-Jul-2013 Elliott Hughes <enh@google.com> Clean up <sys/mount.h>/<linux/fs.h> duplication.

Roll on uapi...

Bug: 6340120
Change-Id: Ic9521905683946e836574e4d768e34853ea777fa
ys/mount.h
a8b954c51edd9ec8c09a5d1dccacaadf5869d78a 03-Jul-2013 Elliott Hughes <enh@google.com> am de2781d9: Merge changes I01345c23,I3b57517c

* commit 'de2781d906f27be4df3e03a8e5041dcc1aeb281d':
Include linux/termios.h from sys/ioctl.h.
Update linux/types.h to linux 2.6.20.
f936ef1a9f1f77985ca1fae35c1b0dc78e1510c0 03-Jul-2013 Lorenzo Colitti <lorenzo@google.com> Include linux/termios.h from sys/ioctl.h.

On NetBSD and glibc, including sys/ioctl.h provides some
terminal ioctl data structures such as struct winsize. For
compatibility, provide these via sys/ioctl.h in bionic as well.
bionic does not have its own definitions for these structures, so
get them from the Linux kernel definitions.

Change-Id: I01345c23c0bebd60b0a80fc33668e7c0ad7356c3
ys/ioctl.h
833dc584d4d02ab8e396b877b38a8a5ad8ba4882 03-Jul-2013 Elliott Hughes <enh@google.com> am 87b4286f: Merge "Expose dn_comp and dn_expand to system C code."

* commit '87b4286f092094a2e8069a06e20ef5036a258172':
Expose dn_comp and dn_expand to system C code.
b8e435c1d5593422349534c1cb356d11273ba1db 02-Jul-2013 Lorenzo Colitti <lorenzo@google.com> Expose dn_comp and dn_expand to system C code.

This is needed to compile open-source code that wants to
expand/compress domain names itself, such as ping6.

Bug: 9469682
Change-Id: I339c6538936d05c031bc6fb0a8793aaf1429dea4
esolv.h
7c808b29d5cea61e5bda90a1b0f2f0e669ee135e 03-Jul-2013 Elliott Hughes <enh@google.com> am feec97a7: Merge "Fix inttypes.h PRI?PTR and SCN?PTR macros."

* commit 'feec97a7c7fbd032174fb4870a02422c2acd891a':
Fix inttypes.h PRI?PTR and SCN?PTR macros.
74f0833df6d04d51eb4e554845862ed7279f78b0 03-Jul-2013 Elliott Hughes <enh@google.com> Fix inttypes.h PRI?PTR and SCN?PTR macros.

Our intptr_t and uintptr_t aren't "long". Add a compilation test so we remember
to fix this to cope with 32- and 64-bit later.

Bug: http://code.google.com/p/android/issues/detail?id=57218
Change-Id: I2f816d339edb4f7d57e4418b818fb4c602093f38
nttypes.h
dcd237a89707357ead904a2476bb2210e251c173 02-Jul-2013 Elliott Hughes <enh@google.com> am 1ba3a2c2: Merge "Update icmp6.h to current NetBSD."

* commit '1ba3a2c26937c68a4a0bd4fdffe95f5162077997':
Update icmp6.h to current NetBSD.
ce7c404dc7d1d6a3cab9105fdb2a7e2610b43bfc 01-Jul-2013 Lorenzo Colitti <lorenzo@google.com> Update icmp6.h to current NetBSD.

This adds a few bits we need such as RFC 6106 support and the
definition of MLD_LISTENER_REDUCTION.

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/netinet/icmp6.h?rev=1.47

Bug: 9469682
Change-Id: I97a4c2f0893012ce315334367c055097d0f8bb10
etinet/icmp6.h
28d298a673da4367f27f428db5e12d7dad3d8e83 01-Jul-2013 Nick Kralevich <nnk@google.com> am 413eef71: Merge "More FORTIFY_SOURCE functions under clang"

* commit '413eef716f822d5eb4f57618f6780c6af5036460':
More FORTIFY_SOURCE functions under clang
a6cde392765eb955cb4be5faa6ee62dcf77e8aa5 29-Jun-2013 Nick Kralevich <nnk@google.com> More FORTIFY_SOURCE functions under clang

* bzero
* umask
* strlcat

Change-Id: I65065208e0b8b37e10f6a266d5305de8fa9e59fc
tring.h
trings.h
ys/stat.h
f9ef0106da43d21e6cb68d87b86d806f63b215fd 27-Jun-2013 Nick Kralevich <nnk@google.com> am 78a7bf99: Merge "stdio.h: enable vs?printf clang FORTIFY_SOURCE"

* commit '78a7bf998d2d29592504984fcf419cd2701c6c54':
stdio.h: enable vs?printf clang FORTIFY_SOURCE
c8ae8bd9418b79f4da85dc12a61ebd82146b7e51 27-Jun-2013 Nick Kralevich <nnk@google.com> stdio.h: enable vs?printf clang FORTIFY_SOURCE

Enable FORTIFY_SOURCE protections under clang for the following
functions:

* vsprintf
* vsnprintf

and add unittests.

Change-Id: I90f8a27f7b202c78b5dd8ebf53050bf9e33496f7
tdio.h
146d79c22a70d772defc63acfa6ac6128102a15f 26-Jun-2013 Colin Cross <ccross@android.com> am fbec57d4: Merge changes Ib496e818,I074204e9

* commit 'fbec57d46c42460b2381484d1610ff21922d162e':
bionic: add compatibility mode for properties
bionic: use the size of the file to determine property area size
5e9a086145764d64c0f7fbce5489d820aa7fdcd4 25-Jun-2013 Colin Cross <ccross@android.com> bionic: add compatibility mode for properties

Allow a new bionic to work with an old init property area by supporting
the old format.

(cherry picked from commit ad76c85b9ca587084089d086f954158bc0eae905)

Change-Id: Ib496e818a62a5834d40c71eb4745783d998be893
ys/_system_properties.h
db6dd600d23eafb1742e5114bae7a4b8be4c04e1 26-Jun-2013 Elliott Hughes <enh@google.com> am b116bf76: Merge "Switch to current upstream getopt_long."

* commit 'b116bf76286178a7d552c4d0a72b79212c8c93d1':
Switch to current upstream getopt_long.
b116bf76286178a7d552c4d0a72b79212c8c93d1 26-Jun-2013 Elliott Hughes <enh@google.com> Merge "Switch to current upstream getopt_long."
baa61864c515a56d4dbeac46b149b4317b01797b 26-Jun-2013 Rom Lemarchand <romlem@google.com> am 995f17e6: Merge "libc: add swapon and swapoff syscalls"

* commit '995f17e6a9a9903f03f542192da9a83b1cabc684':
libc: add swapon and swapoff syscalls
d278b828fef47fb2d7098f8ec70867fbd3da09d6 25-Jun-2013 Elliott Hughes <enh@google.com> Switch to current upstream getopt_long.

Change-Id: I4c646dcb8be9e88dd54d069a03bbc5fbfd92de03
etopt.h
d206b560e72e791b5dfeb339b5f7c18354bf95fd 06-Jun-2013 Rom Lemarchand <romlem@google.com> libc: add swapon and swapoff syscalls

Change-Id: Ie79dc8e3f2ff1cd427dd6d95e3850920c4b407b0
Signed-off-by: Rom Lemarchand <romlem@google.com>
ys/swap.h
7180213557f3120b391053b4f5861037eda6ebb6 25-Jun-2013 Nick Kralevich <nnk@google.com> am bfacb603: Merge "libc: enable FORTIFY_SOURCE snprintf under clang"

* commit 'bfacb603e417c1e2c25ce8482b5c6e31b4db8c9b':
libc: enable FORTIFY_SOURCE snprintf under clang
621b19dddbfba1cd98c01cb95ce312baa20e0e7c 25-Jun-2013 Nick Kralevich <nnk@google.com> libc: enable FORTIFY_SOURCE snprintf under clang

Change-Id: I8b8059782a720104722b0841994b38f873ed02aa
tdio.h
a99e29e61090da9c21c17cae54211083a2268d6e 25-Jun-2013 Colin Cross <ccross@android.com> am 1642edb5: Merge changes Ib074192d,I6df3afed,I69070455,Icbe31908,Id3fa4526,I038d451f

* commit '1642edb5208fe02ef64d5734fffaf7c4a724fd2f':
bionic: store property names as variable-length strings
bionic: prevent root processes from calling __system_property_add
bionic: revert to a single (larger) property area
bionic: reimplement property area as hybrid trie/binary tree
bionic: add missing memory barriers to system properties
bionic: make property area expandable
1540f601be32bdd4af8e8c13bdf2bc06bdaa76f1 19-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: revert to a single (larger) property area

d329697 is too complicated. Change the multiple property pages back to
a single 128K property area that's mapped in entirely at initialization
(the memory will not get allocated until the pages are touched).

d329697 has other changes useful for testing (moving property area
initialization inside bionic and adding __system_property_set_filename)
so undo the change manually rather than with git revert.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 5f05348c18286a2cea46eae8acf94ed5b7932fac)

Change-Id: I690704552afc07a4dd410277893ca9c40bc13e5f
ys/_system_properties.h
996cdc4b1a7fcae89650bee0a44b6cb7900a4a3c 20-Jun-2013 Greg Hackmann <ghackmann@google.com> bionic: reimplement property area as hybrid trie/binary tree

See the comments for an explanation of how properties are stored.

The trie structure is designed to scale better than the previous
array-based implementation. Searching an array with n properties
required average O(n) string compares of the entire key; searching the
trie requires average O(log n) string compares of each token (substrings
between '.' characters).

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 6ac8e6a46d71a51bec16938efa89f275fa89cf7d)

Change-Id: Icbe31908572f33b4d9b85d5b62ac837cbd0f85e0
ys/_system_properties.h
cb215a7e9ecec9feb5aae9d9a5b1c89f392208e7 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: make property area expandable

The property area is initially one 4K region, automatically expanding as
needed up to 64 regions.

To avoid duplicating code, __system_property_area_init() now allocates
and initializes the first region (previously it was allocated in init's
init_property_area() and initialized in bionic). For testing purposes,
__system_property_set_filename() may be used to override the file used
to map in regions.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit d32969701be070c0161c2643ee3c3df16066bbb8)

Change-Id: I038d451fe8849b0c4863663eec6f57f6521bf4a7
ys/_system_properties.h
954480393f4539f62cdc3f6cb83c562050ea4f51 25-Jun-2013 Nick Kralevich <nnk@google.com> am 0ea1d5c0: Merge "libc: enable sprintf FORTIFY_SOURCE under clang"

* commit '0ea1d5c0ae94ee581c72451b20813c028f51090c':
libc: enable sprintf FORTIFY_SOURCE under clang
c6eb9854542c115fd9aa87731adcb1b5da57e8ac 24-Jun-2013 Nick Kralevich <nnk@google.com> libc: enable sprintf FORTIFY_SOURCE under clang

clang doesn't support __builtin_va_arg_pack(), so we have
to use #define instead.

Change-Id: I2ee75e6267d60cdf997fee6b9b0547bf68f062a1
tdio.h
33ae76abf32b8f78799e9ebb1de2343dfa10c91a 20-Jun-2013 Nick Kralevich <nnk@google.com> am 5fed0eea: am 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"

* commit '5fed0eeabd88bfe241c416f2c2f44a14b6e447fa':
libc: enable FORTIFY_SOURCE clang strlcpy
5fed0eeabd88bfe241c416f2c2f44a14b6e447fa 20-Jun-2013 Nick Kralevich <nnk@google.com> am 0ce28d20: Merge "libc: enable FORTIFY_SOURCE clang strlcpy"

* commit '0ce28d20ea5fde250576f355004dbcd741b0b884':
libc: enable FORTIFY_SOURCE clang strlcpy
8bafa7452ec0892572b0b49f86022ce945c5e908 20-Jun-2013 Nick Kralevich <nnk@google.com> libc: enable FORTIFY_SOURCE clang strlcpy

Change-Id: Idcfe08f5afc3dde592416df9eba83f64e130c7c2
tring.h
cb4fd62762c23ba3b8d02a6f5329d2fd62b57db8 19-Jun-2013 Elliott Hughes <enh@google.com> am 33df38a0: am 4eed6509: Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"

* commit '33df38a04c31de0fca431c549469edb6d2de75e2':
stdint.h header is not fully compatible with C99(ISO9899:1999)
33df38a04c31de0fca431c549469edb6d2de75e2 19-Jun-2013 Elliott Hughes <enh@google.com> am 4eed6509: Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"

* commit '4eed65090b1f0d0d087f26bd7367da90a0cca92d':
stdint.h header is not fully compatible with C99(ISO9899:1999)
4eed65090b1f0d0d087f26bd7367da90a0cca92d 19-Jun-2013 Elliott Hughes <enh@google.com> Merge "stdint.h header is not fully compatible with C99(ISO9899:1999)"
d32969701be070c0161c2643ee3c3df16066bbb8 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: make property area expandable

The property area is initially one 4K region, automatically expanding as
needed up to 64 regions.

To avoid duplicating code, __system_property_area_init() now allocates
and initializes the first region (previously it was allocated in init's
init_property_area() and initialized in bionic). For testing purposes,
__system_property_set_filename() may be used to override the file used
to map in regions.

Change-Id: Ibe00ef52464bfa590953c4699a6d98383b0142b1
Signed-off-by: Greg Hackmann <ghackmann@google.com>
ys/_system_properties.h
f4250508d5de415e200888ffdf143f870dc0f829 19-Jun-2013 Colin Cross <ccross@android.com> am 3225f498: Merge "bionic: add __system_property_foreach"

* commit '3225f4984837c4d9e6e9495d2154f2d9987cf457':
bionic: add __system_property_foreach
dc5d3426d8c50c29c3a92ff9c9ca61d069e8dfeb 22-Nov-2012 Sergey Melnikov <sergey.melnikov@intel.com> stdint.h header is not fully compatible with C99(ISO9899:1999)

stdint.h provides macros with incorrect type:
* UINT8_C
* UINT16_C
* UINT8_MAX
* UINT16_MAX

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: I2d130c782d4485bf6c9e9f068de0bdaa4ba7303f
tdint.h
c6ff844d75dddfb19fc804b8add2d6a79947b101 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: add __system_property_foreach

find_nth() will be inefficient on a trie. Since find_nth() is only used
internally and only for enumerating properties, we can add a foreach()
function to do this directly.

Signed-off-by: Greg Hackmann <ghackmann@google.com>

(cherry picked from commit 577418403d68e663fb33c7b0c8a90d862d9c00cf)

Change-Id: Iaca97d1182ce2c28863ba85241cbb5cf6185eb2f
ys/system_properties.h
577418403d68e663fb33c7b0c8a90d862d9c00cf 13-Feb-2013 Greg Hackmann <ghackmann@google.com> bionic: add __system_property_foreach

find_nth() will be inefficient on a trie. Since find_nth() is only used
internally and only for enumerating properties, we can add a foreach()
function to do this directly.

Change-Id: I66bde9926c193073d74b244cce9fffd52108fff8
Signed-off-by: Greg Hackmann <ghackmann@google.com>
ys/system_properties.h
d98d35c5380ce398038d3062d40bc4fe082dce80 18-Jun-2013 Nick Kralevich <nnk@google.com> am 0846109c: Merge "libc: Rename fortify error functions."

* commit '0846109c96d54a28e413893b0cd4b4acb3aa87fc':
libc: Rename fortify error functions.
3bf6279034e6a92c3550fae31c5c136bec61344a 18-Jun-2013 Nick Kralevich <nnk@google.com> am dd0880fe: Merge "libc: add limited FORTIFY_SOURCE support for clang"

* commit 'dd0880fec3bb8c998680e78aff9e2ddc2bcf6d7a':
libc: add limited FORTIFY_SOURCE support for clang
ba6c021a53376c75993cc9866deb7c7ff6e1750d 18-Jun-2013 Nick Kralevich <nnk@google.com> am e2fb05b4: Merge "libc: Introduce __errordecl()"

* commit 'e2fb05b45b9af7b9af8df0ea15bfec63d331d882':
libc: Introduce __errordecl()
a641c18f0c62c31f5678f8c159a74486010ea851 18-Jun-2013 Nick Kralevich <nnk@google.com> libc: Rename fortify error functions.

__umask_error -> __umask_invalid_mode
__creat_error -> __creat_missing_mode
__too_many_args_error -> __creat_too_many_args

Change-Id: I4036f344a3a93628e70f2e948ad73cfed3a967ea
cntl.h
ys/stat.h
16d1af167f8e36a9aa4a07ae77034ad519b00463 17-Jun-2013 Nick Kralevich <nnk@google.com> libc: add limited FORTIFY_SOURCE support for clang

In 829c089f83ddee37203b52bcb294867a9ae7bdbc, we disabled all
FORTIFY_SOURCE support when compiling under clang. At the time,
we didn't have proper test cases, and couldn't easily create targeted
clang tests.

This change re-enables FORTIFY_SOURCE support under clang for a
limited set of functions, where we have explicit unittests available.
The functions are:

* memcpy
* memmove
* strcpy
* strncpy
* strcat
* strncat
* memset
* strlen (with modifications)
* strchr (with modifications)
* strrchr (with modifications)

It may be possible, in the future, to enable other functions. However,
I need to write unittests first.

For strlen, strchr, and strrchr, clang unconditionally calls the
fortified version of the relevant function. If it doesn't know the
size of the buffer it's dealing with, it passes in ((size_t) -1),
which is the largest possible size_t.

I added two new clang specific unittest files, primarily copied
from fortify?_test.cpp.

I've also rebuild the entire system with these changes, and didn't
observe any obvious problems.

Change-Id: If12a15089bb0ffe93824b485290d05b14355fcaa
cntl.h
tdio.h
tring.h
trings.h
ys/cdefs.h
ys/stat.h
b24c0637d06fe0980b9e13a8d0c3e6f4dbda9cd5 18-Jun-2013 Nick Kralevich <nnk@google.com> libc: Introduce __errordecl()

Define __errordecl and replace __attribute__((__error__("foo")))
with __errordecl. Make sure __errordecl is a no-op on clang, as it
generates a compile time warning.

Change-Id: Ifa1a2d3afd6881de9d479fc2adac6737871a2949
cntl.h
tdio.h
tring.h
ys/cdefs.h
ys/stat.h
f6e6e5e72774e302c461767ca0c194f25502108e 18-Jun-2013 Colin Cross <ccross@android.com> am 977a3313: Merge changes Iac00ce10,I192d3825

* commit '977a33137d2be0093f474055f839cf665b82b588':
bionic: add tests for properties
bionic: move system property writing from init to bionic
5cf32de7a0fea0b10959b598300babc6e4f54d95 24-Jan-2013 Colin Cross <ccross@android.com> bionic: move system property writing from init to bionic

Move the implementation of writing to the system property area
from init to bionic, next to the reader implementation. This
will allow full property testing to be added to bionic tests.

Add new accessor and waiting functions to hide the implementation
from watchprops and various bionic users.

Also hide some of the implementation details of the property area
from init by moving them into _system_properties.h, and other details
from everybody by moving them into system_properties.h.

(cherry picked from commit dc1038b7900acb664e99643d2974e1a0f4703781)

Change-Id: I192d3825ee276c5047bc751039fe6cfe226a7cca
ys/_system_properties.h
c1e4183c7ad6943f9cc44fe0b769884370a739cd 14-Jun-2013 Elliott Hughes <enh@google.com> am 560e9f7e: Merge "Ensure that <stdint.h> defines SIZE_MAX and friends."

* commit '560e9f7e7a39e02aca96709043ca06f562f75d58':
Ensure that <stdint.h> defines SIZE_MAX and friends.
7c89506e3af3ee97691a98329f0d7b5edef49218 14-Jun-2013 Elliott Hughes <enh@google.com> Ensure that <stdint.h> defines SIZE_MAX and friends.

We were missing SIG_ATOMIC_MAX, SIG_ATOMIC_MIN, SIZE_MAX,
WCHAR_MAX, WCHAR_MIN, WINT_MAX, and WINT_MIN.

Change-Id: I2535f36bc220fbaea009b483599b7af811c4cb5c
tdint.h
char.h
dc5f5f857c7bf218d33212044539eb73b3fab5f1 13-Jun-2013 Elliott Hughes <enh@google.com> am f1867d47: Merge "Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work.""

* commit 'f1867d47cbce4225d712a2684da67031f7350909':
Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."
9248d3a58cdc6573bb8803ae9f266575e4ce64d2 13-Jun-2013 Elliott Hughes <enh@google.com> Revert "Add SIZE_MAX to <stdint.h> in a way that might actually work."

This reverts commit d8627af159c6b1bc40296fb29297c61b30a5a8e2 which caused build breakage:

In file included from bionic/libc/include/limits.h:86:0,
from bionic/libc/include/stdint.h:33,
from bionic/libc/arch-arm/bionic/crtbegin.c:31:
bionic/libc/include/sys/limits.h:30:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
make: *** [out/target/product/generic/obj/lib/crtbegin_dynamic1.o] Error 1

Change-Id: I128095ecb99df92626e1f57e34c61e08c98a4078
tdint.h
b0a2262c3f91085e79c3fd491379e45821254427 13-Jun-2013 Elliott Hughes <enh@google.com> am 55c5ec64: Merge "Add SIZE_MAX to <stdint.h> in a way that might actually work."

* commit '55c5ec64bd26d92bd1882a9a4c91445de73ebfa2':
Add SIZE_MAX to <stdint.h> in a way that might actually work.
d8627af159c6b1bc40296fb29297c61b30a5a8e2 12-Jun-2013 Elliott Hughes <enh@google.com> Add SIZE_MAX to <stdint.h> in a way that might actually work.

Take two.

Change-Id: I7d08b6d14c82a171312a7f5898270b4441d5cfa2
tdint.h
834f83de3f3363090385963eef1cd9a053a51a71 12-Jun-2013 Elliott Hughes <enh@google.com> am 5cde15eb: Merge "<stdint.h> should expose SIZE_MAX."

* commit '5cde15eb17f4ddc0949c0cbd38a46e6c0bad7019':
<stdint.h> should expose SIZE_MAX.
2c157aec9b37f49367f9411e2c2253bf3975f11c 12-Jun-2013 Elliott Hughes <enh@google.com> <stdint.h> should expose SIZE_MAX.

Change-Id: Id27222c24955c83f29ad953933cbdc48b6f1e900
tdint.h
e84cfbefd82f552490c580d35a54db4f53b6e5fb 06-Jun-2013 Elliott Hughes <enh@google.com> am b7b4f5b8: Merge "update signal.h to be C90 compatable"

* commit 'b7b4f5b838cd41407c734af74e8211f5c7da0036':
update signal.h to be C90 compatable
5a6a0a9445d80bf2bd847088921f6d1d99315552 06-Jun-2013 Elliott Hughes <enh@google.com> am 18af4503: Merge "Ensure header files using __BEGIN_DECLS include sys/cdefs.h."

* commit '18af450393b005b4ead896d82cda750e6876fd33':
Ensure header files using __BEGIN_DECLS include sys/cdefs.h.
156ccf42ff622bc7284640bd6679bf35cfa9a123 30-May-2013 Erik Gilling <konkers@android.com> update signal.h to be C90 compatable

sigismember, sigaddset, and sigdelset had mixed code and declarations
which are not allowed in C90 and before.

Change-Id: I662af944fc1489e34bed228ce592e41f50d00e17
Signed-off-by: Erik Gilling <konkers@android.com>
ignal.h
36fa67bcdd90f18a3c68f8637ae836762407fa51 06-Jun-2013 Elliott Hughes <enh@google.com> Ensure header files using __BEGIN_DECLS include sys/cdefs.h.

We keep fixing these one-by-one; let's fix them all at once.

Found thus:

find . -name *.h | xargs grep -L sys/cdefs.h | xargs grep -l BEGIN_DECL | xargs grep -L sys/types

Change-Id: I188842aa2484dc6176e96556d57c38a0f785b59b
ntent.h
etinet/in.h
ys/auxv.h
ys/signalfd.h
ys/timeb.h
b9e2dae427ef1e1cfdbb3faa1442d4a66a2d3bcd 06-Jun-2013 Elliott Hughes <enh@google.com> am c5bfb624: Merge "sys/personality.h: include <sys/cdefs.h>"

* commit 'c5bfb62433751579e86d5fd24cddf3ae28a49b43':
sys/personality.h: include <sys/cdefs.h>
328223230bd297260ddcce49c400f68961e2e9e7 05-Jun-2013 Kito Cheng <kito@0xlab.org> sys/personality.h: include <sys/cdefs.h>

Change-Id: Ia3fa558a38e0cffe5287bc454e85d5d3bdaa6ba1
ys/personality.h
4b47d9f978296e5bb2eaabb8069960eb6f207c80 05-Jun-2013 Elliott Hughes <enh@google.com> am 4c001859: Merge "Fix declaration of malloc_usable_size()"

* commit '4c001859feeda27727917c5bd00338e90b801742':
Fix declaration of malloc_usable_size()
4c001859feeda27727917c5bd00338e90b801742 05-Jun-2013 Elliott Hughes <enh@google.com> Merge "Fix declaration of malloc_usable_size()"
027a8fae7750855af2ec0f8dd655e4a48ebf9352 31-May-2013 Nick Kralevich <nnk@google.com> am 8539961f: Merge "FORTIFY_SOURCE: strcat / strncat optimize"

* commit '8539961ff299b05d8feac9be8b119698be22da03':
FORTIFY_SOURCE: strcat / strncat optimize
cf870199d576bdfc339b7fb016c9f6fe7f2c87ed 31-May-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: strcat / strncat optimize

__strcat_chk and __strncat_chk are slightly inefficient,
because they end up traversing over the same memory region
two times.

This change optimizes __strcat_chk / __strncat_chk so they
only access the memory once. Although I haven't benchmarked these
changes, it should improve the performance of these functions.

__strlen_chk - expose this function, even if -D_FORTIFY_SOURCE
isn't defined. This is needed to compile libc itself without
-D_FORTIFY_SOURCE.

Change-Id: Id2c70dff55a276b47c59db27a03734d659f84b74
tring.h
25a87f7641f066437d15c6d3148d08a6ab9be231 23-May-2013 David 'Digit' Turner <digit@android.com> Fix declaration of malloc_usable_size()

The function should take a 'const void*' parameter, instead of 'void*'.
Note that the implementation in upstream-dlmalloc/malloc.c already does
this.

For context, see http://b.android.com/55725

Change-Id: Iefd55cdb8996699189e0545f9195972490306227
alloc.h
975d4464cef774768cf99a68f3537cfc0678e3f7 15-May-2013 Elliott Hughes <enh@google.com> am 6f502bc7: Merge "Add more __restricts, clean up __format__ attributes."

* commit '6f502bc74374804766639e6b1515644875810bda':
Add more __restricts, clean up __format__ attributes.
d04c18397946f87ac4495351537c31a3d67257da 15-May-2013 Elliott Hughes <enh@google.com> Add more __restricts, clean up __format__ attributes.

Change-Id: I7e2d270cc722d339d221eaea92747eaff3b51403
rr.h
tdio.h
ys/cdefs.h
01678789bca18d1a4894ae7f987f847b5ae0ce62 14-May-2013 Elliott Hughes <enh@google.com> am 5b7b2809: Merge "epoll: add EPOLLRDHUP, EPOLLWAKEUP, and EPOLLONESHOT events"

* commit '5b7b2809a2110dad1b2434f1070e13a08085d94b':
epoll: add EPOLLRDHUP, EPOLLWAKEUP, and EPOLLONESHOT events
562804ff878ede5d0ce0cb0c79ffb9b26777bf76 14-May-2013 Elliott Hughes <enh@google.com> am f0f4fa3f: Merge "libc: add timerfd calls"

* commit 'f0f4fa3fb1ea8623b1e1bc59f7967e0470c8e532':
libc: add timerfd calls
3136623600a9488859ed7c1681b084ea8315ed50 14-May-2013 Elliott Hughes <enh@google.com> am e1c58ab5: Merge "libc: remove obsolete CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR"

* commit 'e1c58ab5bb6284b3e3a2d0e54c295a93780b3f70':
libc: remove obsolete CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR
91cc8014e8cbc5ebfa90708f77f4f319e553a904 14-May-2013 Elliott Hughes <enh@google.com> am 7cb82791: Merge "libc: add clock ids CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM"

* commit '7cb82791cada0283648fedc316171cbffda79af7':
libc: add clock ids CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM
b0a2fc35d6d1abf8bd37985e9e7181dc4cea83aa 09-May-2013 Todd Poynor <toddpoynor@google.com> epoll: add EPOLLRDHUP, EPOLLWAKEUP, and EPOLLONESHOT events

(cherry-pick of d1ad4f6dab06189d4d3dcfa19ae4bc301481eb3f.)

Change-Id: I4a8476bff068951533d4188de94097c8b84bc489
ys/epoll.h
4200e6203aaa67c37874ad2b2271bff920297c7f 09-May-2013 Todd Poynor <toddpoynor@google.com> libc: add timerfd calls

(cherry-pick of 04c0ac14a49e0969333008a9522b64046d58fbdc.)

Change-Id: I06d0b6c2a8781602362b81f48faf1cca76b9ec05
ys/timerfd.h
5c4340b2abc43278d6cb8fcf5a1379f68ef0842a 11-May-2013 Todd Poynor <toddpoynor@google.com> libc: remove obsolete CLOCK_REALTIME_HR and CLOCK_MONOTONIC_HR

Add CLOCK_MONOTONIC_RAW, CLOCK_REALTIME_COARSE, and CLOCK_MONOTONIC_COARSE
as supported by recent linux kernels.

(cherry-pick of 60e5144ca312b210b54ac8e6966108da0c97ff80.)

Bug: 8895727
Change-Id: If79a4d05d1301108f49a37588f9416c4be19277a
ime.h
23b9fd2c1d8f61fc17e152b4b9142eca603e2426 10-May-2013 Todd Poynor <toddpoynor@google.com> libc: add clock ids CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM

(cherry-pick of b928bda83d4413b703329f607e2706602f15293f.)

Change-Id: Ica6aad84299819ffc5e57ae4891e057d2e401fa1
ime.h
37cd8800d532e5901cc3b332bc39d8580f2ba9ab 08-May-2013 Nick Kralevich <nnk@google.com> am d541ba17: Merge "Use restrict pointers for various libc functions."

* commit 'd541ba17197fd3ef1f60462e51261c4340369218':
Use restrict pointers for various libc functions.
1c462b7a04fc6afc99d8544728dd6d8f2a471fa2 07-May-2013 Nick Kralevich <nnk@google.com> Use restrict pointers for various libc functions.

All the cool kids say this is the best thing since sliced bread.
http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html

For the most part, these changes match what glibc does.

Change-Id: I176268f27f82800162fe5f2515b08d5469ea2dfe
tring.h
8355ab5524557da2737ea9084a8131c1015ae14f 01-May-2013 Nick Kralevich <nnk@google.com> am bee0ab16: Merge "libc: upgrade strrchr to FORTIFY_SOURCE=2"

* commit 'bee0ab16e47086d2f31f6f9ff41328066d5a7128':
libc: upgrade strrchr to FORTIFY_SOURCE=2
3b2e6bc9acf5223db6e9967e46066219c76ee56f 30-Apr-2013 Nick Kralevich <nnk@google.com> libc: upgrade strrchr to FORTIFY_SOURCE=2

Change-Id: I4c34c2ce22c5092c4446dc1ab55f37604c1c223f
tring.h
2ff94a096427a5b5e729ae356c98463c9a9dabf1 30-Apr-2013 Nick Kralevich <nnk@google.com> am c4687130: Merge "libc: upgrade some libc functions to _FORTIFY_SOURCE=2"

* commit 'c46871302e7bd099aaf54d91da93a2248acbf733':
libc: upgrade some libc functions to _FORTIFY_SOURCE=2
9020fd503c9eb073f70dbc239a212f8ece19359d 30-Apr-2013 Nick Kralevich <nnk@google.com> libc: upgrade some libc functions to _FORTIFY_SOURCE=2

Upgrade the following functions:

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

Change-Id: Icc036fc7f0bb317e05f7c051617887a1601271aa
tdio.h
tring.h
aed0c3ac54fa944b1f8512938277e7dc6b6fa2ee 30-Apr-2013 Nick Kralevich <nnk@google.com> am b94b2851: Merge "libc: upgrade sprintf to _FORTIFY_SOURCE=2"

* commit 'b94b2851d72187cc9095864a9c99429ee62d7786':
libc: upgrade sprintf to _FORTIFY_SOURCE=2
78d6d9888c24c50f65d694dc8283afdcb58db84c 30-Apr-2013 Nick Kralevich <nnk@google.com> libc: upgrade sprintf to _FORTIFY_SOURCE=2

Upgrade sprintf to fortify_source level 2, to catch
additional security bugs.

Change-Id: Ibc957d65e4cb96152de84b3745a04e00fa22659e
tdio.h
ys/cdefs.h
56a1b492c40b51204ad1b46a6b46819775c8912a 30-Apr-2013 Nick Kralevich <nnk@google.com> am 382a7753: Merge "strncpy: implement _FORTIFY_SOURCE=2"

* commit '382a7753786646483a8101f4e337f9e3a82ec852':
strncpy: implement _FORTIFY_SOURCE=2
1aae9bd170883805f2e7975cd3dbd2502b083cc1 29-Apr-2013 Nick Kralevich <nnk@google.com> strncpy: implement _FORTIFY_SOURCE=2

Add support for fortify source level 2 to strncpy.
This will enable detection of more areas where strncpy
is used inappropriately. For example, this would have detected
bug 8727221.

Move the fortify_source tests out of string_test.cpp, and
put it into fortify1_test.cpp.

Create a new fortify2_test.cpp file, which copies all
the tests in fortify1_test.cpp, and adds fortify_source level
2 specific tests.

Change-Id: Ica0fba531cc7d0609e4f23b8176739b13f7f7a83
tring.h
ys/cdefs.h
9b84824dfd597d8137137fa33295faa26cc70ae0 03-Apr-2013 Kito Cheng <kito@0xlab.org> Prevent name conflict for eventfd.cpp and eventfd.s when building libc.a

- eventfd.cpp and eventfd.s will output to the same file when building libc.a
out/target/product/*/obj/STATIC_LIBRARIES/libc_intermediates/WHOLE/libc_common_objs/eventfd.o
- And then `eventfd` will undefined when statically linked to libc.

Also add a unit test.

(cherry-pick of 8baa929d5d3bcf63381cf78ba76168c80c303f5e.)

Change-Id: Icd0eb0f4ce0511fb9ec00a504d491afd47d744d3
ys/eventfd.h
8baa929d5d3bcf63381cf78ba76168c80c303f5e 03-Apr-2013 Kito Cheng <kito@0xlab.org> Prevent name conflict for eventfd.cpp and eventfd.s when building libc.a

- eventfd.cpp and eventfd.s will output to the same file when building libc.a
out/target/product/*/obj/STATIC_LIBRARIES/libc_intermediates/WHOLE/libc_common_objs/eventfd.o
- And then `eventfd` will undefined when statically linked to libc.

Also add a unit test.

Change-Id: Ib310ade3256712ca617a90539e8eb07459c98505
ys/eventfd.h
c82b339a7da4dc36e644f5037c3868155fe454e4 25-Mar-2013 Elliott Hughes <enh@google.com> am 3c1504d9: am 48f25cef: Merge "Stop generating <sys/linux-syscalls.h>."

* commit '3c1504d9d7d529b8281a447dc69af3ecf6b5ec83':
Stop generating <sys/linux-syscalls.h>.
1b91c6c11f6b4b8c082da41339b861981570bb4a 23-Mar-2013 Elliott Hughes <enh@google.com> Stop generating <sys/linux-syscalls.h>.

The <asm/unistd.h> files contain the canonical data, and
<sys/glibc-syscalls.h> contain new glibc-compatible names,
and if you #include the standard <sys/syscall.h> you get
both sets of names.

Change-Id: I9919c080931c0ba1660f5e37c6a6265ea716d603
ys/linux-syscalls.h
ba61bb55c4f3d468dd93bedc3deb24a0ef28a948 22-Mar-2013 Elliott Hughes <enh@google.com> am a3fe475c: am c019345a: Merge "Use the correct names for the __ARM_NR_* syscalls."

* commit 'a3fe475c9ff444f45eb3c4dd7fd462326dfdb13d':
Use the correct names for the __ARM_NR_* syscalls.
cda62094ef6ab44d3804954fff75be1246725c36 22-Mar-2013 Elliott Hughes <enh@google.com> Use the correct names for the __ARM_NR_* syscalls.

This lets us move all the ARM syscall stubs over to the kernel <asm/unistd.h>.
Our generated <sys/linux-syscalls.h> is now unused, but I'll remove that in a
later change.

Change-Id: Ie5ff2cc4abce1938576af7cbaef615a79c7f310d
ys/linux-syscalls.h
e0e5b2f6e731c639107e29abec17db2e6eb498e8 22-Mar-2013 Elliott Hughes <enh@google.com> am 65163750: am c37dd599: Merge "Fix builds where _FORTIFY_SOURCE is off."

* commit '65163750b11c814d6a75940ab1ede1e907b14d81':
Fix builds where _FORTIFY_SOURCE is off.
890c8ed6ef773160cd6840a92e0d469fe530871f 22-Mar-2013 Elliott Hughes <enh@google.com> Fix builds where _FORTIFY_SOURCE is off.

Also add a more intention-revealing guard so we don't have loads of
places checking whether our inlining macro is defined.

Change-Id: I168860cedcfc798b07a5145bc48a125700265e47
cntl.h
tdio.h
tring.h
trings.h
ys/cdefs.h
ys/stat.h
ddda044a81b6be2ccdf351ad5c9a2b9800a60f5f 22-Mar-2013 Elliott Hughes <enh@google.com> am 5686bb30: am 3323628d: Merge "The SYS_ constants should cover all __NR_ values."

* commit '5686bb300304f5de0597f356c6da72b8a090a647':
The SYS_ constants should cover all __NR_ values.
5c2772f59d3b6f564897187324d8606f54423207 22-Mar-2013 Elliott Hughes <enh@google.com> The SYS_ constants should cover all __NR_ values.

<sys/linux-syscalls.h> only contains constants for the syscalls
we're generating stubs for. We want all the syscalls available
on the architecture in question.

Keep using <sys/linux-syscalls.h> on ARM for now because the
__NR_ARM_set_tls and __NR_ARM_cacheflush values aren't in <asm/unistd.h>.

Change-Id: I66683950d87d9b18d6107d0acc0ed238a4496f44
ys/glibc-syscalls.h
17a0d1915f871ad67608a582a4fb3352000cf719 22-Mar-2013 Elliott Hughes <enh@google.com> am 01c0e19e: am 612333f6: Merge "Don\'t #define SYS_ constants unless they make sense for the current architecture."

* commit '01c0e19e426df5620c5ca822ab546907dbf1fa7d':
Don't #define SYS_ constants unless they make sense for the current architecture.
9724ce3a09f8c0869a45c4ebdef665a1ee049734 22-Mar-2013 Elliott Hughes <enh@google.com> Don't #define SYS_ constants unless they make sense for the current architecture.

Fixes the MIPS and x86 builds. strace tests whether syscalls
are supported using #ifdef of the appropriate SYS_ constant.

Change-Id: I90be118dc42abfdaf5b0f9b1e676e8601f55106e
ys/glibc-syscalls.h
5c9a25cc2369846f7cf7f4fe1bdb32cf3dc8a469 22-Mar-2013 Elliott Hughes <enh@google.com> am f977d2dc: am 800ad824: Merge "Provide glibc-compatible SYS_* aliases for the __NR_* constants."

* commit 'f977d2dc1dce28a517329e8b4990ebee696faec1':
Provide glibc-compatible SYS_* aliases for the __NR_* constants.
8ecf2258274b6ef2630a503a314573d80517465a 22-Mar-2013 Elliott Hughes <enh@google.com> Provide glibc-compatible SYS_* aliases for the __NR_* constants.

This helps us remove another external/strace bionic hack.

Change-Id: I3e82c0d2fd27e479be98f096e05b666fd16f8eb3
ys/glibc-syscalls.h
ys/linux-syscalls.h
ys/syscall.h
60ac09bdb2ddc4076f78a91f260cd5a1e179c82b 11-Mar-2013 Elliott Hughes <enh@google.com> am 6d6f5e61: am 4b032ee9: Merge "Let bionic use the correct definition of ssize_t."

* commit '6d6f5e618e054e79d80a02f2c3f76ce0fd73bb2a':
Let bionic use the correct definition of ssize_t.
b6e22482d4fbf62c23707a9096eecd2082a63ef1 09-Mar-2013 Elliott Hughes <enh@google.com> Let bionic use the correct definition of ssize_t.

Bug: 8253769
Change-Id: I50c7cc20828fc089b83580e039ce9153a6c5a8cc
ys/types.h
c96ad9bcd28fcd2b34040a2a696262057a11470b 05-Mar-2013 Elliott Hughes <enh@google.com> am 7b69ac53: am cf9a9604: Merge "Switch to upstream-freebsd for the unmolested wchar code."

* commit '7b69ac535abca0e7867524e68f5a3581cc367de8':
Switch to upstream-freebsd for the unmolested wchar code.
eb93ebffba21e2c9b8a12bb86db60d38c7750270 02-Mar-2013 Elliott Hughes <enh@google.com> Switch to upstream-freebsd for the unmolested wchar code.

Change-Id: I87b4d76ff8da04109ae53638eec4f11629798960
char.h
04190c53e3ac2958322a603d7bfb9b07b92d595e 01-Mar-2013 Nick Kralevich <nnk@google.com> am cc646773: am 305a9995: am 8fa924e5: Merge "unistd.h: don\'t include sys/capability.h"

* commit 'cc64677342209d38f88138c03d3ded0e1d61637c':
unistd.h: don't include sys/capability.h
6524d3cad7a1adfc709ace7e983afb9789fed888 01-Mar-2013 Nick Kralevich <nnk@google.com> unistd.h: don't include sys/capability.h

Don't pull in unnecessary header files. AFAIK, I've fixed all
the code which didn't include the correct header files.

Change-Id: If0b7bba74e77cb24a0cf9ce8968aa07400855e58
nistd.h
04766565d3743d70f679ca180d7fcc35321143b8 28-Feb-2013 Elliott Hughes <enh@google.com> am 9c102ccf: am 7fe8229b: am 9c1912c4: Merge "Avoid changing the C++ ABI with ssize_t."

* commit '9c102ccf9517637f9d293b4e52f9a40573d8fc1d':
Avoid changing the C++ ABI with ssize_t.
e255642dc1178663860104d9da2590056fae8d0b 28-Feb-2013 Elliott Hughes <enh@google.com> Avoid changing the C++ ABI with ssize_t.

Bug: 8253769
Change-Id: Ia325003ed6e59da553e2bdde7c43515bc191b8ba
ys/types.h
30f1622a34cade7d3202b9f720fe2c1ece99f285 26-Feb-2013 Nick Kralevich <nnk@google.com> am 82f4cc5d: am 58b997c8: am f5f906c1: Merge "libc: create sys/capability.h"

* commit '82f4cc5de495c6cc3d3736ab075ccd05285beabc':
libc: create sys/capability.h
7c0dd555c09c880b71c7c4039993d1d029add109 26-Feb-2013 Nick Kralevich <nnk@google.com> libc: create sys/capability.h

Per "man capset", sys/capability.h is the appropriate header file
for the capget / capset definition, not unistd.h. Fixed.

As a short term hack, continue to include sys/capability.h in
unistd.h, until we can fix all the code which uses capget / capset.

Change-Id: I6e7cf55955d761ca785a14c5e4b7a44125d8fc15
ys/capability.h
nistd.h
92ce5cc4bcd431f9b0d44e61e3be84ca3a1d299b 22-Feb-2013 Elliott Hughes <enh@google.com> am ed1068c8: am 7b8bf681: am f6bb5bf4: Merge "Add the glibc-compatible names to <sys/endian.h>."

* commit 'ed1068c86ea0380e4b4909252367ffacc812ad57':
Add the glibc-compatible names to <sys/endian.h>.
f6bb5bf498810d0622f66020059c87b96738c35b 22-Feb-2013 Elliott Hughes <enh@google.com> Merge "Add the glibc-compatible names to <sys/endian.h>."
726642cfa5c0f29558f307ce6b2205f0eb6b1ad3 22-Feb-2013 Elliott Hughes <enh@google.com> am dd843914: am 440bc83d: am 7b2c6385: Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."

* commit 'dd8439141aeac6dc3a64e25f313d08833e1d85f5':
Fix <memory.h> to be a synonym for <string.h> like in glibc.
bcedca25d37bb3a70209e1d02e45720d1f86ddbd 22-Feb-2013 Nick Kralevich <nnk@google.com> am 41fb968c: am cadc8583: am bc0e7ee1: Merge "libc: add sys/signal.h for compatibility"

* commit '41fb968c4268d080b0be4493876672efc4a71e16':
libc: add sys/signal.h for compatibility
7b2c6385effbb6d6e98bfe29cc6c144211128d9e 22-Feb-2013 Elliott Hughes <enh@google.com> Merge "Fix <memory.h> to be a synonym for <string.h> like in glibc."
6f1b7a64076528a7eac6c872ba5b294bbe418be8 22-Feb-2013 Elliott Hughes <enh@google.com> Fix <memory.h> to be a synonym for <string.h> like in glibc.

Change-Id: If23589c5d85dffd28788e04b010303620fa178ca
emory.h
cf820d7e96d572484cfd2ef436a4cfada6d38175 22-Feb-2013 Elliott Hughes <enh@google.com> Add the glibc-compatible names to <sys/endian.h>.

Also remove declarations for functions that don't exist; these
are all macros.

Bug: http://code.google.com/p/android/issues/detail?id=41769
Change-Id: Ia3774ab2ff7d3c535f83774eac61068f9b11e194
ys/endian.h
b22a6849902d3bb4a105224c82998703fd6dbb06 22-Feb-2013 Nick Kralevich <nnk@google.com> libc: add sys/signal.h for compatibility

Some applications look for sys/signal.h instead of signal.h.
Work around those apps.

Change-Id: I76ac7744ebc56d196b5f0cb9ed381d32817436b9
ys/signal.h
7dfc6a3cd178281c1005a94e84ce5359b23e612f 22-Feb-2013 Elliott Hughes <enh@google.com> am e974e951: am 2a5b57db: am 580a7073: Merge "Stop advertising rindex(3), which is both deprecated and unimplemented."

* commit 'e974e951606d2efbad4bafe5edbd09c13d875f6a':
Stop advertising rindex(3), which is both deprecated and unimplemented.
d470955eb59b09274e8040ff43b1e907da917d91 22-Feb-2013 Nick Kralevich <nnk@google.com> am 72e983d6: am 398f46dd: am a0259b42: Merge "libc: remove bcmp prototype"

* commit '72e983d62828e1db5049800b7edef5a1b0cbbcbd':
libc: remove bcmp prototype
538f6fc202b07219ce78de54c0e05ab81e937154 22-Feb-2013 Elliott Hughes <enh@google.com> Stop advertising rindex(3), which is both deprecated and unimplemented.

Change-Id: I3c775d9974e49c3f76a53e46e022659657b89034
tring.h
trings.h
11ebbc8437af208f64861b7531502ff0eeb30e03 22-Feb-2013 Nick Kralevich <nnk@google.com> libc: remove bcmp prototype

AFAIK, bionic only ever provided an implementation of bcmp
for x86, and even then, the code was never actually compiled.
Remove the prototype.

bcmp() has been obsoleted and replaced by memcmp()

Change-Id: I549d02ab6a9241a9acbbbfade0d98a9a02c2eaee
trings.h
cae21739525bf446ea5f642a3aa8e7523670d17e 19-Feb-2013 Elliott Hughes <enh@google.com> am ccd40316: Merge "use architecture-specific ssize_t definition"

* commit 'ccd403161cdcc88a0ffcaecd1bc707e2d4c88a1c':
use architecture-specific ssize_t definition
c641cafbc387849510d7f408e85f72fa3608916d 17-Feb-2013 Thorsten Glaser <tg@mirbsd.org> use architecture-specific ssize_t definition

after change 32822 was rejected, this is the more light-weight
version of the fix: libc/include/sys/types.h already - via
libc/kernel/common/linux/posix_types.h - includes a definition
of __kernel_ssize_t from libc/kernel/arch-*/asm/posix_types.h
which is architecture-specific, toolchain-agnostic and also
gets rid of the gcc -Wformat warning (which it issues correctly,
since this i̲s̲ indeed a bug in bionic)

Change-Id: Ie4503ab16628bc25815a836d07556f665e9795c7
ys/types.h
5593d50c721f2ac6b2746f9b083950ceb0e4b521 19-Feb-2013 Elliott Hughes <enh@google.com> am eeecff72: Merge "Fix pthreads functions that should return ESRCH."

* commit 'eeecff7293efd6becf3b07b8d24cada3d820c894':
Fix pthreads functions that should return ESRCH.
9d23e04c43dbb8480bea8be28b8a2f37423bec49 16-Feb-2013 Elliott Hughes <enh@google.com> Fix pthreads functions that should return ESRCH.

imgtec pointed out that pthread_kill(3) was broken, but most of the
other functions that ought to return ESRCH for invalid/exited threads
were equally broken.

Change-Id: I96347f6195549aee0c72dc39063e6c5d06d2e01f
thread.h
ac480b422a2d33c77ec9acbd16d9f8ee4ae6c6b3 12-Feb-2013 Dima Zavin <dima@android.com> am 3fa67465: Merge "add factory property file definition"

# By Andrew Boie
# Via Andrew Boie (1) and Gerrit Code Review (1)
* commit '3fa67465365baf87f751bea09847e32f01005788':
add factory property file definition
3fa67465365baf87f751bea09847e32f01005788 12-Feb-2013 Dima Zavin <dima@android.com> Merge "add factory property file definition"
5bb4f54b4dff28e69fd615b30e139b43ed3cd003 12-Feb-2013 Elliott Hughes <enh@google.com> am 6b73d13f: am 2d3e7233: Merge "Revert "Revert "Pull the pthread_key_t functions out of pthread.c."""

# Via Android Git Automerger (1) and others
* commit '6b73d13fa414afeecba6718bf724e8ac922bac39':
Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""
1b21249d5a9225bcebb0d82cd4dd47896bd1670c 12-Feb-2013 Elliott Hughes <enh@google.com> am e4b08318: am 8397cdba: Merge "Revert "Pull the pthread_key_t functions out of pthread.c.""

# Via Gerrit Code Review (2) and Android Git Automerger (1)
* commit 'e4b08318c13fac774b233a5459427563d2983f79':
Revert "Pull the pthread_key_t functions out of pthread.c."
376bce009785be01d49bd3554a61caabbe01555f 12-Feb-2013 Elliott Hughes <enh@google.com> am 024246ec: am 09e89c3c: Merge "Pull the pthread_key_t functions out of pthread.c."

# Via Android Git Automerger (1) and others
* commit '024246ec274e30bb4a24468d8319620534e13b34':
Pull the pthread_key_t functions out of pthread.c.
44b53ad6818de344e0b499ad8fdbb21fcb0ff2b6 11-Feb-2013 Elliott Hughes <enh@google.com> Revert "Revert "Pull the pthread_key_t functions out of pthread.c.""

This reverts commit 6260553d48f6fd87ca220270bea8bafdde5726ec

(Removing the accidental libm/Android.mk change.)

Change-Id: I6cddd9857c31facc05636e8221505b3d2344cb75
ys/limits.h
6260553d48f6fd87ca220270bea8bafdde5726ec 11-Feb-2013 Elliott Hughes <enh@google.com> Revert "Pull the pthread_key_t functions out of pthread.c."

This reverts commit ad59322ae432d11ff36dcf046016af8cfe45fbe4

somehow my unfinished libm/Android.mk change got into here.

Change-Id: I46be626c5269d60fb1ced9862f2ebaa380b4e0af
ys/limits.h
ad59322ae432d11ff36dcf046016af8cfe45fbe4 09-Feb-2013 Elliott Hughes <enh@google.com> Pull the pthread_key_t functions out of pthread.c.

This was originally motivated by noticing that we were setting the
wrong bits for the well-known tls entries. That was a harmless bug
because none of the well-known tls entries has a destructor, but
it's best not to leave land mines lying around.

Also add some missing POSIX constants, a new test, and fix
pthread_key_create's return value when we hit the limit.

Change-Id: Ife26ea2f4b40865308e8410ec803b20bcc3e0ed1
ys/limits.h
a7d9b655e5ae06702d64693c519f667937a4d9f2 07-Feb-2013 Robert Greenwalt <rgreenwalt@google.com> Merge "dns cache per interface iteration 2"
c63e59039d28c352e3053bb81319e960c392dbd4 23-Aug-2011 Mattias Falk <mattias.falk@sonyericsson.com> dns cache per interface iteration 2

name server addresses are read from the dns
cache associated wih the interface on which
the request shall be done.

processes which has requested to issue dns request
using specific interface are now proxied to netd.

added methods to attach/detach a process to a specific
dns cache/interface.

added getaddrinfoforinface method which takes an
interface as an argument.

bug:4815099
bug:5465296
Change-Id: I7a8fe1980cdf99d4d296ddc5c6411f0c72162263
etdb.h
7582a9c119a4e4d0c306996b2513205889a9fb6c 07-Feb-2013 Elliott Hughes <enh@google.com> Switch x86 syscall stubs over to the ENTER/END style of the ARM stubs.

Also update the x86 asm.h to support this; we need it for libm assembler
anyway.

Also clean up the _FBSDID hack in <sys/cdefs.h>.

Change-Id: Iababd977b8110ec022bf7c93f4d62ece47630e7c
ys/cdefs.h
24fad01755d33e6772ea3be56b702570bf257d55 04-Feb-2013 Elliott Hughes <enh@google.com> Document the mallinfo struct, add missing attributes.

Change-Id: Ia97acce1f6a83bd8b3ba8dd20efd962bc96f35a9
alloc.h
ys/cdefs.h
a0ee07829a9ba7e99ef68e8c12551301cc797f0f 31-Jan-2013 Elliott Hughes <enh@google.com> Upgrade libm.

This brings us up to date with FreeBSD HEAD, fixes various bugs, unifies
the set of functions we support on ARM, MIPS, and x86, fixes "long double",
adds ISO C99 support, and adds basic unit tests.

It turns out that our "long double" functions have always been broken
for non-normal numbers. This patch fixes that by not using the upstream
implementations and just forwarding to the regular "double" implementation
instead (since "long double" on Android is just "double" anyway, which is
what BSD doesn't support).

All the tests pass on ARM, MIPS, and x86, plus glibc on x86-64.

Bug: 3169850
Bug: 8012787
Bug: https://code.google.com/p/android/issues/detail?id=6697
Change-Id: If0c343030959c24bfc50d4d21c9530052c581837
ys/cdefs.h
6fe67c3cf26cc695881d7cb8a9aa971e4dab1f59 30-Jan-2013 Elliott Hughes <enh@google.com> Fix valgrind build.

Change-Id: Ie375d32565d10f4c0c56da5422f52b68cb069654
ys/exec_elf.h
a6a3ac59243d8c95c94c3069e9332051f785c05f 30-Jan-2013 Elliott Hughes <enh@google.com> Use the NetBSD <sys/exec_elf.h>.

Replace a kernel header file dependency with files from NetBSD.
They're more complete, and ELF is ELF, whether you're on Linux or a BSD.

Bug: 7973611
Change-Id: I83ee719e7efdf432ec2ddbe8be271d05b2f558d7
ys/exec_elf.h
41b3179c9ef03ebb447cac7f5e8405dce399cb17 28-Jan-2013 Elliott Hughes <enh@google.com> Unit tests for formatting code, fix %%.

Also fix <signal.h> and <stdio.h> so they don't cause compiler warnings.

Change-Id: Ib1a746bf01de22d47dbd964de0e6af80a7c96303
ignal.h
tdio.h
8e70b0d5c3ba9cc7e2cf6025a9ae0ae157f5acc9 24-Jan-2013 Nick Kralevich <nnk@google.com> prctl.h: include sys/cdefs.h

prctl.h uses __BEGIN_DECLS but fails to include sys/cdefs.h
(where it's defined). Code which includes prctl.h without
previously including sys/cdefs.h will fail to compile.

Fixed.

Change-Id: If4c9f3308f08b93596dcd00e351ae786807e9320
ys/prctl.h
32417fb37642a1f975ec107e6b449ba71196db56 23-Jan-2013 Nick Kralevich <nnk@google.com> libc: use more secure system properties if available

Currently, system properties are passed via the environment
variable ANDROID_PROPERTY_WORKSPACE and a file descriptor passed
from parent to child. This is insecure for setuid executables,
as the environment variable can be changed by the caller.

Modify system property handling so that we get the properties
from a root owned properties file, rather than using an
environment variable. Fall back to the environment variable
if the file doesn't exist.

Bug: 8045561
Change-Id: I54f3efa98cf7d63d88788da5ce0d19e34fd7851a
ys/_system_properties.h
f373b11f9ff46a2f4b918b0027d466eaa035297a 19-Jan-2013 Kito Cheng <kito@0xlab.org> Add const for first argument of sigismember for fit POSIX spec

Change-Id: Icbc67375282f2a22dce02e4bacab15ddae846057
ignal.h
a44e9afdd16105d6f36319cb538666d9cc78435a 18-Jan-2013 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: optimize

Don't do the fortify_source checks if we can determine, at
compile time, that the provided operation is safe.

This avoids silliness like calling fortify source on things like:

size_t len = strlen("asdf");
printf("%d\n", len);

and allows the compiler to optimize this code to:

printf("%d\n", 4);

Defer to gcc's builtin functions instead of pointing our code
to the libc implementation.

Change-Id: I5e1dcb61946461c4afaaaa983e39f07c7a0df0ae
tring.h
f193b9fc211760938a79703f6e7ca1619de8cee8 16-Jan-2013 Elliott Hughes <enh@google.com> Fix signalfd for MIPS.

Also mark signalfd's sigset_t* argument as non-nullable.

Change-Id: I466e09cdf3fb92480744c496da92274a97f99dd1
ys/signalfd.h
2c5153b043b44e9935a334ae9b2d5a4bc5258b40 11-Jan-2013 Nick Kralevich <nnk@google.com> libc: add getauxval()

Add support for getauxval(). This method allows a program an easy way
to retrieve information from the kernel auxiliary vector, and will
hopefully replace other clumsy ways of accessing this same information.

This particular function was also added to glibc in glibc 2.16.
See the following URLs for more details.

* http://lwn.net/Articles/519085/
* http://www.gnu.org/software/libc/manual/html_node/Auxiliary-Vector.html

This change is a prerequisite for bug 7959813.

Bug: http://code.google.com/p/android/issues/detail?id=38441
Change-Id: Iba19d899df334bddc6f4899077ece2fc87564ea8
lf.h
ys/auxv.h
07564f2d3a97eb0918adb7237508beeecdea1721 11-Jan-2013 Andrew Boie <andrew.p.boie@intel.com> add factory property file definition

This property file is used for properties which are set at device
provisioning time or in the factory. They are never touched by
a software update or factory data reset and typically contain
data specific to the particular unit.

Change-Id: I2e7c2fe62cb684cb2449eea917c42b19462e89a5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
ys/_system_properties.h
a4b2dc016fa62bd172a73c3f8971c805700ffb0f 10-Jan-2013 Rom Lemarchand <romlem@google.com> Add signalfd call to bionic

Add signalfd() call to bionic.

Adding the signalfd call was done in 3 steps:
- add signalfd4 system call (function name and syscall
number) to libc/SYSCALLS.TXT
- generate all necessary headers by calling
libc/tools/gensyscalls.py. This patch is adding
the generated files since the build system
does not call gensyscalls.py.
- create the signalfd wrapper in signalfd.cpp and add
the function prototype to sys/signalfd.h

(cherry-pick of 0c11611c11f4dc1b6d43587b72c3ccbe8c51a51c, modified to
work with older versions of GCC still in use on some branches.)

Change-Id: I4c6c3f12199559af8be63f93a5336851b7e63355
ys/linux-syscalls.h
ys/signalfd.h
fb5e5cbdd4e1d75594c37ebb544c0f46482a027b 07-Jan-2013 Elliott Hughes <enh@google.com> Fix an off-by-one error in the sigset_t function error handling.

Spotted while running the tests on MIPS, where sigset_t is
actually large enough. The bits in sigset_t are used such that
signal 1 is represented by bit 0, so the range of signals is
actually [1, 8*sizeof(sigset_t)]; it seems clearer to reword
the code in terms of valid bit offsets [0, 8*sizeof(sigset_t)),
which leads to the usual bounds checking idiom.

Change-Id: Id899c288e15ff71c85dd2fd33c47f8e97aa1956f
ignal.h
d73c0b300e2dbaa4cc59f87fc1435661e5e1c736 04-Jan-2013 Elliott Hughes <enh@google.com> Add AF_CAN and PF_CAN (and other missing families).

Change-Id: I2c183a6f5f7a7e81e87dad85d8c9aff9c43ed33a
ys/socket.h
a55f63083fb16b2595f517a3260083e5f8cddd02 02-Jan-2013 Elliott Hughes <enh@google.com> Define _POSIX_MONOTONIC_CLOCK and implement sysconf(_SC_MONOTONIC_CLOCK).

Bug: http://code.google.com/p/android/issues/detail?id=39680
Change-Id: I11cf10a66f9d305868a725f04f581099fb88bbfc
ys/limits.h
ys/sysconf.h
4fa35d8ae80c175425e9525831d7b6a71a3ada60 12-Dec-2012 Elliott Hughes <enh@google.com> Fix <endian.h> and <sys/endian.h>.

Previously we'd been relying on getting the machine-specific <endian.h>
instead of the top-level <endian.h>, and <sys/endian.h> was basically broken.
Now, with this patch and the previous patch we should have <endian.h>
and <sys/endian.h> behaving the same. This is basically how NetBSD's endian.h
works, and was probably how ours was originally intended to work.

Bug: http://code.google.com/p/android/issues/detail?id=39824
Change-Id: I71de5a507e633de166013a658b5764df9e1aa09c
ys/endian.h
57874753900865312d7d265d2ca15cb4edb00ef2 07-Dec-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: remove memcpy overlap checks

These checks haven't been as useful as I hoped, and it's
causing a false positive finding. Remove the overlap
compile time checks.

Change-Id: I5d45dde10ae4663d728230d41fa904adf20acaea
tring.h
9a4d305340e6ce2fc6c3f371f2d7ede446f8c6d4 03-Dec-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: fortify strrchr

This change compliments 049e58369c37fdeacd0380a6bf1e078d9baf819f

Change-Id: I27d015d70a520713c7472558a3c427f546d36ee4
tring.h
46d64ed2e5cf8e37d53b116f2281b4a39cc4f288 03-Dec-2012 Elliott Hughes <enh@google.com> Merge "Add argument checking to sigemptyset(3) and friends."
da73f655fcbac6e1a8bfd35303cef6f41187d12b 01-Dec-2012 Elliott Hughes <enh@google.com> Add argument checking to sigemptyset(3) and friends.

You could argue that this is hurting people smart enough to have manually
allocated a large-enough sigset_t, but those people are smart enough to
implement their own sigset functions too.

I wonder whether our least unpleasant way out of our self-inflicted 32-bit
cesspool is to have equivalents of _FILE_OFFSET_BITS such as _SIGSET_T_BITS,
so calling code could opt in? You'd have to be careful passing sigset_t
arguments between code compiled with different options.

Bug: 5828899
Change-Id: I0ae60ee8544835b069a2b20568f38ec142e0737b
ignal.h
049e58369c37fdeacd0380a6bf1e078d9baf819f 01-Dec-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: fortify strchr

Detect when strchr reads off the end of a buffer.

Change-Id: I0e952eedcff5c36d646a9c3bc4e1337b959224f2
tring.h
4a9e837840fda3aaea48aeba85c7c7a8782d2586 30-Nov-2012 Elliott Hughes <enh@google.com> Reduce the exposure of the __set_errno implementation detail.

Change-Id: I395e1b46a9491e34fc53e71853e932ea90b3d1cc
rrno.h
3975cec694a0c9b42e3f7e671fcd678da92836c3 30-Nov-2012 Elliott Hughes <enh@google.com> Remove (near-)duplicate definitions of size_t and ssize_t.

The near duplicates upset fussier compilers that insist that
typedefs be exactly the same, but the fix isn't to make all
copies identical...

Change-Id: Icfdace41726f36ec33c9ae919dbb5a54d3529cc9
earch.h
tdint.h
tdio.h
ys/types.h
50e62e4051c14d7d2a5e07ebe66afd2a81693a26 30-Nov-2012 Elliott Hughes <enh@google.com> Merge "Bug: __WINT_TYPE__ and wint_t reference to different types"
99ea84b12dd3ebebbbd527b8748f0d74bb1dfc0d 29-Nov-2012 Elliott Hughes <enh@google.com> Merge "[MIPS] Fix the MIPS getsid system call"
58aaaa730b5b33bc4ee524eb04985e5b8cf540bb 29-Nov-2012 Chris Dearman <chris@mips.com> [MIPS] Fix the MIPS getsid system call

Change-Id: I30a27941125bccb35d73a572a729ecf7dd555389
Signed-off-by: Chris Dearman <chris@mips.com>
ys/linux-syscalls.h
f27b7fb0567a9cbb642be9d98298cb6668e7db39 10-Oct-2012 Hakan Kvist <hakan.kvist@sonymobile.com> Define DEFFILEMODE and friends

Define the macros ACCESSPERMS, ALLPERMS and DEFFILEMODE.
These macros originates from BSD but has been available in glibc
for quite some time.

Change-Id: I429cd30aa4e73f53b153ee7740070cebba166c57
ys/stat.h
a437bff914aa4416e8a72ea444f226f84c8b11fd 21-Nov-2012 Sergey Melnikov <sergey.melnikov@intel.com> Bug: __WINT_TYPE__ and wint_t reference to different types

__WINT_TYPE__ type provided by gcc. It references to unsigned int
type for android and linux. Patch corrects wint_t typedef to
__WINT_TYPE__.

Signed-off-by: Sergey Melnikov <sergey.melnikov@intel.com>
Change-Id: Iabeb9fcb0b7bb303a8b220043e339126f125dd68
char.h
c30396f5f225e0b5a83a35432e2d82a7063cfdb9 29-Oct-2012 David 'Digit' Turner <digit@android.com> libc: Fix alphasort() signature (and implementation).

The declaration for alphasort() in <dirent.h> used the deprecated:

int alphasort(const void*, const void*);

while both Posix and GLibc use instead:

int alphasort(const struct dirent** a, const struct dirent** b);

See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html

This patch does the following:

- Update the declaration to match Posix/GLibc
- Get rid of the upstream BSD code which isn't compatible with the new
signature.
- Implement a new trivial alphasort() with the right signature, and
ensure that it uses strcoll() instead of strcmp().
- Remove Bionic-specific #ifdef .. #else .. #endif block in
dirent_test.cpp which uses alphasort().

Even through strcoll() currently uses strcmp(), this does the right
thing in the case where we decide to update strcoll() to properly
implement locale-specific ordered comparison.

Change-Id: I4fd45604d8a940aaf2eb0ecd7d73e2f11c9bca96
irent.h
063cfb2084ea4b12d3c85b2d2c44e888f0857eb4 26-Oct-2012 Elliott Hughes <enh@google.com> Clean up the implementation of the <dirent.h> functions.

Change-Id: I3c647cc9588525afc41fee90ee468d58cd13503a
irent.h
e8bcca3a2ca4a70156c72239d62bb68eeb2929fd 23-Oct-2012 Elliott Hughes <enh@google.com> Upgrade more functions to the current upstream NetBSD copy.

Change-Id: Ie0b3f8b3fccef28609eb210434413ebd51d6ef45
rpa/inet.h
ha1.h
ys/sha1.h
ce45fea03ddfd8d6d1900d6777a002dec98ea1e1 23-Oct-2012 Elliott Hughes <enh@google.com> Add missing BEGIN_DECLS/END_DECLS for FORTIFY_SOURCE stdio prototypes.

Change-Id: I35ceb09fedf873c5e98e1e26efce5e4f00a17e74
tdio.h
c1b44ecc5385e68e81667068e03b32c2084a85b1 17-Oct-2012 David 'Digit' Turner <digit@android.com> Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>"

This creates build issues in the internal Android tree.
Will investigate later.

Original patch: https://android-review.googlesource.com/#/c/38875/

Change-Id: I12c5995ebf172890051af42a5d3b31014c9c5117
ignal.h
ys/cdefs.h
ys/ucontext.h
ime.h
c124baaf29a948fd8b93e7f1fefc20b659271026 12-Jul-2012 David 'Digit' Turner <digit@android.com> libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>

This patch updates the C library headers to provide ucontext_t
definitions for three architectures.

+ Fix <signal.h> to always define 'struct sigcontext'.

The new declarations are announced with new macros defined in
<sys/cdefs.h> in order to make it easier to adapt client code
that already defines its own, incompatible, versions of the
structures seen here.

http://code.google.com/p/android/issues/detail?id=34784

Change-Id: Ie78c48690a4ce61c50593f6c39639be7fead3596
ignal.h
ys/cdefs.h
ys/ucontext.h
ime.h
f8a2c51bf3b85bf86bff905dd1232299d333dafe 13-Sep-2012 David 'Digit' Turner <digit@android.com> LONG_LONG_MIN/MAX: Move declarations to <limits.h>

LONG_LONG_MIN, LONG_LONG_MAX and ULONG_LONG_MAX are
GLibc-specific macros that are better defined in <limits.h>
instead of the current exotic location (<pthread.h>).

Note that GCC's <limits.h> only defines these macros
when __GNU_LIBRARY__ is also defined. This is only the
case when building against GLibc, so manually redefine
the macros here.

Note that using LLONG_MIN/LLONG_MAX/ULLONG_MAX is the
C99-compliant way to get these values, but it's easier
to define these compatibility macros for the sake of
porting existing code.

Change-Id: I8023918d73b4685238054932f94a4006c1ca7d03
imits.h
thread.h
4e75c4b2d745c673f5fe20676f7b53eedbec2853 11-Oct-2012 Shuo Gao <shuo.gao@intel.com> Fix perf_event_open syscall for x86 and mips

perf_event_open syscall has a different syscall number for
the 3 supported architectures: arm, x86 and mips. Currenlty
only the arm syscall number is defined for all architectures.
Tracing tools like perf will not work on other architectures
than arm.

Add the different values for perf_event_open on x86 and mips
and run gensyscalls.py to update generated headers.

Change-Id: I2ed78bd42c0e5df8dbc51d784be49cccda5fab30
Author: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
ys/linux-syscalls.h
7d56ccbfaac2b702e4be0f71038efb7f251ef637 02-Oct-2012 Elliott Hughes <enh@google.com> Always take GCC's definition of NULL.

There's a (bad) definition of NULL in <linux/stddef.h>, and this
definition of NULL, and the One True definition in the <stddef.h> provided
by the compiler. This change at least kills one of the bad duplicates.
Killing the <linux/stddef.h> one is harder, because it's in a generated
file.

Change-Id: Iea4ccb12d6758199f312ea9cd753b84322d5c471
tdio.h
0cc0d250fd3097e4c26b70cdeb5c47caac634069 02-Oct-2012 Elliott Hughes <enh@google.com> Remove useless #defines and incorrect claims from header files.

The various __need_* macros were write-only.

Change-Id: Id3cca34188e0801fdf93a038b22f2817226ad9c2
tdio.h
tdlib.h
ys/types.h
char.h
422b6ef92c1cca3cfd412621dc3db3b8609fa88c 28-Sep-2012 Elliott Hughes <enh@google.com> Define ssize_t if necessary.

Change-Id: I63801cc1f09be5e4ca20a6da7ec3366ba6441afd
tdio.h
eac9eb462ed6f7fcfb791e7a08b4011fcca47829 08-Sep-2012 Irina Tirdea <irina.tirdea@intel.com> Add getdelim(3) and getline(3) to bionic

Some userspace programs (e.g. perf) need getline.

Changes:
() add getdelim.c, getline.c from NetBSD (http://netbsd.org/) under the
NetBSD Foundation's (TNF) license ("2 clause" Berkeley-style license).
() add stub for reentrant.h header that is needed by getdelim.c
() add tests for getdelim(3) and getline(3).
() update NOTICE file.

Change-Id: I22ed82dd5904b9d7a3695535c04f502be3c27c5d
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
tdio.h
ys/param.h
cd587701c8590fb34bb69804b5d3b3c14d3d2508 26-Sep-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add umask check

Verify that the call to umask makes sense. While this wouldn't
have detected bug 7094213 (because the low order bits were all zero),
it might detect other similar bugs.

References: https://code.google.com/p/android-source-browsing/source/detail?r=acba45cc4b1f98f67fcdeda2f7c13ed57659b92a&repo=platform--libcore

Change-Id: I966a531d6b3cf8e1c5eacd69bd3cbec475b5fa58
ys/stat.h
047a285d41e3fe0b1a8071ec19f436baf6f187b2 15-Sep-2012 Elliott Hughes <enh@google.com> Merge "Fix <sys/klog.h> to correspond to the kernel operations."
51519521979c2daa417f6ca50c175e631c55dfb0 15-Sep-2012 Elliott Hughes <enh@google.com> Merge "Add tty defaults to bionic"
e249b059637b49a285ed9f58a2a18bfd054e5d95 15-Sep-2012 Elliott Hughes <enh@google.com> Fix <sys/klog.h> to correspond to the kernel operations.

This makes the constants correspond to those in the Linux kernel's
include/linux/syslog.h, but keeping our old badly-named constants for
source compatibility.

Change-Id: Ia47d1299205754cbfffd29ed48b497b53d1edaae
ys/klog.h
5e58ea07d47c175abf8285ff67e3e9bc0b3a9e8e 12-Sep-2012 Nick Kralevich <nnk@google.com> libc: add ftw / nftw functions

Please see "man 3 ftw" for a description of the
ftw / nftw functions.

This code is taken directly from netbsd unmodified.

Change-Id: Ia4879ac57212b424adf5281b5e92858e216d0f14
tw.h
b5f053b5a7deb084e7a052d527e0aa41339ae05c 08-Sep-2012 Irina Tirdea <irina.tirdea@intel.com> Make strerror(3) and strsignal(3) thread-safe, and add psignal(3) and psiginfo(3).

Change-Id: I426109db25e907980d6cb3a7a695796e45783b78
ignal.h
86ec05acc9df3098c4e99e5b3ad85dcef66712c7 12-Sep-2012 Elliott Hughes <enh@google.com> Update the kernel headers to match external/kernel-headers.

Note that the Linux kernel handed over responsibility for most of the
socket constants to glibc some time ago. Someone had updated our
external/kernel-headers file but not regenerated the bionic headers,
so this change copies the missing stuff from the old bionic <linux/socket.h>
into <sys/socket.h>. This is what glibc does.

I've hacked a few of the other files to #include <sys/socket.h> for
backward compatibility, but even so this requires numerous other
changes to switch people over from direct inclusion of <linux/...> headers.

Change-Id: I0e4af64e631d3cef911a31d90f2f806e058278a0
et/if.h
et/if_arp.h
etdb.h
etinet/if_ether.h
etinet/in.h
ys/socket.h
0d207ba624b81038600e71d109c3234912c4125b 12-Sep-2012 Elliott Hughes <enh@google.com> Backwards and forwards compatibility for an upcoming <sys/socket.h> change.

Change-Id: Iba58077a1f057a968eb2283ebba259975925ff4c
ys/un.h
e77e1afe244097ccad5bb3a3a648a8037e58beac 08-Sep-2012 Irina Tirdea <irina.tirdea@intel.com> Add tty defaults to bionic

Add ttydefaults.h bionic. Some userspace programs (e.g. perf) need the
definitions from this file. This header file is copied from NetBSD
(http://netbsd.org/) under the NetBSD Foundation's (TNF) license (“2 clause”
Berkeley-style license).

Change-Id: I9c862415b52b710f25adb1629a699627cd715775
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
ys/ttydefaults.h
1ad05db9cef23c1ca28ffd51852fa2a0b0c9b4b7 06-Sep-2012 Elliott Hughes <enh@google.com> Add mlockall and munlockall for Google TV.

Change-Id: I10e961d701e74aab07211ec7975f61167e387853
ys/linux-syscalls.h
be19a3671709879ccc0156b94f7ef7540027dc37 05-Sep-2012 Elliott Hughes <enh@google.com> Merge "termios: add tcdrain"
954923858b34dbe695d202c5a3076f05f269338a 04-Sep-2012 Vitaly Wool <vitaly.wool@sonyericsson.com> termios: add tcdrain

Change-Id: I05c0007f7bcc6ef5295c32f86fafbf1ad31e07fa
ermios.h
1ad10a566e042676c95a0bdbf3cbc48e99ddafb2 29-Aug-2012 Irina Tirdea <irina.tirdea@intel.com> Add getsid system call to bionic

Add getsid() system call to bionic for
all architectures. This is needed for various tools
(e.g. perf).

Adding the getsid system call was done in 3 steps:
() add getsid system call (function name and syscall
number) to libc/SYSCALLS.TXT
() generate all necessary headers by calling
libc/tools/gensyscalls.py. This patch is adding
the generated files since the build system
does not call gensyscalls.py.
() add the system call signature to libc/include/unistd.h

Change-Id: Id69a257e13ec02e1a44085a6b217a3f19ab025b1
Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>
ys/linux-syscalls.h
nistd.h
829c089f83ddee37203b52bcb294867a9ae7bdbc 29-Aug-2012 Nick Kralevich <nnk@google.com> disable _FORTIFY_SOURCE under clang

Clang and _FORTIFY_SOURCE are just plain incompatible with
each other. First of all, clang doesn't understand the
__attribute__((gnu_inline)) header. Second of all,
Clang doesn't have support for __builtin_va_arg_pack()
and __builtin_va_arg_pack_len() (see
http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc)

Until we can resolve these issues, don't even try using
_FORTIFY_SOURCE under clang.

Change-Id: I81c2b8073bb3276fa9a4a6b93c427b641038356a
cntl.h
tdio.h
tring.h
ys/cdefs.h
999089181ef60bb67e1a49f2cf6f4ec608a7caf8 18-Aug-2012 Ian Rogers <irogers@google.com> Upgrade to dlmalloc 2.8.5.

Move dlmalloc code to upstream-dlmalloc to make pulling upstream changes
easier.
Declare pvalloc and malloc_usable_size routines present in malloc.h but with
missing implementations. Remove other functions from malloc.h that have
no implementation nor use in Android.

Change-Id: Ia6472ec6cbebc9ad1ef99f4669de9d33fcc2efb4
alloc.h
6d6731adc0cd0fb249a2b73a575e5ab2204643cc 17-Aug-2012 Elliott Hughes <enh@google.com> Always define the 64-bit int types.

These preprocessor tricks have caused trouble for -std=gnu99 and -ansi, and
both netbsd's libc and glibc seem to unconditionally define these types.

Change-Id: Ib8dffa341a8ca88f80d275ba2b7f93a4c910ee32
tdint.h
b7beb6907599b36809effe1b4db76039ac649518 16-Aug-2012 Pavel Chupin <pavel.v.chupin@intel.com> Add link.h for all platforms with dl_phdr_info

This header is used on bionic build and should be propagated into
sysroot on toolchain rebuild. Discussion re. this header is here:
http://gcc.gnu.org/ml/gcc-patches/2012-08/msg00936.html

It is available already in mips NDK platforms:
development/ndk/platforms/android-9/arch-mips/include/link.h

Change-Id: I39ff467cdac9f448e31c11ee3e14a6200e82ab57
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
ink.h
74c046400677505aebe9686f111f147c2855cde0 11-Aug-2012 Jeff Sharkey <jsharkey@android.com> Update MS_ mount flags, define unshare() syscall.

(cherry-pick of 82393decdfc6b0383054fb5d2f54725bbee88b8c.)

Bug: 6925012
Change-Id: I4f962d8975ad62ff4b9983150f9e481796092b9d
ched.h
ys/mount.h
316ee626b729e3f66a5505a20128af26440cfd19 11-Aug-2012 Elliott Hughes <enh@google.com> Merge "MIPS support to sigsuspend and sigwait routines"
a1822dced3ed8625438b3cbf1c53f907f78a3a48 10-Aug-2012 Elliott Hughes <enh@google.com> Merge "Add unshare() syscall."
e36c826f7a6580227e9e70f6ec70aa88ba0f577e 10-Aug-2012 Jeff Sharkey <jsharkey@android.com> Add unshare() syscall.

(cherry-pick of 5467f25f82934d611c60f8bc57a05114f3c1bea0.)

Bug: 6925012
Change-Id: Ic5ea2fbd606311087de05d7a3594df2fa9b2fef9
ys/linux-syscalls.h
01030e6388019bc89e8d2959b9e787d31d3faa43 10-Aug-2012 Elliott Hughes <enh@google.com> Fix typo in SIGTTOU description.

Change-Id: Ie0db3e7df3e1f17b43f5645d027a90603139be2f
ys/_sigdefs.h
abd10011a7a6066df76de7acf5eecb2cc870b0c4 09-Aug-2012 Raghu Gandham <raghu@mips.com> MIPS support to sigsuspend and sigwait routines

Change-Id: I870e798ed7eac5a8c74e5784a670f3a4f24331a9
ys/linux-syscalls.h
d504eee9fa7dda59a41eb3e12ef973f32ee1169f 09-Aug-2012 Elliott Hughes <enh@google.com> Merge "MIPS support to sys/ headers"
e2731d98c1f0cd32d94b34cc4ee77148d6d52647 06-Aug-2012 Shih-wei Liao <sliao@google.com> Merge "When compiling with clang, don't "fortify_source" the strlcpy and strlcat."
d600617645e85435cf98fc30139a6945aaadc1ca 06-Aug-2012 Shih-wei Liao <sliao@google.com> When compiling with clang, don't "fortify_source" the strlcpy and
strlcat.

Change-Id: I91f58322f28e425ab9d22b51c23fcd6b772ede97
tring.h
8173d76740cafc2ceb49d2fddf1ceabfaa823236 06-Aug-2012 Shih-wei Liao <sliao@google.com> Merge "Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute""
9a3d53fad062cdadb4df81f6998a5e09336c637b 06-Aug-2012 Shih-wei Liao <sliao@google.com> When compiling with clang, don't "fortify_source" the strlen.

At this point, FORTIFY_SOURCE and clang are just plain incompatible.
Need to solve the underlying incompatibility first.

Change-Id: I3366477d19461e1ec93b1c30e0c7e8145b391b9b
tring.h
2b7f68c03df9df33708280cf3f5e8f5eba81dda6 04-Aug-2012 Shih-wei Liao <sliao@google.com> Revert "Fix the clang build: this compiler doesn't support the gnu_inline function attribute"

This reverts commit 4f1f149c3757c594f9ff987e5ddd919c3e7dba10.
ys/cdefs.h
4f1f149c3757c594f9ff987e5ddd919c3e7dba10 03-Aug-2012 Shih-wei Liao <sliao@google.com> Fix the clang build: this compiler doesn't support the gnu_inline function attribute

Recent clang compiler doesn't have gnu_inline working. When frameworks/rs
is compiled with clang instead of gcc, it no longer works. Will be fixed
by this patch.

Change-Id: I8b281a1305151909e18958b73914ea27343cb4cd
ys/cdefs.h
6437eac15a5b595ab26ef51834509c44695eb7e4 03-Aug-2012 Raghu Gandham <raghu@mips.com> MIPS support to sys/ headers

Change-Id: I32207a1d918e4842da341f6b242ae39c69a83b03
ys/_sigdefs.h
ys/ioctl_compat.h
ys/socket.h
ys/stat.h
ys/vfs.h
405b8029a6888f386adf3512113a33546141d1c8 26-Jul-2012 Raghu Gandham <raghu@mips.com> MIPS support for libc.

Change-Id: I2864dea04b3faf2d919165dcaa600af5b16c41c8
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
ys/cachectl.h
ecb53eab4b63a777c189f880e7f88ebbe0e8101b 03-Aug-2012 Elliott Hughes <enh@google.com> Fix a ENOTUP/ENOTSUP typo.

Change-Id: Ifa347a09a2aa1f505965ae7c1383fd0caf95793c
rrno.h
da2611084f7b5a05b802af6d5007661f42fc2578 28-Jan-2012 Chris Dearman <chris@mips.com> Error numbers are target specific.

Use the system supplied error numbers when mapping error numbers to messages.

Change-Id: I520556fa3e2ff668fdc4eda36ad31491fbb48ea8
Signed-off-by: Chris Dearman <chris@mips.com>
Signed-off-by: Raghu Gandham <raghu@mips.com>
ys/_errdefs.h
958dad705a8c2c191e4352547fc9950c4feaa9fb 24-Jul-2012 Chris Dearman <chris@mips.com> Fix implementation of generic atomic operations

Change-Id: Ie1ea5aacc561e2d6d40125d2952ed0e9116b7b0d
ys/atomics.h
0351955a686fe4e0bf9f30780f78ff0e2402a6b0 19-Jul-2012 Nick Pelly <npelly@google.com> Update time.h for CLOCK_BOOTTIME.

(cherry-pick of 8958a383296ea0e1cc106ae245c37671809ffd49)

Change-Id: Ie8de6b32fa81566db53ad7e9fd4b197f4cede628
ime.h
fabddfe833097ecca92b3547a725879234780468 16-Jul-2012 Elliott Hughes <enh@google.com> Merge "limits.h: Include page.h when relying on PAGE_SIZE"
c37fc1ab6a3ac3956a8c9ba3ac089d41969815ed 14-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: revert memcpy changes.

Performance regressions. Hopefully this is a temporary
rollback.

Bug: 6821003
Change-Id: I84abbb89e1739d506b583f2f1668f31534127764
tring.h
9b6cc223a36835c4367a036d4cfeff14d25bc742 13-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: introduce __BIONIC_FORTIFY_UNKNOWN_SIZE macro

Replace all occurances of "(size_t) -1" with a
__BIONIC_FORTIFY_UNKNOWN_SIZE macro.

Change-Id: I0b188f6cf31417d2dbef0e1bd759de3f9782873a
tdio.h
tring.h
ys/cdefs.h
260bf8cfe00f83bc579dfe81c78b75bd9973f051 13-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: strlen check.

This test is designed to detect code such as:

int main() {
char buf[10];
memcpy(buf, "1234567890", sizeof(buf));
size_t len = strlen(buf); // segfault here with _FORTIFY_SOURCE
printf("%d\n", len);
return 0;
}

or anytime strlen reads beyond an object boundary. This should
help address memory leakage vulnerabilities and make other
unrelated vulnerabilities harder to exploit.

Change-Id: I354b425be7bef4713c85f6bab0e9738445e00182
tring.h
f3913b5b68347ce9a4cb17977df2c33f1e8f6000 13-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: enhanced memcpy protections.

Two changes:

1) Detect memory read overruns.

For example:

int main() {
char buf[10];
memcpy(buf, "abcde", sizeof(buf));
sprintf("%s\n", buf);
}

because "abcde" is only 6 bytes, copying 10 bytes from it is a bug.
This particular bug will be detected at compile time. Other similar
bugs may be detected at runtime.

2) Detect overlapping buffers on memcpy()

It is a bug to call memcpy() on buffers which overlap. For
example, the following code is buggy:

char buf3[0x800];
char *first_half = &buf3[0x400];
char *second_half = &buf3[1];
memset(buf3, 0, sizeof(buf3));
memcpy(first_half, second_half, 0x400);
printf("1: %s\n", buf3);

We now detect this at compile and run time.

Change-Id: I092bd89f11f18e08e8a9dda0ca903aaea8e06d91
tring.h
6331db3fd251ddc350913cc1e8a7941740c25f63 10-Jan-2012 Arun Raghavan <arun.raghavan@collabora.co.uk> limits.h: Include page.h when relying on PAGE_SIZE

limits.h relies on PAGE_SIZE being defined without actually including
page.h. Make sure this is included to avoid compilation failures.

Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
imits.h
8f08e1c902c726ac5230776c238e5edb6f51f440 09-Jul-2012 Nick Kralevich <nnk@google.com> Merge "FORTIFY_SOURCE: Add openat, fix bug"
a3e230d1fa9a5ed773a029e2acc6eb4f3e849ea3 02-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: Add openat, fix bug

Add fortify_source support for openat(). This change requires that
an argument be supplied when using O_CREAT.

Fix unnecessary call to __open_2. If, at compile time, we know that
"flags" is constant and DOESN'T contain O_CREAT, the call to __open_2
is useless.

Change-Id: Ifcd29c4fb25e25656961d7552d672e161f0cfdbd
cntl.h
965dbc6405aa2c3170270cfc53a8d4416444fddb 03-Jul-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add fgets support.

Change-Id: I8c3410a90c71a3336c4ac8581618fa9330edf5e3
tdio.h
bd73eede4661298ddbdafa510c3af347683b5f60 27-Jun-2012 Nick Kralevich <nnk@google.com> Merge "FORTIFY_SOURCE: add open() checks"
cb228fb4a91bdccfd974b8a4f45e2b6002e90728 27-Jun-2012 Nick Kralevich <nnk@google.com> libc: cleanups

Prefix private functions with underscores, to prevent name
conflicts.

Use __error__ instead of error, since occasionally programs will
create their own "#define error ...".

Change-Id: I7bb171df58aec5627e61896032a140db547fd95d
tring.h
8118f62a7d3f1af1edb47e0bc2a49af1d523ae0f 27-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add open() checks

Add a FORTIFY_SOURCE check which requires that you pass a
"mode" argument when calling open(..., O_CREAT). If a mode isn't
passed, then the file is created with "undefined" permissions.

Change-Id: I4427be4f9ce170c69da01af5b00fb05b03613a28
cntl.h
70f6901c3dbe6f09c7fc3ebdb18f715915635d70 14-Jun-2012 Nick Kralevich <nnk@google.com> libc: make atoi, atol, and atoll pure functions

Change-Id: Ib831c079c865929b6c91d42f35e117f2e974808f
tdlib.h
8df49ad2467ec2d48f94a925162185c34bf6e68b 14-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add strlcpy / strlcat support

Add strlcpy / strlcat support to FORTIFY_SOURCE. This allows
us to do consistency checks on to ensure we don't overflow buffers
when the compiler is able to tell us the size of the buffer we're
dealing with.

Unlike previous changes, this change DOES NOT use the compiler's
builtin support. Instead, we do everything the compiler would
normally do.

Change-Id: I47c099a911382452eafd711f8e9bfe7c2d0a0d22
tring.h
a5eaa02f623b14a50f965a7279c2a6ae9f78337f 14-Jun-2012 Nick Kralevich <nnk@google.com> Merge "Don't mark realloc with __attribute__((malloc))"
b27631b9aee760034ea4aecc5c052e880292c417 14-Jun-2012 Nick Kralevich <nnk@google.com> Don't mark realloc with __attribute__((malloc))

According to
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

realloc should NOT be marked with __attribute__((malloc)). Quoting:

realloc-like functions do not have this property as the memory
pointed to does not have undefined content.

For reference, __mallocfunc is defined in sys/cdefs.h as:

#define __mallocfunc __attribute__((malloc))

Change-Id: I56083542ba92e4608dd7c55fb5596a138eb50cc9
alloc.h
9b549c39c938f54680f282c21e6885f53254bfb0 13-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add sprintf / vsprintf support

sprintf FORTIFY_SOURCE protections are not available
on clang.

Also add various __attribute__s to stdio functions.

Change-Id: I936d1f9e55fe53a68885c4524b7b59e68fed218d
tdio.h
c2f1d215b1786520fa8c371caa97f062e0bfb513 12-Jun-2012 Nick Kralevich <nnk@google.com> Merge "FORTIFY_SOURCE: add snprintf, vsnprintf"
20afd4e70c2f346d7cd03a7a3049f8de2d176d5c 12-Jun-2012 Elliott Hughes <enh@google.com> am e0961445: Merge "Remove the meaningless on Linux if_dl.h header."

* commit 'e0961445124b5ff39412da32578e14e0d1f6afd6':
Remove the meaningless on Linux if_dl.h header.
cffdf6693ffb50d2a1258d955a162bca83038f25 12-Jun-2012 Nick Kralevich <nnk@google.com> FORTIFY_SOURCE: add snprintf, vsnprintf

Add _FORTIFY_SOURCE support for snprintf, vsnprintf

At this time, we opt out of these protections for clang, as clang
does not implement __builtin_va_arg_pack().

http://clang.llvm.org/docs/UsersManual.html#c_unimpl_gcc

Change-Id: I73ebe5ec8dad1dca8898a76d6afb693a25f75375
tdio.h
c3d45b822cd7d7c359aceba9447a1619b5a2150b 12-Jun-2012 Elliott Hughes <enh@google.com> Remove the meaningless on Linux if_dl.h header.

This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.

Reported to AOSP by Jun-ya Kato.

(cherry-pick of 5056f1fad1187cd67729bb04ba72397d78256f03.)

Change-Id: Ic67f674d2221497c8166994812bb5fc7f0831066
et/if_dl.h
5056f1fad1187cd67729bb04ba72397d78256f03 12-Jun-2012 Elliott Hughes <enh@google.com> Remove the meaningless on Linux if_dl.h header.

This was misleading 'configure' into thinking we actually support AF_LINK,
but we're Linux, so we don't, and we never implemented the functions we
declared here either.

Reported to AOSP by Jun-ya Kato.

Change-Id: I111f9887f3812469b411b9cf5124d9dd624f19f7
et/if_dl.h
71a18dd435e96564539b5af71b8ea5093a2109a1 07-Jun-2012 Nick Kralevich <nnk@google.com> _FORTIFY_SOURCE: add memset / bzero support

Add _FORTIFY_SOURCE support for the following functions:

* memset
* bzero

Move the __BIONIC_FORTIFY_INLINE definition to cdefs.h so it
can be used from multiple header files.

Change-Id: Iead4d5e35de6ec97786d58ee12573f9b11135bb7
tring.h
trings.h
ys/cdefs.h
0a2301598c207fd1b50015984942fee5e8511593 05-Jun-2012 Nick Kralevich <nnk@google.com> libc: implement some FORTIFY_SOURCE functions

Add initial support for -D_FORTIFY_SOURCE to bionic for the
following functions:

* memcpy
* memmove
* strcpy
* strcat
* strncpy
* strncat

This change adds a new version of the above functions which passes
the size of the destination buffer to __builtin___*_chk.

If the compiler can determine, at compile time, that the destination
buffer is large enough, or the destination buffer can point to an object
of unknown size, then the check call is bypassed.

If the compiler can't make a compile time decision, then it calls
the __*_chk() function, which does a runtime buffer size check

These options are only enabled if the code is compiled with
-D_FORTIFY_SOURCE=1 or 2, and only when optimizations are enabled.

Please see
* http://gcc.gnu.org/onlinedocs/gcc/Object-Size-Checking.html
* http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html

for additional details on FORTIFY_SOURCE.

Testing: Compiled the entire Android tree with -D_FORTIFY_SOURCE=1,
and verified that everything appears to be working properly.
Also created a test buffer overflow, and verified that it was
caught by this change.

Change-Id: I4fddb445bafe92b16845b22458d72e6dedd24fbc
tring.h
beb349348e3df55d1d57d327fbd48fedc6073188 13-May-2012 Cédric Cabessa <ccabessa@genymobile.com> syslog needs a valid socket path for _PATH_LOG

/dev/kmsg is a character device already used for different purposes.
Most distribution use /dev/log for _PATH_LOG but this path is already used
by logcat.
I suggest using /dev/syslog.
This change was tested with busybox's syslogd.

Change-Id: I75b428123c7a0b3ca4bea656ce06860f6f727dde
yslog.h
804147cb7d533f5635da6adc28fbca1467a3078b 10-May-2012 Elliott Hughes <enh@google.com> am edb7cad9: Merge "Actually set the header guard in "linux-syscalls.h"."

* commit 'edb7cad9b764f029c5faac2750f749d3d84bd86a':
Actually set the header guard in "linux-syscalls.h".
1928523c870f7acd7f34870f4bb4ab9c6215bf7a 10-May-2012 Elliott Hughes <enh@google.com> Actually set the header guard in "linux-syscalls.h".

Spotted while merging a MIPS change.

Change-Id: I36fb5a07d0bba0c117e9fe9733957bd37ca4b4c0
ys/linux-syscalls.h
dbd5ecad26e39281bb83f97664bc32555c5c071a 09-May-2012 Elliott Hughes <enh@google.com> resolved conflicts for merge of e5408907 to jb-dev-plus-aosp

Change-Id: If4c3f51bf87b28da8074be2e46ae772a374b266f
1fa0d849576555577ffd9675677a3c95f21b754e 28-Jan-2012 Raghu Gandham <raghu@mips.com> [MIPS] Add support for MIPS syscalls

Change-Id: I4deba67e15c865c4c2db03064c04098a09828ea6
Signed-off-by: Raghu Gandham <raghu@mips.com>
Signed-off-by: Chris Dearman <chris@mips.com>
ys/linux-syscalls.h
ys/linux-unistd.h
6baffed252d0efbce5a79f356c2f156f4f818996 15-Dec-2011 Ken Sumrall <ksumrall@android.com> Add the posix_memalign(3) function to bionic

The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed. In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
tdlib.h
4994deaef51d5fa1ac12e6160b47d9cbe3b2bc43 16-Apr-2012 Elliott Hughes <enh@google.com> Merge "Bionic: Fix wrong prototype of system call clock_nanosleep"
d515ce465be909d830a39462c3f196b5d7f35c66 17-Apr-2012 Jack Ren <jack.ren@intel.com> Bionic: Fix wrong prototype of system call clock_nanosleep

In bionic/libc/SYSCALLS.TXT, the prototype of system call
clock_nanosleep is incorrect.

According to man page:
int clock_nanosleep(clockid_t clock_id, int flags,
const struct timespec *request,
struct timespec *remain);

Change-Id: Ic44c6db3d632293aa17998035554eacd664c2d57
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
ys/linux-unistd.h
41070dd15f2c5916dfc96da4c256dd04d7f9c837 17-Apr-2012 Jack Ren <jack.ren@intel.com> bionic: Fix wrong prototype of system call getresuid/getresgid

In bionic/libc/SYSCALLS.TXT, the prototypes of system call
getresuid/getresgid are incorrect.

According to man page, they should be:
int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);

Change-Id: I676098868bb05a9e1fe45419b234cf397626fdad
Signed-off-by: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
ys/linux-unistd.h
f0ec06ba609a15cf9343aabd5b2486f9a8af9adb 13-Apr-2012 Kenny Root <kroot@google.com> Add faccessat to syscall list

Change-Id: I427a18811089cb280769ac8da3ed8adc00a65a10
ys/linux-syscalls.h
nistd.h
891966d0209b17d27d8d1f7a94bc6404be93f7bf 21-Mar-2012 Nick Kralevich <nnk@google.com> Merge "string.h: add __attribute__ ((pure)) to string functions"
a677907ee8ecca034318fdb97902fa73e7392c4f 21-Mar-2012 Nick Kralevich <nnk@google.com> string.h: add __attribute__ ((pure)) to string functions

cdefs.h: Introduce the __purefunc attribute, which allows us to mark
certain functions as being "pure".

http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Many functions have no effects except the return value and their
return value depends only on the parameters and/or global variables.
Such a function can be subject to common subexpression elimination
and loop optimization just as an arithmetic operator would be.

string.h: Mark many commently used string functions as "pure", to
allow for additional compiler optimizations.

Change-Id: I42961f90f822b6dbcbc3fd72cdbe774a7adc8785
tring.h
ys/cdefs.h
21eab513e7eec280a7a8bcb9482a1a8b61e59442 14-Mar-2012 Ben Cheng <bccheng@google.com> New additions/bug fixes required/found when porting perf.

New functions:
tfind
tsearch
tdelete
twalk
tdestroy (GNU extension)

Bug fix: the current implementation for realpath would crash
if the second argument (resolved_path) is NULL.

New headers:
ar.h
search.h

Change-Id: Ib6c1e42fc186a6d597a6e5a9692b16acaa155804
r.h
earch.h
1a823691a21519014daf252691a314f0726d7c3a 13-Mar-2012 Ben Cheng <bccheng@google.com> Update kernel headers and add syscall "perf_event_open"

Change-Id: I43f12b727881df002a8524f2738586c043833bae
ys/linux-syscalls.h
9ec0f03a0d0b17bbb94ac0b9fef6add28a133c3a 28-Feb-2012 Nick Kralevich <nnk@google.com> Add relro support

Add support for PT_GNU_RELRO. This allows the static linker to
indicate that certain regions of memory should be marked as
"read-only" after dynamic linking is complete.

See:
* http://www.akkadia.org/drepper/nonselsec.pdf (section 6)
* http://tk-blog.blogspot.com/2009/02/relro-not-so-well-known-memory.html

Note that this change has no effect on Android right now, because
we don't compile our code with relro enabled.

Change-Id: I6541f8775367e8558b4388f7d105b1ae6e8f046b
ys/exec_elf.h
51d22d7ea92e77f47accee59c99cb8157bf29fcb 01-Mar-2012 Jean-Baptiste Queru <jbq@google.com> am afab5a70: Merge "Eliminate duplicate constants"

* commit 'afab5a703d30df613848cb30ab3ecceafd76102b':
Eliminate duplicate constants
9921947e6fa4547c10f68281fc1a7ad72e11cf56 28-Feb-2012 Nick Kralevich <nnk@google.com> Eliminate duplicate constants

include/elf.h contains basically the same values as
linux/auxvec.h. Eliminate dups.

include/sys/exec_elf.h contains basically the same
values as linux/elf.h. Eliminate dups.

Change-Id: I66b8358161bb52223bb657f8f73ba28b324f4fa3
lf.h
ys/exec_elf.h
7c38f53d1911e04acf6398921a7bd4444d585c2b 01-Mar-2012 Jean-Baptiste Queru <jbq@google.com> am 7f28e0b4: Merge "Clean up the remnants of SuperH support"

* commit '7f28e0b4501de7c4f8f627fd3e4be323d737ae82':
Clean up the remnants of SuperH support
7f28e0b4501de7c4f8f627fd3e4be323d737ae82 29-Feb-2012 Jean-Baptiste Queru <jbq@google.com> Merge "Clean up the remnants of SuperH support"
67e7a93844989a4ea4660e6cfb9613e486c6d352 28-Feb-2012 Nick Kralevich <nnk@google.com> Eliminate duplicate constants

include/elf.h contains basically the same values as
linux/auxvec.h. Eliminate dups.

include/sys/exec_elf.h contains basically the same
values as linux/elf.h. Eliminate dups.

Change-Id: I66b8358161bb52223bb657f8f73ba28b324f4fa3
lf.h
ys/exec_elf.h
d6b58b03b8e046e0bd46d6d7e57290dcabe48860 13-Feb-2012 Jean-Baptiste Queru <jbq@google.com> am 09049311: am cfff36df: am a60ff6c5: Merge "libc: Define new symbol visibility macros"

* commit '09049311a229c427f73e3e0ac873bf344b45aaf2':
libc: Define new symbol visibility macros
cfff36df2bebd95f2663b7b053c6308593c343dd 13-Feb-2012 Jean-Baptiste Queru <jbq@google.com> am a60ff6c5: Merge "libc: Define new symbol visibility macros"

* commit 'a60ff6c5b2ca76181b387d8c10aee22a2cbcf840':
libc: Define new symbol visibility macros
b69060f1ae0bd14c93caed2d113a72cf81d98f1d 10-Feb-2012 Raghu Gandham <raghu@mips.com> Clean up the remnants of SuperH support
ys/linux-unistd.h
f39a3fe67d7f1faa21a39ea8e1f57a6596c8cadb 09-Feb-2012 Glenn Kasten <gkasten@google.com> Allow C++ to call fdprintf

Change-Id: I1adb7b165ab9f62eaee4e7a9108e8b461350b347
tdio.h
25b7a16a6ee73248192909862f03f95d2363ad14 01-Feb-2012 Jean-Baptiste Queru <jbq@google.com> Merge c4cb87f3

Change-Id: I4cc14eba43fde75a7702fdc7ad07d3d949e9c092
c4cb87f367fc33b36c9988b4f42fc07876abccd1 01-Feb-2012 Jean-Baptiste Queru <jbq@google.com> Merge 5b892aa7

Change-Id: Ic82bc2866bdb0c93822c94281301fa127fd4bb0c
5fbf2e09921723cfdea75e83c1fac2080f0ad564 23-Jan-2012 David 'Digit' Turner <digit@android.com> libc: Define new symbol visibility macros

This patch defines a few new macros that can be used to control the
visibility of symbols exported by the C library:

- ENTRY_PRIVATE() can be used in assembly sources to indicate
that an assembler function should have "hidden" visibility, i.e.
will never be exported by the C library's shared library.

This is the equivalent of using __LIBC_HIDDEN__ for a C function,
but ENTRY_PRIVATE() works like ENTRY(), and must be used with
END() to tag the end of the function.

- __LIBC_ABI_PUBLIC__ can be used to tag a C functions as being
part of the C library's public ABI. This is important for a
few functions that must be exposed by the NDK to maintain
binary compatibility.

Once a symbol has been tagged with this macro, it shall
*never* be removed from the library, even if it becomes
directly unused due to implementation changes
(e.g. __is_threaded).

- __LIBC_ABI_PRIVATE__ can be used for C functions that should
always be exported by the C library because they are used by
other libraries in the platform, but should not be exposed
by the NDK. It is possible to remove such symbols from the
implementation if all callers are also modified.

+ Add missing END() assembly macro for x86

Change-Id: Ia96236ea0dbec41d57bea634b39d246b30e5e234
ys/cdefs_elf.h
70b1668a76d3b719ae690903ea790fda964a5458 30-Jan-2012 David 'Digit' Turner <digit@google.com> remove obsolete SuperH support

We don't have a toolchain anymore, we don't have working original
kernel headers, and nobody is maintaining this so there is really
no point in keeping this here. Details of the patch:

- removed code paths from Android.mk files related to the SuperH
architecture ("sh")

- removed libc/arch-sh, linker/arch-sh, libc/kernel/arch-sh

- simplified libc/SYSCALLS.TXT

- simplified the scripts in libc/tools/ and libc/kernel/tools

Change-Id: I26b0e1422bdc347489e4573e2fbec0e402f75560

Signed-off-by: David 'Digit' Turner <digit@android.com>
ys/linux-syscalls.h
73fa5fdaf9ec27741a17b0b793ff6890e6dcecd5 21-Jan-2012 Jean-Baptiste Queru <jbq@google.com> Merge 2f80f07d

Change-Id: Iff51b8530dbee01499ba4af0ecd6ab837c8c94fb
2f80f07d8106782ac94b05f529c8cbb1fd1c6f64 20-Jan-2012 Jean-Baptiste Queru <jbq@google.com> am 23f56bbb: Merge "Add extended attribute (xattr) system call wrappers to bionic."

* commit '23f56bbb6ae053996dd821f29379aea0c7166055':
Add extended attribute (xattr) system call wrappers to bionic.
79fcc6948d139878b9ae0423c2fe804636433ad8 19-Jan-2012 David 'Digit' Turner <digit@google.com> Merge "libc: remove private declarations from <time.h> and <resolv.h>"
5eb686d105ebd7cea332fd1ef0bb3af9386e19f7 13-Jan-2012 Stephen Smalley <sds@tycho.nsa.gov> Add extended attribute (xattr) system call wrappers to bionic.

The xattr system calls are required for the SE Android userspace in
order to get and set file security contexts. In particular, libselinux
requires these calls.

Change-Id: I78f5eb3d8f3384aed0a5e7c6a6f001781d982017
ys/linux-syscalls.h
ys/linux-unistd.h
ys/xattr.h
ea29cd5a4a0b1fc49a63a789ace1668283a6a280 18-Jan-2012 Nick Kralevich <nnk@google.com> Eliminate duplicate copies of constants.

sys/personality.h and linux/personality.h contain mostly
identical contents. Eliminate dups.

Change-Id: Ie786edcb5dca57af7ee5b5fdad2949369f1bc4e4
ys/personality.h
d6045cba4e572cf9ed0b87efddce93f3c4a80a8f 18-Jan-2012 Nick Kralevich <nnk@google.com> Don't generate sys/linux-unistd.h

linux-unistd.h was here for reference purposes, but shouldn't
have been accessible to client code. Delete it.

Change-Id: I60c264ff6ca489a48117914bdf6daa486737af8c
ys/linux-unistd.h
023e5409df07a5d5ead6efb1825f6df92bcf50da 17-Jan-2012 Nick Kralevich <nnk@google.com> am 06f51ba1: am f44de270: add personality() system call.

* commit '06f51ba1af2fafeec7fdfcba5d635bd001a31b3e':
add personality() system call.
06f51ba1af2fafeec7fdfcba5d635bd001a31b3e 17-Jan-2012 Nick Kralevich <nnk@google.com> am f44de270: add personality() system call.

* commit 'f44de270bba32c9b1b5eff8a34be07b10ddff238':
add personality() system call.
f44de270bba32c9b1b5eff8a34be07b10ddff238 13-Jan-2012 Nick Kralevich <nnk@google.com> add personality() system call.

Change-Id: Ie899def8ea1d705930ed83adae1343c1353e7c57
ys/linux-syscalls.h
ys/linux-unistd.h
ys/personality.h
208898ee776117f42815c2fcb15903b2781bf0aa 13-Jan-2012 David 'Digit' Turner <digit@google.com> libc: remove private declarations from <time.h> and <resolv.h>

This patch is used to remove private C library declarations from the
public headers (that are exported to the NDK). It should *only* be
submitted after all other patches modifying the users of said
private functions have been submitted to the tree, to avoid
breakages.

Change-Id: I0a5e3014f8e3ac9ed8df86a5cdae506337c23252
esolv.h
ime.h
11f3d5a4319e6e37e5280cf187b3d173e1ac0adb 13-Jan-2012 David 'Digit' Turner <digit@google.com> libc: Copy private C library declarations to private/

This patch is the first in a series that aims at cleaning up the
public C library headers (which end up being distributed with the NDK).

<resolv.h> and <time.h> contain declarations that should not be public.
They are used by other parts of the platform, but NDK applications should
not use or rely on them.

So copy them to private <bionic_time.h> and <resolv_iface.h> headers
and use a guard macro to avoid conflicts when both headers are included
at the same time.

The idea is that we're going to fix the other platform modules to
include these private headers. After this is done, we will remove the
duplicate definitions from <resolv.h> and <time.h>

Change-Id: I121c11936951c98ca7165e811126ed8a4a3a394d
esolv.h
ime.h
6519c8124ee9f2b1ed341cc683b78cf26809678d 04-Jan-2012 Bruce Beare <bruce.j.beare@intel.com> am e30e9093: sreadahead: adding readahead system call into bionic libc

* commit 'e30e909363c5c706f394050d9cd00ce222caadbf':
sreadahead: adding readahead system call into bionic libc
e30e909363c5c706f394050d9cd00ce222caadbf 13-Jul-2011 Bruce Beare <bruce.j.beare@intel.com> sreadahead: adding readahead system call into bionic libc

Add bionic libc to support readahead system call.
This is needed to enable sreadahead to work.

Change-Id: I3856e1a3833db82e6cf42fd34af7631bd40cc723
Author: Winson Yung <winson.w.yung@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
ys/linux-syscalls.h
ys/linux-unistd.h
85aad909560508410101c18c6ecc6633df39c596 15-Dec-2011 Ken Sumrall <ksumrall@android.com> Add the posix_memalign(3) function to bionic

The posix_memalign(3) function is very similar to the traditional
memalign(3) function, but with better error reporting and a guarantee
that the memory it allocates can be freed. In bionic, memalign(3)
allocated memory can be freed, so posix_memalign(3) is just a wrapper
around memalign(3).

Change-Id: I62ee908aa5ba6b887d8446a00d8298d080a6a299
tdlib.h
de44d0b2bd32a2c2cc5e2ffb64f8356efd893bca 22-Nov-2011 David 'Digit' Turner <digit@google.com> Merge "libc: provide atomic operations will full barriers for NDK apps."
95a17848d3a96000f90cdbfc7ff922182f0003b3 21-Nov-2011 Jeff Brown <jeffbrown@google.com> Merge "Add tgkill syscall."
10c8ce59a40a1d8ae8f49145eca365b364aabe58 19-Nov-2011 Jeff Brown <jeffbrown@google.com> Add tgkill syscall.

Use tgkill instead of tkill to implement pthread_kill.
This is safer in the event that the thread has already terminated
and its id has been reused by a different process.

Change-Id: Ied715e11d7eadeceead79f33db5e2b5722954ac9
ys/linux-syscalls.h
ys/linux-unistd.h
0fec6b9d88ee5a9e359b2208038f9806c0804538 16-Nov-2011 David 'Digit' Turner <digit@google.com> libc: provide atomic operations will full barriers for NDK apps.

__atomic_cmpxchg and other related atomic operations did not
provide memory barriers, which can be a problem for non-platform
code that links against them when it runs on multi-core devices.

This patch does two things to fix this:

- It modifies the existing implementation of the functions
that are exported by the C library to always provide
full memory barriers. We need to keep them exported by
the C library to prevent breaking existing application
machine code.

- It also modifies <sys/atomics.h> to only export
always-inlined versions of the functions, to ensure that
any application code compiled against the new header will
not rely on the platform version of the functions.

This ensure that said machine code will run properly on
all multi-core devices.

This is based on the GCC built-in sync primitives.

The end result should be only slightly slower than the
previous implementation.

Note that the platform code does not use these functions
at all. A previous patch completely removed their usage in
the pthread and libstdc++ code.

+ rename arch-arm/bionic/atomics_arm.S to futex_arm.S
+ rename arch-x86/bionic/atomics_x86.S to futex_x86.S
+ remove arch-x86/include/sys/atomics.h which already
provided inlined functions to the x86 platform.

Change-Id: I752a594475090cf37fa926bb38209c2175dda539
ys/atomics.h
9831ad3ce6bd5b22da16a275ed67e7236eae3d1f 29-Aug-2011 David 'Digit' Turner <digit@google.com> libc: speed-up flockfile()/funlockfile()

For Honeycomb, we added proper file thread-safety for
all FILE* operations. However, we did implement that by
using an out-of-band hash table to map FILE* pointers
to phtread_mutex_t mutexes, because we couldn't change
the size of 'struct _sFILE' without breaking the ABI.

It turns out that our BSD-derived code already has
some support code to extend FILE* objects, so use it
instead. See libc/stdio/fileext.h

This patch gets rid of the hash table, and put the
mutex directly into the sFILE extension.

Change-Id: If1c3fe0a0a89da49c568e9a7560b7827737ff4d0
thread.h
bda5da074eab4bdf374e1f4a19d480c62c72f5ff 28-Sep-2011 Mathias Agopian <mathias@google.com> fix prototype of dladdr

this breaks C++ source code in particular.

Change-Id: Ie06b5d31d23b5455e6950c470adc64dd5e7784df
lfcn.h
8f88cbedc1692def20298300a7df94ad1c536259 27-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> am e0a4b678: am cc32fbc3: Merge "Add support for a dns cache per interface"

* commit 'e0a4b67811981ab4c04c437b23c36ae42c444bce':
Add support for a dns cache per interface
e0a4b67811981ab4c04c437b23c36ae42c444bce 23-Jun-2011 Robert Greenwalt <rgreenwalt@google.com> am cc32fbc3: Merge "Add support for a dns cache per interface"

* commit 'cc32fbc3050079aa020ac39afb1c84b5e72737a8':
Add support for a dns cache per interface
a94dc678fb2003eaf26e97c79140223035836272 22-Jun-2011 Brian Carlstrom <bdc@google.com> Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master

Change-Id: I795687c11ca2e8443f7c8c264e209501dab9b2c9
23d3e6b21b4b6debff87da8c6558495e564cc38e 04-Apr-2011 Mattias Falk <mattias.falk@sonyericsson.com> Add support for a dns cache per interface

Initial commit for dns cache per interface.
Added a type that holds a reference to a
cache and name of associated interface,
address of interface, name server(s)
associated with an interface etc.

New functions to set default interface,
address of name servers etc.

Change-Id: Ie991bc5592fd998409853d8bf77d7fe69035dac5
esolv.h
09dc7fb1b893221776ef5d35d9aaecd07f95eceb 07-Jun-2011 Jean-Baptiste Queru <jbq@google.com> am b127b1f2: Merge "libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto."

* commit 'b127b1f208e67d74a7ee94ad2bd0ffb2fed3af6b':
libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto.
cfaf49ddea18b0fb56887627bd0f1832cb0eb1c9 07-Jun-2011 David 'Digit' Turner <digit@android.com> am 4aa32153: am 2cae7967: Merge "libc: Fix prctl() declaration."

* commit '4aa321538afde20a632ed666f83f40f892505550':
libc: Fix prctl() declaration.
4aa321538afde20a632ed666f83f40f892505550 06-Jun-2011 David 'Digit' Turner <digit@android.com> am 2cae7967: Merge "libc: Fix prctl() declaration."

* commit '2cae7967e6049e45eaef71207481b6f8b2456025':
libc: Fix prctl() declaration.
8a5123740750298433cce102f93cf5871985aa09 19-May-2011 JP Abgrall <jpa@google.com> libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto.

Make netinet/ip.h have IPTOS_MINCOST which matches what
kernel/common/linux/ip.h has to say.
Fixup gethostbyaddr() 1st arg to match what man has to say.

Change-Id: Iff9647d4a46ea88b1fc32163eb69bb9b27cdf370
etdb.h
etinet/ip.h
c18d76f6eca570e8e69b0c70d01d49e69d903b2c 20-Jan-2011 Steinar H. Gunderson <sesse@google.com> Add icmp6.h and ip6.h files from current NetBSD libc.

Change-Id: I6b304dfbefaec74c5fb15b216f38d698a55f0642
etinet/icmp6.h
etinet/ip6.h
b083bb57f5cae6b1fa3fd756a2720a3de806da2b 26-May-2011 David 'Digit' Turner <digit@android.com> libc: Fix prctl() declaration.

This change fixes the prctl() declaration to match GLibc, and allow us
to build gcc-4.6 for Android (among other things). Note that this does
not change the source and binary interfaces.

Change-Id: I3900c957f0da8b3548cbe9da8c41d50099dc19d6
ys/prctl.h
nistd.h
f8d02d24edd23dfb5028881105828cbf15e59310 19-May-2011 JP Abgrall <jpa@google.com> libc: enable IPTOS_MINCOST, fixup gethostbyaddr() proto.

Make netinet/ip.h have IPTOS_MINCOST which matches what
kernel/common/linux/ip.h has to say.
Fixup gethostbyaddr() 1st arg to match what man has to say.

Change-Id: Iff9647d4a46ea88b1fc32163eb69bb9b27cdf370
etdb.h
etinet/ip.h
bf018299bd556867ffcd573417c11f6c83f601cd 13-May-2011 Elliott Hughes <enh@google.com> Fix strerror(3) for errno 0.

Everyone else's C library says "Success". We say "Unknown error: 0", which
isn't really true.

Change-Id: I9f9054779123eda996634e5f7a277789b6805809
ys/_errdefs.h
c5d8d36d4d816b1e443cf4766cf39968c0806802 05-Apr-2011 JP Abgrall <jpa@google.com> add net/ethernet.h stub


Some externals tend to use net/ethernet.h. Most of which is in net/if_ether.h.

Change-Id: I465d18136b565e56a4bd6678238fe0afef25d913
et/ethernet.h
f5da2df1265fe14141c45a86fc706da657be7ab6 31-Mar-2011 David 'Digit' Turner <digit@android.com> am bfe04ea0: am 8c6b848e: am 0e47a919: Merge "libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++"

* commit 'bfe04ea0e61c6905c1f6781097bddf07f843eb25':
libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++
bfe04ea0e61c6905c1f6781097bddf07f843eb25 30-Mar-2011 David 'Digit' Turner <digit@android.com> am 8c6b848e: am 0e47a919: Merge "libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++"

* commit '8c6b848e435b86db58179763da30008ac7d4c24a':
libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++
01d14ab42967528dc77aa46f293f6a0c63ebc06c 25-Mar-2011 Ken Sumrall <ksumrall@android.com> am c913b28f: am b130f004: am ae2d5ba3: Add support for the utimensat(2) syscall to bionic.

* commit 'c913b28f20ffb147fca05fe9f8d582e0a915fa9c':
Add support for the utimensat(2) syscall to bionic.
b130f00493f6ae3b2343e1caac002de528a45e41 25-Mar-2011 Ken Sumrall <ksumrall@android.com> am ae2d5ba3: Add support for the utimensat(2) syscall to bionic.

* commit 'ae2d5ba31412c4f382ef405000baa866f35dd736':
Add support for the utimensat(2) syscall to bionic.
ae2d5ba31412c4f382ef405000baa866f35dd736 18-Mar-2011 Ken Sumrall <ksumrall@android.com> Add support for the utimensat(2) syscall to bionic.

The kernel has supported this syscall for quite some time now,
but bionic did not. Now that there is a need for it, let's
add it to bionic.

Change-Id: Ifcef3e46f1438d79435b600c4e6063857ab16903
ys/linux-syscalls.h
ys/linux-unistd.h
ys/stat.h
8eda21baa54977e4d164a4174d06b6aa12115fb1 17-Mar-2011 David 'Digit' Turner <digit@android.com> libc: <sys/cdefs.h>: Fix the use of __STDC_VERSION__ from C++

See http://code.google.com/p/android/issues/detail?id=14627 for context.

Change-Id: Idb10b675667d0d6e64dcb1d382be11e45aa6f4c4
ys/cdefs.h
f8e658cf6b9601e63d4b363ccee83ee4af1a78e4 22-Mar-2011 Dmitry Shmidt <dimitrysh@google.com> Merge "Return back EAI_ADDRFAMILY definition needed for libnl-2.0"
9a48b8e4196d23529e28f6965ad7a03d543922a2 21-Mar-2011 Dmitry Shmidt <dimitrysh@google.com> Return back EAI_ADDRFAMILY definition needed for libnl-2.0

Change-Id: I86e6ca8ad92da7a81ea4b659dd9fc9be2d6fd3c9
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
etdb.h
0b3c5c50f7bed92282783995bf6a7cc777fa9392 15-Mar-2011 satok <satok@google.com> do not merge. Move property setting from libcutils to bionic.

Backport I110b653a58f3

All the other property stuff is already here. Property setting was
only in libcutils previously to leverage a utility function / constant
or two.

Unfortunately in the process of fixing a race condition we would've
had to do break abstraction boundaries and put some libc-internal
details into libcutils so instead of that we'll just move this
into bionic.

Along with Iee1ca9b7, this now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

Bug: 3511230

Change-Id: I1b588db3344169621e1279ecc0b660cf4e1015d7
ys/system_properties.h
ec7e8cc9dddafc624cd28939c1a38ea336c89455 15-Mar-2011 satok <satok@google.com> do not merge. Move property setting from libcutils to bionic.

Backport I110b653a58f3

All the other property stuff is already here. Property setting was
only in libcutils previously to leverage a utility function / constant
or two.

Unfortunately in the process of fixing a race condition we would've
had to do break abstraction boundaries and put some libc-internal
details into libcutils so instead of that we'll just move this
into bionic.

Along with Iee1ca9b7, this now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

Bug: 3511230

Change-Id: I1b588db3344169621e1279ecc0b660cf4e1015d7
ys/system_properties.h
4399df8f2ebd797e45bec81e6f22e4911b2c5686 11-Mar-2011 Brad Fitzpatrick <bradfitz@android.com> Move property setting from libcutils to bionic.

All the other property stuff is already here. Property setting was
only in libcutils previously to leverage a utility function / constant
or two.

Unfortunately in the process of fixing a race condition we would've
had to do break abstraction boundaries and put some libc-internal
details into libcutils so instead of that we'll just move this
into bionic.

Along with Iee1ca9b7, this now passes:

$ adb shell am instrument -w -e class android.os.SystemPropertiesTest \
com.android.frameworks.coretests.systemproperties/android.test.InstrumentationTestRunner

Bug: 3511230
Change-Id: I110b653a58f312fbe069dca59892a877ae9bc911
ys/system_properties.h
8d1f2e6ffc7230e4000e5352e5798095a1f6d428 14-Mar-2011 David 'Digit' Turner <digit@android.com> am 638608b1: am da8ea213: Merge "libc: <stdint.h>: Don\'t make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined."

* commit '638608b11afbd255ddbd15e739f0f638791a4305':
libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined.
448a1b9f1827cbebad69383ba3f09cc0be5b4986 14-Mar-2011 David 'Digit' Turner <digit@android.com> am b299039d: am e6e2ba1d: Merge "libc: <pthread.h>: Replace \'#if __cplusplus\' by \'#ifdef __cplusplus\'"

* commit 'b299039d060eb5f523c05e4f9b6934a6b897a54f':
libc: <pthread.h>: Replace '#if __cplusplus' by '#ifdef __cplusplus'
3134b56bb077d9dce1a8d49ac805878baef33603 12-Mar-2011 David 'Digit' Turner <digit@android.com> am 0d6bbc7a: am dfe6eda5: Merge "libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition"

* commit '0d6bbc7af091ee05dd032492ae594c263404e4aa':
libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition
b868a32df691c5deee1ce2f40878419e3c49d1a3 12-Mar-2011 David 'Digit' Turner <digit@android.com> am 0b73dac8: am d6722bdd: Merge "libc: <stdint.h>: Proper C++"

* commit '0b73dac8aa9546c0f532c7ea5e0bf72dd029f271':
libc: <stdint.h>: Proper C++
da8ea213abb8bec08da37622179061630bd8e2f8 11-Mar-2011 David 'Digit' Turner <digit@android.com> Merge "libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined."
847b183f631ccbaa363a15c24195c00cad9529f9 11-Mar-2011 David 'Digit' Turner <digit@android.com> libc: <pthread.h>: Replace '#if __cplusplus' by '#ifdef __cplusplus'

See http://code.google.com/p/android/issues/detail?id=15221

Change-Id: Ia7b6668c28737810d6c4941604c6adf232a27c61
thread.h
8b3cea67326c1afb9b7815ae042819c0c3a1f144 11-Mar-2011 David 'Digit' Turner <digit@android.com> libc: <stdint.h>: Don't make __STD_CONSTANT_MACROS available if only __STD_LIMIT_MACROS is defined.

Change-Id: I8b0ea266eab9c6f75d8407b704953ecaef948221
tdint.h
0e5411b4ba15946bde04c7ee69b0c20129443b36 10-Mar-2011 David 'Digit' Turner <digit@android.com> libc: <stdint.h>: fix typo in INTMAX_C()/UINTMAX_C() definition

Change-Id: I3c74269901a288c448734dd7eb442a62b9348db8
tdint.h
08ff1a647484e67f23d1d8a0364b2e930dd2b9da 10-Mar-2011 David 'Digit' Turner <digit@android.com> libc: <stdint.h>: Proper C++

This patch prevents the definition of various macros when <stdint.h> is
included from C++. The ISO C99 standard mentions that when this header
is included from a C++ source file, limit and constant related macros
should only be defined when asked explicitely by defining
__STDC_LIMIT_MACROS and __STD_CONSTANT_MACROS, respectively.

The <stdint.h> lacked the proper #ifdef .. #endif blocks for the
following macros:

INTPTR_MIN, INTPTR_MAX, UINTPTR_MAX, PTRDIFF_MIN, PTRDIFF_MAX
INTMAX_MIN, INTMAX_MAX, UINTMAX_MAX,
INPTR_C, UINTPR_C, PTRDIFF_C, INTMAX_C, UINTMAX_C

This is intended to fix http://code.google.com/p/android/issues/detail?id=14380
after we copy this file to development/ndk/platforms/android-3/include/

Change-Id: Ia77e0822edfaaf568ea599d7de673b310eeeaa4a
tdint.h
81d79f9fb38d9ae8a5711f5774aa5a1516f6cc26 10-Mar-2011 David 'Digit' Turner <digit@android.com> am 962dcb22: am fed58049: Merge "libc: Fix PTHREAD_RWLOCK_INITIALIZER"

* commit '962dcb22218a1a6d4ebd05e4fc4a69875d037234':
libc: Fix PTHREAD_RWLOCK_INITIALIZER
Proxy getnameinfo through netd
Updated gcc 4.4.3 IA toolchain doesn't require the .ctors list
Convert cname lenght before use
ca4462d76c65ebfbc20328ee283ac2f19efca732 10-Mar-2011 David 'Digit' Turner <digit@android.com> libc: Fix PTHREAD_RWLOCK_INITIALIZER

The macro definition was incorrect and resulted in a compile error
when used.

Fixes http://code.google.com/p/android/issues/detail?id=15306

Change-Id: I8fa6047b63e7f56b53653774327099822c469cd1
thread.h
f582340a6a48588aa50da17e1620e8f91b146941 12-Feb-2011 Kenny Root <kroot@google.com> Fix the handle locking in stdio

Fix the handle locking in stdio to use flockfile/funlockfile
internally when and where required. Macros in <stdio.h> are updated
to automatically call the underlying functions when the process is
threaded to obtain the necessary locking. A private mutex is added
to protect __sglue, the internal list of FILE handles, and another
to protect the one-time initialization. Some routines in libc that
use getc() change to use getc_unlocked() as they're either protected
by their own lock or aren't thread-safe routines anyway.

Based on OpenBSD change by guenther@openbsd.org
http://www.mail-archive.com/source-changes@cvs.openbsd.org/msg01015.html

Bug: 3446659
Change-Id: Ie82116e358c541718d6709ec45ca6796be5a007b
tdio.h
62e1f374d1df0b98e8c8a1dd5a846aa955ae2c35 06-Feb-2011 David 'Digit' Turner <digit@google.com> Merge "libc: Update auto-gen scripts"
fc2693110ee8a2ba22a445ad9855fbe9e118d439 11-Oct-2010 David 'Digit' Turner <digit@google.com> libc: Update auto-gen scripts

Make the scripts use external/kernel-headers/original by default.

clean_header.py: Document -k<path>, add -d<path>
find_headers.py: Make kernel config files optional
update_all.py: Allow setting the path to kernel headers on the command-line
update_all.py: Better formatting of output on ttys
update_all.py: Automatically perform "git add/rm" on affected files.
SYSCALLS.TXT: Fix typo in __socketcall definition.
checksyscalls.py: Add support for superH architecture in the checks.
gensyscalls.py: Automatically perform "git add/rm" on affected files.
cpp.py: Fixed a bug that prevented certain type definitions to
be kept in the generated clean header (e.g.
struct ethtool_drvinfo in <linux/ethtool.h>)

All scripts will use the content of external/kernel-headers/original by default now.

The generated code removes all empty lines and trailing whitespace. This is useful
to ensure a unified output even if we change the parser again in the future.

The top-level disclaimer has been edited with update instructions to regenerate
the headers when needed.

Also, a warning is now inserted every 8th line in the final output:

/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */

Changes under kernel/arch-arm and kernel/arch-x86 should correspond to whitespace
differences and additionnal struct definitions that were missed by the previous
parser implementation.

Change-Id: Icd1c056bacd766759f3e9b7bb5d63a246f3d656a

WARNING: If you run these script, do not submit the result to gerrit for now.
It seems there are discrepancies between the content of original headers
and those currently commited under bionic/libc/kernel/.

(This problem is the main motivation to insert the warning repeatedly).

Current list of issues:

- Missing SuperH headers (i.e. external/kernel-headers/original/asm-sh)
ys/linux-syscalls.h
6846a45882f4e099f422d1455eab3a94d4c69795 20-Jan-2011 Steinar H. Gunderson <sesse@google.com> Add icmp6.h and ip6.h files from current NetBSD libc.

Change-Id: I6b304dfbefaec74c5fb15b216f38d698a55f0642
etinet/icmp6.h
etinet/ip6.h
bdca379412d5e19058115b9c5b4de2dc6f0c4099 20-Jan-2011 Steinar H. Gunderson <sesse@google.com> Include the Linux ipv6.h header from netinet/in.h, to get things like in6_pktinfo.

Change-Id: I4a3c2035ff8e2846352345580756a1bdc2768ec4
etinet/in.h
3de032169071cf6588edceefa686616cdf485320 20-Jan-2011 Steinar H. Gunderson <sesse@google.com> Add IN6ADDR_LOOPBACK_INIT macro to <netinet/in6.h>, as the kernel headers do not provide it anymore.

Change-Id: I5af12b3f38097ed165e64a408253dc375aa605d7
etinet/in6.h
64b6c43379dba176659bc1313b6bb488ac94cfd6 20-Dec-2010 Steinar H. Gunderson <sesse@google.com> Add a new #define IN6_IS_ADDR_ULA, for testing for Universal Local IPv6 Unicast addresses (ULAs). These replace the old site-local IPv6 addresses.

Change-Id: I2656423764569d07b92b8eb8fe6dcad6eba5b0bb
etinet/in6.h
5c8c00a95a6cdcd74ac32dadedf0cea2b1661169 20-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Fix the definition of SIGRTMAX

After this change, SIGRTMAX will be set to 64 (instead of 32 currently).
Note that this doesn't change the fact that our sigset_t is still defined
as a 32-bit unsigned integer, so most functions that deal with this type
won't support real-time signals though.

Change-Id: Ie1e2f97d646f1664f05a0ac9cac4a43278c3cfa8
ignal.h
d4a65d28d4dd7dab4ad66d2d65903296d183d47c 16-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Add missing declarations in <netinet/in.h>

Add missing declarations:
INET_ADDRSTRLEN
IN6_IS_ADDR_MC_NODELOCAL
IN6_IS_ADDR_MC_GLOBAL

It has been reported that these prevent compilation of the Boost libraries
with the NDK. The corresponding patch has already been performed under
development/ndk/platforms/android-3/include.

Change-Id: I4ac514973daf3c06a8ef5538d7df79142a98e562
etinet/in.h
etinet/in6.h
95d751feacdb58d3fbc36f3f21a895a3ec2f065b 16-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Add ftruncate64 and improve 64-bit parameter syscall handling.

This patch improves the handling of 64-bit parameters in syscalls on ARM.
The ARM EABI mandates that 64-bit quantities be passed in even/odd register
pairs, which requires special treatment.

This allows us to simplify our implementations of pread() and pwrite()
and remove the C stubs for pread64() and pwrite64().

Also add ftruncate64() to <unistd.h>

Change-Id: I407e2fd223ba0093dd2d0b04c6152fadfc9ce3ef

Bug 3107933
ys/linux-syscalls.h
ys/linux-unistd.h
nistd.h
72e6fd42421dca80fb2776a9185c186d4a04e5f7 03-Dec-2010 David 'Digit' Turner <digit@google.com> <sched.h>: Add sched_getcpu() and cpu_set_t

This adds the cpu_set_t type definition and related functions
and macros used to handle CPU thread affinity.

sched_getcpu()
sched_setaffinity()
sched_getaffinity()

Change-Id: If382ecafde8926341a88478062b275553645065b
ched.h
ys/linux-syscalls.h
ys/linux-unistd.h
6481b91520150e9664a3c4abc5d2aebdce422f93 06-Dec-2010 David 'Digit' Turner <digit@google.com> <time.h>: Add timegm(), timelocal() and others.

Add timegm(), timelocal(), time2posix() and posix2time() to the
C library.

Change-Id: I34d5771ed83dd994870a5ca58a511d01898b1ffb
ime.h
23d24394e72715ddf580726655c8ba3fbcf11bfe 06-Dec-2010 David 'Digit' Turner <digit@google.com> libc: Add <android/api-level.h>

Add a new header that defines __ANDROID_API__ as a constant integer
corresponding to the current native API level. This header is included
by <sys/cdefs.h>

Change-Id: Ib4774e247b395991266245815a24292afc919848
NOTE: This header is already provided by the NDK's platform headers.
for levels 3 to 9.
ndroid/api-level.h
ys/cdefs.h
9962cef7c6ba20bcb4d4f5e6a4c923aa335d9107 02-Dec-2010 Ed Heyl <edheyl@google.com> Merge "Add mkdtemp() prototype to stdlib.h."
ad1ff2fb268034074488f0b4b30b5311008b8617 30-Nov-2010 tedbo <tedbo@google.com> Add mkdtemp() prototype to stdlib.h.

The mkdtemp() function is implemented in libc/stdio/mktemp.c but not
exposed in stdlib.h. This change adds the prototype to stdlib.h.

Change-Id: I5a98650c665d2e45b2cf6ed3382742f7bdc7c88a
tdlib.h
16e02c2e3b005c2f801bf27fd4c27fbb235fb5be 29-Nov-2010 tedbo <tedbo@google.com> Add wcscasecmp() and wcsncasecmp() prototypes to wchar.h.

The above prototypes are missing from libc/include/wchar.h but
the functions are present (although with a limited implementation)
in libc.

Change-Id: I1b7c6accfc59ff0f56f3f41a9d3c075e935ac54a
char.h
72e64e08697cc2b3d66397c8b6d34965dd2a7338 24-Nov-2010 Kenny Root <kroot@google.com> Add support for pread64/pwrite64

64-bit pread() and pwrite() is needed for ZipFileRO to be able to read
ludicrously large ZIP files just in case someone is crazy enough to do
it.

Also fix a license header that was apparently mangled.

Change-Id: I6819ef8b36e46b63b40749c95717b1ecf9307033
nistd.h
8d8034eae023b38581158d3811d34d99f46bea40 15-Oct-2010 David 'Digit' Turner <digit@google.com> am 5c485373: am d3f0638a: libc: fix typo in waitid() declaration.

Merge commit '5c485373563c1183db2ba02ec2aca695d1c87cc8'

* commit '5c485373563c1183db2ba02ec2aca695d1c87cc8':
libc: fix typo in waitid() declaration.
5c485373563c1183db2ba02ec2aca695d1c87cc8 13-Oct-2010 David 'Digit' Turner <digit@google.com> am d3f0638a: libc: fix typo in waitid() declaration.

Merge commit 'd3f0638aeec0b1daf4d3347386a5e441d5a4bcc4' into gingerbread-plus-aosp

* commit 'd3f0638aeec0b1daf4d3347386a5e441d5a4bcc4':
libc: fix typo in waitid() declaration.
d3f0638aeec0b1daf4d3347386a5e441d5a4bcc4 13-Oct-2010 David 'Digit' Turner <digit@google.com> libc: fix typo in waitid() declaration.

The implementation file uses the correct spelling.

Change-Id: I572e336f8695a9754267c8d2e0a67b1b69bacb06
ys/wait.h
168f267723234d3921d6419f0ad36af7e7c965b3 12-Oct-2010 Jean-Baptiste Queru <jbq@google.com> am ff7d9453: am f67e5211: Merge "Hide the symbol of helper function __libc_android_abort"

Merge commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a'

* commit 'ff7d94530db60cf4fe4a4c287ee8821ebdf6263a':
Hide the symbol of helper function __libc_android_abort
364462ea2ee025043a6a2d951961a95c20867e45 12-Oct-2010 David 'Digit' Turner <digit@google.com> am 1aeeeae1: am b8d2233e: Merge "libc: tag missing functions in system headers." into gingerbread

Merge commit '1aeeeae166920f871c1e4ecd960bb92dcaef0896'

* commit '1aeeeae166920f871c1e4ecd960bb92dcaef0896':
libc: tag missing functions in system headers.
ff7d94530db60cf4fe4a4c287ee8821ebdf6263a 11-Oct-2010 Jean-Baptiste Queru <jbq@google.com> am f67e5211: Merge "Hide the symbol of helper function __libc_android_abort"

Merge commit 'f67e5211e045af1b12f646448a5a35f96ba5e8f1' into gingerbread-plus-aosp

* commit 'f67e5211e045af1b12f646448a5a35f96ba5e8f1':
Hide the symbol of helper function __libc_android_abort
f67e5211e045af1b12f646448a5a35f96ba5e8f1 11-Oct-2010 Jean-Baptiste Queru <jbq@google.com> Merge "Hide the symbol of helper function __libc_android_abort"
1aeeeae166920f871c1e4ecd960bb92dcaef0896 11-Oct-2010 David 'Digit' Turner <digit@google.com> am b8d2233e: Merge "libc: tag missing functions in system headers." into gingerbread

Merge commit 'b8d2233e8abc30f33be7d7acc7f3ef6e6aabebac' into gingerbread-plus-aosp

* commit 'b8d2233e8abc30f33be7d7acc7f3ef6e6aabebac':
libc: tag missing functions in system headers.
bb5581ad6eec40041dab4e961149f7a8a3a83497 09-Oct-2010 David 'Digit' Turner <digit@google.com> libc: tag missing functions in system headers.

This matches recent changes in the NDK header.
We enclose missing functions in #if 0 .. #endif blocks
with a clear "MISSING" in comments in order to locate
them later.

Change-Id: I87b3a62e777897e75c9243360fb0a82bcc53d9fb
etopt.h
ched.h
ignal.h
tdio.h
tdlib.h
ys/fsuid.h
ys/mount.h
nistd.h
319de1758cca4efcd18be773aba6c0b7e36dcbaf 28-Sep-2010 repo sync <digit@google.com> am 686af0b3: resolved conflicts for merge of defd1622 to gingerbread-plus-aosp

Merge commit '686af0b3a5978356be3b1a97187c765d63f11623'

* commit '686af0b3a5978356be3b1a97187c765d63f11623':
libc: add <sys/eventfd.h> and corresponding implementations.
2336503264b9a274d8c05e9d439000a7b1c42858 28-Sep-2010 David 'Digit' Turner <digit@google.com> am a511f245: am 9973a564: libc: Add missing waitid() implementation.

Merge commit 'a511f245614d8e6c7700df624e13a41a084ad7e4'

* commit 'a511f245614d8e6c7700df624e13a41a084ad7e4':
libc: Add missing waitid() implementation.
37c4305633f30eb7c6ced2233a73e66034643413 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 052fbd88: am a3ae60d3: libc: Add missing fdatasync() implementation

Merge commit '052fbd88080c88b7f568612dcac7579092c2e3d9'

* commit '052fbd88080c88b7f568612dcac7579092c2e3d9':
libc: Add missing fdatasync() implementation
1e95e58c9185a6eae5d0a520bbcc699d0eb88e12 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 5b5212b4: am 307aadb8: Merge "libc: Add missing C++ guards to <pathconf.h>" into gingerbread

Merge commit '5b5212b457f7308f9d7d4011c02af71ef1cad9c4'

* commit '5b5212b457f7308f9d7d4011c02af71ef1cad9c4':
libc: Add missing C++ guards to <pathconf.h>
49034875550d8c798edfa0d82b91dae1a995de05 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 5d335a1c: am 032a7135: Merge "libc: add missing O_CLOEXEC from <fcntl.h>" into gingerbread

Merge commit '5d335a1c6552f74e7da2c5f2d97f65eea8cb8c72'

* commit '5d335a1c6552f74e7da2c5f2d97f65eea8cb8c72':
libc: add missing O_CLOEXEC from <fcntl.h>
6f39e611f36738a9d3468357c3aac15b8227d13c 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 914528cd: am 223ddfcf: Merge "libc: Add missing pipe2() declaration and implementation." into gingerbread

Merge commit '914528cdc90dced0c07055d4d986e68adc8da60c'

* commit '914528cdc90dced0c07055d4d986e68adc8da60c':
libc: Add missing pipe2() declaration and implementation.
2172188923b3ae14d20ab8923d99c2ec153d5576 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 9aac3824: am bd8d987b: libc: remove C++ comments from public headers.

Merge commit '9aac38249b579282ae8eaa630de3deaf97c4edff'

* commit '9aac38249b579282ae8eaa630de3deaf97c4edff':
libc: remove C++ comments from public headers.
686af0b3a5978356be3b1a97187c765d63f11623 28-Sep-2010 repo sync <digit@google.com> resolved conflicts for merge of defd1622 to gingerbread-plus-aosp

Conflicts:
libc/arch-arm/syscalls/eventfd.S
libc/include/sys/eventfd.h
libc/include/sys/linux-syscalls.h

Change-Id: I02f6e9536aa5478322240c199ff4c2f4367922d0
a511f245614d8e6c7700df624e13a41a084ad7e4 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 9973a564: libc: Add missing waitid() implementation.

Merge commit '9973a564222b842eb7497fd6e659fe8c8c49e2b3' into gingerbread-plus-aosp

* commit '9973a564222b842eb7497fd6e659fe8c8c49e2b3':
libc: Add missing waitid() implementation.
defd162212de3789d2268a1f3339c2a6097fa825 26-Sep-2010 David 'Digit' Turner <digit@google.com> libc: add <sys/eventfd.h> and corresponding implementations.

Change-Id: Ide040884c456190226e580513099fdb8377e015b
ys/eventfd.h
ys/linux-syscalls.h
ys/linux-unistd.h
052fbd88080c88b7f568612dcac7579092c2e3d9 28-Sep-2010 David 'Digit' Turner <digit@google.com> am a3ae60d3: libc: Add missing fdatasync() implementation

Merge commit 'a3ae60d343661784e3f6f4566b276d8e6b8a06a7' into gingerbread-plus-aosp

* commit 'a3ae60d343661784e3f6f4566b276d8e6b8a06a7':
libc: Add missing fdatasync() implementation
9973a564222b842eb7497fd6e659fe8c8c49e2b3 27-Sep-2010 David 'Digit' Turner <digit@google.com> libc: Add missing waitid() implementation.

Change-Id: I312ee608dbf9249e4886a10d45d13e3cda8a9042
ys/linux-unistd.h
ys/wait.h
a3ae60d343661784e3f6f4566b276d8e6b8a06a7 27-Sep-2010 David 'Digit' Turner <digit@google.com> libc: Add missing fdatasync() implementation

Change-Id: I04bb655d77e414021e1f2a973329167ad76ca1c4
ys/linux-syscalls.h
ys/linux-unistd.h
5b5212b457f7308f9d7d4011c02af71ef1cad9c4 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 307aadb8: Merge "libc: Add missing C++ guards to <pathconf.h>" into gingerbread

Merge commit '307aadb8473744c3d946add8b3e4947ada5481aa' into gingerbread-plus-aosp

* commit '307aadb8473744c3d946add8b3e4947ada5481aa':
libc: Add missing C++ guards to <pathconf.h>
307aadb8473744c3d946add8b3e4947ada5481aa 28-Sep-2010 David 'Digit' Turner <digit@google.com> Merge "libc: Add missing C++ guards to <pathconf.h>" into gingerbread
5d335a1c6552f74e7da2c5f2d97f65eea8cb8c72 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 032a7135: Merge "libc: add missing O_CLOEXEC from <fcntl.h>" into gingerbread

Merge commit '032a713549c12b79b5dde6ef3dff323b7698110d' into gingerbread-plus-aosp

* commit '032a713549c12b79b5dde6ef3dff323b7698110d':
libc: add missing O_CLOEXEC from <fcntl.h>
914528cdc90dced0c07055d4d986e68adc8da60c 28-Sep-2010 David 'Digit' Turner <digit@google.com> am 223ddfcf: Merge "libc: Add missing pipe2() declaration and implementation." into gingerbread

Merge commit '223ddfcfc4cb354641e70da31a60556248db5036' into gingerbread-plus-aosp

* commit '223ddfcfc4cb354641e70da31a60556248db5036':
libc: Add missing pipe2() declaration and implementation.
9aac38249b579282ae8eaa630de3deaf97c4edff 28-Sep-2010 David 'Digit' Turner <digit@google.com> am bd8d987b: libc: remove C++ comments from public headers.

Merge commit 'bd8d987b3c3aa6d9d00cede2cb091f00bdb42204' into gingerbread-plus-aosp

* commit 'bd8d987b3c3aa6d9d00cede2cb091f00bdb42204':
libc: remove C++ comments from public headers.
032a713549c12b79b5dde6ef3dff323b7698110d 28-Sep-2010 David 'Digit' Turner <digit@google.com> Merge "libc: add missing O_CLOEXEC from <fcntl.h>" into gingerbread
223ddfcfc4cb354641e70da31a60556248db5036 28-Sep-2010 David 'Digit' Turner <digit@google.com> Merge "libc: Add missing pipe2() declaration and implementation." into gingerbread
d285151df65f94daa01086ab9134463692c4327e 27-Sep-2010 Elliott Hughes <enh@google.com> am 8120a8df: am 3cf53d1a: Fixes for the ARM-specific bswap_16, bswap_32, and bswap_64.

Merge commit '8120a8df848e6dec31ef5f00bc0b41ed95ce1310'

* commit '8120a8df848e6dec31ef5f00bc0b41ed95ce1310':
Fixes for the ARM-specific bswap_16, bswap_32, and bswap_64.
8120a8df848e6dec31ef5f00bc0b41ed95ce1310 27-Sep-2010 Elliott Hughes <enh@google.com> am 3cf53d1a: Fixes for the ARM-specific bswap_16, bswap_32, and bswap_64.

Merge commit '3cf53d1a7814e1520df09d24b009c16f4f27db0d' into gingerbread-plus-aosp

* commit '3cf53d1a7814e1520df09d24b009c16f4f27db0d':
Fixes for the ARM-specific bswap_16, bswap_32, and bswap_64.
bd8d987b3c3aa6d9d00cede2cb091f00bdb42204 26-Sep-2010 David 'Digit' Turner <digit@google.com> libc: remove C++ comments from public headers.

Change-Id: I4af84f912062cd2ff34711c25122fb323f20c032
thread.h
ys/file.h
ys/ioctl_compat.h
ys/ptrace.h
tmp.h
00eea3f8a07190dc6d2c4d0e927fed3e47502424 26-Sep-2010 David 'Digit' Turner <digit@google.com> libc: add missing O_CLOEXEC from <fcntl.h>

Change-Id: Ie7ad57898e67800a9fe92bb52589d67ec30e1cd9
cntl.h
275cd48511daabe4591caa49c3ad0df34a6889ff 27-Sep-2010 David 'Digit' Turner <digit@google.com> libc: Add missing pipe2() declaration and implementation.

Change-Id: Iacb914bd6ac5adc60c5671e6fef680ede21f9b0c
ys/linux-syscalls.h
ys/linux-unistd.h
nistd.h
f33a7700a5a893798e92ee67495281d2e24159fa 27-Sep-2010 David 'Digit' Turner <digit@google.com> libc: Add missing C++ guards to <pathconf.h>

Change-Id: I94dad48678181d8b02431b1c1f5d507beafb5406
athconf.h
9d16a79b18f43faebbe8155dbc14896e9b7d8a2e 27-Sep-2010 Jim Huang <jserv@0xlab.org> Hide the symbol of helper function __libc_android_abort

Ideally __libc_android_abort would be static, but it could not be
because gcc would not allow calling a static function from an asm
statement. Instead, using GCC visibility is work around.

Change-Id: Ifff6b9957ca3f0fc03c75c3e42582a48d43cefa2
ys/cdefs_elf.h
3cf53d1a7814e1520df09d24b009c16f4f27db0d 25-Sep-2010 Elliott Hughes <enh@google.com> Fixes for the ARM-specific bswap_16, bswap_32, and bswap_64.

1. Make the feature test work by excluding known-deficient processors, so
we don't have to maintain a complete list of all the processors that support
REV and REV16.

2. Don't abuse 'register' to get an effect similar to GCC's +l constraint,
but which was unnecessarily restrictive.

3. Fix __swap64md so _x isn't clobbered, breaking 64-bit swaps.

4. Make <byteswap.h> (which declars bswap_16 and friends) use <endian.h>
rather than <sys/endian.h>, so we get the machine-dependent implementations.

Change-Id: I6a38fad7a9fbe394aff141489617eb3883e1e944
yteswap.h
8f670c8e41092f861ac0396c25fad7cb52e86867 08-Sep-2010 Keith Deacon <kdeacon@ti.com> am d7b156d2: am 3a1bbee3: Add eventfd system call support

Merge commit 'd7b156d2a38e58ab1e5f9e6a4b420588aeb78b46'

* commit 'd7b156d2a38e58ab1e5f9e6a4b420588aeb78b46':
Add eventfd system call support
d7b156d2a38e58ab1e5f9e6a4b420588aeb78b46 08-Sep-2010 Keith Deacon <kdeacon@ti.com> am 3a1bbee3: Add eventfd system call support

Merge commit '3a1bbee36b773862e88c6f1895b607c0cd81b499' into gingerbread-plus-aosp

* commit '3a1bbee36b773862e88c6f1895b607c0cd81b499':
Add eventfd system call support
3a1bbee36b773862e88c6f1895b607c0cd81b499 31-Aug-2010 Keith Deacon <kdeacon@ti.com> Add eventfd system call support
ys/eventfd.h
ys/linux-syscalls.h
ys/linux-unistd.h
75a3689b6904a2b979730c797a8ffa30df30e7d4 25-Aug-2010 Szymon Jakubczak <szym@google.com> am 41e533af: added missing ether_aton and ether_ntoa

Merge commit '41e533af4a2720c1dc228ba40b6582ca53085c3a'

* commit '41e533af4a2720c1dc228ba40b6582ca53085c3a':
added missing ether_aton and ether_ntoa
41e533af4a2720c1dc228ba40b6582ca53085c3a 09-Jun-2010 Szymon Jakubczak <szym@google.com> added missing ether_aton and ether_ntoa

Change-Id: I32ee448abde4d5693d393030ed77ddc6d2ad1dfc
et/if_ether.h
076bc8f92dca689e7ee7db68046bbc2243f942d3 18-Aug-2010 Jean-Baptiste Queru <jbq@google.com> am 3871d57b: Revert "added missing ether_aton and ether_ntoa"

Merge commit '3871d57ba581236142c9bf2f8be2d34cce7c5829'

* commit '3871d57ba581236142c9bf2f8be2d34cce7c5829':
Revert "added missing ether_aton and ether_ntoa"
3871d57ba581236142c9bf2f8be2d34cce7c5829 18-Aug-2010 Jean-Baptiste Queru <jbq@google.com> Revert "added missing ether_aton and ether_ntoa"

This reverts commit 4032c1e2dfcc99613fe3e509a8153191e35aec12.
et/if_ether.h
2304a0bf86f224efdd67e38f34c97f35c5cf3c56 11-Aug-2010 Jeff Hamilton <jham@android.com> Fix pwrite to take a const void* instead of void* for the buffer.

Change-Id: I10b315946b8f8f7e34825410dfef37e0220edbee
ys/linux-unistd.h
nistd.h
63673645c4da1cf97938d5018d7d373837563174 06-Aug-2010 Dima Zavin <dima@android.com> libc: make lseek64 proto be glibc compatible (loff_t -> off64_t)

Change-Id: Ib79b99be9ca8d4b1f95ceeba416b6abc04187c3c
Signed-off-by: Dima Zavin <dima@android.com>
nistd.h
91af9e64b5d86dd5925c0fcfdb3f3db5a86aa43c 30-Jul-2010 Dima Zavin <dima@android.com> am 18c5bcc6: Revert "Set SA_RESTORER in sigaction()"

Merge commit '18c5bcc66a9a7b2178dcdcf04a0716958798ab81' into gingerbread-plus-aosp

* commit '18c5bcc66a9a7b2178dcdcf04a0716958798ab81':
Revert "Set SA_RESTORER in sigaction()"
18c5bcc66a9a7b2178dcdcf04a0716958798ab81 30-Jul-2010 Dima Zavin <dima@android.com> Revert "Set SA_RESTORER in sigaction()"

This reverts commit e4fa46e75cd0d433b5c6c064720ed7e195cba7c8.
ys/linux-syscalls.h
ys/linux-unistd.h
6d4d8cb79c5578d33ab17806d67b1e53a730fbc3 23-Jul-2010 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 4f086aeb to gingerbread-plus-aosp

Change-Id: Ice2a6d41a7e9d04eca02e15ed189d648d61b5801
4f086aeb4aa06e13079b7fec71a8178ceeacf318 25-Jun-2010 Matt Fischer <matt.fischer@garmin.com> Implemented pthread_atfork()

Change-Id: Ie6c0bf593315d3507b3c4a6c8903a74a1fa053db
thread.h
7ab9c068aac3373fe35a94b01a36d360c2bcb97f 09-Jul-2010 David 'Digit' Turner <digit@google.com> am ab8b5410: libc: fix fstatfs() implementation.

Merge commit 'ab8b54101eed0a4b92ebf8fa6994cd1b4f22d8f4' into gingerbread-plus-aosp

* commit 'ab8b54101eed0a4b92ebf8fa6994cd1b4f22d8f4':
libc: fix fstatfs() implementation.
ab8b54101eed0a4b92ebf8fa6994cd1b4f22d8f4 09-Jul-2010 David 'Digit' Turner <digit@google.com> libc: fix fstatfs() implementation.

The syscall expects the size of the buffer as the second argument.

Change-Id: I99ede2fec7fcd385ca03ff022c2cffa4297bea8d
ys/linux-unistd.h
cb0f5ed8111d4305cf6798aefdb4f9623570c83a 23-Jun-2010 David 'Digit' Turner <digit@google.com> am 50ace4fe: Remove compiler warnings when building Bionic.

Merge commit '50ace4fec5e8cb5afcbc656a4556fa528adfd760' into gingerbread-plus-aosp

* commit '50ace4fec5e8cb5afcbc656a4556fa528adfd760':
Remove compiler warnings when building Bionic.
50ace4fec5e8cb5afcbc656a4556fa528adfd760 17-Jun-2010 David 'Digit' Turner <digit@google.com> Remove compiler warnings when building Bionic.

Also add missing declarations to misc. functions.
Fix clearerr() implementation (previous was broken).
Handle feature test macros like _POSIX_C_SOURCE properly.

Change-Id: Icdc973a6b9d550a166fc2545f727ea837fe800c4
nttypes.h
imits.h
tdio.h
tdlib.h
ys/cdefs.h
ys/select.h
ys/types.h
char.h
f201ae83fc1742f34f9b0ff248c0c6c48a55f7a4 15-Jun-2010 David 'Digit' Turner <digit@google.com> am 6a09cfd9: Merge "wchar.h: improve wchar_t support in Bionic" into kraken

Merge commit '6a09cfd9f916e3a60de707ff0806cdeb143d77a4' into gingerbread-plus-aosp

* commit '6a09cfd9f916e3a60de707ff0806cdeb143d77a4':
wchar.h: improve wchar_t support in Bionic
3527fd6f0df794207215790321824b7844cc712d 15-Jun-2010 David 'Digit' Turner <digit@google.com> wchar.h: improve wchar_t support in Bionic

Change-Id: Iffd41046fd0933c66542abf7627a1569522dfcb2
ys/cdefs.h
char.h
49b53c0b948595ac34a52daca5fc6ef6af336b94 14-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from froyo-plus-aosp

Change-Id: Ibbde24d8ee26259f3eff076ee4d32476f868db85
04ed4a1c888309dc3af3fbeb0a32eb91b3733f23 14-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I63e2bfcf87d190fb063c5b2457ebe6b0d50ddd26
4032c1e2dfcc99613fe3e509a8153191e35aec12 09-Jun-2010 Szymon Jakubczak <szym@google.com> added missing ether_aton and ether_ntoa

Change-Id: I32ee448abde4d5693d393030ed77ddc6d2ad1dfc
et/if_ether.h
da3019b55305ce51b1b483d8727641e791ce0941 11-Jun-2010 David 'Digit' Turner <digit@google.com> libc: add missing truncate() declaration

Change-Id: Icb3601bbc9365b75b05ff443a39192f9cd3cbfb7
nistd.h
ecb6d4133477fef90c2fa23a40637d3c62681ee0 11-Jun-2010 David 'Digit' Turner <digit@google.com> libc: Add missing <termio.h> header

Change-Id: Id4e020ed330b3eabf09324f9b6d44d3a0f336d87
ermio.h
506b13d910a1a603b29fbc5a9ba41ba4c533b14c 21-May-2010 Jing Yu <jingyu@google.com> Remove a gcc-4.5 compilation warning:
bionic/libc/include/../include/stdlib.h: In function 'int grantpt(int)':
bionic/libc/include/../include/stdlib.h:138:23: warning: parameter '__fd' set but not used [-Wunused-but-set-parameter]

By adding __attribute((unused)) to __fd, the warning is gone, and this
attribute is compatible with gcc-4.4.0, gcc-4.3.1 gcc-4.2.1.
There is no any side effect.

Change-Id: I385f0f4da1013ffd1499e391eac9123aafe1f7a5
tdlib.h
aa4b1d042927872224e4bf5d22e4db5367e389fa 20-May-2010 David 'Digit' Turner <digit@google.com> Add missing sysinfo() implementation (already declared in <sys/sysinfo.h>) - DO NOT MERGE

Change-Id: Iac4eb5911ffe4a7ab72b84df44e907685ac816af
ys/linux-syscalls.h
ys/linux-unistd.h
a8a21488630980c1d2a2152d0ac39bd7978879e2 04-Jun-2010 Jean-Baptiste Queru <jbq@google.com> resolved conflicts for merge of 7b6e6fa5 to kraken

Change-Id: I2b9b80a7fa32c56be2b85ff8be0d6e7ac1848afe
7b6e6fa57240466c2728d553be136f800600dd71 03-Jun-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ib7fc9c6f79f9b13e2175da137005d8968ea85eaf
78c1c04ced772298be8bdb5a94b6ce491bb9b3e1 20-May-2010 André Goddard Rosa <andre.goddard@gmail.com> pthread: introduce pthread_setname_np() as a mean to give names to threads

... so that each cloned process at the kernel level can be named
independently. Tools like 'top' can display the CPU/memory statistics
for each process's thread if "Show Threads" mode is on.

With this function in place, we can convert dalvik/Thread.c setThreadName()
function over this function. This feature ought to be provided by the
underlying C library and not coded directly in Dalvik.

Change-Id: Ifa997665dbaa114e0b126f8c667708be9a4137fd
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
thread.h
nistd.h
8a1d2cf1422e35257c160ac5bb12dd3ee481c433 12-May-2010 David 'Digit' Turner <digit@google.com> Add pthread_rwlock_t implementation to the C library (DO NOT MERGE)

Change-Id: I756d8c26afc37cd7b71117ddbaa02a2cb40fdecb
thread.h
fdf2454db21284b5e1ec23cb18724388c85fd975 14-May-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I9c926a3cd680a96ece026cdec71c6e0fb0b7ad7c
1297428e89ead45849068989d334d8b7eae2f602 14-May-2010 David Turner <digit@android.com> Merge "Add declaration for sys_signame[] forgotten in change 12489"
4aef0ae660e81ca151a04ce0ddaf956275c70116 13-May-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I2be62bce462ee53fe9519f433523bd7a44a73d40
e4fa46e75cd0d433b5c6c064720ed7e195cba7c8 11-Jan-2010 Matt Fischer <matt.fischer@garmin.com> Set SA_RESTORER in sigaction()

GDB looks for specific opcode sequences when trying to recognize a stack
frame as a signal trampoline. The sequences it looks for happen to be those
created when SA_RESTORER is set, since glibc always sets a restorer. This
patch does the same here, so that the trampolines can be correctly identified.

Change-Id: I0ac574a68818cb24d939c3527f3aaeb04b853d04
ys/linux-syscalls.h
ys/linux-unistd.h
81569aa72c48caef1e74be31a5f799fc34a1cfc5 01-Dec-2009 Thorsten Glaser <tg@mirbsd.org> Add declaration for sys_signame[] forgotten in change 12489
ignal.h
377d4c979dee3dcb5929e8f7a68a53c2407259ab 22-Mar-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: I70266ee8c520b216773f267e46c8273d2334c31d
ee7b077abf1d99503b986489ad93374a057cb354 18-Mar-2010 David 'Digit' Turner <digit@google.com> Add pthread_condattr_init/destroy/setpshared/getpshared

Note that this does not change the implementation of conditional variables
which still use shared futexes, independent on the flags being selected.

This will be fixed in a later patch, once our system is modified to use
pthread_condattr_setpshared(attr, PTHREAD_PROCESS_SHARED) properly.

Change-Id: I935de50964cd41f97a13dbfd6626d3407b0406c3
thread.h
e2a8b1fd19fb3a8ead2ba28ddba27be19fa978b5 31-Dec-2009 Matt Fischer <matt.fischer@garmin.com> Added support for dladdr()

dladdr() is a GNU extension function, which allows the caller to retrieve
symbol information for a specified memory address. It is useful for things
like generating backtrace information at runtime.

Change-Id: I3a1def1a6c9c666d93e1e97b7d260dfa5b9b79a9
lfcn.h
8641833b62e3b319796dc80ea16eb1592c05edf6 11-Mar-2010 Fabrice Di Meglio <fdimeglio@google.com> Revert "bionic: pthread: use private futexes by default for mutexes and condvars"

This reverts commit ba9c6f0989ae94778ba2b9f597adc827c9dc81e8.
thread.h
ba9c6f0989ae94778ba2b9f597adc827c9dc81e8 11-Mar-2010 David 'Digit' Turner <digit@google.com> bionic: pthread: use private futexes by default for mutexes and condvars

Private futexes are a recent kernel addition: faster futexes that cannot be
shared between processes. This patch uses them by default, unless the PROCESS_SHARED
attribute flag is used when creating a mutex and/or conditional variable.

Also introduces pthread_condattr_init/destroy/setpshared/getpshared.

Change-Id: I3a0e2116f467072b046524cb5babc00e41057a53
thread.h
9f6915631b918a56e0e6be958fb14d274cbab322 02-Mar-2010 Mike Chan <mike@android.com> bonic: libc: cpuacct support for setuid functions

Any of the setuid functions now updates /acct/uid/ with its own tid
before changing users. This is so we can properly account for cpu time
per uid.

Change-Id: I34186cf4d5228cac8439e582a9e26c01ef3011e4
Signed-off-by: Mike Chan <mike@android.com>
ys/linux-unistd.h
eb9d5ed3477ef8cd9ccfa424ea585541ea3af84a 25-Feb-2010 Andrei Popescu <andreip@google.com> add sigaltstack syscall
ys/linux-syscalls.h
ys/linux-unistd.h
75c5e25ae3615c34f4bcc7dcbe9b29e548e26b9c 24-Feb-2010 San Mehat <san@google.com> bionic: syscalls: Add ioprio_set/ioprio_get syscall wrappers

Signed-off-by: San Mehat <san@google.com>
ys/linux-syscalls.h
ys/linux-unistd.h
2e1a03c16fae7bfd5f5e6955985bc46baf93ba84 12-Feb-2010 Nicolas Catania <niko@google.com> Changed __get_h_errno linkage to "C".

Bug:2441631
etdb.h
49f0a8f23bba188466c6ee3652858ef4da228c6f 09-Feb-2010 David 'Digit' Turner <digit@google.com> Fix <sys/epoll.h> and <sys/system_properties.h> to include proper C++ inclusion guards
ys/epoll.h
ys/system_properties.h
97cf7f3394780d524038fc083e2c134031b54728 23-Jan-2010 David 'Digit' Turner <digit@google.com> Implement clone() C library function properly.

Only provide an implementation for ARM at the moment, since
it requires specific assembly fragments (the standard syscall
stubs cannot be used because the child returns in a different
stack).
ched.h
ys/linux-unistd.h
fc10b24accd082fb33c8f92ff8b92481c22fe3dc 14-Jan-2010 Colin Cross <ccross@android.com> Add implementation of fdprintf, clearenv, and stubs for ttyname_r, *usershell

Change-Id: I5fe7e8b6ee5edbb49e707c3b6737a58563781fa3
tdio.h
nistd.h
8c59d96e243ba1a05d7d9ab7a14d1a00e20bad4a 14-Jan-2010 Colin Cross <ccross@android.com> Add killpg function

Change-Id: I9bc347d264fe38faf2d0f9935d2ebb43a353196e
ignal.h
64ceac3f493e3063a289aec4a12c74787be974e4 14-Jan-2010 Colin Cross <ccross@android.com> Add fts, err, and sys/queue for grep

Change-Id: Id47514a1812d828e95efa2fab0e9c15c5b682b58
rr.h
ts.h
ys/queue.h
c29731a491ae96b5cfe8835a7ec23900c773ca7e 14-Jan-2010 Colin Cross <ccross@android.com> mntent.h requires stdio.h

Change-Id: If69f64cf088dedb19602bf47627d03400abb9095
ntent.h
e9d08ba5236fb6524c7b65135ef133002027f050 14-Jan-2010 Colin Cross <ccross@android.com> Add definition of rlim_t

Change-Id: Ie8c2451360cbcce9fc1587528a95aca09a03d0de
ys/resource.h
2497f65fee7c132d1ddb1997dbfa07678c07c4f0 13-Jan-2010 Colin Cross <ccross@android.com> Import change from ctype.h revision 1.20 from openbsd

Fixes builds with gcc >= 4.3 with -std=gnu99

Change-Id: I8729b7f4237fd7a99a82b2fe60573a7afe66b435
type.h
d1cfc947f9b2f431cf416185ffdffb7e76303414 13-Jan-2010 Colin Cross <ccross@android.com> Import include/arpa/telnet.h from BSD

Change-Id: I684251bfb8ef04f0706866ea55dceebcd2a5b0e1
rpa/telnet.h
4fa7b105644222d9b35347c9d226ca8e011072eb 13-Jan-2010 Colin Cross <ccross@android.com> Import regex from OpenBSD

Change-Id: I7ad7d907ef65e4e345f94777d730813b1270a612
egex.h
6458c49c96fd2069a82fa6bb48283b4397087a25 12-Jan-2010 Colin Cross <ccross@android.com> Fix ptsname_r(3) return type to match glibc

The gHardy man pages specify the return type of ptsname_r to be char*, but the
return value to be 0 on success, negative on error and the gHardy stdlib.h
defines extern int ptsname_r(...).

Busybox telnetd fails to run successfully without this change.
tdlib.h
99d7907611725e23b6fad3ae7acff4926504e687 15-Dec-2009 Elliott Hughes <enh@google.com> Fix usleep(3) return type to be POSIX-compliant.

POSIX usleep(3) returns 0 on successful completion, -1 otherwise:
http://www.opengroup.org/onlinepubs/007908799/xsh/usleep.html

This was found by an external user porting native code:
http://groups.google.com/group/android-porting/browse_thread/thread/674848f001db0292
nistd.h
278d960aae1b2f0b8a3fa0c8056ba4aded96b133 04-Dec-2009 Mathias Agopian <mathias@google.com> am f197147a: am ca07064c: am 5f53a182: Revert "Add qsort_r() implementation to the C library."

Merge commit 'f197147a787d7415e6e0a1bad15566836c55befb'

* commit 'f197147a787d7415e6e0a1bad15566836c55befb':
Revert "Add qsort_r() implementation to the C library."
44358b9fed375e7f452b22380e100bc0b536fea2 04-Dec-2009 David 'Digit' Turner <digit@google.com> am be71c814: am 20b3097d: am 754c178a: Add qsort_r() implementation to the C library.

Merge commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e'

* commit 'be71c8142d4225dd9af4742ec050f30fcbc2aa5e':
Add qsort_r() implementation to the C library.
f197147a787d7415e6e0a1bad15566836c55befb 04-Dec-2009 Mathias Agopian <mathias@google.com> am ca07064c: am 5f53a182: Revert "Add qsort_r() implementation to the C library."

Merge commit 'ca07064c9ebd8523ed88fa09e97feaaafb7e9c15' into eclair-mr2-plus-aosp

* commit 'ca07064c9ebd8523ed88fa09e97feaaafb7e9c15':
Revert "Add qsort_r() implementation to the C library."
caa17a905a6f73eefbcd913e5c5cab4090f4820b 04-Dec-2009 Mathias Agopian <mathias@google.com> am 5f53a182: Revert "Add qsort_r() implementation to the C library."

Merge commit '5f53a18204ec991f5a77872806eeaa185936aa8c' into eclair-plus-aosp

* commit '5f53a18204ec991f5a77872806eeaa185936aa8c':
Revert "Add qsort_r() implementation to the C library."
ca07064c9ebd8523ed88fa09e97feaaafb7e9c15 04-Dec-2009 Mathias Agopian <mathias@google.com> am 5f53a182: Revert "Add qsort_r() implementation to the C library."

Merge commit '5f53a18204ec991f5a77872806eeaa185936aa8c' into eclair-mr2

* commit '5f53a18204ec991f5a77872806eeaa185936aa8c':
Revert "Add qsort_r() implementation to the C library."
be71c8142d4225dd9af4742ec050f30fcbc2aa5e 04-Dec-2009 David 'Digit' Turner <digit@google.com> am 20b3097d: am 754c178a: Add qsort_r() implementation to the C library.

Merge commit '20b3097d4cc225d948dac38e778a9d3b3b1549db' into eclair-mr2-plus-aosp

* commit '20b3097d4cc225d948dac38e778a9d3b3b1549db':
Add qsort_r() implementation to the C library.
5f53a18204ec991f5a77872806eeaa185936aa8c 04-Dec-2009 Mathias Agopian <mathias@google.com> Revert "Add qsort_r() implementation to the C library."

This reverts commit 754c178ae551aedcbbfd3bfd1c1c3b710d9ad989.

Turns out we don't need it afterall (needed a stable sort anyways).
So, we'll make that change in the dev branch instead.
tdlib.h
20b3097d4cc225d948dac38e778a9d3b3b1549db 04-Dec-2009 David 'Digit' Turner <digit@google.com> am 754c178a: Add qsort_r() implementation to the C library.

Merge commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989' into eclair-mr2

* commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989':
Add qsort_r() implementation to the C library.
f7ee5739faeff7e12bb25ae4350ce4a0d22f6d81 04-Dec-2009 David 'Digit' Turner <digit@google.com> am 754c178a: Add qsort_r() implementation to the C library.

Merge commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989' into eclair-plus-aosp

* commit '754c178ae551aedcbbfd3bfd1c1c3b710d9ad989':
Add qsort_r() implementation to the C library.
754c178ae551aedcbbfd3bfd1c1c3b710d9ad989 03-Dec-2009 David 'Digit' Turner <digit@google.com> Add qsort_r() implementation to the C library.

NOTE: This replaces qsort.c with the FreeBSD version. While
the patch changes the source, it should not alter the
implementation that should use the exact same algorithm.
tdlib.h
c1202510b67f200b668d85ac0190db2b179b0c4d 25-Nov-2009 Andy McFadden <fadden@android.com> Added a comment.

The structs for stdin/stdout/stderr are formed with a static initializer
that needs to be updated if something in FILE is changed.
tdio.h
25f8ea4d40879096a56ae6036543dfe41e701ca5 23-Nov-2009 Fred Fettinger <fred.fettinger@motorola.com> am 01a1f8b0: am b5239ed1: libc: allow usage of time64.h from cpp code

Merge commit '01a1f8b080d9d4e619ce00039f195f6fa3aa2045'

* commit '01a1f8b080d9d4e619ce00039f195f6fa3aa2045':
libc: allow usage of time64.h from cpp code
01a1f8b080d9d4e619ce00039f195f6fa3aa2045 23-Nov-2009 Fred Fettinger <fred.fettinger@motorola.com> am b5239ed1: libc: allow usage of time64.h from cpp code

Merge commit 'b5239ed16aeba648f1c9bcb7a4887b8a41670326' into eclair-mr2-plus-aosp

* commit 'b5239ed16aeba648f1c9bcb7a4887b8a41670326':
libc: allow usage of time64.h from cpp code
b5239ed16aeba648f1c9bcb7a4887b8a41670326 20-Nov-2009 Fred Fettinger <fred.fettinger@motorola.com> libc: allow usage of time64.h from cpp code

Wrapped declarations in time64.h with __BEGIN_DECLS/__END_DECLS so that
the prototypes are correctly identified as extern C.

Change-Id: I253453307831c929a6c7174b28b48bceef946fed
Signed-off-by: Fred Fettinger <fred.fettinger@motorola.com>
Signed-off-by: Mike Lockwood <lockwood@android.com>
ime64.h
03c643b493d0d6e4385fe5a33d33d2cb945493d2 10-Nov-2009 Dan Bornstein <danfuzz@android.com> Add stdlib functions mbstowcs() and wcstombs().

As with the other wchar functions in Bionic, these are really
minimally functional stubs.

Change-Id: I805bc5642e7bc22d9d730cfc18f9fb4a5f164416
char.h
b152dde4cafffb3b37ca60c589f71110ca988c79 09-Nov-2009 Jean-Baptiste Queru <jbq@google.com> am 83362689: merge from open-source master

Merge commit '83362689f5b1f6393d376d242fe29541b63ead2d'

* commit '83362689f5b1f6393d376d242fe29541b63ead2d':
added and modified linker to support SuperH architecture
Add the BSD sys_signame array.
added and modified bionic code to support SuperH architecture
83362689f5b1f6393d376d242fe29541b63ead2d 09-Nov-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
10be95cffc7f2b02d8baac55a9cf1b16d8afbadb 09-Nov-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
92b10af793da235659198cf38ff2e0237c181058 02-Oct-2009 Thorsten Glaser <tg@mirbsd.org> Add the BSD sys_signame array.

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
ys/_sigdefs.h
35af95026e01e69cfaf0cb369e918a6638e76be1 15-Oct-2009 Jean-Baptiste Queru <jbq@google.com> am 73981476: merge from open-source master

Merge commit '73981476a389847e8537cca37503c43e107fadc9'

* commit '73981476a389847e8537cca37503c43e107fadc9':
Fill l_ld of linkmaps with value from soinfo::dynamic.
modified kernel headers re-generate tools to support SuperH architecture
added syscalls for SuperH which automatically generate by gensyscalls.py
73981476a389847e8537cca37503c43e107fadc9 14-Oct-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
cf399f77b83b03cd83da784aa27ef1df71cca78d 05-Oct-2009 Elliott Hughes <enh@google.com> Add a GNU-compatible TEMP_FAILURE_RETRY.

I wondered about #ifndef, but the other macros in here don't use it.

I also wondered about __GNUC__, since this macro uses two GCC extensions.
nistd.h
9641805419d30e8bfa4624cf54f823b7a3a9e320 23-Sep-2009 David 'Digit' Turner <digit@google.com> am d154954f: Merge change 26419 into eclair

Merge commit 'd154954f02691618fdf73a5a97336e64cad37af0' into eclair-plus-aosp

* commit 'd154954f02691618fdf73a5a97336e64cad37af0':
Add pthread_mutex_lock_timeout_np
3f56b7f65adb9ee35cd0f878ca00b92011eec427 22-Sep-2009 David 'Digit' Turner <digit@google.com> Add pthread_mutex_lock_timeout_np

This is used to perform a mutex lock for a given amount of
milliseconds before giving up. Using the _np prefix since this
is absolutely not portable.

Also remove a compiler warning in pthread_attr_getstackaddr
thread.h
4e30c09e57a0351daff70f6657794569445be21c 21-Sep-2009 Android Code Review <code-review@android.com> Merge change 10538

* changes:
added syscalls for SuperH which automatically generate by gensyscalls.py
895244b2ab91b34ab03efc78417ee1eb73f3e7ba 17-Sep-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
c88110e284d6fcb5922c72f524dc3b4f24139580 08-Sep-2009 Martin Storsjo <martin@martin.st> Define 64 bit types if compiling with -std=c99

Compiling with -std=c99 defines __STRICT_ANSI__, but the 64 bit types
and type macros should still be defined in this case.

This helps compiling third party code that needs -std=c99 with the NDK.
tdint.h
842cdcd2f63992dcdbe30e90a29c6d5ba2169f0e 10-Sep-2009 Erik Gilling <konkers@android.com> am 9e74f697: libc: add void to clock() function prototype

Merge commit '9e74f697e0178a0e9b6133a2b270cc7fed9920bf' into eclair-plus-aosp

* commit '9e74f697e0178a0e9b6133a2b270cc7fed9920bf':
libc: add void to clock() function prototype
9e74f697e0178a0e9b6133a2b270cc7fed9920bf 09-Sep-2009 Erik Gilling <konkers@android.com> libc: add void to clock() function prototype

Signed-off-by: Erik Gilling <konkers@android.com>
ime.h
00fb8b45d9d3fdf3db0dfb93df9a94a89f94f68d 01-Sep-2009 Jean-Baptiste Queru <jbq@google.com> merge from open-source master
8f53951b054d5d8267f4550a4bc726e09e66fc2d 21-Aug-2009 Android Code Review <code-review@android.com> Merge change 10749

* changes:
Make sure size_t is defined before used in strings.h
70f1280ca9ccbf211da5514f01a77fad54e546a4 22-Jul-2009 Martin Storsjo <martin@martin.st> Make sure size_t is defined before used in strings.h

Otherwise, including strings.h as the first file in a C file yields errors.

This fixes issue 3332.
trings.h
a2f5e212448f36f0b35cf695d13bb4defdb4472e 14-Jul-2009 Mathias Agopian <mathias@google.com> added pthread_cond_timedwait_relative_np()
thread.h
336efb5267e465ac52d78327d37f79553b3f0584 01-Jul-2009 Tony Sim <sim.chinyeow@renesas.com> added syscalls for SuperH which automatically generate by gensyscalls.py
ys/linux-syscalls.h
ys/linux-unistd.h
fc90c51f72a669ec3be951cace1a013d3b43c9f8 22-Jun-2009 David 'Digit' Turner <digit@google.com> am 09baf4e8: Add Glibc-compatible macro aliases for the nanosecond time accessors in stat structure

Merge commit '09baf4e881c78e67c7849aa81432ceb34e72e913'

* commit '09baf4e881c78e67c7849aa81432ceb34e72e913':
Add Glibc-compatible macro aliases for the nanosecond time accessors in stat structure
09baf4e881c78e67c7849aa81432ceb34e72e913 22-Jun-2009 David 'Digit' Turner <digit@google.com> Add Glibc-compatible macro aliases for the nanosecond time accessors in stat structure
ys/stat.h
c52c174e412fa6c829cf6353ce8dbebdf710511f 12-Jun-2009 Lorenzo Colitti <lorenzo@google.com> Make IPv6 definitions comply with RFC 3493:
- Add some definitions to netinet/in6.h
- Include netinet/in6.h from netinet/in.h
rpa/inet.h
etinet/in.h
etinet/in6.h
a48fa7f4deb6ba703e1da55143771476d4e668ce 15-May-2009 Eric Fischer <enf@google.com> Add standalone_months field to libc strftime().

Replicate my change 722a5c0462f38827f4097065bfc3826b9e0e9fb4 into
bionic in an attempt to fix the build.
ime.h
edbe7fc97bab7ff0684053d1be564330689bf3ad 19-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import //branches/master/...@140412
ime.h
1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
lloca.h
rpa/inet.h
rpa/nameser.h
ssert.h
yteswap.h
type.h
irent.h
lfcn.h
lf.h
ndian.h
rr.h
rrno.h
cntl.h
eatures.h
nmatch.h
etopt.h
rp.h
nttypes.h
astlog.h
ibgen.h
imits.h
ocale.h
alloc.h
emory.h
ntent.h
et/ethertypes.h
et/if.h
et/if_arp.h
et/if_dl.h
et/if_ether.h
et/if_ieee1394.h
et/if_packet.h
et/if_types.h
et/route.h
etdb.h
etinet/ether.h
etinet/if_ether.h
etinet/in.h
etinet/in6.h
etinet/in_systm.h
etinet/ip.h
etinet/ip_icmp.h
etinet/tcp.h
etinet/udp.h
etpacket/packet.h
sswitch.h
athconf.h
aths.h
oll.h
thread.h
wd.h
esolv.h
ched.h
emaphore.h
etjmp.h
gtty.h
ha1.h
ignal.h
tdint.h
tdio.h
tdlib.h
tring.h
trings.h
ys/_errdefs.h
ys/_sigdefs.h
ys/_system_properties.h
ys/_types.h
ys/atomics.h
ys/cdefs.h
ys/cdefs_elf.h
ys/dirent.h
ys/endian.h
ys/epoll.h
ys/errno.h
ys/exec_elf.h
ys/file.h
ys/fsuid.h
ys/inotify.h
ys/ioctl.h
ys/ioctl_compat.h
ys/ipc.h
ys/klog.h
ys/limits.h
ys/linux-syscalls.h
ys/linux-unistd.h
ys/mman.h
ys/mount.h
ys/param.h
ys/poll.h
ys/prctl.h
ys/ptrace.h
ys/reboot.h
ys/resource.h
ys/select.h
ys/sendfile.h
ys/socket.h
ys/socketcalls.h
ys/stat.h
ys/statfs.h
ys/syscall.h
ys/sysconf.h
ys/sysinfo.h
ys/syslimits.h
ys/sysmacros.h
ys/system_properties.h
ys/time.h
ys/timeb.h
ys/times.h
ys/ttychars.h
ys/ttydev.h
ys/types.h
ys/uio.h
ys/un.h
ys/utime.h
ys/utsname.h
ys/vfs.h
ys/vt.h
ys/wait.h
yslog.h
ermios.h
ime.h
ime64.h
nistd.h
til.h
time.h
tmp.h
char.h
ctype.h
1767f908af327fa388b1c66883760ad851267013 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
lloca.h
rpa/inet.h
rpa/nameser.h
ssert.h
yteswap.h
type.h
irent.h
lfcn.h
lf.h
ndian.h
rr.h
rrno.h
cntl.h
eatures.h
nmatch.h
etopt.h
rp.h
nttypes.h
astlog.h
ibgen.h
imits.h
ocale.h
alloc.h
emory.h
ntent.h
et/ethertypes.h
et/if.h
et/if_arp.h
et/if_dl.h
et/if_ether.h
et/if_ieee1394.h
et/if_packet.h
et/if_types.h
et/route.h
etdb.h
etinet/ether.h
etinet/if_ether.h
etinet/in.h
etinet/in6.h
etinet/in_systm.h
etinet/ip.h
etinet/ip_icmp.h
etinet/tcp.h
etinet/udp.h
etpacket/packet.h
sswitch.h
athconf.h
aths.h
oll.h
thread.h
wd.h
esolv.h
ched.h
emaphore.h
etjmp.h
gtty.h
ha1.h
ignal.h
tdint.h
tdio.h
tdlib.h
tring.h
trings.h
ys/_errdefs.h
ys/_sigdefs.h
ys/_system_properties.h
ys/_types.h
ys/atomics.h
ys/cdefs.h
ys/cdefs_elf.h
ys/dirent.h
ys/endian.h
ys/epoll.h
ys/errno.h
ys/exec_elf.h
ys/file.h
ys/fsuid.h
ys/inotify.h
ys/ioctl.h
ys/ioctl_compat.h
ys/ipc.h
ys/klog.h
ys/limits.h
ys/linux-syscalls.h
ys/linux-unistd.h
ys/mman.h
ys/mount.h
ys/param.h
ys/poll.h
ys/prctl.h
ys/ptrace.h
ys/reboot.h
ys/resource.h
ys/select.h
ys/sendfile.h
ys/socket.h
ys/socketcalls.h
ys/stat.h
ys/statfs.h
ys/syscall.h
ys/sysconf.h
ys/sysinfo.h
ys/syslimits.h
ys/sysmacros.h
ys/system_properties.h
ys/time.h
ys/timeb.h
ys/times.h
ys/ttychars.h
ys/ttydev.h
ys/types.h
ys/uio.h
ys/un.h
ys/utime.h
ys/utsname.h
ys/vfs.h
ys/vt.h
ys/wait.h
yslog.h
ermios.h
ime.h
ime64.h
nistd.h
til.h
time.h
tmp.h
char.h
ctype.h
6f04a0f4c72acff80dad04828cb69ef67fa609d1 19-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132276
ys/linux-syscalls.h
ys/linux-unistd.h
ys/msg.h
ys/shm.h
9f65adf2ba3bb15feb8b7a7b3eef788df3fd270e 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
thread.h
tring.h
ys/stat.h
ys/time.h
ys/types.h
ime64.h
nistd.h
d37527501c85edcb3a6a7c8a0b6297d52d434897 20-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@127101
emaphore.h
e5cc1f386b167b9f7bfdebc7219e89aa9b71e4b2 16-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@126645
tdio.h
tdlib.h
ys/android/atomics.h
ys/android/tls.h
ys/stat.h
ys/tls.h
char.h
6d6c82c7a0a6b9a89f61b61c66f9b90d9c7177dc 10-Jan-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@125939
sc/assertions.h
sc/dst.h
sc/eventlib.h
sc/heap.h
sc/list.h
sc/memcluster.h
ocale.h
etdb.h
etjmp.h
tdlib.h
tring.h
ys/tls.h
char.h
4e468ed2eb86a2406e14f1eca82072ee501d05fd 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
irent.h
eatures.h
rp.h
et/if.h
etdb.h
etinet/in.h
etinet/in6.h
thread.h
ignal.h
tdint.h
tdio.h
tdlib.h
tl_pair.h
ys/_system_properties.h
ys/atomics.h
ys/linux-syscalls.h
ys/linux-unistd.h
ys/socket.h
ys/timeb.h
ermios.h
ime.h
nistd.h
tility
char.h
a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
lloca.h
rpa/inet.h
rpa/nameser.h
ssert.h
yteswap.h
type.h
irent.h
lfcn.h
lf.h
ndian.h
rr.h
rrno.h
cntl.h
nmatch.h
etopt.h
rp.h
nttypes.h
sc/assertions.h
sc/dst.h
sc/eventlib.h
sc/heap.h
sc/list.h
sc/memcluster.h
astlog.h
ibgen.h
imits.h
ocale.h
alloc.h
emory.h
ntent.h
et/ethertypes.h
et/if.h
et/if_arp.h
et/if_dl.h
et/if_ether.h
et/if_ieee1394.h
et/if_packet.h
et/if_types.h
et/route.h
etdb.h
etinet/ether.h
etinet/if_ether.h
etinet/in.h
etinet/in6.h
etinet/in_systm.h
etinet/ip.h
etinet/ip_icmp.h
etinet/tcp.h
etinet/udp.h
etpacket/packet.h
sswitch.h
athconf.h
aths.h
oll.h
thread.h
wd.h
esolv.h
ched.h
emaphore.h
etjmp.h
gtty.h
ha1.h
ignal.h
tdint.h
tdio.h
tdlib.h
tl_pair.h
tring.h
trings.h
ys/_errdefs.h
ys/_sigdefs.h
ys/_system_properties.h
ys/_types.h
ys/android/atomics.h
ys/android/tls.h
ys/atomics.h
ys/cdefs.h
ys/cdefs_elf.h
ys/dirent.h
ys/endian.h
ys/epoll.h
ys/errno.h
ys/exec_elf.h
ys/file.h
ys/fsuid.h
ys/inotify.h
ys/ioctl.h
ys/ioctl_compat.h
ys/ipc.h
ys/klog.h
ys/limits.h
ys/linux-syscalls.h
ys/linux-unistd.h
ys/mman.h
ys/mount.h
ys/msg.h
ys/param.h
ys/poll.h
ys/prctl.h
ys/ptrace.h
ys/reboot.h
ys/resource.h
ys/select.h
ys/sendfile.h
ys/shm.h
ys/socket.h
ys/socketcalls.h
ys/stat.h
ys/statfs.h
ys/syscall.h
ys/sysconf.h
ys/sysinfo.h
ys/syslimits.h
ys/sysmacros.h
ys/system_properties.h
ys/time.h
ys/times.h
ys/tls.h
ys/ttychars.h
ys/ttydev.h
ys/types.h
ys/uio.h
ys/un.h
ys/utime.h
ys/utsname.h
ys/vfs.h
ys/vt.h
ys/wait.h
yslog.h
ermios.h
ime.h
nistd.h
til.h
tility
time.h
tmp.h
char.h
ctype.h