]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
syscall: add prlimit
authorIan Lance Taylor <iant@golang.org>
Thu, 11 May 2023 16:19:26 +0000 (09:19 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 11 May 2023 16:19:42 +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 96974bd3269aa9f7a2f85ba68bdd318a8b6d8578..a39f408151ae2e88809441b48bc625c911dc9283 100644 (file)
@@ -188,6 +188,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