From 9d34fc5108d91bfcce3c465069dbb2c563af4229 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 3 Mar 2022 10:19:07 +0100 Subject: runtime: remove fallback to pipe on platforms with pipe2 On Linux, the minimum required kernel version for Go 1.18 was be changed to 2.6.32, see #45964. The pipe2 syscall was added in 2.6.27. All other platforms already provide the pipe2 syscall in the minimum supported version: - DragonFly BSD added it in version 4.2, see https://www.dragonflybsd.org/release42/ - FreeBSD added it in version 10.0, see https://www.freebsd.org/cgi/man.cgi?pipe(2)#end - NetBSD added it in version 6.0, see https://man.netbsd.org/pipe2.2#HISTORY - OpenBSD added it in version 5.7, see https://man.openbsd.org/pipe.2#HISTORY - Illumos supports it since 2013, see https://www.illumos.org/issues/3714 - Solaris supports it since 11.4 This also allows to remove setNonblock which was only used in the pipe fallback path on these platforms. Change-Id: I1f40d32fd3065d74e22af77b9ff2292b9cf66706 Reviewed-on: https://go-review.googlesource.com/c/go/+/389354 Trust: Tobias Klauser Run-TryBot: Tobias Klauser TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/runtime/sys_linux_arm.s | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/runtime/sys_linux_arm.s') diff --git a/src/runtime/sys_linux_arm.s b/src/runtime/sys_linux_arm.s index ca443b699f..201940b4e6 100644 --- a/src/runtime/sys_linux_arm.s +++ b/src/runtime/sys_linux_arm.s @@ -23,7 +23,6 @@ #define SYS_close (SYS_BASE + 6) #define SYS_getpid (SYS_BASE + 20) #define SYS_kill (SYS_BASE + 37) -#define SYS_pipe (SYS_BASE + 42) #define SYS_clone (SYS_BASE + 120) #define SYS_rt_sigreturn (SYS_BASE + 173) #define SYS_rt_sigaction (SYS_BASE + 174) @@ -98,14 +97,6 @@ TEXT runtime·read(SB),NOSPLIT,$0 MOVW R0, ret+12(FP) RET -// func pipe() (r, w int32, errno int32) -TEXT runtime·pipe(SB),NOSPLIT,$0-12 - MOVW $r+0(FP), R0 - MOVW $SYS_pipe, R7 - SWI $0 - MOVW R0, errno+8(FP) - RET - // func pipe2(flags int32) (r, w int32, errno int32) TEXT runtime·pipe2(SB),NOSPLIT,$0-16 MOVW $r+4(FP), R0 @@ -717,20 +708,6 @@ TEXT runtime·closeonexec(SB),NOSPLIT,$0 SWI $0 RET -// func runtime·setNonblock(fd int32) -TEXT runtime·setNonblock(SB),NOSPLIT,$0-4 - MOVW fd+0(FP), R0 // fd - MOVW $3, R1 // F_GETFL - MOVW $0, R2 - MOVW $SYS_fcntl, R7 - SWI $0 - ORR $0x800, R0, R2 // O_NONBLOCK - MOVW fd+0(FP), R0 // fd - MOVW $4, R1 // F_SETFL - MOVW $SYS_fcntl, R7 - SWI $0 - RET - // b __kuser_get_tls @ 0xffff0fe0 TEXT runtime·read_tls_fallback(SB),NOSPLIT|NOFRAME,$0 MOVW $0xffff0fe0, R0 -- cgit v1.3