Commit graph

81 commits

Author SHA1 Message Date
Dimitry Ivanov
b63ed1d2b9 Restore __system_property_find_nth version
Moving this to LIBC_DEPRECATED caused compatibility
problems for some apps.

Bug: http://b/36566667
Test: launch app and check that it does not crash
Change-Id: I470f916ef818ff62ff5391b3a0c86dd44c1e8cd0
(cherry picked from commit 2167e74f16)
2017-04-13 11:18:53 -07:00
Dimitry Ivanov
b876babd04 Move __system_property_*_serial back to LIBC
Bug: http://b/35764972
Bug: http://b/34114501
Test: make
Change-Id: Ibbda0107d07c432110a0633de03259e39480fde4
2017-02-24 16:11:14 -08:00
Dimitry Ivanov
41a3a6f3cf Hide internal __system_property_* functions
Bug: http://b/34114501
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I1fc57b4ced6aaf841aad64e12e7696d25c2e027b
2017-02-23 14:20:13 -08:00
Treehugger Robot
c54937b972 Merge "add fortified implementations of send/sendto" 2017-02-15 18:26:50 +00:00
Daniel Micay
95b59c520b add fortified implementations of send/sendto
Bug: None
Test: Bullhead builds+boots; CtsBionicTestCases passes.
Change-Id: I2f137a100f679f7f2145d84b2f29ddd3e96a36ae
2017-02-14 15:50:28 -08:00
Elliott Hughes
a0d374d587 Add __system_property_wait and return the serial in __system_property_read_callback.
In order to implement android::base::WaitForProperty well, we need a way to
wait not for *any* property to change (__system_property_wait_any), but to
specifically wait for the property represented by a given `prop_info` to
change.

The android::base::WaitForProperty implementation, like attempts to cache
system properties in the past, also needs a way to keep serials and values
in sync, but the existing functions don't provide a cheap way to get a
consistent snapshot. Change the __system_property_read_callback callback's
type to include the serial corresponding to the given value.

Add a test, slightly clean up some of the existing tests (and name them to
include the names of the functions they're testing, in our usual style).

Bug: http://b/35201172
Test: ran tests
Change-Id: Ibc8ebe2e88eef1e333a1bd3dd7f68135f1ba7fb5
2017-02-13 13:30:10 -08:00
Dimitry Ivanov
16b2a4de14 Revert "Revert "Remove limit of system property name length""
This reverts commit 489f58b5ea.
Bug: http://b/33926793
Bug: http://b/34670529
Test: Run bionic-unit-tests --gtest_filter=prop*

Change-Id: Id4e94652dc2310a21f5b7bd3af098bf79df3f380
2017-01-24 12:58:18 -08:00
Dimitry Ivanov
489f58b5ea Revert "Remove limit of system property name length"
This reverts commit 5c1ce278f3.
Bug: http://b/33926793
Bug: http://b/34670529

Change-Id: I0dc4a8ae55576c69b34b2958d8e664f7066b9c54
2017-01-24 18:39:04 +00:00
Dimitry Ivanov
5c1ce278f3 Remove limit of system property name length
This change introduces new __system_property_read_callback
method to use in place of deprecated __system_property_read
__system_property_set() and get() should just work but now
do not have limit on system property names.

Bug: http://b/33926793
Test: boot device, run adb shell propget
Test: boot device with old version of init (protocol v1)
Test: run bionic-unit-tests --gtest_filter=prop*
Change-Id: I619fb5a7e27a272aac30011579665f6160888bc7
2017-01-23 11:21:18 -08:00
Dimitry Ivanov
581b9f661b Hide __system_property_add/update, deprecate find_nth
These functions are supposed to be used only by the
property service.

__system_property_find_nth is deprecated and no longer part
of NDK. Call to this function will result in abort for apps
targeting Android O.

Bug: http://b/34114501
Test: bionic-unit-tests --gtest_filter=prop*
Change-Id: I9846965bf248e2ddf45cd7b293618245bbd87145
2017-01-10 13:41:27 -08:00
Elliott Hughes
fc8e688c32 Implement <langinfo.h>.
POSIX locale only, as usual.

The GNU YESSTR and NOSTR extensions return the empty string in the C locale,
so I haven't bothered supporting them.

Bug: http://b/1401872
Test: bionic tests
Change-Id: I6846839e4f9f1812344ed5dce0b93f83c0c20eb3
2016-11-19 11:46:54 -08: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
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
5ffed9b856 Move brillo closer to Android.
Hiding our legacy cruft seemed like a good idea, but in practice it will only
mean worse interoperability.

Plus we got it wrong, as the recent `putw` example showed.

Change-Id: I167c7168eff133889028089c22a7a0dfb8d6d0cf
2016-08-10 14:08:31 -07:00
Dan Albert
c8a95a3b15 Run genversion-scripts.py.
Change-Id: I01c4d9a85d3397b02b00b4d33fafe6d9ae692ed7
2016-08-04 15:39:21 -07:00
Dan Albert
37ba9052b0 Run genversion-scripts.py.
Change-Id: Iecc1b127c67a96aecc4e86582c1cc3291a4acf00
2016-08-02 15:33:53 -07:00
Elliott Hughes
20788aec00 Add ctermid.
Change-Id: I7c7c815c2725df222932db923632c8b6419741ab
2016-06-09 15:16:32 -07:00
Elliott Hughes
449eff02d2 Add futimes, futimesat, and lutimes.
Spotted these while cleaning up <sys/cdefs.h> --- if we remove __USE_XOPEN2K8,
libchrome decides you "must" have futimes. Adding the missing functions (all
just alternative interfaces to utimensat(2) system call) lets us clean up
without breaking anything.

Change-Id: If44fab08ee3de0e31066d650d128a3c96323529b
2016-06-08 19:51:20 -07:00
Dimitry Ivanov
71e783d8a4 Remove __brk
The symbol is unused and deprecated

Bug: http://b/29005114
Change-Id: I5e99c8b029514e8b2405a1eec23ac8941374a8a4
2016-06-03 08:33:51 -07:00
Elliott Hughes
7ba106c784 Fix <wctype.h>.
* Fix the return type of towlower_l/towupper_l.
* Implement wctrans/wctrans_l/towctrans/towctrans_l.
* Move declarations that POSIX says are available from both <wchar.h> and
  <wctype.h> to <bits/wctype.h> and include from both POSIX headers.
* Write the missing tests.

Change-Id: I3221da5f3d7e8a2fb0a7619dc724de45f7b55398
2016-04-28 18:22:06 -07:00
Elliott Hughes
6f6f9058fa Implement mblen(3).
Change-Id: I65948ea5b9ecd63f966ba767ad6db4a2effc4700
2016-04-28 16:41:29 -07:00
Dimitry Ivanov
54548d8cf9 Make malloc debug symbols platform-private
Bug: http://b/28432442
Change-Id: I96b9cb8b57726b4e8d53069e72666cf107cdeba2
2016-04-27 18:16:16 -07:00
Mark Salyzyn
722ab05b25 bionic: Implement getpwent and getgrent
Not efficient to iterate through given the large number of Android
ids (AID). Compile warning will result if you use these functions,
telling you as much. Not for general consumption, however for
example, some filesystem tests would like to see these to perform
all corners.

About 1/4 second for getpwent, and 1/8 second for getgrent to iterate
through all reserved Android aids.

Bug: 27999086
Change-Id: I7784273b7875c38e4954ae21d314f35e4bf8c2fc
2016-04-22 10:44:19 -07:00
Pierre Imai
97c9d73a87 Add new info functions to resolver for use by Netd.
android_net_res_stats_get_info_for_net returns the current name servers, search
domains, parameters and stats for the given network ID.

android_net_res_stats_aggregate provides statistics such as errors counts from
the raw stats data reported by android_net_res_stats_get_info_for_net.

android_net_res_stats_get_usable_servers uses the data returned by
android_net_res_stats_aggregate to determine which of the servers are
considered valid or broken by the resolver.

BUG: 25731675

Change-Id: I6059b68e5e8b809027a4d3135f6081588bee8a7d
2016-04-21 10:07:26 +09:00
Dimitry Ivanov
ab6c7defc1 Merge "Revert "Temporary move __udivdi3 back to LIBC for x86"" 2016-04-16 01:30:44 +00:00
Dimitry Ivanov
9f39326a74 Revert "Temporary move __udivdi3 back to LIBC for x86"
This reverts commit bc02fb964a.

Bug: http://b/26406724
Bug: http://b/26423217
Change-Id: I8e3186fc76502d6818753e5d76a7c145207ed9a3
2016-04-16 00:58:12 +00:00
Elliott Hughes
6cfb84b97e Add trivial no-op <nl_types.h>.
Needed to build OpenMP.

Bug: http://b/27617302
Change-Id: Iac15c84ead6f5d5274cfdb2d6d4a4ec0072244bb
2016-04-06 17:22:44 -07:00
Elliott Hughes
eafad49bd6 Add <sys/quota.h>.
It turns out that at least the Nexus 9 kernel is built without CONFIG_QUOTA.
If we decide we're going to mandate quota functionality, I'm happy for us to
be a part of CTS that ensures that happens, but I don't want to be first, so
there's not much to test here other than "will it compile?". The strace
output looks right though.

Bug: http://b/27948821
Bug: http://b/27952303
Change-Id: If667195eee849ed17c8fa9110f6b02907fc8fc04
2016-04-06 11:06:09 -07:00
Elliott Hughes
7f72ad4d6c Add sync_file_range to <fcntl.h>.
Bug: http://b/27952303
Change-Id: Idadfacd657ed415abc11684b9471e4e24c2fbf05
2016-04-05 12:17:22 -07:00
Elliott Hughes
c9291e1bb5 Merge "Add POSIX getsubopt(3)." 2016-04-05 18:03:56 +00:00
Elliott Hughes
df143f8576 Add POSIX getsubopt(3).
Bug: http://b/27952303
Change-Id: I8a816477545dadcbd5c055714e76263574446b6f
2016-04-04 17:34:04 -07:00
Greg Hackmann
5375bf6398 Add SysV signal handling
Implement the legacy SysV signal handling functions sighold(),
sigignore(), sigpause(), sigrelse(), and sigset() in terms of the newer
POSIX signal APIs.  As of POSIX 2013 the SysV signal APIs are deprecated
but still required.

Change-Id: I4ca40e3d706605a7d1a30dc76c78b2b24586387d
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-04-04 16:33:29 -07:00
Greg Hackmann
3679ade533 Add hasmntopt(3)
bionic has the Linux-specific mntent.h but is missing hasmntopt().

Change-Id: I0ab7b83626c969704add4e64b37a6fc715d4a723
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-03-25 14:16:58 -07:00
Greg Hackmann
e2faf07d65 Add {get,set}domainname(2)
{get,set}domainname aren't in POSIX but are widely-implemented
extensions.

The Linux kernel provides a setdomainname syscall but not a symmetric
getdomainname syscall, since it expects userspace to get the domain name
from uname(2).

Change-Id: I96726c242f4bb646c130b361688328b0b97269a0
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-03-25 14:16:58 -07:00
Elliott Hughes
63322aa555 Merge "Add pthread_getname_np." 2016-03-24 02:47:10 +00:00
Elliott Hughes
725b2a96a7 Add pthread_getname_np.
Also guard both these GNU extensions with _GNU_SOURCE.

Also improve the tests to test each case on both the current thread and
another thread, since the code paths are totally different.

Bug: http://b/27810459
Change-Id: I72b05bca5c5b6ca8ba4585b8edfb716a1c252f92
2016-03-23 17:40:25 -07:00
Greg Hackmann
e5c872ffb7 genversion-scripts: fix script name in autogenerated comment
Change-Id: I2a304818cfc54d08a08d2e621e4cf74e7ce465dd
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2016-03-23 16:25:42 -07:00
Colin Cross
2d4721c0c5 Export malloc_backtrace
Change-Id: Ic1adb4dfd86b9ca698443a36263a3df2c91edda3
2016-02-18 16:09:16 -08:00
Colin Cross
869691c6f7 Export malloc_iterate and friends
Export malloc_iterate, malloc_enable, and malloc_disable to be used by
libmemunreachable.

Change-Id: I08a50349af82a95d096b6b4cbac37ababe4b9b06
2016-02-18 15:05:38 -08:00
Elliott Hughes
0c485dae70 Add in6addr_any and in6addr_loopback symbols.
Change-Id: I3a90fa448b6bd43321672ba74b84a4e9e8a67738
2016-02-03 14:13:52 -08:00
Elliott Hughes
5f26c6bc91 Really add adjtimex(2), and add clock_adjtime(2) too.
Change-Id: I81fde2ec9fdf787bb19a784ad13df92d33a4f852
2016-02-03 13:19:10 -08:00
Elliott Hughes
f226ee59e0 Add fopen64/freopen64/tmpfile64 aliases.
Our fopen/freopen/tmpfile are already always O_LARGEFILE, but let's add
the aliases for _LARGEFILE_SOURCE compatibility.

Bug: http://b/24807045
Change-Id: I5d99b3ef3c9f27ce70f13313f6a92e96c7f21f80
2016-02-03 11:24:28 -08:00
Elliott Hughes
e4fa6e9cc7 Expose ftello64.
Also add the missing test that would have caught this.

Bug: http://b/24807045
Change-Id: I756a4d825595b52396b15898e3f717156fd1ba2f
2016-02-02 22:39:15 -08:00
Dimitry Ivanov
ffaa2169d7 Hide '__moddi3' symbol for x86 and mips
Bug: http://b/26805673
Change-Id: I7dc213e9f25510a2a74a30e8c43fd7a64cb3dbdb
2016-01-27 15:12:19 -08:00
Dimitry Ivanov
aa2fd0fece Hide '__isthreaded' for lp64 libc.so
Bug: http://b/26805673
Change-Id: I2928d68287894be9f9ae7ed1858af512d8c80a3b
2016-01-27 14:54:36 -08:00
Elliott Hughes
896224aa7f Merge "Implement funopen64." 2016-01-26 23:26:43 +00:00
Dimitry Ivanov
3a33b52981 Merge "Move android_ network functions to LIBC_PRIVATE" 2016-01-26 22:47:56 +00:00
Elliott Hughes
03e65eb03b Implement funopen64.
Bug: http://b/24807045
Change-Id: I161920978161389be34b707cc6ce8e05f760d552
2016-01-26 14:45:13 -08:00
Dimitry Ivanov
97cb4fbed2 Move android_ network functions to LIBC_PRIVATE
Make following functions platform-private:
 android_getaddrinfofornet
 android_getaddrinfofornetcontext
 android_gethostbyaddrfornet
 android_gethostbynamefornet

Bug: http://b/26794226
Change-Id: I0855b0b82721e4d24e918508931b4d5587fcae7d
2016-01-26 14:44:00 -08:00
Elliott Hughes
94bb0fab93 Merge "Support _FILE_OFFSET_BITS=64 for most of <stdio.h>." 2016-01-26 20:51:59 +00:00