Apply restorecon_recursive to all of /data.

With the following prior changes:
I77bf2a0c4c34b1feef6fdf4d6c3bd92dbf32f4a1
I698b1b2c3f00f31fbb2015edf23d33b51aa5bba1
I8dd915d9bb80067339621b905ea2b4ea0fa8d71e
it should now be safe (will correctly label all files)
and reasonably performant (will skip processing unless
file_contexts has changed since the last call) to call
restorecon_recursive /data from init.rc.

The call is placed after the setprop selinux.policy_reload 1 so that
we use any policy update under /data/security if present.

Change-Id: Ib8d9751a47c8e0238cf499fcec61898937945d9d
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
AArch64: Use negative values in error enumeration

With AArch64 the enumerations with values in the range
0x80000000 to 0x80000007 are being assigned to ssize_t
typed variables which are 64-bit rather than 32-bit, and
are being used in conditions where they are being checked
for being negative. This is not the case when ssize_t is
64-bit, so redefine this to INT32_MIN value.

Change-Id: I7a031a940a28658b3bf34bebac93dfb3ba397b05
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
fs_mgr: Don't run e2fsck inside SDK system images.

These images do not have GPL-ed binaries like /system/bin/e2fsck so
avoid running the program when we detect that we're running inside
one of them.

Note that this does not affect other emulator-based build products
(e..g full-eng instead of sdk-eng), which do have the binaries.

BUG=13057123

Change-Id: Ia42f1d02a3845fbf4b2f9d95818f35d760711a12
Remove unused #includes of <asm/page.h>.

(<asm/page.h> is going away.)

Change-Id: Id0d7ad0eb791cd47490c48458f9f8a6468ddf5c9
Merge "Remove unused #includes of <asm/page.h>."
Remove an unused #include of <asm/page.h>.

Change-Id: I000aead8c82ec11151f69e6ce439dd09b0f0b4f4
Merge "Remove an unused #include of <asm/page.h>."
Merge "fs_mgr: Don't run e2fsck inside SDK system images."
Fix undefined args access for x86_64.

From libc manual for vsnprintf:
   The  functions  vprintf(),  vfprintf(), vsprintf(), vsnprintf()
   are equivalent to the functions printf(), fprintf(), sprintf(), snprintf(),
   respectively, except that they are called with a va_list instead of a
   variable number of arguments.  These  functions  do  not  call  the  va_end  macro.
   Because they invoke the va_arg macro, the value of ap is undefined after the call.

We need to allocate/end new va_list for each vsnprintf.

Change-Id: I66ec058033be1cb918e7b2bc84ca546800da226b
Signed-off-by: Fengwei Yin <fengwei.yin@intel.com>
logcat: test: add clear and blocking check

(cherry picked from commit 1beb2ab6f6f7cec157b25a2e728c6de8c6be58c4)

Change-Id: I243b1338c4a5935a297a0519c03697fd828e47e6
logd: initial checkin.

* Create a new userspace log daemon for handling logging messages.

Original-Change-Id: I75267df16359684490121e6c31cca48614d79856
Signed-off-by: Nick Kralevich <nnk@google.com>

* Merge conflicts
* rename new syslog daemon to logd to prevent confusion with bionic syslog
* replace racy getGroups call with KISS call to client->getGid()
* Timestamps are filed at logging source
* insert entries into list in timestamp order
* Added LogTimeEntry tail filtration handling
* Added region locking around LogWriter list
* separate threads for each writer
* /dev/socket/logd* permissions

Signed-off-by: Mark Salyzyn <salyzyn@google.com>

(cherry picked from commit 3e76e0a49760c4970b7cda6153e51026af98e4f3)

Author: Nick Kralevich <nnk@google.com>
Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098
logd: prune more aggressively when over the top

(cherry picked from commit 63c15d50615a4c9e9ad25f601ef9dcb1161d8990)

Change-Id: I929dddc7da048c032fb791c7af23f215f8856bf3
logd: Adjust to match defacto coding style

(cherry picked from commit c46f77bd2ad01f3a695416c4cf22d6a9738bb7b8)

Change-Id: I80685cdc7116e10c5a5a77abe856fd96804f9117
logd: Add SCHED_BATCH to reduce priority

(cherry picked from commit 85620a1bfff1824687fd1cb14c8e1a9b2683c061)

Change-Id: Id25cdef0dd7f8c5e154a0da2db2dd0554849babc
libcutils: Socket type might contain bitwise OR flags

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Change-Id: Ia5c8f136793a989fc1d71c61292afe4e5cf169fa
Merge "libcutils: Socket type might contain bitwise OR flags"
Merge "Fix undefined args access for x86_64."
Merge "logcat: test: add clear and blocking check"
Merge "logd: initial checkin."
Merge changes Id25cdef0,I80685cdc,I929dddc7

* changes:
  logd: Add SCHED_BATCH to reduce priority
  logd: Adjust to match defacto coding style
  logd: prune more aggressively when over the top