]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
syscall: add prlimit
authorIan Lance Taylor <iant@golang.org>
Thu, 11 May 2023 16:18:10 +0000 (09:18 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 11 May 2023 16:19:00 +0000 (09:19 -0700)
As of https://go.dev/cl/476695 golang.org/x/sys/unix can call
syscall.prlimit, so we need such a function in libgo.

libgo/go/syscall/libcall_linux.go

index 19ae4393cf138eb30b8568381fc0b20bc63b937d..03ca7261b59ba0929c93525c726e64e92da14dd6 100644 (file)
@@ -189,6 +189,14 @@ func Gettid() (tid int) {
 //sys  PivotRoot(newroot string, putold string) (err error)
 //pivot_root(newroot *byte, putold *byte) _C_int
 
+// Used by golang.org/x/sys/unix.
+//sys  prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) (err error)
+//prlimit(pid Pid_t, resource _C_int, newlimit *Rlimit, oldlimit *Rlimit) _C_int
+
+func Prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) error {
+       return prlimit(pid, resource, newlimit, oldlimit)
+}
+
 //sys  Removexattr(path string, attr string) (err error)
 //removexattr(path *byte, name *byte) _C_int