Skip to content

Commit edf3ec9

Browse files
committed
runtime: correct setNonblock on linux/arm64
The current code uses EOR (exclusive OR), which will result in the O_NONBLOCK flag being toggled rather than being set. Other implementations use OR, hence this is likely a bug. Change-Id: I5dafa9c572452070bd37789c8a731ad6d04a86cd Reviewed-on: https://go-review.googlesource.com/c/go/+/212766 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Zhang <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent f266cce commit edf3ec9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/sys_linux_arm64.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ TEXT runtime·setNonblock(SB),NOSPLIT|NOFRAME,$0-4
688688
MOVD $SYS_fcntl, R8
689689
SVC
690690
MOVD $0x800, R2 // O_NONBLOCK
691-
EOR R0, R2
691+
ORR R0, R2
692692
MOVW fd+0(FP), R0 // fd
693693
MOVD $4, R1 // F_SETFL
694694
MOVD $SYS_fcntl, R8

0 commit comments

Comments
 (0)