Commit graph

13 commits

Author SHA1 Message Date
Elliott Hughes
88e4e60a75 Sync with upstream NetBSD.
Test: treehugger
Change-Id: Ia82ba4a0c00a47377240e5d9a85dc30deb5ce3b7
2022-11-08 02:51:48 +00:00
Elliott Hughes
d0bbfa8327 Make res_init() work again.
Change 75830fb836 to fix _nres
initialization to be thread safe accidentally introduced a behavior
change whereby res_init() became a no-op. It also failed to remove all
direct accesses to _nres.

Move the file over to C++ so we can let RAII ensure we're always holding
a lock while using the global state, make all callers access the global
state via this class, and restore the previous behavior of res_init().

Test: atest DnsResolverTest
Bug: 166235340
Change-Id: Ib390a7eac063bc0ff5eeba755e8c74ef1383004e
2021-04-08 12:04:05 -07:00
Elliott Hughes
5828ad7dfe Clean up some obsolete NetBSD portability cruft.
Test: treehugger
Change-Id: I9197e6ebcaec6811ff5ee12e4d2e7a14c2881f64
2019-10-29 19:58:17 -07:00
Sandeep Patil
aa3e32422c libc: Add support to allow library calls to find appropriate shell executable for a process
Library calls like system() and popen() invoke the shell executable
pointed to by '_PATH_BSHELL' in order to run the command passed into the
function. The _PATH_BSHELL points to /system/bin/sh by default and thus
breaks any vendor process trying to use system() / popen(), as they are
denied access to system shell by selinux.

This CL make necessary changes, so the implmentations of system() and popen()
can use the appropriate shell (e.g. /vendor/bin/sh for processes running
out of /vendor partition). Also, changes the implementation of system()
and popen().

Bug: 64832610
Test: Manual, Using a test program running from /system/bin and
      /vendor/bin to ensure correct shell is being used.

Change-Id: Ie7168d69decb1ae98284446ae7db34dec930dc33
Signed-off-by: Sandeep Patil <sspatil@google.com>
2017-08-21 19:21:35 -07:00
Elliott Hughes
1665158b71 Merge \"Make it possible to build bionic with -I instead of -isystem.\"
am: 420d02c56d

Change-Id: I2b105c0dbe34e206fbdb6a1ad5df82f17564ec2a
2016-07-22 21:47:47 +00:00
Elliott Hughes
5470c18361 Make it possible to build bionic with -I instead of -isystem.
Various things:

* work around -Wnullability-completeness.
* use C++ casts in C++ and C casts in C.
* stop using attributes clang doesn't support (such as `warning`).
* remove duplicate definitions of XATTR_CREATE and XATTR_REPLACE.

Change-Id: I07649e46275b28a23ca477deea119fe843999533
2016-07-22 13:12:53 -07:00
Elliott Hughes
8739a1a513 Merge "Fix regerror(..., nullptr, 0)."
am: 925bf56447

* commit '925bf56447cf87da910441f12b302051e07549ba':
  Fix regerror(..., nullptr, 0).
2016-02-13 01:32:59 +00:00
Elliott Hughes
cac2908b08 Fix regerror(..., nullptr, 0).
Found by passing a bad regular expression to the Google benchmark
code (https://github.com/google/benchmark).

Change-Id: I475db71c25706bbf02091b754acabe8254062f3a
2016-02-12 16:00:53 -08:00
Christopher Ferris
afff4442ae resolve merge conflicts of d676080a37 to lmp-mr1-ub-dev.
Change-Id: I56c1bb2adb4b6a48733c928415e788e689b4944e
2015-10-21 14:56:52 -07:00
Elliott Hughes
055a66c9b1 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904

(cherry-picked from commit 71927a8237)
2015-10-19 10:42:31 -07:00
Elliott Hughes
71927a8237 Sync with upstream NetBSD lib/libc/regex.
Bug: http://b/22850181
Change-Id: I11a51a2031e68a953ccd5691da98c699c7d01904
2015-09-14 18:45:52 -07:00
Elliott Hughes
b810462028 Fix _BSD_SOURCE/__USE_BSD.
Bug: 14659579
Change-Id: I80ec9584f054c02d1078828f6bca759c42bc1d4c
2014-08-19 09:18:03 -07:00
Elliott Hughes
d39f3f2c2e Clean up and document our hacks for building BSD source.
Change-Id: Ic591e22fa5b363bb68376b9f25814c0e5bd83fbf
2014-04-21 17:13:46 -07:00
Renamed from libc/upstream-netbsd/netbsd-compat.h (Browse further)