summaryrefslogtreecommitdiff
path: root/src/runtime/sys_linux_amd64.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-05-18 16:56:48 -0400
committerAustin Clements <austin@google.com>2017-05-19 16:05:39 +0000
commit4dcba023c62d7f7968abc54fa5d38d2bf11412ba (patch)
tree2f19adc95a837e7a832b8d3d40fb35c5f9d15daa /src/runtime/sys_linux_amd64.s
parent366bb678aa0281ca2920e38ace9d695474a61797 (diff)
downloadgo-git-4dcba023c62d7f7968abc54fa5d38d2bf11412ba.tar.gz
runtime: use pselect6 for usleep on linux/amd64 and linux/arm
Android O black-lists the select system call because its libc, Bionic, does not use this system call. Replace our use of select with pselect6 (which is allowed) on the platforms that support targeting Android. linux/arm64 already uses pselect6 because there is no select on arm64, so only linux/amd64 and linux/arm need changing. pselect6 has been available since Linux 2.6.16, which is before Go's minimum requirement. Fixes #20409. Change-Id: Ic526b5b259a9e01d2f145a1f4d2e76e8c49ce809 Reviewed-on: https://go-review.googlesource.com/43641 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_amd64.s')
-rw-r--r--src/runtime/sys_linux_amd64.s9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s
index c2b1376fa9..bf539aa0da 100644
--- a/src/runtime/sys_linux_amd64.s
+++ b/src/runtime/sys_linux_amd64.s
@@ -82,15 +82,18 @@ TEXT runtimeĀ·usleep(SB),NOSPLIT,$16
MOVL $1000000, CX
DIVL CX
MOVQ AX, 0(SP)
- MOVQ DX, 8(SP)
+ MOVL $1000, AX // usec to nsec
+ MULL DX
+ MOVQ AX, 8(SP)
- // select(0, 0, 0, 0, &tv)
+ // pselect6(0, 0, 0, 0, &ts, 0)
MOVL $0, DI
MOVL $0, SI
MOVL $0, DX
MOVL $0, R10
MOVQ SP, R8
- MOVL $23, AX
+ MOVL $0, R9
+ MOVL $270, AX
SYSCALL
RET