Commit graph

43 commits

Author SHA1 Message Date
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
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
Elliott Hughes
5704c423c8 Implement POSIX lockf.
This has been requested a few times over the years. This is basically
a very late rebase of https://android-review.googlesource.com/45470
which was abandoned years ago. One addition is that this version has
_FILE_OFFSET_BITS=64 support.

POSIX puts this in <unistd.h>. glibc also has it in <fcntl.h>.

Bug: http://b/13077650
Change-Id: I5862b1dc326e326c01ad92438ecc1578d19ba739
2016-01-26 11:09:44 -08:00
Elliott Hughes
9677fab88c Support _FILE_OFFSET_BITS=64 for most of <stdio.h>.
This doesn't address funopen, but does add fgetpos/fsetpos/fseeko/ftello.

Bug: http://b/24807045
Change-Id: Ibff6f00df5fb699c8e8f13b91a75caf024540b73
2016-01-26 09:14:41 -08:00
Elliott Hughes
ed57b98758 Implement if_nameindex(3)/if_freenameindex(3).
This is just a subset of the recently-implemented getifaddrs(3), though if
we want to handle interfaces (such as "rmnet_*") that don't have an address,
we need to either expose ifaddrs_storage and keep track of which interfaces
we've already seen (which is pretty messy), or refactor the netlink code so
we can reuse it and just extract the information we need for if_nameindex(3).
This patch goes the latter route.

Also clean up if_nametoindex(3) and if_indextoname(3).

Change-Id: I5ffc5df0bab62286cdda2e7af06f032c767119a8
2016-01-18 12:07:38 -08:00
Dimitry Ivanov
126d5ab779 Merge "Revert "Move __system_property* to LIBC_PRIVATE for lp64 libc"" 2016-01-13 20:35:25 +00:00
Dimitry Ivanov
e1078a939a Revert "Move __system_property* to LIBC_PRIVATE for lp64 libc"
This reverts commit ff14fb5a1f.

Bug: http://b/26497521
Change-Id: Id7131b37a31e936db0e72ef9969e1f13d2dd578f
2016-01-13 20:32:12 +00:00
Elliott Hughes
76dfa6e351 Remove mktime_tz.
Bug: http://b/15765976
Change-Id: Ifc8cd19ae621e611d66173ae927ef9a0445965c1
2016-01-06 09:15:02 -08:00
Dimitry Ivanov
04673ee997 Merge changes I4fc241e6,Idca71396
* changes:
  Move __system_property* to LIBC_PRIVATE for lp64 libc
  Move ndk-cruft symbols to LIBC_PRIVATE
2016-01-04 22:52:21 +00:00
Dimitry Ivanov
ff14fb5a1f Move __system_property* to LIBC_PRIVATE for lp64 libc
Bug: http://b/26367254
Change-Id: I4fc241e69444a4b5641dfdf09576fe3ce5c1169e
2016-01-04 14:39:42 -08:00
Elliott Hughes
9cddb482b4 Revert "Revert "Implement getifaddrs(3)/freeifaddrs(3).""
This reverts commit 76814a8250.

This differs from the original in fixing the GCC -Werror build:

  bionic/libc/bionic/ifaddrs.cpp: In function 'void __handle_netlink_response(ifaddrs**, nlmsghdr*)':
  bionic/libc/bionic/ifaddrs.cpp:113:62: error: use of old-style cast [-Werror=old-style-cast]
       ifinfomsg* ifi = reinterpret_cast<ifinfomsg*>(NLMSG_DATA(hdr));

This appears to be a GCC bug; the GCC command-line correctly uses -isystem,
and manually adding #pragma GCC system_header doesn't help. So just turn the
warning off for GCC for now. We won't need to worry about building with GCC
soon anyway.

Bug: http://b/26238832
Change-Id: I01615bd335edf11baf487b1c83a9157cd780f4a1
2016-01-04 13:00:39 -08:00
Dimitry Ivanov
788a2bc756 Make some of unwanted symbols LIBC_PRIVATE
Bug: http://b/26274444
Change-Id: Ic66f6519a974b72779071235c1d0dd36655fd1b9
2015-12-21 23:26:53 -08:00
Dimitry Ivanov
bc2e88a85d Revert "Revert "Remove remaining ndk_cruft from LP64 platforms""
This reverts commit 23af25b747.

Bug: http://b/26164862
Change-Id: I201bf49530f33f8ba6a1a35b79723afb9e84c7a5
2015-12-16 19:02:04 +00:00
Dimitry Ivanov
23af25b747 Revert "Remove remaining ndk_cruft from LP64 platforms"
This reverts commit b1d0a2ae77.

Change-Id: I1da06be0b78a4f2a4cad7e4a19a3ee755f55a813
2015-12-15 01:34:14 +00:00
Dimitry Ivanov
b1d0a2ae77 Remove remaining ndk_cruft from LP64 platforms
This change removes endpwent, dlmalloc_inspect_all, dlmalloc_trim
from lp64 libc.so. It also removed necessety of having brillo
version scripts for lp64 platforms.

Bug: http://b/26164862
Change-Id: I4e9b38907bb1dc410f0eb6d2f5d5944fe713da51
2015-12-14 15:49:28 -08:00
Dimitry Ivanov
585e959849 Generate libc version-script for brillo
Brillo doesn't use the ndk cruft, so we need
separate set of version scripts. Added new "nobrillo"
tag to mark such symbols in *.map.txt files.

Bug: http://b/26164862
Change-Id: Iaee1b7119f75b68c2971679fc32817e6df29fd94
2015-12-14 14:23:06 -08:00
Yabin Cui
fe3a83a934 Implement pthread spin.
In order to run tsan unit tests, we need to support pthread spin APIs.

Bug: 18623621
Bug: 25392375
Change-Id: Icbb4a74e72e467824b3715982a01600031868e29
2015-11-18 17:51:21 -08:00
Yabin Cui
b804b9d67b Merge "Implement pthread barrier." 2015-11-17 00:22:54 +00:00
Yabin Cui
e7c2fffa16 Implement pthread barrier.
Bug: 24341262
Change-Id: I5472549e5d7545c1c3f0bef78235f545557b9630
2015-11-16 14:02:26 -08:00
Yabin Cui
fb994f4c04 Add fileno_unlocked to support thread sanitizer.
Bug: 25392375
Change-Id: If3f92a0e08a53f4b59e01397e8efa307d8572349
2015-11-06 16:13:47 -08:00
Dmitriy Ivanov
e85fb580c8 Fix LDFLAGS for arm and x86
Change-Id: I5366f4499cb4da3a51b8484ab3e4ff785f0888ab
2015-10-28 17:25:34 -07:00
Dmitriy Ivanov
284b468524 Generate per-architecture version scripts.
Bug: http://b/24767418
Change-Id: I23e49d8d30c0def3215ffbd99d09f207d9483624
2015-10-28 16:40:53 -07:00