diff options
author | Ian Lance Taylor <iant@golang.org> | 2023-05-11 09:19:58 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2023-05-11 09:20:17 -0700 |
commit | 173216f75b5b73f02cb414165ea6e6b0535d9fe5 (patch) | |
tree | fe5541d30d9ee8fc681bef0cc803c469b4de402b | |
parent | 4759de55e97a8640f5794bdc219e262d63687479 (diff) | |
download | gcc-173216f75b5b73f02cb414165ea6e6b0535d9fe5.tar.gz |
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.
-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 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 |