diff options
| author | Hyang-Ah Hana Kim <hyangah@gmail.com> | 2015-10-16 14:17:25 -0400 |
|---|---|---|
| committer | Hyang-Ah Hana Kim <hyangah@gmail.com> | 2015-10-20 16:56:58 +0000 |
| commit | 30ee5919bd08fd9d05504f8e0b568cc59a97c1fc (patch) | |
| tree | 833cc3a94003f9f5d1d9a3d856b1c334a2989578 /src/runtime/sys_linux_amd64.s | |
| parent | 7d2c6eb3f53d4fa54587ff52ecb739bd4b13f9ab (diff) | |
| download | go-30ee5919bd08fd9d05504f8e0b568cc59a97c1fc.tar.xz | |
runtime: add syscalls needed for android/amd64 logging.
access, connect, socket.
In Android-L, logging is done by writing the log messages to the logd
process through a unix domain socket.
Also, changed the arg types of those syscall stubs to match linux
programming APIs.
For golang/go#10743
Change-Id: I66368a03316e253561e9e76aadd180c2cd2e48f3
Reviewed-on: https://go-review.googlesource.com/15993
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_amd64.s')
| -rw-r--r-- | src/runtime/sys_linux_amd64.s | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s index 7ad704f306..df72a77afc 100644 --- a/src/runtime/sys_linux_amd64.s +++ b/src/runtime/sys_linux_amd64.s @@ -442,3 +442,33 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0 MOVL $72, AX // fcntl SYSCALL RET + + +// int access(const char *name, int mode) +TEXT runtime·access(SB),NOSPLIT,$0 + MOVQ name+0(FP), DI + MOVL mode+8(FP), SI + MOVL $21, AX // syscall entry + SYSCALL + MOVL AX, ret+16(FP) + RET + +// int connect(int fd, const struct sockaddr *addr, socklen_t addrlen) +TEXT runtime·connect(SB),NOSPLIT,$0-28 + MOVL fd+0(FP), DI + MOVQ addr+8(FP), SI + MOVL addrlen+16(FP), DX + MOVL $42, AX // syscall entry + SYSCALL + MOVL AX, ret+24(FP) + RET + +// int socket(int domain, int type, int protocol) +TEXT runtime·socket(SB),NOSPLIT,$0-20 + MOVL domain+0(FP), DI + MOVL type+4(FP), SI + MOVL protocol+8(FP), DX + MOVL $41, AX // syscall entry + SYSCALL + MOVL AX, ret+16(FP) + RET |
