From 173216f75b5b73f02cb414165ea6e6b0535d9fe5 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 11 May 2023 09:19:58 -0700 Subject: syscall: add prlimit 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go index 96974bd3269..a39f408151a 100644 --- a/libgo/go/syscall/libcall_linux.go +++ b/libgo/go/syscall/libcall_linux.go @@ -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 -- cgit v1.2.1