runtime: support panic/print logging in android-L.

In android-L, logging is done through the logd daemon.
If logd daemon is available, send logging to logd.
Otherwise, fallback to the legacy mechanism (/dev/log files).

This change adds access/socket/connect calls to interact with the logd.

Fixes golang/go#9398.

Change-Id: I3c52b81b451f5862107d7c675f799fc85548486d
Reviewed-on: https://go-review.googlesource.com/3350
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah Hana Kim 2015-01-24 17:51:42 -05:00
parent 11c1227493
commit 3a87135754
4 changed files with 175 additions and 18 deletions

View file

@ -65,7 +65,7 @@ const (
_ITIMER_PROF = 0x2
_ITIMER_VIRTUAL = 0x1
_O_RDONLY = 0
_O_CLOEXEC = 02000000
_O_CLOEXEC = 0x80000
_EPOLLIN = 0x1
_EPOLLOUT = 0x4
@ -77,6 +77,10 @@ const (
_EPOLL_CTL_ADD = 0x1
_EPOLL_CTL_DEL = 0x2
_EPOLL_CTL_MOD = 0x3
_AF_UNIX = 0x1
_F_SETFL = 0x4
_SOCK_DGRAM = 0x2
)
type timespec struct {
@ -166,3 +170,8 @@ type epollevent struct {
_pad uint32
data [8]byte // to match amd64
}
type sockaddr_un struct {
family uint16
path [108]byte
}