Commit graph

719 commits

Author SHA1 Message Date
Mark Salyzyn
53c0ca6520 libcutils: abort for invalid fd
If ashmem accessors are being called with a file descriptor that
belongs to anything other than ashmem, we need to stop it right
now so that they can fix the caller.

Bug: 26871259
Change-Id: Icf9aafc3631a80b9af6fe0fea03599d61e285d21
2016-02-03 15:09:20 -08:00
Mark Salyzyn
e37111d751 libcutils: ashmem print error message for invalid fd
NB: We decided to not sniff for the constant saved __ashmem_rdev in
the early error path; requiring either the use of atomic operations,
or acquiring a lock to do it correctly. The heroics are not worth it.

Bug: 26871259
Change-Id: I46249838850ae32063eb5b7d08c731c5bb0fbf6b
2016-02-03 15:06:45 -08:00
Mark Salyzyn
1186f3a5ad libcutils: ashmem check fd validity
- collect st_rdev on open, or when required, for /dev/ashmem.
- check in all cases if fd is a character device and matches rdev.
- requires that we have open, read and write access to /dev/ashmem
  to check, assumption being that if we can not, then we have no
  right playing with the associated misdirected file descriptor.

NB: ashmem libcutil library entry points can no longer be called in
    signal context.

Bug: 26871259
Change-Id: I9a17e33317a9be795131473a51c16f761b5f7407
2016-02-03 13:05:22 -08:00
David Pursell
f722c253e6 Merge "libcutils/fastboot: improve multi-buffer write." am: f6f800ef3c
am: ef0e01c346

* commit 'ef0e01c346b2f60b1941bf3335906de5996785d8':
  libcutils/fastboot: improve multi-buffer write.
2016-02-03 18:13:02 +00:00
David Pursell
ef0e01c346 Merge "libcutils/fastboot: improve multi-buffer write."
am: f6f800ef3c

* commit 'f6f800ef3c4f7caef65f75bd6365a2045be488ea':
  libcutils/fastboot: improve multi-buffer write.
2016-02-03 18:09:24 +00:00
David Pursell
f6f800ef3c Merge "libcutils/fastboot: improve multi-buffer write." 2016-02-03 18:03:00 +00:00
David Pursell
b34e4a06ee libcutils/fastboot: improve multi-buffer write.
Fixes libcutils multi-buffer write interface to be more friendly and
hooks into it from the fastboot Socket class.

Bug: http://b/26558551
Change-Id: Ibb3a8428fc379755602de52722c1260f9e345bc0
2016-02-03 10:01:38 -08:00
Mark Salyzyn
af86f6e093 Merge "libcutils: ashmem fortify and comply with Android coding standard" am: 0e0a4628f6
am: a9bb866861

* commit 'a9bb866861766305482757d90b9263dcd648b90e':
  libcutils: ashmem fortify and comply with Android coding standard
2016-02-02 21:40:59 +00:00
Mark Salyzyn
a9bb866861 Merge "libcutils: ashmem fortify and comply with Android coding standard"
am: 0e0a4628f6

* commit '0e0a4628f6af7dc5f39d745098143699257dfbe6':
  libcutils: ashmem fortify and comply with Android coding standard
2016-02-02 21:38:19 +00:00
Mark Salyzyn
c2d8aad8d7 libcutils: ashmem fortify and comply with Android coding standard
- sort header order and in groups
- remove all tabs, use only spaces
- use TEMP_FAILURE_RETRY in system calls
- preserve errno for -1 return

Bug: 26871259
Change-Id: I94fffbcaeba01fcc18a3ed07c02389c06c54d3b7
2016-02-02 12:38:06 -08:00
David Pursell
2fe3a0b7a4 Merge "libcutils: add multi-buffer socket send." am: d95ecfc432
am: d56499b21d

* commit 'd56499b21d1411a7c799cdad316fb2138db26a7c':
  libcutils: add multi-buffer socket send.
2016-02-02 19:25:52 +00:00
David Pursell
d56499b21d Merge "libcutils: add multi-buffer socket send."
am: d95ecfc432

* commit 'd95ecfc432206d5408738bb7cbc6eb15e5827d91':
  libcutils: add multi-buffer socket send.
2016-02-02 19:23:51 +00:00
David Pursell
e03df480b1 Merge "libcutils: add socket_get_local_port()." am: d90adbc45b
am: 9875e6c7e3

* commit '9875e6c7e318fe11a888b6b53c0472f5586410e4':
  libcutils: add socket_get_local_port().
2016-02-02 19:21:39 +00:00
David Pursell
9875e6c7e3 Merge "libcutils: add socket_get_local_port()."
am: d90adbc45b

* commit 'd90adbc45b905dcf3e5cddcd2908b9307fc2a332':
  libcutils: add socket_get_local_port().
2016-02-02 19:19:27 +00:00
David Pursell
8385fb299f libcutils: add multi-buffer socket send.
Unix and Windows both have functions to write multiple buffers to a
socket with a single call but they have very different signatures. This
CL creates some cross-platform functions to be able to perform these
operations in a uniform way, which will be required for upcoming
fastboot functionality.

This CL also fixes some inconsistent spacing in the touched files.

Bug: http://b/26558551
Change-Id: I8f14d52d3a1de1f3b464267666d6cd3b54263238
2016-02-02 11:18:56 -08:00
David Pursell
756e1c81e8 libcutils: add socket_get_local_port().
Tests that require a local server currently hardcode a test value,
which can run into conflicts depending on what's currently running on
the machine.

This CL adds socket_get_local_port(), which lets us pass 0 so the
system picks an open port and we can query which port it chose.

Bug: http://b/26236380
Change-Id: I01d1558884e7636081d9a357db6faa86929934f6
2016-02-02 09:52:02 -08:00
Tim Murray
6647bb5130 Enable top-app cpuset support.
Allows ActivityManager to use the top-app cpuset to grant the currently
focused app exclusive access to a CPU core.

Change-Id: I45bca5170477e413dec6e5889338399d0859706c
2016-02-01 15:03:16 -08:00
Tim Murray
4284f9f3a3 Improve cpuset support for surfaceflinger.
SurfaceFlinger needs some of its threads in the system-background cpuset
and some of its threads (the binder pool) outside of the
system-background cpuset in order to improve UI perf/power
consumption. Remove surfaceflinger from the system-background cpuset in
init.rc and allow a thread to place itself in the system-background
cpuset given enough permissions.

bug 25745866

Change-Id: I85f7e41c5439e6ad7cc2d355e51f5dfb3a0c7088
2016-01-22 14:06:50 -08:00
David Pursell
f6012df68d Merge "fastboot: use cutils socket functions." am: bbedd9523f
am: f0bfaf9503

* commit 'f0bfaf95038241c3f8ed65099c7d532a6c112e86':
  fastboot: use cutils socket functions.
2016-01-22 18:46:54 +00:00
David Pursell
f0bfaf9503 Merge "fastboot: use cutils socket functions."
am: bbedd9523f

* commit 'bbedd9523faf2c56b9c8236b22658bb659eb1533':
  fastboot: use cutils socket functions.
2016-01-22 00:35:01 +00:00
David Pursell
572bce2908 fastboot: use cutils socket functions.
Now that cutils has cross-platform socket functionality, we can
restructure fastboot to remove platform-dependent networking code.

This CL adds socket_set_receive_timeout() to libcutils and combines the
fastboot socket code into a single implementation. It also adds TCP
functionality to fastboot sockets, but nothing uses it yet except for
the unit tests. A future CL will add the TCP protocol which will use
this TCP socket implementation.

Bug: http://b/26558551

Change-Id: If613fb348f9332b31fa2c88d67fb1e839923768a
2016-01-21 09:53:11 -08:00
David Pursell
cb56fb4b15 Merge "libcutils: share Windows networking code." am: 1906de1e0f
am: 7a568dbdd6

* commit '7a568dbdd6c1a39a90c01ab89092cb67a9a86198':
  libcutils: share Windows networking code.
2016-01-21 17:03:45 +00:00
David Pursell
7a568dbdd6 Merge "libcutils: share Windows networking code."
am: 1906de1e0f

* commit '1906de1e0fb70dbae4a713620072113a76d0a22a':
  libcutils: share Windows networking code.
2016-01-21 17:00:57 +00:00
David Pursell
1906de1e0f Merge "libcutils: share Windows networking code." 2016-01-21 16:40:00 +00:00
Nick Kralevich
974bf66088 Merge "logging: avoid unnecessary printfs" am: 542a511f87
am: 5644112b7e

* commit '5644112b7e05372fcda105fa621630c12ec29a6e':
  logging: avoid unnecessary printfs
2016-01-19 18:10:37 +00:00
Nick Kralevich
5644112b7e Merge "logging: avoid unnecessary printfs"
am: 542a511f87

* commit '542a511f870f33215ec3b4773fc7a85ac9134f26':
  logging: avoid unnecessary printfs
2016-01-19 18:08:47 +00:00
Nick Kralevich
5db8d6aafa logging: avoid unnecessary printfs
Don't spend CPU cycles formatting a bunch of strings if we're
just going to throw them away later. Maybe make booting faster.

Change-Id: I4d8eb99fb3fa873ca91cf776933d0ad01988abf5
2016-01-16 16:20:24 -08:00
David Pursell
0eb8e1b706 libcutils: share Windows networking code.
This CL moves Windows networking code from fastboot to libcutils so
that it can be shared with other host programs such as adb.

Not all libcutils networking functions have been implemented for
Windows, just those necessary for fastboot. In the next CL I will do
the same for adb, adding any additional required functions.

Unit tests have also been added to test the functions using a loopback
connection.

Bug: http://b/26236380.
Change-Id: Ibc51a67030fe69a04c23512eefa9d19b055c7c12
2016-01-15 15:57:35 -08:00
Jeff Sharkey
814640315a Be strict, but not that strict.
Certain apps decide that they want to chmod() their private data
directories to gain more security.  We still want to carefully
enforce owner UID/GID, but relax the mode check for now.

Bug: 26549892
Change-Id: I362d530ba0b20fb23f427ac082ee003864adc57d
2016-01-14 12:02:53 -07:00
Jeff Sharkey
cf94fe152e Offer a stricter way to prepare directories.
Some callers, such as installd, have stricter requirements around
directory preparation, where they want to assert ownership and mode
without quietly fixing the values.

Bug: 26466827
Change-Id: Id44db5f29a3326cfe178b443fb450ad2edeaefd8
2016-01-12 13:07:52 -07:00
Nick Kralevich
2af9135b8a Merge "trace-dev.c: more O_CLOEXEC" am: a8d3fdf4c6
am: 2dda6ac98d

* commit '2dda6ac98d2e82adaebd443f468eff060961f1c6':
  trace-dev.c: more O_CLOEXEC
2015-12-16 14:20:39 -08:00
Nick Kralevich
2dda6ac98d Merge "trace-dev.c: more O_CLOEXEC"
am: a8d3fdf4c6

* commit 'a8d3fdf4c62b485073b439ed46b4814f1608f77a':
  trace-dev.c: more O_CLOEXEC
2015-12-16 21:50:01 +00:00
Nick Kralevich
dee1ef48a9 trace-dev.c: more O_CLOEXEC
Stop the file descriptors from leaking.

Change-Id: Ib5ca1c2e5031fbec8751bde9e86b32e51e10fcbc
2015-12-16 12:32:26 -08:00
Elliott Hughes
02903348f8 Merge "Make host ashmem_create_region more robust." am: ec2f506e74
am: 6ed33e5ada

* commit '6ed33e5ada7e7a1f7d4f0a0407850021169893d3':
  Make host ashmem_create_region more robust.
2015-12-16 18:44:31 +00:00
Elliott Hughes
6ed33e5ada Merge "Make host ashmem_create_region more robust."
am: ec2f506e74

* commit 'ec2f506e741bbc9252d25f0f2ba1c24b1aa0ab7d':
  Make host ashmem_create_region more robust.
2015-12-16 18:40:04 +00:00
Elliott Hughes
3918090252 Make host ashmem_create_region more robust.
Don't clobber errno if mkstemp failed, always unlink, and only count
mkstemp/ftruncate failures as real failures --- if only the unlink
fails, there's no point not using what we have.

Change-Id: I6bc788682c88651a50a6316b9ca07ba07e9fefa2
2015-12-16 08:33:52 -08:00
Erik Kline
f3501658af Merge "Listen on dualstack sockets." am: 1f7bcf3e93 am: f6df8fce6d
am: 4cb2c1fbb6

* commit '4cb2c1fbb60b5b4684bdd01c140eb82e1c397e3c':
  Listen on dualstack sockets.
2015-12-08 06:38:12 +00:00
Erik Kline
4cb2c1fbb6 Merge "Listen on dualstack sockets." am: 1f7bcf3e93
am: f6df8fce6d

* commit 'f6df8fce6d0bea7da34e2e16edc691881b92105a':
  Listen on dualstack sockets.
2015-12-07 22:35:10 -08:00
Todd Kennedy
088113f419 Merge "Create new ephemeral app directory" 2015-12-07 15:33:06 +00:00
Erik Kline
c40da92e5b Listen on dualstack sockets.
Change-Id: Id6eff59c65a7f7e190ab9aa93625e32a9806ae6c
2015-12-07 16:09:39 +09:00
Nick Kralevich
aa68a571b4 Merge "fs_config.c: Remove obsolete reference to /system/bin/pppd-ril" am: e08e4656db
am: 9efbfda576

* commit '9efbfda5764c8d2a1abb4a4e88caf0aa3c9c92ea':
  fs_config.c: Remove obsolete reference to /system/bin/pppd-ril
2015-11-30 18:49:28 +00:00
Nick Kralevich
cbbc66174c fs_config.c: Remove obsolete reference to /system/bin/pppd-ril
Codesearch finds no reference to this in the Android tree. It was
added in 2010 in commit bbf1c64527.

Change-Id: I8cd1153912b78b4b23b8f5ba2577a58c5c49e316
2015-11-30 09:17:18 -08:00
Nick Kralevich
cb2202f614 Merge "fs_config: remove setuid bit from librank" am: 0380d49024
am: dee5c24927

* commit 'dee5c24927754c7a3213a3118f53cb119f00ad85':
  fs_config: remove setuid bit from librank
2015-11-30 14:57:05 +00:00
Nick Kralevich
3e6356834f fs_config: remove setuid bit from librank
Anyone wanting to call /system/xbin/librank can execute "su"
beforehand. There's no need for it to be setuid root.

Bug: 25739721
Change-Id: Ie3d68701397d21e901bf1ec17b4b4a9f12128d2d
2015-11-27 18:08:22 -08:00
Josh Gao
d9a3f0b65f Merge changes I36b66fc5,I0561affb am: 166e716851
am: 8e82180c83

* commit '8e82180c83eb89069716fb790ed0f006e469be1c':
  libcutils: turn on -Werror on Win32, fix resulting build break.
  libcutils: add prefix to local variables in Android.mk.
2015-11-24 20:20:44 +00:00
Josh Gao
1175d0fdb0 libcutils: turn on -Werror on Win32, fix resulting build break.
Mingw doesn't provide strndup or strtok_r used in str_parms.c, resulting in
-Wimplicit-function-declaration being emitted for the Windows build.
None of the consumers of str_parms.c appear to be compiled for Windows,
so we can just remove it from the Windows build.

Change-Id: I36b66fc54ed261d38f5294bc8662ddb2db4fe64f
2015-11-24 09:35:45 -08:00
Josh Gao
9e86f8e036 libcutils: add prefix to local variables in Android.mk.
Change-Id: I0561affbcc306c20f8aa87beb2d9728a9bb79f5e
2015-11-24 08:45:07 -08:00
Todd Kennedy
0a2733582d Create new ephemeral app directory
Bug: 25119046
Change-Id: Ie005430700a73ef1ba492dae4101419a41da4071
2015-11-23 15:24:13 -08:00
Josh Gao
7454190acd Merge "Revert "libcutils: don\'t build for Windows."" am: 39a1b77381 am: 167b4bed93
am: 5153be7f94

* commit '5153be7f94046cf2e7e34060f9d5ae4866abb015':
  Revert "libcutils: don't build for Windows."
2015-11-18 19:17:54 +00:00
Josh Gao
b5d763b053 Merge changes Ice07f892,Ie1f082a0 am: 74a33fbcef am: 053eba0bc1
am: cb601eb981

* commit 'cb601eb981f70d395e9bac5c1bf39c7773141eca':
  libcutils: don't build for Windows.
  adb: don't link against libcutils on Windows.
2015-11-18 19:17:39 +00:00
Todd Kjos
88b5892d74 resolve merge conflicts of ed60788968 to mnc-dr2-dev-plus-aosp.
Change-Id: I9b07dd8dcb8fc74b658466b8dd47546cefffab1d
2015-11-18 08:31:03 -08:00
Josh Gao
cab716f101 Revert "libcutils: don't build for Windows."
This reverts commit bb3f9ce0aa.
2015-11-17 14:28:33 -08:00
Josh Gao
bb3f9ce0aa libcutils: don't build for Windows.
Change-Id: Ice07f892a346bbba2ed6bfdcddf7222799e76f9d
2015-11-16 16:21:22 -08:00
Todd Kjos
ba8a47531c Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 14:57:47 -08:00
Todd Kjos
ed60788968 Actively mangage EAS schedtune nodes
Move foreground tasks to /sys/fs/cgroup/stune/boost/tasks (boosted
weight in EAS scheduler). Move background tasks to
/sys/fs/cgroup/stune/tasks (default weight). For services started
with init, set "foreground" services to boosted.

Change-Id: I0e489fad9510727c13e6754dabaf311c2391f395
2015-11-16 08:53:04 -08:00
Gilad Arnold
1bc7888104 Fix permissions for /data/nativetest{,64}/tests.txt.
This is not an executable so we have to specifically set its permissions
accordingly.

Bug: 25668833
Change-Id: I502f69bad75b4da4fdc29eb3ebaa42a19ae04d27
2015-11-14 18:25:31 -08:00
Gilad Arnold
47af47f4c1 Sane ownership/permissions for directories in /data/nativetest{,64}.
This makes native test directories 750 root:shell. This matches the
value for files within those directories, and results in a more usable
access paradigm when (say) unprivileged test tools need to discover
these test binaries.

Bug: 25668833
Change-Id: I9bd2081b2c211b4383b5873238aaf64597756714
2015-11-12 14:34:57 -08:00
Daniel Erat
5510c13991 libcutils: Make /data/nativetest{,64}/* executable.
Make test files under /data/nativetest{,64} 0750 root:shell
to avoid needing to manually chmod them.

Bug: 25340994
Change-Id: I174cc226195907c0effa99063a8aa0082f85722b
2015-11-02 09:45:04 -07:00
Christopher Ferris
634df89db6 Make allocations use unique_ptr.
Change-Id: I4b84b8106faeaeb61847f8f9d13fd6444f474efd
2015-10-14 14:03:29 -07:00
Nick Kralevich
e2b2996d96 fs_config.c: remove setuid from procrank
procrank only exists on userdebug/eng builds. For those builds,
procrank can be executed by running "su 0 procrank" instead of
relying on the binary being setuid root. This reduces the number
of setuid binaries on Android and allows for the deletion of
SELinux policy to support this.

Bug: 18342188
Change-Id: I982283f2e0f6fbe5efaffc08501c1ec175f65373
2015-10-07 16:41:47 -07:00
Jorge Lucangeli Obes
fd7a9f79f2 am 66d32c74: Merge "Use CAP_MASK_LONG for file capabilities."
* commit '66d32c7488e12545218e83195738c95c183760ef':
  Use CAP_MASK_LONG for file capabilities.
2015-09-03 15:55:32 +00:00
Jorge Lucangeli Obes
66d32c7488 Merge "Use CAP_MASK_LONG for file capabilities." 2015-09-03 15:48:01 +00:00
Dan Willemsen
a4b8f9f1c2 am bfe32228: Merge "Remove USE_MINGW/CYGWIN; Whitelist windows modules"
* commit 'bfe322285fdbe86fdc01fdc4c711e22e894bdaee':
  Remove USE_MINGW/CYGWIN; Whitelist windows modules
2015-09-03 00:39:19 +00:00
Jorge Lucangeli Obes
e920c46e7d Use CAP_MASK_LONG for file capabilities.
Extract the |1ULL << $CAP_NAME| construct to a macro, to avoid
repeating it.

Change-Id: I9312c27130d7e6c5b6ab3b4cc5c70a6b98378b98
2015-09-02 17:18:44 -07:00
Dan Willemsen
87a419c8b1 Remove USE_MINGW/CYGWIN; Whitelist windows modules
CYGWIN is not supported, USE_MINGW and HOST_OS==windows are being
replaced with LOCAL_..._windows variables.

Bug: 23566667
Change-Id: I3e4a1e4097dc994cf5abdce6939e83a91758fd75
2015-09-02 17:10:35 -07:00
Nick Kralevich
eb45890579 am f4355868: Merge "android_memset.c: Use sanitized shifts"
* commit 'f4355868cbce0713331bbb04b063515d6de4c795':
  android_memset.c: Use sanitized shifts
2015-08-27 23:24:35 +00:00
Duane Sand
c348a88376 android_memset.c: Use sanitized shifts
Avoid checks and traps on msb=1 unsigned shifts.

Change-Id: I5203a4290296b5557c0420ce0debad3b60d48233
2015-08-27 14:32:17 -07:00
Nick Kralevich
b7699c6550 am e6d3cf39: Merge "android_memset.c: Use __attribute__((no_sanitize("integer")))"
* commit 'e6d3cf393749556d6bb6b8ea51bb1252cfb061f3':
  android_memset.c: Use __attribute__((no_sanitize("integer")))
2015-08-27 20:44:40 +00:00
Nick Kralevich
d9eda62875 android_memset.c: Use __attribute__((no_sanitize("integer")))
Turn off integer sanitization on android_memset. memset()ing is
expected to be a fast operation.

Avoid the use of the "while (size--) { }" construct, which harmlessly
underflows.

Change-Id: Ia61ff2323c759bf52df7e70b8be2fae0b0366dda
2015-08-27 13:14:36 -07:00
Nick Kralevich
212e4f1fe1 am d34f4198: Merge "strdup16to8.c: fix benign integer underflow."
* commit 'd34f419826e74640dfe88c50d171a0cd8580eeda':
  strdup16to8.c: fix benign integer underflow.
2015-08-27 18:01:44 +00:00
Nick Kralevich
2b98a9eec0 strdup16to8.c: fix benign integer underflow.
A size_t value is not allowed to go below zero.

Change-Id: Ic888c6605d911e0b5dbee1a2fe1daf41e616e106
2015-08-27 10:30:50 -07:00
Nick Kralevich
3192689b21 am 63141512: am 53f11b62: Merge "libcutils: enable LOCAL_SANITIZE := integer"
* commit '631415129c51a24cd5c9843694bd5283fe3b9345':
  libcutils: enable LOCAL_SANITIZE := integer
2015-08-26 18:51:02 +00:00
Nick Kralevich
78d632a01d am 38f4a139: am 532e6cde: Merge "libcutils: cleanups for -fsanitize=integer"
* commit '38f4a1391e499c2392cd8136061153cc35438eb3':
  libcutils: cleanups for -fsanitize=integer
2015-08-26 18:51:00 +00:00
Nick Kralevich
fc82dd9179 libcutils: enable LOCAL_SANITIZE := integer
Call abort() on undefined or sketchy integer behavior.
Protects against integer overflow attacks.

Tested on Nexus 5 and Nexus 9 with no obvious problems.

Change-Id: I6cb28b4a0f5feed69ea472dfac8804fb0bf99719
2015-08-26 11:32:31 -07:00
Nick Kralevich
7390478f19 libcutils: cleanups for -fsanitize=integer
Hash functions rely on overflow behavior, so whitelist them.

ATRACE_TAG_NOT_READY: use an unsigned constant when shifting bits.
Otherwise, the value overflows on shift. The users of this constant
assign it to a uint64_t variable.

Change-Id: I21c437ce2083525e906c3ead3259ec34a1ef4b66
2015-08-26 10:40:00 -07:00
Elliott Hughes
145afc2cc4 am fb1ecbc5: am e6e71608: Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS."
* commit 'fb1ecbc55e7edeafb138eb2a60ca89ba9a7b1f0f':
  Use __ANDROID__ instead of HAVE_ANDROID_OS.
2015-07-30 16:50:15 +00:00
Elliott Hughes
e6e71608bd Merge "Use __ANDROID__ instead of HAVE_ANDROID_OS." 2015-07-30 16:34:47 +00:00
Elliott Hughes
9b828adfad Use __ANDROID__ instead of HAVE_ANDROID_OS.
Change-Id: I9967f3fd758c2a5b40be5b60ae72be7e2fb75136
2015-07-30 09:33:43 -07:00
Elliott Hughes
c6dbc85845 am 42dbc4b1: am 44443bea: Merge "Use _WIN32 rather than HAVE_WINSOCK."
* commit '42dbc4b1859fe4de16b19e9b74324b345c5fcb9d':
  Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:17:07 +00:00
Elliott Hughes
adbf442a51 Use _WIN32 rather than HAVE_WINSOCK.
Change-Id: I9855b6fe72e2f2f3a8360c0993a67cb988024ee4
2015-07-29 17:45:24 -07:00
Tao Bao
5c151c4a4b am beb13044: am 1cae8cc1: Merge "Set mode bits for /system/etc/recovery.img."
* commit 'beb1304469c916bedf625ab126d75b38a688c62f':
  Set mode bits for /system/etc/recovery.img.
2015-07-28 21:24:21 +00:00
Tao Bao
1cae8cc13a Merge "Set mode bits for /system/etc/recovery.img." 2015-07-28 20:47:00 +00:00
Tao Bao
c6e93fec84 Set mode bits for /system/etc/recovery.img.
/system/etc/recovery.img defaults to 0644. Change it to 0440.

Bug: 22641135
Change-Id: I45cdb0cc1b58f35fbcd0f16e7cc6c4eef63b0b74
(cherry picked from commit b602e6f9a3)
2015-07-27 19:17:15 -07:00
Elliott Hughes
8a8953bb3d Fix libcutils build.
Change-Id: I4df2065f60f5363877809161298c1f9718252934
2015-07-24 20:28:31 -07:00
Elliott Hughes
3dced0d2c6 am 12d912bc: am ed217967: Merge "Fix socket_network_client_timeout error check."
* commit '12d912bc4facd9490becd9d1306a54fd079a8800':
  Fix socket_network_client_timeout error check.
2015-07-25 03:06:47 +00:00
Elliott Hughes
8b262b9de4 resolved conflicts for merge of 038b76c2 to mnc-dev-plus-aosp
Change-Id: Id84946b67f207a7586cfa9c918ee6e4ae335fe86
2015-07-24 20:02:31 -07:00
Elliott Hughes
ed21796754 Merge "Fix socket_network_client_timeout error check." 2015-07-25 01:58:57 +00:00
Elliott Hughes
eabe8af7e3 Fix socket_network_client_timeout error check.
Change-Id: Ia30ffc1a7815c63d247d9ba298c2fe9d7a780af2
2015-07-24 18:54:02 -07:00
Elliott Hughes
8fea1ede67 Turn on warnings for libcutils, fix a bug.
This doesn't actually spot the bug I'm about to fix, but maybe one day...

Change-Id: Ib8a2016ecd8a426f38960a05d439646255ea6cd8
2015-07-24 18:48:31 -07:00
Elliott Hughes
5937a860f3 am 1f76c1ab: am 9727a6a0: Merge "Report getaddrinfo failures correctly."
* commit '1f76c1abea3196a61f85164a078d44505d3a6b5e':
  Report getaddrinfo failures correctly.
2015-07-24 21:02:36 +00:00
Elliott Hughes
381cfa9a8b Report getaddrinfo failures correctly.
Also move us off the "convenience" function because you can't get useful
error reporting from it.

Change-Id: I5fcc6a6d762f5f60906980a7835f01a35045be65
2015-07-23 21:14:38 -07:00
Yusuke Sato
7c842b57fe am ab64465d: am 0e3ce82b: Merge "Use fsck.f2fs -a instead of -f for faster boot"
* commit 'ab64465d1f16f414c0bde5e3c4707c32b8220bbc':
  Use fsck.f2fs -a instead of -f for faster boot
2015-07-21 18:25:57 +00:00
Yusuke Sato
0e3ce82b94 Merge "Use fsck.f2fs -a instead of -f for faster boot" 2015-07-21 16:06:40 +00:00
Elliott Hughes
32cfa95271 am 099ec31b: am ff201659: Merge "Fix the Mac libcutils build."
* commit '099ec31bdb910020c5c86b4ad8711940616bcbaf':
  Fix the Mac libcutils build.
2015-07-18 18:21:13 +00:00
Elliott Hughes
0f8f70beb4 Fix the Mac libcutils build.
The stupid Mac doesn't have SOCK_NONBLOCK.

Bug: http://b/22559299
Change-Id: I476dadd0ba0076f5e61a4cd9b1f39cf3508f4188
2015-07-18 10:47:59 -07:00
Elliott Hughes
cb599d34b9 am 5403d155: am e36b10a8: Merge "Switch libcutils from gethostbyname to getaddrinfo."
* commit '5403d155a3677ff334246eb5524ced4166fd1c96':
  Switch libcutils from gethostbyname to getaddrinfo.
2015-07-18 17:20:13 +00:00
Elliott Hughes
94ae41874a Switch libcutils from gethostbyname to getaddrinfo.
Needed for IPv6 support.

Bug: http://b/22559299
Change-Id: Id10d958b434b207e84bc2ec2ff83221f2c4e8168
2015-07-17 23:45:15 -07:00
Yusuke Sato
0df08271fb Use fsck.f2fs -a instead of -f for faster boot
and run fsck with -f on clean shutdown instead.

With -f, fsck.f2fs always performs a full scan of the /data
partition regardless of whether the partition is clean or not.
The full scan takes more than 2 seconds on volantis-userdebug
and delays the OS boot.

With -a, the command does almost nothing when the partition
is clean and finishes within 20-30ms on volantis-userdebug.
When the partition has an error or its check point has
CP_FSCK_FLAG (aka "need_fsck"), the command does exactly the
same full scan as -f to fix it.

Bug: 21853106
Change-Id: I126263caf34c0f5bb8f5e6794454d4e72526ce38
2015-07-15 10:13:51 -07:00
Daniel Rosenberg
6b6687bec9 am 00392411: am e7ed68ad: Merge "libcutils: fs_config: Add folders normally created in init.rc"
* commit '0039241124ae3ef9b19c805b0341120e11f9561e':
  libcutils: fs_config: Add folders normally created in init.rc
2015-07-14 22:28:11 +00:00
Thierry Strudel
a0fbb90885 am 8703bea1: Merge "fs_config: replace getenv(\'OUT\') by new fs_config parameter" into mnc-dev
* commit '8703bea1807326fef9835bc474e7a7288c725925':
  fs_config: replace getenv('OUT') by new fs_config parameter
  fs_mgr: Use ro.boot.veritymode
2015-07-10 18:44:51 +00:00
Thierry Strudel
df33ffadd2 fs_config: replace getenv('OUT') by new fs_config parameter
Using a getenv('OUT') in such a deep down function is a wrong design
choice. Replacing with explicit parameter that may be NULL in case
device specific files can be accessed from /.
Since TARGET_COPY_OUT_SYSTEM may be defined to something different than
system we also ensure that we use a path relative to TARGET_OUT to
compute path to fs_config_* files.

Bug: 21989305
Bug: 22048934
Change-Id: Id91bc183b29beac7379d1117ad83bd3346e6897b
Signed-off-by: Thierry Strudel <tstrudel@google.com>
2015-07-09 21:47:07 -07:00
Daniel Rosenberg
bbe796d231 libcutils: fs_config: Add folders normally created in init.rc
When the ramdisk is built into the system image, we need to create
those folders during the build.

Change-Id: I40881940c75e379d7599dc1f743b35fbc7cc66e8
2015-07-08 16:37:13 -07:00
Todd Kjos
7c3e2696c5 am 1fb6e24f: Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev
* commit '1fb6e24f19533c2d7bfa1e8e69443d752e9df3ce':
  Fix janky navbar ripples -- incorrect timerslack values
2015-06-29 22:55:34 +00:00
Todd Kjos
1fb6e24f19 Merge "Fix janky navbar ripples -- incorrect timerslack values" into mnc-dev 2015-06-29 22:29:54 +00:00
Todd Kjos
4cdce427f9 Fix janky navbar ripples -- incorrect timerslack values
If a thread is created while the parent thread is "Background",
then the default timerslack value gets set to the current
timerslack value of the parent (40ms). The default value is
used when transitioning to "Foreground" -- so the effect is that
the timerslack value becomes 40ms regardless of foreground/background.

This does occur intermittently for systemui when creating its
render thread (pretty often on hammerhead and has been seen on
shamu). If this occurs, then some systemui animations like navbar
ripples can wait for up to 40ms to draw a frame when they intended
to wait 3ms -- jank.

This fix is to explicitly set the foreground timerslack to 50us.

A consequence of setting timerslack behind the process' back is
that any custom values for timerslack get lost whenever the thread
has transition between fg/bg.

See Bug: 19398120

Change-Id: Idc259717f62fa2255f8bafbbf88b68c0043f29cf
2015-06-25 14:29:07 -07:00
Tim Murray
f7180d1d2d am 98c6de69: Merge "Don\'t set cgroup policy when updating cpusets." into mnc-dev
* commit '98c6de6926e65615caff5be72236a24339258dee':
  Don't set cgroup policy when updating cpusets.
2015-06-22 22:09:19 +00:00
Tim Murray
999102664c Don't set cgroup policy when updating cpusets.
bug 21782794

Change-Id: I3b2cf8ae4f3ed0c14f206584ae7fa2b1a1d11ad0
2015-06-22 14:00:56 -07:00
Tim Murray
63e383136b am e5b0c837: Merge "add cpuset support to libcutils" into mnc-dev
* commit 'e5b0c837856007812ace8ec5849f6852015d5d2b':
  add cpuset support to libcutils
2015-06-12 19:03:30 +00:00
Tim Murray
b769c8d24f add cpuset support to libcutils
bug 21782794

Change-Id: I249531754fb29442dc3c7434d77dbb103f4220a7
2015-06-11 18:35:46 -07:00
Elliott Hughes
af02e2403a am 9fc83437: Don\'t use TEMP_FAILURE_RETRY on close in system/core.
* commit '9fc834377297cb2dcc418e4ce7e38e89dd09812b':
  Don't use TEMP_FAILURE_RETRY on close in system/core.
2015-05-27 20:51:25 +00:00
Elliott Hughes
9fc8343772 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
(cherry picked from commit 47b0134ec2)
2015-05-27 13:27:06 -07:00
Elliott Hughes
3464c77b8d Merge "Don't use TEMP_FAILURE_RETRY on close in system/core." 2015-05-27 20:24:08 +00:00
Nick Kralevich
27fe3cb63f am 7eb3abdb: klog: don\'t unconditionally call mknod()
* commit '7eb3abdb3ba500d3acca82b95705f34128251015':
  klog: don't unconditionally call mknod()
2015-05-19 23:03:19 +00:00
Nick Kralevich
7eb3abdb3b klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

(cherrypicked from commit 4d32a486fe)

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-19 15:19:25 -07:00
Nick Kralevich
4d32a486fe klog: don't unconditionally call mknod()
If /dev/kmsg already exists, it's unnecessary for klog_init()
to create it's own copy. This avoids needing to grant the mknod
permission to everyone who uses kmsg. Typically the only time
/dev/kmsg doesn't exist is before ueventd starts.

Bug: 21242418
Change-Id: I0c88d80feca6899fcdbc8c9f2f99448ee0a3422d
2015-05-18 18:43:28 -07:00
Adam Lesinski
b278ab2f0f am 0ebd13f0: Merge "Prevent integer overflow when allocating native_handle_t" into mnc-dev
* commit '0ebd13f0639ddfc3e6e96bbcc6ce5465ca489808':
  Prevent integer overflow when allocating native_handle_t
2015-05-19 00:55:12 +00:00
Elliott Hughes
47b0134ec2 Don't use TEMP_FAILURE_RETRY on close in system/core.
Bug: http://b/20501816
Change-Id: I1839b48ee4f891b8431ecb809e37a4566a5b3e50
2015-05-15 19:16:40 -07:00
Adam Lesinski
07edc3b3b3 Prevent integer overflow when allocating native_handle_t
User specified values of numInts and numFds can overflow
and cause malloc to allocate less than we expect, causing
heap corruption in subsequent operations on the allocation.

Bug: 19334482
Change-Id: I43c75f536ea4c08f14ca12ca6288660fd2d1ec55
2015-05-15 13:09:39 -07:00
Dan Albert
428fad97a0 Remove libbacktrace definition of gettid.
Also simplifies the Darwin implementation of gettid, because
apparently libbacktrace had a better way of doing it.

Bug: 19517541

(cherry picked from commit 23f750b068)

Change-Id: I2f888e8ed7a2f5719973786cbcbb399a81867ee9
2015-05-13 13:44:34 -07:00
Dan Albert
cd206b3900 Fix gettid() on Windows.
Accidentally had this all hidden by an #ifndef _WIN32 when I wrote it.

Bug: 19517541

(cherry picked from commit b3a36ca5ee)

Change-Id: Ifbd5d19e506e7313700e2e29a2dae5736e049844
2015-05-13 13:43:32 -07:00
Elliott Hughes
36284db817 Switch arch-arm/memset32.S to unified syntax.
This fixes the clang build.

Change-Id: I492c7dc016986020de3f70a77e0ace6610f50765
2015-05-11 22:22:13 -07:00
Dan Albert
23f750b068 Remove libbacktrace definition of gettid.
Also simplifies the Darwin implementation of gettid, because
apparently libbacktrace had a better way of doing it.

Change-Id: I9e14f9176b167405a5aaa5b8a0db0327c7126271
2015-04-30 12:52:21 -07:00
Dan Albert
b3a36ca5ee Fix gettid() on Windows.
Accidentally had this all hidden by an #ifndef _WIN32 when I wrote it.

Change-Id: I3a6afefe23b799ea7aa0f9a380f5a743673096d0
2015-04-29 17:13:32 -07:00
Elliott Hughes
d5ff3e9449 Remove dead code.
We weren't even building this.

Change-Id: I8b2afbc76d784a7b24bbe0be6502b9fbcf0b5c09
2015-04-21 12:24:50 -07:00
Elliott Hughes
2cba9405f9 Merge "[MIPS] Fast android_memset for Mips64, Mipsr6" 2015-04-17 02:07:32 +00:00
Duane Sand
1ef9ccd772 [MIPS] Fast android_memset for Mips64, Mipsr6
Fix broken mips64 build by replacing mips32r2-only android_memset.S.
Use HW-bonded pairs of 64-bit stores to fill 128 bits/cycle.
Rely on HW automatic cache prefetch optimizations.
Software cache prefetching is counterproductive on next mips cores.
New method is coded in C, and also works okay on non-Mips architectures.

Change-Id: Id7153a8fe11538fe25287e101375661b0e99e2a2
2015-04-16 18:26:22 -07:00
Greg Hackmann
0e2d6015bc Merge "Revert "cutils: add OS-independent endian.h"" 2015-04-16 21:29:44 +00:00
Greg Hackmann
bf7f28a415 Revert "cutils: add OS-independent endian.h"
This reverts commit c3bac8b671.
2015-04-16 14:28:58 -07:00
Greg Hackmann
88e03449de Merge "cutils: add OS-independent endian.h" 2015-04-16 20:06:40 +00:00
Yabin Cui
51e32b52a3 Merge "Move trace.h to stdatomic." 2015-04-16 18:35:43 +00:00
Greg Hackmann
c3bac8b671 cutils: add OS-independent endian.h
cutils/endian.h provides the helpers defined in endian(3), either by
pulling in the OS's built-in endian.h (where available) or recreating
them using GCC builtins.

Change-Id: Ic8965f67e1efdc03f884dbe6b7fe0276f840e4fc
Signed-off-by: Greg Hackmann <ghackmann@google.com>
2015-04-16 11:12:02 -07:00
Yabin Cui
a8ac32c781 Move trace.h to stdatomic.
Bug: 20262261
Change-Id: Idaf984786804eb76c285f38b11abbbc0d3706509
2015-04-16 10:41:16 -07:00
Mark Salyzyn
4232b378e7 libcutils: fs_config must use O_BINARY
Bug: 19908228
Change-Id: I3273cf99b320941f9530a015c9e582af72469acb
2015-04-16 08:44:33 -07:00
Mark Salyzyn
fd5b425b6e libcutils: fs_config: winsdk_tools build fix
Bug: 19908228
Change-Id: Ia725d20ca4f8a87deec63b6c661f6a09c8671231
2015-04-16 08:32:25 -07:00
Mark Salyzyn
7977cc63b1 libcutils: drop use of mmap
- Causes a build break for MAC and Windows

Bug: 19908228
Change-Id: I9d69967aa988c9ca202805593fa846cb670101cf
2015-04-15 19:28:36 -07:00
Mark Salyzyn
5d9e5efbcd libcutils: add fs_config_generate
Bug: 19908228
Change-Id: Icb0e189a86758bb779b9bdf7c0d92216d297869f
2015-04-15 16:43:07 -07:00
Mark Salyzyn
68651148dd libcutils: fs_config read from file
Intention is to read from ${OUT}/system/etc/fs_config_dirs and
${OUT}/system/etc/fs_config_files on host. And
/system/etc/fs_config_dirs and /system/etc/config_files
on target systems.

Bug: 19908228
Change-Id: Ieaedd99e88c7f7f717878d9344c387ddf335ccbb
2015-04-15 16:43:01 -07:00
Mark Salyzyn
7e82633106 Revert "libcutils: fs_config read from file"
There is no endian.h on windows

This reverts commit 4e5f71ae72.

Change-Id: I6aedf35ed319c7f8febc7ab98e104a625fb27f69
2015-04-15 22:30:30 +00:00
Mark Salyzyn
4e5f71ae72 libcutils: fs_config read from file
Intention is to read from ${OUT}/system/etc/fs_config_dirs and
${OUT}/system/etc/fs_config_files on host. And
/system/etc/fs_config_dirs and /system/etc/config_files
on target systems.

Bug: 19908228
Change-Id: I0966a94f79a3fae4f7325056c701ea355370f9df
2015-04-15 11:22:52 -07:00
Mark Salyzyn
a21c29ee81 android_filesystem_config: move fs_config to libcutils
Bug: 19908228
Change-Id: Id51c0c50eb2677824d052882f4263193a08e1402
2015-04-06 10:04:16 -07:00
Mark Salyzyn
8b2c7dee59 libcutils: add fs_config
Bug: 19908228
Change-Id: I78e6a8d780e578a287ffdee7b7120ecc74797e80
2015-04-06 10:04:15 -07:00
Elliott Hughes
8193d41ea6 Fix Windows strlcpy.c build.
Change-Id: I572c553227a5a2cd57ec304de7e898d7c801fe93
2015-04-02 17:21:47 -07:00
Elliott Hughes
2040031f7b Be more intention-revealing with libcutils' strlcpy.
Several people have been independently confused about when this gets
built and why over the past couple of days.

Change-Id: I2d4a02f66e24c0734327585b7d27e50a344b1e94
2015-04-02 15:39:33 -07:00
Elliott Hughes
af98efbd15 Move all libcutils tests into the gtests.
This also fixes the bug where we were always testing against the fake
strlcpy we provide for glibc/Windows rather than the Android one.

This also removes some unnecessary library dependencies.

This also builds all the cutils tests for the host (static and dynamic).

Change-Id: Icd129d5b025c0ca801be5acf31a54ecd88608df9
2015-04-02 14:25:55 -07:00
Elliott Hughes
a492f3797a Move mips/mips64 android_memset16/android_memset32 into libcutils.
Change-Id: Ia826dd872f64cc80635f50525a0c393f43ae5204
2015-04-02 11:59:22 -07:00
Brian Carlstrom
60a347fc87 Fix shared version of libcutils on the host to include strlcpy
Change-Id: Ic727508d9cfadea0050d1ccc491ee61aac1ef55a
2015-04-02 00:43:45 -07:00
Dan Albert
43db1c347b Revert "Disable the static libcutils tests."
Also move them to libc++ since stlport is dead.

Bug: 18389856

This reverts commit bb28776db0.

Change-Id: Icdf9be3bc5cc40433727ff71a121b145002dda72
2015-04-01 16:45:28 -07:00
Richard Uhler
0c266ef2d7 Merge "Define atrace_* functions for both target and host." 2015-04-01 17:29:34 +00:00
Elliott Hughes
c02f81cccb Always unlink /dev/__kmsg__.
Whether the open succeeds or fails, we should unlink.

Change-Id: Ic2f1e10dc7b6d6e459c56049da00d165bd63ba8f
2015-03-28 09:51:54 -07:00
Elliott Hughes
da40c00137 Log more timing information from init.
Also make important events in init's life NOTICE rather than INFO,
and ensure that NOTICE events actually make it to the kernel log.

Also fix the logging so that if you have a printf format string
error, the compiler now catches it.

Also give messages from init, ueventd, and watchdogd distinct tags.
(Previously they'd all call themselves "init", and dmesg doesn't
include pids, so you couldn't untangle them.)

Also include the tag in SELinux messages.

Bug: 19544788
Change-Id: Ica6daea065bfdb80155c52c0b06f346a7df208fe
2015-03-28 00:25:22 -07:00
Richard Uhler
7d451ab96d Define atrace_* functions for both target and host.
This change defines atrace_* functions for the host that act as
no-ops, which makes it easier to add tracing in ART.

Change-Id: I89397e83986686a2b6a6f245c25017eb379081b1
2015-03-27 14:58:30 -07:00
Richard Uhler
a0115bf78d Merge "Add make target for shared libcutils on host." 2015-03-25 15:48:42 +00:00
Richard Uhler
acb31ba905 Add make target for shared libcutils on host.
Needed by host dex2oat.

Change-Id: Ia5b53136de3d531c820f03c3f251e58418204be1
2015-03-24 14:46:01 -07:00
Christopher Ferris
fc3576f675 Fix mac sdk build.
Add include files for types and functions that were not included properly.

Change-Id: I4849f5bdf535c6eec9254228cf980c30d11a5a1b
2015-03-23 21:40:30 -07:00
Dan Albert
483060208c More Mac fix.
Change-Id: I7a1f726819c68eea1afb7e45f92954325f8933e1
2015-03-23 16:38:46 -07:00
Dan Albert
e308104390 Undo mac fix to fix windows, fix mac differently.
Change-Id: I7d1ee439d25e17c31c0be448e67a90a0f626ff42
2015-03-23 16:07:42 -07:00
Dan Albert
728b13f08d (Probably) fix the mac build.
Change-Id: I4209f2d66d8701df2f32dcfb79abea9ea6d3dc69
2015-03-23 14:48:05 -07:00
Dan Albert
7dfb61dcdc Move gettid() into libcutils.
Change-Id: Ic8a15036833e6d129b7998d954b804be391de399
2015-03-23 13:01:21 -07:00
Nick Kralevich
5e14f416af am 6864e673: Merge "More SOCK_CLOEXEC"
* commit '6864e6739027adf725ced33777d3e21f80a95479':
  More SOCK_CLOEXEC
2015-02-27 23:19:11 +00:00
Nick Kralevich
6d3cddb2e2 More SOCK_CLOEXEC
Change-Id: I3e18f34d08a6443aaf55d7c91c27867840ac1773
2015-02-26 13:32:52 -08:00
Narayan Kamath
d9ee5ff49f am f1ac6917: Merge "Remove loghack.h."
* commit 'f1ac6917da172dd3e6829bac41fcbf23e96da079':
  Remove loghack.h.
2015-02-21 10:15:55 +00:00
Narayan Kamath
453a332812 Remove loghack.h.
This was supposedly used to enable logging when !HAVE_ANDROID_OS
but it's only used in a file that's target specific.

Change-Id: Id83f2597e48a66b4821fc3b1237e212872b909fb
2015-02-21 09:46:31 +00:00
Andreas Gampe
dc941b5f37 am 623eebe6: Merge "Libcutils: Remove unused variable"
* commit '623eebe68f3c6c9e54cf5b186696052d2948410c':
  Libcutils: Remove unused variable
2015-02-20 01:02:45 +00:00
Andreas Gampe
7f71a45a17 Libcutils: Remove unused variable
Change-Id: I95eed017e78468c4946b2a5b62b6fe92e256673e
2015-02-19 16:54:32 -08:00
Elliott Hughes
7faec394d1 am 3bc8ae63: Merge "Use mkstemp for host ashmem."
* commit '3bc8ae63ce3bbcc0ab61def99a4e9b4822ba3f51':
  Use mkstemp for host ashmem.
2015-02-10 16:52:44 +00:00
Elliott Hughes
2004a863dc Use mkstemp for host ashmem.
Bug: 19310167
Change-Id: Ic4e32b3924a9aa0b0d095d445108cbcf2231cd91
2015-02-09 12:49:53 -08:00
Elliott Hughes
8a2634c2ab am 55732f49: Merge "android_reboot should take a const char*."
* commit '55732f49287a75f9baabe9f150443aec9234c90d':
  android_reboot should take a const char*.
2015-02-04 01:20:40 +00:00
Elliott Hughes
0068da6a93 android_reboot should take a const char*.
The kernel argument is actually a void*, but it's only read from.

Change-Id: I305c50249bf12b7fbdea4721257aed52a0372f8d
2015-02-03 15:44:16 -08:00
Yabin Cui
631965a32e am e862350b: Merge "Kill HAVE_PTHREADS."
* commit 'e862350bb2eb3d3eda526da7f3b6d5c2dd40a445':
  Kill HAVE_PTHREADS.
2015-01-27 22:45:14 +00:00
Yabin Cui
4a6e5a3b64 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2015-01-27 14:23:22 -08:00
Christopher Ferris
bd3bbff674 am d426a4e7: Merge "Move 32 bit/64 bit check into debuggerd."
* commit 'd426a4e7b62c18124827868ddbf8987aa433451b':
  Move 32 bit/64 bit check into debuggerd.
2015-01-22 00:13:01 +00:00
Christopher Ferris
9774df6134 Move 32 bit/64 bit check into debuggerd.
On 64 bit systems, calls to dump_backtrace_to_file or dump_tombstone
try and directly contact the correct debuggerd (32 bit vs 64 bit)
by reading the elf information for the executable.
Unfortunately, system_server makes a call to dump_backtrace_to_file
and it doesn't have permissions to read the executable data, so it
defaults to always contacting the 64 bit debuggerd.
This CL changes the code so that all dump requests go to the 64 bit
debuggerd, which reads the elf information and redirects requests for
32 bit processes to the 32 bit debuggerd.

Testing:

- Forced the watchdog code in system_server to dump stacks and
  verified that all native stacks are dumped correctly.
- Verified that dumpstate and bugreport still properly dump the native
  processes on a 64 bit and 32 bit system.
- Intentionally forced the 64 bit to 32 bit redirect to write only a
  byte at a time and verified there are no errors, and no dropped data.
- Used debuggerd and debuggerd64 to dump 32 bit and 64 bit processes
  seemlessly.
- Used debuggerd on a 32 bit system to dump native stacks.

Bug: https://code.google.com/p/android/issues/detail?id=97024
Change-Id: Ie01945153bdc1c4ded696c7334b61d58575314d1
2015-01-20 17:22:07 -08:00
Elliott Hughes
bb604524fb am 45c4c06f: Merge "Remove unused cruft from libcutils."
* commit '45c4c06ffe6f38e0f77f37f488e07f2537eddd45':
  Remove unused cruft from libcutils.
2015-01-16 16:02:24 +00:00
Jeff Sharkey
7c42c7f84f am 9f72ef89: Merge "Extend to receive NFLOG packets."
* commit '9f72ef8944a93bd333c6c7f87c7f7d79207ae663':
  Extend to receive NFLOG packets.
2015-01-16 06:07:29 +00:00
Elliott Hughes
f21717cd87 Remove unused cruft from libcutils.
Change-Id: I316d39e8e0a9aa385d8e1f37678b8bf2c03441eb
2015-01-15 21:16:03 -08:00
Jeff Sharkey
9f72ef8944 Merge "Extend to receive NFLOG packets." 2015-01-16 01:11:02 +00:00
Christopher Ferris
fa41e0f5c8 Add timed versions of stack dumping functions.
Under some unknown circumstances, debuggerd could become unresponsive.
If you try and take a bugreport during this time, it will hang forever.
Adding functions that have a timeout will allow dumpstate to stop if
dumping is taking too long.

Bug: 18766581

(cherry picked from commit 5f2ff6a910)

Change-Id: I39e8e9c60209e3ef9efac795fedb8e1edce2bd3e
2015-01-15 15:34:21 -08:00
Jeff Sharkey
9a20e67fa6 Extend to receive NFLOG packets.
Packets captured and logged by the NFLOG target are unicast, so
extend to catch and decode them.  To avoid escaping issues, the raw
contents are passed around as hex strings.

Bug: 18335678
Change-Id: Ib7299500baa00080a1f000f9da843eb527363353
2015-01-15 12:50:59 -08:00
Christopher Ferris
844c7ccc0a am 5f2ff6a9: Add timed versions of stack dumping functions.
* commit '5f2ff6a9106083e2a79b8600a0bf6a5341c6ca38':
  Add timed versions of stack dumping functions.
2015-01-15 01:48:27 +00:00
Christopher Ferris
5f2ff6a910 Add timed versions of stack dumping functions.
Under some unknown circumstances, debuggerd could become unresponsive.
If you try and take a bugreport during this time, it will hang forever.
Adding functions that have a timeout will allow dumpstate to stop if
dumping is taking too long.

Bug: 18766581
Change-Id: I85053b8dcfe6224e2b64b4d8f7f2ef448b3cda34
2015-01-14 15:24:33 -08:00
Elliott Hughes
4d9ddb14c0 am ec556521: Merge "Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER."
* commit 'ec556521e23f66ea52e41a7d9540b2dec31766c5':
  Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER.
2015-01-12 22:28:11 +00:00
Elliott Hughes
ae52165490 Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER.
Change-Id: I3d92dbecebd2bb449a8c4332de684919a58847ad
2015-01-12 13:56:34 -08:00
Yabin Cui
28175b0221 am fdb3da59: Merge "Use getmntent when accessing /proc/mounts."
* commit 'fdb3da5953b70dc87a05d28c31cb0dc06b8181aa':
  Use getmntent when accessing /proc/mounts.
2015-01-06 18:17:41 +00:00
Yabin Cui
d6bd9bf459 Use getmntent when accessing /proc/mounts.
Bug: 18887435
Change-Id: I6d7f95bbdb976428d4722bd640745e73c9839160
2015-01-05 20:28:36 -08:00
Elliott Hughes
f8328e7744 am 0e74cfb6: Merge "Fix references to HAVE_PRCTL."
* commit '0e74cfb677319c0f006dcc81f74fb21956807d2a':
  Fix references to HAVE_PRCTL.
2014-12-15 23:19:51 +00:00
Elliott Hughes
292ccd3c18 Fix references to HAVE_PRCTL.
Change-Id: I8343b398f2ce0d743487fdd086e67763c7dd67f1
2014-12-15 12:52:53 -08:00
Elliott Hughes
27484f2e74 am fae953eb: Merge "HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>."
* commit 'fae953ebccfabfa500b3ebca93202063c8e3501d':
  HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>.
2014-12-15 02:00:31 +00:00
Elliott Hughes
6acf3d7703 HAVE_ANDROID_OS implies that you have <pthread.h> and <sched.h>.
Change-Id: Ica7940c00d1d5da9d50711fd138dd459deec9b6d
2014-12-14 16:51:36 -08:00
Andreas Gampe
422ced07e5 am 374de72b: Merge "Libcutils: Remove unused variable"
* commit '374de72bbc218198e6a5f09ae4da853d02199b5c':
  Libcutils: Remove unused variable
2014-11-25 18:51:52 +00:00
Andreas Gampe
50c15f980d Libcutils: Remove unused variable
For build-system CFLAGS clean-up, remove unused variable.

Change-Id: Iaf6dd7b84ee4ef4734a48b37a4d0ca8287ca5fb5
2014-11-24 10:04:56 -08:00
Elliott Hughes
88cc0aded6 am eda16b98: Merge "Kill LOCAL_SOCKET_NAMESPACE."
* commit 'eda16b98dce3ef4c75b7b46c6acdab2b6970f54a':
  Kill LOCAL_SOCKET_NAMESPACE.
2014-11-22 07:56:37 +00:00
Elliott Hughes
9768d24fa0 Kill LOCAL_SOCKET_NAMESPACE.
Change-Id: I18928f89f66c37be310c45ff4c05a6d47ab84f66
2014-11-21 22:50:20 -08:00
Elliott Hughes
ba96de5f65 am 3ef0460e: Merge "Remove the error-prone TARGET_CPU_SMP from system/core."
* commit '3ef0460e86f2a7c5442bcf424b8e83fdfb8e3669':
  Remove the error-prone TARGET_CPU_SMP from system/core.
2014-11-17 19:40:16 +00:00
Elliott Hughes
e9ca709a73 Remove the error-prone TARGET_CPU_SMP from system/core.
This means that code that uses libcutils no longer has to ensure that
it's set ANDROID_SMP in the calling code's Android.mk for this to
function correctly.

Change-Id: I80c7ff170cd621106f34d6b74689d6b4f03e4eb7
2014-11-17 11:16:59 -08:00
Dan Albert
a57aacbaef am 29a34a5e: Merge "Disable the static libcutils tests."
* commit '29a34a5e7c249046a995a140ba30fa10960c7d42':
  Disable the static libcutils tests.
2014-11-14 21:47:40 +00:00
Dan Albert
bb28776db0 Disable the static libcutils tests.
The static libcutils tests cannot be built when using libc++ because
there are multiple symbol definition errors between libc++ and libgcc.

Bug: 18389856
Change-Id: I6f41c561f97b3a37477f844e9abf6551524a0fa3
2014-11-14 10:56:34 -08:00
Hans Boehm
0b7f368442 am 64d7117e: Merge "Second attempt to "Rewrite atomic.h to use stdatomic.h.""
* commit '64d7117efc7f7b8b477cd216a119b07041d8f406':
  Second attempt to "Rewrite atomic.h to use stdatomic.h."
2014-11-14 00:26:51 +00:00
Hans Boehm
c56648948c Second attempt to "Rewrite atomic.h to use stdatomic.h."
This should not be committed until win_sdk and aarch64 builds are
fixed in the presence of this CL.

This reverts commit 2789faabfa.

We additionally remove uniprocessor support from the earlier CL,
thus avoiding a potential compiler code reordering issue.

Change-Id: I7207a5ca2efa907a6f757f172d7090a62b2311fe
2014-11-13 15:59:10 -08:00
Dan Albert
21d8d89c7c am 06279285: Merge "Revert "Move some tests to libc++.""
* commit '06279285ae38b58988a9431c89b8689d8e16904e':
  Revert "Move some tests to libc++."
2014-11-12 05:50:56 +00:00
Dan Albert
1d3b492bde Revert "Move some tests to libc++."
The build system is still linking both libgcc and libcompiler-rt,
which is causing duplicate symbol errors on some architectures. This
requires a fix in the build system, so reverting for now.

This reverts commit e3cccbfd47.
2014-11-11 21:42:27 -08:00
Dan Albert
498c8135b4 am 7d196df6: Merge "Move some tests to libc++."
* commit '7d196df6f9990b5c93e0661fb0867971da7e6c34':
  Move some tests to libc++.
2014-11-12 02:52:59 +00:00
Dan Albert
e3cccbfd47 Move some tests to libc++.
Bug: 15193147
Change-Id: I93244e4a5d0c751056910ec8005a92401d305716
2014-11-11 23:59:02 +00:00
Elliott Hughes
aeac9cd1b3 am 85507404: Merge "Remove dead code."
* commit '855074043144e74156972e7a3416808dc6696452':
  Remove dead code.
2014-11-08 20:11:53 +00:00
Elliott Hughes
9a092dd373 Remove dead code.
__APPLE__ => HAVE_FUNOPEN.

Change-Id: I191cccd9b75020ffbb3281283ce1f1b7abc15d22
2014-11-08 11:32:07 -08:00
Michael Lentine
98a51de1cc Merge "Fix native_handle_create to check if malloc fails" into lmp-mr1-dev
automerge: b542285

* commit 'b5422854361be038b812f1c0272c66cdb4618a4b':
  Fix native_handle_create to check if malloc fails
2014-11-04 00:04:42 +00:00
Michael Lentine
2b8852dece Fix native_handle_create to check if malloc fails
Bug: 18076253
Change-Id: I8dbe3af88f52f18f74a3ab857fea53ae7585e2f7
2014-11-03 13:48:15 -08:00
Chih-Hung Hsieh
6ea35520fd am 07f1300c: am 7979f1ce: Merge "Do not inline rarely used trace function bodies."
* commit '07f1300c4c4f7d3c0df540bf8df3443c3f4539cd':
  Do not inline rarely used trace function bodies.
2014-10-15 17:57:07 +00:00
Chih-Hung Hsieh
c37387a4cd am 07f1300c: am 7979f1ce: Merge "Do not inline rarely used trace function bodies."
* commit '07f1300c4c4f7d3c0df540bf8df3443c3f4539cd':
  Do not inline rarely used trace function bodies.
2014-10-15 17:57:07 +00:00
Chih-Hung Hsieh
2d3150e736 Do not inline rarely used trace function bodies.
When atrace_* functions are inlined,
the rarely used 1024-byte buffers are allocated on stack.

BUG: 17444504
Change-Id: I773512aeb70e8b79f3803c6d59cba064d2aa65b6
2014-10-14 15:37:20 -07:00
Riley Andrews
d1380d645d am 33b33549: Merge "Make the default cgroup, the foreground cgroup." into lmp-mr1-dev
* commit '33b335495c7b8eea4b9af13a7157cf83cd085129':
  Make the default cgroup, the foreground cgroup.
2014-10-08 20:51:48 +00:00
Riley Andrews
522d72b702 Make the default cgroup, the foreground cgroup.
All kernel services will now be in the same cgroup as
foreground applications. This will now make kernel threads
not implicitly higher priority than android foreground
services.

Bug 17681097

Change-Id: I28e81c7aade50428d5395df86f00ce01c1e7af02
2014-10-07 19:24:54 +00:00
Chih-Hung Hsieh
ddb3fe8c17 am ad0ff1d9: am 4fceda2b: Merge "Add -no-integrated-as at local level."
* commit 'ad0ff1d99cd00ce53f667b27e53f44e802315a36':
  Add -no-integrated-as at local level.
2014-10-06 22:37:48 +00:00
Chih-Hung Hsieh
2aaccfe590 am ad0ff1d9: am 4fceda2b: Merge "Add -no-integrated-as at local level."
* commit 'ad0ff1d99cd00ce53f667b27e53f44e802315a36':
  Add -no-integrated-as at local level.
2014-10-06 22:37:06 +00:00
Chih-Hung Hsieh
60c57dad4e Add -no-integrated-as at local level.
Later we will enable integrated-as as default at the global level.

BUG: 17820427
Change-Id: I1beed3e75d074d970fa9112ec1c0f0df3d43947a
2014-10-06 13:33:25 -07:00
Hans Boehm
f381920b58 am 072877af: am 41198eea: Merge "Revert "Rewrite atomic.h to use stdatomic.h.""
* commit '072877af485d49f11e227c0d22a7bb4a341533d6':
  Revert "Rewrite atomic.h to use stdatomic.h."
2014-10-04 02:17:43 +00:00
Hans Boehm
054627df6b am 072877af: am 41198eea: Merge "Revert "Rewrite atomic.h to use stdatomic.h.""
* commit '072877af485d49f11e227c0d22a7bb4a341533d6':
  Revert "Rewrite atomic.h to use stdatomic.h."
2014-10-04 02:09:19 +00:00
Hans Boehm
2789faabfa Revert "Rewrite atomic.h to use stdatomic.h."
This reverts commit cb344d4640.

Change-Id: Ib17cd8d00695062177ce863cedc4ec7148012317
2014-10-04 00:49:06 +00:00
Hans Boehm
954fc61b6b am f5204549: am 028928fe: Merge "Rewrite atomic.h to use stdatomic.h."
* commit 'f5204549faf7310cc808bcb3676fb36268178e26':
  Rewrite atomic.h to use stdatomic.h.
2014-10-04 00:06:45 +00:00
Hans Boehm
2ac8207e50 am f5204549: am 028928fe: Merge "Rewrite atomic.h to use stdatomic.h."
* commit 'f5204549faf7310cc808bcb3676fb36268178e26':
  Rewrite atomic.h to use stdatomic.h.
2014-10-04 00:06:30 +00:00
Hans Boehm
cb344d4640 Rewrite atomic.h to use stdatomic.h.
Replace atomic-inl.h with a file that just includes atomic.h.
Remove platform specific implementations.

Change-Id: If16d74fbe0af7836ed8c1296c17e13a2d0d20f64
2014-10-01 17:37:20 -07:00
Dan Albert
c4affb2b4e am be0d295d: am 19d686ee: Merge "Don\'t manually link stlport."
* commit 'be0d295da912076239a1e112c4b7b94be10cf7af':
  Don't manually link stlport.
2014-09-26 19:53:04 +00:00
Dan Albert
31171b6e31 am be0d295d: am 19d686ee: Merge "Don\'t manually link stlport."
* commit 'be0d295da912076239a1e112c4b7b94be10cf7af':
  Don't manually link stlport.
2014-09-26 19:53:04 +00:00
Dan Albert
b50af2bc60 Don't manually link stlport.
Change-Id: I60d2bc868fb9052f120103e9675046ef54f510d0
2014-09-26 10:37:30 -07:00
Elliott Hughes
f9cdbb1a30 am 6c03b85f: am 32e2f1be: Merge "Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license."
* commit '6c03b85f1dcfd0efd2ec741cbfb6c5ecc404fbd8':
  Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license.
2014-09-18 03:23:47 +00:00
Elliott Hughes
bdac720255 am 6c03b85f: am 32e2f1be: Merge "Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license."
* commit '6c03b85f1dcfd0efd2ec741cbfb6c5ecc404fbd8':
  Clean up memset[16,32] routines: unify files names, remove redundant wrapper for 32-bit, remove Atom caches sizes for 64-bit, fix license.
2014-09-18 03:23:08 +00:00
Varvara Rainchik
458d1253f5 Clean up memset[16,32] routines: unify files names, remove redundant wrapper
for 32-bit, remove Atom caches sizes for 64-bit, fix license.

Change-Id: Ieda6367d7b21cf25b2beda6dd8d77cf668d3f2af
Signed-off-by: Varvara Rainchik <varvara.rainchik@intel.com>
2014-09-17 18:11:18 +04:00
Christopher Ferris
6bcc4acc6f Use the correct debuggerd given the tid.
On 64 bit systems, calling dump_backtrace_to_file will automatically
call debuggerd64. If the process to dump is actually 32 bit, this
creates an unrecognizable dump backtrace. Modify the code to check the
type of the process and connect to the appropriate debuggerd process.

This change refactors both the tombstone and backtrace functionality to
allow both to work properly on 64 bit systems when dealing with mixed
processes.

Bug: 17487122

(cherry picked from commit a9fa7b87f1)

Change-Id: I3c9e0212c8720877a6af092071a3695df2a36df8
2014-09-13 16:22:17 -07:00
Christopher Ferris
07bb3f1e0b am 07dda6b5: Merge "Use the correct debuggerd given the tid." into lmp-dev
* commit '07dda6b57c6a476177b68ad42966f24cbbdb04c1':
  Use the correct debuggerd given the tid.
2014-09-13 22:54:00 +00:00
Christopher Ferris
a9fa7b87f1 Use the correct debuggerd given the tid.
On 64 bit systems, calling dump_backtrace_to_file will automatically
call debuggerd64. If the process to dump is actually 32 bit, this
creates an unrecognizable dump backtrace. Modify the code to check the
type of the process and connect to the appropriate debuggerd process.

This change refactors both the tombstone and backtrace functionality to
allow both to work properly on 64 bit systems when dealing with mixed
processes.

Bug: 17487122
Change-Id: Icf123a6f4508b1aeec073663aa1a0ceae5380aa1
2014-09-12 20:12:11 -07:00
Dan Albert
fb1b6daca8 am 522c1d34: am e18ed89e: Merge "Remove makefile cruft."
* commit '522c1d340b6c1742d3e47aad27b974e43fad4bc2':
  Remove makefile cruft.
2014-09-12 20:08:49 +00:00
Dan Albert
fbb8db2e2a Remove makefile cruft.
Don't manually include stlport, and don't use private bionic headers.

Change-Id: I0fc4e8b34ab449e9ef07c26f71e472fca5640590
2014-09-12 10:36:26 -07:00
Dan Albert
dccbb07dfb am a66532e7: am 91baad56: Merge "Fix some clang compilation issues."
* commit 'a66532e73a9c8205002482477f1bf53366d15f38':
  Fix some clang compilation issues.
2014-09-11 17:48:39 +00:00
Dan Albert
949aa23898 Fix some clang compilation issues.
Use expected inline behavior with clang.

GCC defaults to -std=gnu90, giving C89 inline semantics with GNU
extensions. Clang defaults to C99. Explicitly use gnu90.

Mark an unused parameter as __unused.

Fix some incorrect casts.

Change-Id: I05b95585d5e3688eda71769b63b6b8a9237bcaf4
2014-09-11 17:17:32 +00:00
Elliott Hughes
176fe9005d am 4592d73e: am a59b6ac6: Merge "Only the Mac doesn\'t have open_memstream."
* commit '4592d73e18684b8ba2addb97433eed4cf389e386':
  Only the Mac doesn't have open_memstream.
2014-08-21 03:16:26 +00:00
Elliott Hughes
3ff8888f66 Only the Mac doesn't have open_memstream.
We should probably move this into art, since they're the only people using it.

Bug: 17164505
Change-Id: I67b8f0cbad4c6368d4424e6979d6b044dd36aa37
2014-08-20 16:16:24 -07:00
Elliott Hughes
10cce72c4b am 3859029a: am 7fb0ee0c: Merge "Remove androidGetTid."
* commit '3859029a48aa78150fa61eb4988214f8632b33ce':
  Remove androidGetTid.
2014-08-18 19:34:23 +00:00
Elliott Hughes
b7659613b2 Remove androidGetTid.
Bug: 17048545
Change-Id: I93cbb2d7bd18d506b5f5f7f262dd9ac0fca053b4
2014-08-18 10:47:37 -07:00
Elliott Hughes
a613844e13 am e07a6e63: am 6d9a5ac3: Merge "[MIPSR6] Skip pixelflinger, memset assembler code on mips32r6"
* commit 'e07a6e6337a959c45ab71acf6ff1fad8a8ac5dfd':
  [MIPSR6] Skip pixelflinger, memset assembler code on mips32r6
2014-08-05 21:43:16 +00:00
Duane Sand
734f50c2fe [MIPSR6] Skip pixelflinger, memset assembler code on mips32r6
Temporarily use generic C-coded libpixelflinger & memset on mips32r6.

Change-Id: I629b11ba955eaba323cba1df96c39f75f4d24d62
2014-07-31 16:21:16 -07:00
Stephen Hines
eb49dd791e Remove invalid 64-bit host objects.
Bug: 16408818

These targets are no longer in use, since we have a proper way to create both
32-bit and 64-bit host libraries in a single build now.

Cherry-pick from AOSP: 03cc1f747c

Change-Id: Icd09f795acd220de5b5e956a8d8e1b4ab4864fa9
2014-07-25 10:39:38 -07:00
Stephen Hines
da6d2cb925 am 31dc191b: am 73290cd1: Merge "Remove invalid 64-bit host objects."
* commit '31dc191b2b39d4cbd68feba29c7692c91de57a53':
  Remove invalid 64-bit host objects.
2014-07-22 20:53:45 +00:00
Stephen Hines
03cc1f747c Remove invalid 64-bit host objects.
Bug: 16408818

These targets are no longer in use, since we have a proper way to create both
32-bit and 64-bit host libraries in a single build now.

Change-Id: Icd09f795acd220de5b5e956a8d8e1b4ab4864fa9
2014-07-22 13:36:16 -07:00
Elliott Hughes
400c381835 Move sched_policy.c off bionic's PR_SET_TIMERSLACK_PID.
Change-Id: I3a27803d46b5b88a10aa8043a114d780ed685e56
2014-07-17 17:15:14 -07:00
Elliott Hughes
e07d77e422 Use <sys/prctl.h> instead of <linux/prctl.h>.
Change-Id: I708da00e36a9da8be9184c451453774be6b78c06
2014-07-11 20:58:55 -07:00
Christopher Ferris
1472dd465c am f77cf6c6: am 5450a441: am 676f3755: Merge "Add android_memset16/android_memset32 for aarch64."
* commit 'f77cf6c6986057aceece5d7e09d1c23a9efaf20c':
  Add android_memset16/android_memset32 for aarch64.
2014-06-24 19:38:51 +00:00
Christopher Ferris
d660d895c1 Add android_memset16/android_memset32 for aarch64.
Included new unit tests for these functions.

Bug: 15456369

Change-Id: I3fac02f61c62d15d54d0df51957680d7155e98ae
2014-06-23 19:28:33 -07:00
Igor Murashkin
1f7f70a629 libcutils: Fix warnings in properties.c when verbose logging is enabled
Change-Id: I07c5eb59b9395734ad3fc25eba753564c0f096a0
2014-06-20 15:57:09 -07:00
Igor Murashkin
d8f2a8d34a cutils: Add property_get_bool, _get_int32, _get_int64
* Read out system properties with same syntax as SystemProperties.java
* Also adds unit test suite to validate correctness of properties
* Also fixes buffer overrun in property_get

(cherry picked from commit d4507e9246)

Change-Id: Ifd42911f93e17da09e6ff1298e8875e02f3b6608
2014-06-20 20:01:49 +00:00
Nick Kralevich
30a86ebc7a fs_mkdirs: use O_NOFOLLOW and O_CLOEXEC
Don't follow symlinks. Suggestion from Jann Horn.

Also, add O_CLOEXEC. This prevents file descriptor leakage should
this code ever run in a multithreaded environment.

I'm not sure if either of these changes actually address any
security concerns, but it's harmless, so go ahead and add it.

Bug: 15675141
Change-Id: I7ba4e9d10439b7150f59759b54e3ad8ccba411e3
2014-06-16 15:40:40 -07:00
Dan Albert
232c711795 am 46ed1c8c: am ed1a0dbd: am b44e626c: Merge "Fix windows sdk build."
* commit '46ed1c8c99fce33c78e239d4155ece84feca069d':
  Fix windows sdk build.
2014-06-13 10:24:51 +00:00