1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-12-25 20:31:29 +00:00
syncthing-android/ext/patches/golang/386/0002-runtime-add-syscalls-needed-for-android-386-logging.patch

54 lines
1.6 KiB
Diff

From 4d38efc71f1a8733377cb0d0b06eeaee11ddb15c Mon Sep 17 00:00:00 2001
From: Hyang-Ah Hana Kim <hyangah@gmail.com>
Date: Thu, 5 Nov 2015 16:35:24 -0500
Subject: [PATCH 2/4] runtime: add syscalls needed for android/386 logging
Update golang/go#9327.
Change-Id: I27ef973190d9ae652411caf3739414b5d46ca7d2
---
src/runtime/sys_linux_386.s | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s
index a52c4b2..eaf1d1e 100644
--- a/src/runtime/sys_linux_386.s
+++ b/src/runtime/sys_linux_386.s
@@ -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
+ // 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
+ // 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
--
2.5.2