unix: change Setrlimit/Prlimit to always call syscall functions

As of Go 1.21 syscall.Setrlimit and syscall.prlimit can affect
starting a new process, by restoring the original NOFILE rlimit.
That is recorded locally in the syscall package, so just always
call the syscall functions.

For golang/go#46279

Change-Id: I2f3dafe5562a7dde1297bad6f5d34a80af5d620b
Reviewed-on: https://go-review.googlesource.com/c/sys/+/476695
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor
2023-03-15 21:12:13 +00:00
committed by Gopher Robot
parent 494aa493cc
commit ff18efa0a3
72 changed files with 17 additions and 618 deletions
-1
View File
@@ -129,7 +129,6 @@ var darwinTests = [...]darwinTest{
{"setprivexec", libc_setprivexec_trampoline_addr},
{"setregid", libc_setregid_trampoline_addr},
{"setreuid", libc_setreuid_trampoline_addr},
{"setrlimit", libc_setrlimit_trampoline_addr},
{"setsid", libc_setsid_trampoline_addr},
{"setsockopt", libc_setsockopt_trampoline_addr},
{"settimeofday", libc_settimeofday_trampoline_addr},