1
0
mirror of https://github.com/golang/go synced 2024-11-18 00:54:45 -07:00

runtime: add syscalls needed for android/386 logging

Update golang/go#9327.

Change-Id: I27ef973190d9ae652411caf3739414b5d46ca7d2
Reviewed-on: https://go-review.googlesource.com/16679
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
Hyang-Ah Hana Kim 2015-11-05 16:35:24 -05:00
parent 05c4c6e2f4
commit b2259dcef0

View File

@ -518,3 +518,34 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0
MOVL $1, DX // FD_CLOEXEC
INVOKE_SYSINFO
RET
// int access(const char *name, int mode)
TEXT runtime·access(SB),NOSPLIT,$0
MOVL $33, AX // syscall - access
MOVL name+0(FP), BX
MOVL mode+4(FP), CX
INVOKE_SYSINFO
MOVL AX, ret+8(FP)
RET
// int connect(int fd, const struct sockaddr *addr, socklen_t addrlen)
TEXT runtime·connect(SB),NOSPLIT,$0-16
// connect is implemented as socketcall(NR_socket, 3, *(rest of args))
// stack already should have fd, addr, addrlen.
MOVL $102, AX // syscall - socketcall
MOVL $3, BX // connect
LEAL fd+0(FP), CX
INVOKE_SYSINFO
MOVL AX, ret+12(FP)
RET
// int socket(int domain, int type, int protocol)
TEXT runtime·socket(SB),NOSPLIT,$0-16
// socket is implemented as socketcall(NR_socket, 1, *(rest of args))
// stack already should have domain, type, protocol.
MOVL $102, AX // syscall - socketcall
MOVL $1, BX // socket
LEAL domain+0(FP), CX
INVOKE_SYSINFO
MOVL AX, ret+12(FP)
RET