aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_linux_amd64.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2024-08-28 16:20:44 -0700
committerGopher Robot <gobot@golang.org>2024-08-30 19:26:45 +0000
commitd0baac37e61648c2a9e9299553c863cf7b7eed61 (patch)
treea930867938705097c3e0872a2339bda46de086e6 /src/syscall/syscall_linux_amd64.go
parentc2098929056481d0dc09f5f42b8959f4db8878f2 (diff)
downloadgo-d0baac37e61648c2a9e9299553c863cf7b7eed61.tar.xz
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 <cherryyz@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/syscall/syscall_linux_amd64.go')
-rw-r--r--src/syscall/syscall_linux_amd64.go12
1 files changed, 0 insertions, 12 deletions
diff --git a/src/syscall/syscall_linux_amd64.go b/src/syscall/syscall_linux_amd64.go
index ec52f8a4bd..725ebdba22 100644
--- a/src/syscall/syscall_linux_amd64.go
+++ b/src/syscall/syscall_linux_amd64.go
@@ -4,10 +4,6 @@
package syscall
-import (
- "unsafe"
-)
-
const (
_SYS_setgroups = SYS_SETGROUPS
_SYS_clone3 = 435
@@ -23,7 +19,6 @@ const (
//sysnb Getegid() (egid int)
//sysnb Geteuid() (euid int)
//sysnb Getgid() (gid int)
-//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getuid() (uid int)
//sysnb InotifyInit() (fd int, err error)
//sys Ioperm(from int, num int, on int) (err error)
@@ -38,7 +33,6 @@ const (
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys Setfsgid(gid int) (err error)
//sys Setfsuid(uid int) (err error)
-//sysnb setrlimit(resource int, rlim *Rlimit) (err error) = SYS_SETRLIMIT
//sys Shutdown(fd int, how int) (err error)
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
//sys Statfs(path string, buf *Statfs_t) (err error)
@@ -103,12 +97,6 @@ func Time(t *Time_t) (tt Time_t, err error) {
//sys Utime(path string, buf *Utimbuf) (err error)
//sys utimes(path string, times *[2]Timeval) (err error)
-//go:nosplit
-func rawSetrlimit(resource int, rlim *Rlimit) Errno {
- _, _, errno := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
- return errno
-}
-
func setTimespec(sec, nsec int64) Timespec {
return Timespec{Sec: sec, Nsec: nsec}
}