Commit graph

808 commits

Author SHA1 Message Date
Elliott Hughes
69f05d291d 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
2014-06-05 23:19:15 -07:00
Dan Albert
0921204660 Revert "Remove ftime from bionic LP64"
Breaking some build... will look in to it later.

This reverts commit 26d6799bbe.

Change-Id: I35fa770221be3a181bd37c6c3dce1bf37a69a4a1
2014-06-05 00:50:43 +00:00
Dan Albert
26d6799bbe Remove ftime from bionic LP64
Bug: 13935372
Change-Id: I5dd31147143b23a090a3b75b846dc5354e599121
2014-06-04 16:25:24 -07:00
Dan Albert
001f8f041b Removes wcswcs from bionic for LP64.
Bug: 13935372
Change-Id: I0deb15e769da4fa81bb65a87f3c86db5163a5796
2014-06-04 12:01:56 -07:00
Dan Albert
452e091300 Merge "Adds functionality specified by uchar.h" 2014-06-04 16:10:50 +00:00
Dan Albert
7a7f9952c1 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
2014-06-04 08:39:24 -07:00
Dan Albert
ce9ce28e5d 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
2014-06-03 17:22:07 -07:00
Elliott Hughes
b4e099c6f7 Remove issetugid.
Bug: 14569474
Change-Id: I752c77ed53c724f144f0b618443eb95e87f2929a
2014-05-29 16:43:01 -07:00
Calin Juravle
bdca3802c9 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
2014-05-28 17:24:28 +01:00
Dan Albert
a7821b7121 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
2014-05-27 12:47:54 -07:00
Elliott Hughes
e6c57fcb05 Add C11 <stdatomic.h>.
Bug: 14903517
Change-Id: I631dbfdaa698cf7fea8e3b5e18a32586383e62a5
2014-05-23 20:06:03 -07:00
Elliott Hughes
c3f909630b Remove <sys/atomics.h>.
Bug: 14903517
Change-Id: I6de1d9d3624922517fdc37922097abbc3b41f661
2014-05-23 14:36:30 -07:00
Calin Juravle
92687e41bc 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
2014-05-23 00:22:58 +01:00
Calin Juravle
254fa8857f Merge "Switch to POSIX dprintf/vdprintf." 2014-05-22 13:28:52 +00:00
Elliott Hughes
fcac8ff97f Switch to POSIX dprintf/vdprintf.
Bug: 11156955
Change-Id: I734bd02db514367ab119a48304aae9767958e367
2014-05-22 11:27:06 +01:00
Calin Juravle
d1dc009c56 Merge "Add padding to mips ucontext_t." 2014-05-22 10:16:41 +00:00
Calin Juravle
156c7d3d0a Merge "Clean up ucontext.h TODOs." 2014-05-22 10:16:12 +00:00
Calin Juravle
172167163a Merge "Mutex-free implementation of pthread_rwlock" 2014-05-22 10:15:03 +00:00
Calin Juravle
76f352eec1 Mutex-free implementation of pthread_rwlock
Bug: 8133149
Change-Id: Id6775010d95f2634b173daa55d87a59a3cf4131b
2014-05-22 11:11:15 +01:00
Elliott Hughes
d5ed63a6a8 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
2014-05-21 18:30:00 -07:00
Calin Juravle
ae0f8f1e48 Add padding to mips ucontext_t.
Bug: 12828904
Change-Id: I49e7adcebf769a9c30dc43def36501260369b1ac
2014-05-21 18:16:17 +01:00
Calin Juravle
eb454522da 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
2014-05-21 18:15:35 +01:00
Dmitriy Ivanov
b648a8a57e 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
2014-05-20 12:02:24 -07:00
Calin Juravle
0e85fb6121 Add uc_regspace to arm's ucontext_t
Bug: 12828904
Bug: 12875898
Change-Id: Ic5d532bd0ef58cad9e36a99fc2995c4b069121b2
2014-05-19 19:14:03 +01:00
Calin Juravle
a6ab968ca0 Fill in missing bits in x86(_64) ucontext_t
Bug: 12828904
Bug: 12875898
Change-Id: I0ec0dfe16af80bfb3153f3c3b1b3d180eff30f39
2014-05-15 10:34:06 +01:00
Andrew Hsieh
9b5b40b4df Rename user_i387_struct -> user_fpregs_struct in sys/ucontext.h
See 93e1907ae1

Change-Id: Icb207f4e17cfffdd6d37500656434adf1cc34427
2014-05-15 09:11:11 +08:00
Christopher Ferris
ea5248ee1b Increase minimum thread size for 64 bit.
Bug: 14468519
Change-Id: I642a5515acf5fbed46e77e176f6b5dd3b7c7bd45
2014-05-14 18:02:11 -07:00
Ross McIlroy
bac795586b Merge "Fix x86_64 user_fpregs_struct to use the same name for the tag word as glibc." 2014-05-14 14:27:41 +00:00
Ross McIlroy
0c8a5f82e6 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
2014-05-14 13:29:19 +01:00
Calin Juravle
a731877406 Merge "Change wctype_t from int to long." 2014-05-14 10:33:46 +00:00
Calin Juravle
fd3171b465 Merge "Change wctype_t from enum to int" 2014-05-14 10:33:35 +00:00
Elliott Hughes
135b103fd9 Fix <sys/endian.h> uint32_t build failures.
Change-Id: I833b51318f0bf7749073859b7ffacc668c27558e
2014-05-13 18:42:12 -07:00
Elliott Hughes
17f8ef87b5 Merge "Flesh out <arpa/inet.h>." 2014-05-14 01:09:01 +00:00
Elliott Hughes
6a41b0fb0e 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
2014-05-13 18:08:29 -07:00
Elliott Hughes
eed3d0d1f3 We don't need two copies of <nsswitch.h>.
Change-Id: I3f874326d96f41249f5c9b1b3c2885f858589029
2014-05-13 18:05:29 -07:00
Elliott Hughes
eb664e24c0 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
2014-05-13 10:44:07 -07:00
Calin Juravle
f34f0ccb0e Merge "Use __LP64__ instead of __LP32__ in sched.h" 2014-05-13 17:16:30 +00:00
Calin Juravle
dd09699fae Use __LP64__ instead of __LP32__ in sched.h
Gcc defines only __LP64__ so testing __LP32__ will always be false.

Bug: 14881256
Change-Id: Ic63c1d562be09c3eb4b9e17c9e5ef2d9e404db80
2014-05-13 16:07:28 +01:00
Calin Juravle
b55f2631dc 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
2014-05-13 13:11:27 +01:00
Calin Juravle
0c472479a2 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
2014-05-13 12:47:27 +01:00
Calin Juravle
f963da22ec Undef private *_BODY defines after use
Bug: 14865741
Change-Id: I1398f7b3f64e3c94f2714cede5b61205dfa78a24
2014-05-13 11:01:11 +01:00
Calin Juravle
15a6310e4b Support mb sequences across calls to mb*to*wcs* functions
Bug: 13077905
Change-Id: I5abdc7cc3c27c109b7900c94b112f18a95c35763
2014-05-13 00:24:25 +01:00
Calin Juravle
d67c6af2f6 Merge "Reserve space for the future in statvfs(64)" 2014-05-12 09:59:57 +00:00
Calin Juravle
7bec1212c7 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
2014-05-12 10:56:39 +01:00
Calin Juravle
4d695bf560 Merge "Align struct passwd definition with other variations of libc" 2014-05-12 09:53:41 +00:00
Calin Juravle
c768874c66 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
2014-05-09 22:29:23 +01:00
Elliott Hughes
4aa2e6a32a 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
2014-05-07 12:57:51 -07:00
Calin Juravle
e292875cf5 Merge "Reserve some space in sem_t for the future." 2014-05-07 14:04:32 +00:00
Calin Juravle
b6c48b20e4 Merge "Allow for better utmp logging." 2014-05-07 14:04:22 +00:00
Calin Juravle
fc2af0ca47 Merge "Fix ino_t and suseconds_t" 2014-05-07 14:04:12 +00:00