Commit graph

161 commits

Author SHA1 Message Date
Nick Kralevich
69ce489fc3 fs.c: Fix implicit declaration of function 'mkstemp'
system/core/libcutils/fs.c: In function 'fs_write_atomic_int':
system/core/libcutils/fs.c:109:5: warning: implicit declaration of function 'mkstemp' [-Wimplicit-function-declaration]

Change-Id: I337ecb818f85e20b058f782df45987acf2e9d6c1
2012-10-15 15:51:33 -07:00
Jeff Sharkey
489609bb44 Allow mkdir() race to succeed.
When two zygotes are starting, they both may try creating a mount
point after checking lstat().  The second mkdir() will result in
EEXIST, which is okay to ignore.

Bug: 7165469
Change-Id: If4411e2621f773c74cd05247899982fa5ebdd020
2012-09-25 13:13:08 -07:00
Jeff Sharkey
6de7026790 Wrap more system calls in TEMP_FAILURE_RETRY.
Bug: 7151474
Change-Id: I9fe19746104cf392f88ea5cf8061e2e21e334671
2012-09-13 15:11:42 -07:00
Jeff Sharkey
ddb1733944 Wrap system calls in TEMP_FAILURE_RETRY.
fs_prepare_dir() is used heavily during Zygote init, and can easily
run into EINTR.

Bug: 7151474
Change-Id: I7aac43a43483d55db47ca20456fff68ce51bbc46
2012-09-13 15:02:53 -07:00
Jeff Sharkey
9685194fc9 File-system utilities for installd and zygote.
Bug: 7008879
Change-Id: Ia54b8d4ad434e8973f235e2a4728651814bef8a9
2012-08-30 10:29:41 -07:00
Ian Rogers
fd7f1b6a50 Revert "Revert "Upgrade to dlmalloc 2.8.5.""
This reverts commit 42b83c6df7.
2012-08-28 15:52:20 -07:00
Brian Carlstrom
42b83c6df7 Revert "Upgrade to dlmalloc 2.8.5."
This reverts commit 2d13791ce7.
2012-08-22 12:10:19 -07:00
Brian Carlstrom
1768707951 am e05ac541: am 9d779bf1: Merge "Upgrade to dlmalloc 2.8.5."
* commit 'e05ac5415e861dee6a3f175c8066ff577736ba1f':
  Upgrade to dlmalloc 2.8.5.
2012-08-20 17:04:24 -07:00
Ian Rogers
2d13791ce7 Upgrade to dlmalloc 2.8.5.
Remove mspace functionality from cutils.
Directly declare mspace from dlmalloc in code flinger's code cache, and
manage without using morecore.

Depends upon: https://android-review.googlesource.com/41717

Change-Id: If927254febd4414212c690f16509ef2ee1b44b44
2012-08-20 15:30:35 -07:00
Jeff Sharkey
de980f27a7 Omit multiuser.c from Windows builds.
Change-Id: I0cee35373e33084e4fc65a1d5c0b611c6fa82346
2012-08-16 17:16:43 -07:00
Jeff Sharkey
2be5338a84 Merge "Multi-user external storage support." into jb-mr1-dev 2012-08-16 14:33:00 -07:00
Jeff Sharkey
885342a0f2 Multi-user external storage support.
Remount rootfs as recursively shared, so that mount changes are
propagated into child namespaces.  Mount external storage for access
from adb.

Clean multi-user dependencies for use in Dalvik.  Also define
external storage paths.

Bug: 6925012
Change-Id: I375de581a63f4f36667894c56a34a9dd45361e8f
2012-08-15 21:10:07 -07:00
Jean-Baptiste Queru
93be76f5c0 am e8e73b01: am 311a4758: Merge "Remove system/core\'s remnants of SH support."
* commit 'e8e73b01399e8d3c3fc6b94d26ef9cc49b33dda8':
  Remove system/core's remnants of SH support.
2012-08-13 16:03:30 -07:00
Elliott Hughes
6521a41dcf Remove system/core's remnants of SH support.
SH support is long dead.

Change-Id: I6be2763ca9f1ad8b3f9b09a8ad2f1d67f1e7f802
2012-08-11 10:04:00 -07:00
Jeff Sharkey
46ac0ef00b Include to define uid_t.
Change-Id: I02d36346fc3c6236bd64309798b434405f8dfef7
2012-08-08 13:59:34 -07:00
Jeff Sharkey
9509d27252 Native utils for working with user and app IDs.
Bug: 6925012
Change-Id: I56f18826fd324f60b6e446cebd30719258e40990
2012-08-07 17:56:48 -07:00
Jeff Brown
053b865412 Enhance native stack dumps.
Provides a new mechanism for dumpstate (while running as root)
to request that debuggerd dump the stacks of native processes that
we care about in bug reports.  In this mode, the backtrace
is formatted to look similar to a Dalvik backtrace.

Moved the tombstone generating code into a separate file to
make it easier to maintain.

Fixed a bug where sometimes the stack traces would be incomplete
because we were not waiting for each thread to stop after issuing
PTRACE_ATTACH, only the main thread.  So sometimes we were missing
traces for some threads.

Refactored the logging code to prevent accidentally writing data
to logcat when explicitly dumping a tombstone or backtrace from the
console.

Only root or system server can request to dump backtraces but
only root can dump tombstones.

Bug: 6615693
Change-Id: Ib3edcc16f9f3a687e414e3f2d250d9500566123b
2012-06-08 13:29:23 -07:00
Dima Zavin
29319a6753 cutils: sched_policy: remove audio app/sys groups, merge into fg
Bug: 6528015
Change-Id: I6c2658b62442d811b53c6d18476fbd6cd45f9e3f
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 13:20:17 -07:00
Dima Zavin
13ed76bfbc cutils: sched_policy: make bg group be nested under fg
Adds an apps cgroup which will contain fg tasks. Move the bg group
nested underneath it.

Bug: 6538553
Change-Id: I55279415da625e15a5bb061c2b45fbe7f7a4c047
Signed-off-by: Dima Zavin <dima@android.com>
2012-06-04 10:42:40 -07:00
Jeff Brown
5b878d24c1 Revert "Revert "Use O_CLOEXEC when opening cgroup fds.""
This reverts commit 4df54bc4a8.
2012-05-08 15:07:58 -07:00
Jeff Brown
bff8f3fa98 Add stubs for host builds.
Bug: 4466013
Change-Id: I5633c841e71a48357bb04cd7ccc02550c17bde22
2012-05-08 15:07:32 -07:00
Jeff Brown
4df54bc4a8 Revert "Use O_CLOEXEC when opening cgroup fds."
This reverts commit e1440d81ae
2012-05-08 14:58:30 -07:00
Jeff Brown
e1440d81ae Use O_CLOEXEC when opening cgroup fds.
Bug: 4466013
Change-Id: I0d2e915fc550a0ecaccad5e452dd4c87fc878b8b
2012-05-08 13:41:10 -07:00
Jeff Sharkey
e34b91719c Support full 32 bits for socket tags.
Bug: 5321184
Change-Id: Iabd668674e60626caafc9b66b29fdbddc3724f58
2012-05-02 16:01:31 -07:00
Glenn Kasten
10ec3c7645 Add more SP_ constants
Change-Id: I52c8ea33b9b915fc08546f2ca0b191391f58506b
2012-04-23 17:34:06 -07:00
Glenn Kasten
69bfb1f099 Scheduling group cleanup - add comment, SP_DEFAULT
Also tid == 0 maps to gettid() on platforms that support it.
This is needed by mediaserver code that was formerly using
the old C++ API.

Change-Id: I8baaa3e42315c9b924cec26b6da01e7cb69e0078
2012-04-20 10:31:50 -07:00
Geremy Condra
15621e0970 cutils: return the remote uid on netlink recv failure
This change adds a layer of indirection to uevent's
uevent_kernel_multicast_recv, allowing dependent code to
get the remote endpoint if desired.

Change-Id: If2f00708a1dd6196c415b1ebc2a7eeb72399a90e
2012-03-29 17:07:24 -07:00
Jeff Brown
4a6b384f60 Provide portable wrapper for qsort_r.
qsort_r() is declared differently on BSD and GNU libc and
may be absent on other platforms.

Provide qsort_r_compat() which should work everywhere.

Change-Id: I17a9026573b1ed971ff7d79895e7eb41ba108807
2012-03-19 14:07:26 -07:00
Jeff Brown
14d0c6c7c0 Add missing includes.
Caused warnings about implicitly defined malloc() and sprintf().

Change-Id: Ia56309adc11caf5801ffd88e374c512b785cfd93
2012-03-19 14:06:50 -07:00
Dima Zavin
c4edb9ec90 Merge "cutils: str_parms: when deleting entry, need to also remove key" 2012-03-19 09:56:14 -07:00
Glenn Kasten
0ad682cdde Merge "Add get_sched_policy_name() and use in ps and top" 2012-03-15 15:45:19 -07:00
Glenn Kasten
86c7cc8189 Add get_sched_policy_name() and use in ps and top
This will make it easier to add additional policies (cgroups) if needed.
Also added comments to the sched_policy APIs.

Change-Id: I33ce1cc4deae10983241f7391294b7a512d2c47c
2012-03-15 15:10:45 -07:00
Dima Zavin
efd7501d53 cutils: str_parms: when deleting entry, need to also remove key
When removing one entry, we can't just remove it from the map since
key will not be freed. So, instead, search through the map for the key
and free it once it is found.

Change-Id: Id745c166a4acc5ea25f6d6cdbfe4f8fbc21cbbb3
Reported-by: Xin Qian <xqian@marvell.com>
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-14 23:17:11 -07:00
Dima Zavin
86bfbe3cae cutils: str_parms: free the key if the value was replaced during create/add
Change-Id: I9f31da62f10f78ed11693a7c04e2be29b0790c93
Reported-by: Xin Qian <xqian@marvell.com>
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-14 23:17:11 -07:00
Andrew Hsieh
9d4dbf4835 Merge "Added rules to build 64-bit libraries: lib64cutils.a and lib64log.a" 2012-03-13 16:28:08 -07:00
Dima Zavin
eccfb08f38 Revert "cutils: str_parms: make test executable build for host instead"
This reverts commit 7d31e6e533.
2012-03-12 15:06:05 -07:00
Dima Zavin
7d31e6e533 cutils: str_parms: make test executable build for host instead
Change-Id: I711e03aaf859107c697c6dcb82e0ab83e94570ba
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-12 11:03:38 -07:00
Dima Zavin
a603e40f9e cutils: str_parms: test str_parms_add_str too
Change-Id: I93f0e577aff6b8ff23a44e29f9942a26545b6dc8
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-12 11:03:38 -07:00
Dima Zavin
70b93034f3 cutils: str_parms: need to also dup the key when adding to hash
Change-Id: Iabdd2061cbc36c6f4d4eb6e46bd757b5b52e0027
Signed-off-by: Dima Zavin <dima@android.com>
2012-03-12 11:03:38 -07:00
Andrew Hsieh
99e7f7af84 Added rules to build 64-bit libraries: lib64cutils.a and lib64log.a
Both libraries are needed to build four shared libraries in 64-bit
for 64-bit emulator with "-gpu on"
  lib64OpenglRender.so
  lib64EGL_translator.so
  lib64GLES_CM_translator.so
  lib64GLES_V2_translator.so

Change-Id: If57f72d4661a74f1d5e537568881f39132e0b43d
2012-03-01 23:58:50 -08:00
David 'Digit' Turner
7913bc05be libcutils: Use proper private header to access C library's <time.h> extension
The strftime_tz() function is not a standard C library function and should not
appear in <time.h>. Instead, it is being moved to <bionic_time.h>, a private
header only available to platform libraries.

Change-Id: I4dc18939b9380725dfaa20c9e417296363bc52f4
2012-01-13 13:38:40 +01:00
Steve Block
01dda204cd Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: Ibcffdcf620ebae1c389446ce8e9d908f11ac039c
2012-01-08 11:03:26 +00:00
Steve Block
ae8b56c0d1 Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I1e070511b6a538e9f1c94657356437a457d58882
2012-01-05 22:25:38 +00:00
Steve Block
fe71a61e5b Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I4951baa981f09a84ce483e3d1bd0f9ebe009035f
2012-01-04 19:23:34 +00:00
Steve Block
8d66c49258 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: I9244d927f14c750cd359ebffb1fc1c355a755d5a
2012-01-03 22:32:30 +00:00
Steve Block
69f4cd7f5a Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE
Bug: 5449033
Change-Id: Ib453f869977a6e909095a578bbf0420851f887d2
2011-10-26 09:59:23 +01:00
JP Abgrall
29656d34a2 qtaguid: shhhh. LOGI -> LOGV
Less verbose output.

Bug: 5360129
Change-Id: Id32a7c61d51b6a16f50a5c8bcc75a2feaa0e34b1
2011-09-22 14:39:47 -07:00
JP Abgrall
243123fb41 libcutils: qtaguid: Support new functions, add tag resource tracking.
* Add support for
  deleteTagData(tag, uid)
  setCounterSet(counterSetNum, uid)
  setPacifier(on)

* Add resource tracking
(If only kernel process termination had a hook)
Because the xt_qtaguid netfilter module needs to keep track of
tagged sockets, it needs a way to know when the process owning
the socket has died.
Normally the app will untag the sockets. But not on crash.
So the process opens the qtaguid misc dev, which is closed on crash,
at which point the xt_qtaguid can force-untag the processes sockets,
and thus allowing their refcount to go down and release them.

* Add pacifier support
 Add function to enable/disable pacification of the xt_qtaguid
 kernel module. (mostly for debugging)

Change-Id: I7f2228e65208046dd37ec1c7407ee307d5ba9b99
2011-09-14 15:00:40 -07:00
Dima Zavin
7e14e0c974 cutils: only build klog for target
Change-Id: Id524753ca5e7271a498fdf03179bba3fdaed5729
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-04 17:16:13 -07:00
Dima Zavin
da04c52ab1 init/cutils: move list utility code to cutils from init
Change-Id: I357ceee813700297d8343159f22a07659e768d41
Signed-off-by: Dima Zavin <dima@android.com>
2011-09-02 12:11:18 -07:00