]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
syscall: add prlimit
authorIan Lance Taylor <iant@golang.org>
Wed, 19 Apr 2023 22:05:54 +0000 (15:05 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 11 May 2023 16:17:48 +0000 (09:17 -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.

For golang/go#46279
Fixes golang/go#59712

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/486576

gcc/go/gofrontend/MERGE
libgo/go/syscall/libcall_linux.go

index e133650ad915176d71df790b6a0af6314c8eda09..702257009d288977e66293a6d0b35516d644588f 100644 (file)
@@ -1,4 +1,4 @@
-0411a2733fd468e69f1998edd91e8fe3ba40ff9e
+737de90a63002d4872b19772a7116404ee5815b4
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
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