Commit graph

1375 commits

Author SHA1 Message Date
Josh Gao
6cd9fb080c Fix warnings (and errors) in static inline headers.
Bug: http://b/31676510
Change-Id: Idcbc544e498f7e6bbe99c2bf7dc557a5681e96c4
Test: preupload hook
2016-09-23 14:34:03 -07:00
Dan Albert
6576a3749b Add legacy inlines for locale aware APIs.
Test: make checkbuild tests
Bug: http://b/31639993
Change-Id: Ic43d690dff3c6960d7826bd0b064640a3ea0e883
2016-09-22 00:44:37 -07:00
Dan Albert
3103f6d39e Add strtof_l and strtod_l.
libc++ needs these now. Add shims to match the others.

Test: make checkbuild tests
Bug: http://b/31639993
Change-Id: Ifec6c32099145d8d3d1a5639a4809e5e9f553c33
2016-09-22 00:44:37 -07:00
Nick Desaulniers
904460f749 Merge "bionic: tests: add test for fallocate FALLOC_FL_PUNCH_HOLE" 2016-09-21 22:30:31 +00:00
Elliott Hughes
53ad33b993 Merge "Remove remaining big-endian cruft." 2016-09-21 21:48:24 +00:00
Nick Desaulniers
09d900d50f bionic: tests: add test for fallocate FALLOC_FL_PUNCH_HOLE
Bug: 28760453
Change-Id: I1a58d19bf45eac5f930b0f649cf9b8c9046302f3
2016-09-21 09:24:50 -07:00
Dan Albert
f45d76a85b Match _Nonnull between char and wchar_t funcs.
The char versions of these functions have `_Nonnull` on these
parameters. Match it in the wide char versions. strxfrm_l also has
`__restrict` on its pointer arguments, I believe we've decided that's
something that shouldn't be proliferated...

Test: make checkbuild tests
Bug: None
Change-Id: Ie533e1af92b2a7c9df657073dbc4c345abf72473
2016-09-21 02:00:18 -07:00
Dan Albert
495ec92605 Add __ANDROID_API_FUTURE__.
Needed for checking conditions like `__ANDROID_API__ <
__ANDROID_API_FUTURE__` for providing inlines for things that have
not yet been included in any release.

Test: make checkbuild tests
Bug: None
Change-Id: Ibcddac5a538ede020a8cb65fca03194475121966
2016-09-21 01:08:44 -07:00
Elliott Hughes
497127711a Remove remaining big-endian cruft.
We'd removed most of it already, but a few bits and pieces were still lying
around.

Change-Id: I572a23eb15b9670d8d0f95586eca99ab0bdb4a1b
Test: mm.
2016-09-16 18:53:34 -07:00
Josh Gao
81b4aadb48 Fix BYTE_ORDER check in <netinet/ip6.h>.
Neither BYTE_ORDER nor BIG_ENDIAN were being defined anywhere, so they
were defaulting to zero, leading to BIG_ENDIAN values being used.

Bug: http://b/31496165
Change-Id: Ic6089895f39b86e7762bdb5b7d5b01feb0d2fd17
2016-09-15 14:21:28 -07:00
Josh Gao
cb728e6f63 Fix instances of '#if __i386__'.
Triggers -Wundef, which is on in -Weverything.

Bug: http://b/31496165
Change-Id: Ie2241b19abd6257bebf68baa3ecc4de8066c722e
2016-09-15 14:21:28 -07:00
Josh Gao
b36efa4343 Fix instances of '#if __LP64__'.
Triggers -Wundef, which is on in -Weverything.

Bug: http://b/31496165
Change-Id: Ib06107073f7dd1d584c19c222d0430da9d35630b
2016-09-15 14:21:28 -07:00
Dan Albert
a39f5d8b95 Make getpagesize inline static.
Needed to avoid multiple definition errors.

Test: make checkbuild tests
Bug: None
Change-Id: Ife83e89f5232e98d363e2b2edd7a353ed61c4836
2016-09-14 17:16:33 -07:00
Dan Albert
31d7037f2a Expose some more function decls.
Test: make checkbuild tests # for x86-eng this time
Bug: http://b/30465923
Change-Id: I98c5a8d09463e85ac22b05035c87edab04eaa200
2016-09-13 14:16:14 -07:00
Dan Albert
cb0b14385b Provide fake definitions for libstdc++.
libstdc++ needs to be able to `using ::foo` these in the various C++
wrapper headers for the C library. The NDK long ago added fake
definitions. We need to keep the same.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: Id513b72a59eafcc823080631e07b21290d5e3b24
2016-09-08 16:13:28 -07:00
Dan Albert
69b26542de Provide static inlines for in6addr things.
mdnsresponder needs these and is built against a very old API level
since it is used in gmscore. The legacy NDK headers defined these
inline.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: I92cd0116b3bde47e748ba648eaba94a7a3e3523e
2016-09-08 16:13:28 -07:00
Dan Albert
11f0e10c49 Provide an inline __cmsg_nxthdr.
This was defined as an inline in the legacy NDK headers. Keep that
here until we can get it into libandroid_support.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: I62393b58e4fba3bc7337cc5ecf4ae1590b0e9917
2016-09-08 16:13:28 -07:00
Dan Albert
2990404206 Correct more fortify availability guards.
Test: make checkbuild
Bug: http://b/30465923
Change-Id: I90ac222483ecd39f1e7cc358babfb64e305cffcb
2016-09-08 16:13:27 -07:00
Dan Albert
e5dd632e43 Move strncpy fortify into android-21.
__strncpy_chk2 wasn't added until android-21.

Test: make checkbuild
Bug: None
Change-Id: I527f88aca55ef5010e12ece18abbdce3d54ce252
2016-09-08 13:08:47 -07:00
Josh Gao
fff29fe17a versioner: add support for __VERSIONER_NO_GUARD.
Add an attribute that tells the preprocessor not to guard a
declaration, primarily for use with symbols that get reexported by
libc++ of the form `namespace std { using ::wctrans; }`.

Bug: http://b/28178111
Change-Id: I08c8751214797e37e8f26e7f7416a19e81c2bb4c
2016-09-07 18:34:39 -07:00
Christopher Ferris
106b3a8a7d Update to kernel headers v4.7.2.
Modify the kernel header update script to rename C++ keyword
struct members to something else. This fixes problems when including
these kernel files in C++ code.

Also, make a manual change to linux/fib_rules.h and comment out the
value FRA_PAD since it conflicts with a special android kernel value
FRA_UID_START that has not been upstreamed yet.

Test: Built aosp_angler, aosp_x86_64, aosp_mips (bionic only)
Test: Booted on angler and ran bionic unit tests
Test: Built these changes in internal master

Change-Id: Ia22b7e3ca409404696dba76311f49157f4a9ceed
2016-08-29 12:07:13 -07:00
Elliott Hughes
7d4e28a486 Merge "Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>." 2016-08-18 23:58:43 +00:00
Elliott Hughes
7c59f3f6f3 Flesh out <sys/msg.h>, <sys/sem.h>, <sys/shm.h>.
Also fix <sys/ipc.h>.

Not useful except to systems/bringup folks for testing. Trivial tests
added, and double-checked under strace to see that things look right.

x86 -- which works differently to everything else -- tested on the host.

Bug: http://b/27952303
Change-Id: I328534e994ae9e90755f545478fba03038c0bb94
2016-08-18 15:23:38 -07:00
Elliott Hughes
ecb7611538 Document that our getnameinfo(3) prototype is unfixably wrong.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getnameinfo.html

We could fix it for LP32, but that's probably just more confusing and
inconvenient.

Change-Id: Ic37c60fe3665a309cc35c89961712b484dbdaa4c
2016-08-16 15:05:57 -07:00
Treehugger Robot
fe4ab7dc30 Merge "Add missing <sys/stat.h> macros." 2016-08-16 21:59:16 +00:00
Treehugger Robot
c8476bb7ad Merge "Fix various <sys/socket.h> prototypes." 2016-08-16 21:57:31 +00:00
Elliott Hughes
2b9605fec4 Fix various <sys/socket.h> prototypes.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html

Interestingly, recvmmsg/sendmmsg do actually return int, unlike their
recv/recvmsg/sendv/sendvmsg siblings.

The generated assembler stubs don't actually change.

Change-Id: If71cd02431903774de9bbce77fbedf6b03f90c0f
2016-08-16 13:37:24 -07:00
Elliott Hughes
9288761a26 Add missing <sys/stat.h> macros.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_stat.h.html

Change-Id: I8c31f3a6fae2c4955c5fba3d880a416d03dfafb7
2016-08-16 13:26:35 -07:00
Elliott Hughes
9dff0d05b5 mprotect and msync take void*, not const void*.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/mprotect.html
http://pubs.opengroup.org/onlinepubs/9699919799/functions/msync.html

Change-Id: Ie26195e2e382c1387037c7ee5cd90b3963220328
2016-08-16 13:25:13 -07:00
Treehugger Robot
e73fc63f96 Merge "Move some POSIX math functions out of _USE_GNU/_USE_BSD." 2016-08-13 00:43:54 +00:00
Elliott Hughes
c1929e4452 Move some POSIX math functions out of _USE_GNU/_USE_BSD.
The signgam global and the j0/j1/jn and y0/y1/yn functions are POSIX.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/math.h.html

Change-Id: I802997a2060a011a777c2b641f28c1d58dfe49ed
2016-08-12 16:25:40 -07:00
Treehugger Robot
9519fc08b7 Merge changes I9b662ca9,Iad7f3fc9,I1b16a4b5,I47b07755,I6496a8c4, ...
* changes:
  versioner: add support for preprocessing headers.
  versioner: fix makefiles.
  versioner: purge iostreams.
  versioner: assorted fixes.
  versioner: replace availability attributes with annotate.
  versioner: improve the test script.
2016-08-12 23:14:19 +00:00
Elliott Hughes
280236537e POSIX says <sys/types.h> should make all the pthread_* types available.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html

Change-Id: I606194e15ceaa3129f266a9a460c358eaa8bf686
2016-08-12 13:18:32 -07:00
Treehugger Robot
cea5c8a609 Merge "POSIX says <locale.h> makes NULL visible." 2016-08-12 19:56:46 +00:00
Treehugger Robot
4a77fa3dcd Merge "Fix recvfrom prototype." 2016-08-12 19:48:38 +00:00
Treehugger Robot
f8f2949744 Merge "Fix pthread_barrierattr_getpshared prototype." 2016-08-12 19:13:37 +00:00
Treehugger Robot
a1858a7f59 Merge "POSIX says IPPORT_RESERVED is in <netdb.h>." 2016-08-12 18:52:58 +00:00
Treehugger Robot
5b45d2fec8 Merge "POSIX says SEM_FAILED shall have type sem_t*." 2016-08-12 18:42:44 +00:00
Treehugger Robot
f135e4e56b Merge "POSIX says <fcntl.h> makes SEEK_* visible." 2016-08-12 18:35:17 +00:00
Elliott Hughes
e43778880e POSIX says IPPORT_RESERVED is in <netdb.h>.
In <netdb.h>:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netdb.h.html

Not in <netinet/in.h>:

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html

Change-Id: Ie34cdb80eeb1443cf292944f3c68d8383aee2295
2016-08-12 10:38:35 -07:00
Elliott Hughes
95b0680cde POSIX says SEM_FAILED shall have type sem_t*.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/semaphore.h.html

(Even if it didn't, this header previously referred to NULL without ensuring
that NULL was actually visible.)

Change-Id: I70577f4afc21f32c9e585076986127899ef8c8c1
2016-08-12 10:28:52 -07:00
Elliott Hughes
c5537889f5 POSIX says <locale.h> makes NULL visible.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/locale.h.html

Change-Id: I81a600153738dff6ce3d9cde95c787b71d81a368
2016-08-12 10:28:08 -07:00
Elliott Hughes
fd936ae025 POSIX says <fcntl.h> makes SEEK_* visible.
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html

We already had two copies of these constants, so time to factor them out
into bits/.

Change-Id: I213c0d2372e41463593f878d338002b8eaa918cd
2016-08-12 10:16:34 -07:00
Elliott Hughes
48bfc6e0df Add two missing POSIX constant-only headers.
Change-Id: Ic175635a0edc16f9354445adeb7b90837d3e858b
2016-08-12 09:28:17 -07:00
Elliott Hughes
8197aca7f2 Fix recvfrom prototype.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/recvfrom.html

Change-Id: Iba203c74045c88e53e28c2e0c8bc1f9ac63ce23e
2016-08-12 09:20:07 -07:00
Elliott Hughes
02ac028bf7 Fix pthread_barrierattr_getpshared prototype.
As http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_barrierattr_getpshared.html
is my witness, there's a missing `const` here.

Change-Id: Ifd68188fb952460b64d144bdc21a53bc40ed82a7
2016-08-11 23:18:13 -07:00
Treehugger Robot
166f875eab Merge "dlerror returns char*, not const char*." 2016-08-11 23:16:59 +00:00
Elliott Hughes
5e071a18ce dlerror returns char*, not const char*.
http://pubs.opengroup.org/onlinepubs/9699919799/functions/dlerror.html:

    char *dlerror(void);
    ...
    The application shall not modify the string returned.

Change-Id: I5e684bfd3930c39a2a30ea6fd005a5d5d3e5b181
2016-08-11 15:02:45 -07:00
Treehugger Robot
32a2e137a5 Merge "Add __attribute__((sentinel)) tags to execl and friends." 2016-08-11 01:19:23 +00:00
Josh Gao
d80a52eb65 Add __attribute__((sentinel)) tags to execl and friends.
Give a compile time diagnostic when the nullptr sentinel is missing
from an execl family call, instead of just pulling arbitrary values.

Bug: http://b/30793878
Change-Id: I1c49005c58b7ad4a5b04f0435b722d4c744e8f0e
Test: Built bullhead
2016-08-10 15:26:41 -07:00