diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-04-19 15:05:54 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2023-05-11 09:17:48 -0700 |
commit | fd95566fda0b45e92e20562321221bd2c486c089 (patch) | |
tree | 49e37ece1acefbe11d45abe131982673a9513bd7 /libgo/go | |
parent | 0d0c467d216bf538faa7ceb75875e4efa73ae23f (diff) | |
download | gcc-fd95566fda0b45e92e20562321221bd2c486c089.zip gcc-fd95566fda0b45e92e20562321221bd2c486c089.tar.gz gcc-fd95566fda0b45e92e20562321221bd2c486c089.tar.bz2 |
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.
For golang/go#46279
Fixes golang/go#59712
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/486576
Diffstat (limited to 'libgo/go')
-rw-r--r-- | libgo/go/syscall/libcall_linux.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libgo/go/syscall/libcall_linux.go b/libgo/go/syscall/libcall_linux.go index 19ae439..03ca726 100644 --- a/libgo/go/syscall/libcall_linux.go +++ b/libgo/go/syscall/libcall_linux.go @@ -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 |