From d0baac37e61648c2a9e9299553c863cf7b7eed61 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 28 Aug 2024 16:20:44 -0700 Subject: syscall: always use prlimit for getrlimit/setrlimit on Linux Linux added the prlimit system call in version 2.6.36. As our minimum Linux kernel version is now 3.2, simplify the various getrlimit/setlrimit implementations to just always use prlimit. For #67001 Change-Id: I2512c21c947d0bc83f8f9077c143163fd8d83be3 Reviewed-on: https://go-review.googlesource.com/c/go/+/609178 Reviewed-by: Cherry Mui Reviewed-by: Damien Neil Auto-Submit: Ian Lance Taylor Reviewed-by: Tobias Klauser LUCI-TryBot-Result: Go LUCI --- src/syscall/exec_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/syscall/exec_linux.go') diff --git a/src/syscall/exec_linux.go b/src/syscall/exec_linux.go index e4b9ce1bf4..5ef62450a8 100644 --- a/src/syscall/exec_linux.go +++ b/src/syscall/exec_linux.go @@ -632,7 +632,7 @@ func forkAndExecInChild1(argv0 *byte, argv, envv []*byte, chroot, dir *byte, att // Restore original rlimit. if rlim != nil { - rawSetrlimit(RLIMIT_NOFILE, rlim) + RawSyscall6(SYS_PRLIMIT64, 0, RLIMIT_NOFILE, uintptr(unsafe.Pointer(rlim)), 0, 0, 0) } // Enable tracing if requested. -- cgit v1.3