Skip to content

Commit 737de90

Browse files
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 Change-Id: I87ad6daaba68c188fb0abecb30f7d574db1f2600 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/486576 Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Than McIntosh <[email protected]>
1 parent 0411a27 commit 737de90

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libgo/go/syscall/libcall_linux.go

+8
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,14 @@ func Gettid() (tid int) {
189189
//sys PivotRoot(newroot string, putold string) (err error)
190190
//pivot_root(newroot *byte, putold *byte) _C_int
191191

192+
// Used by golang.org/x/sys/unix.
193+
//sys prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) (err error)
194+
//prlimit(pid Pid_t, resource _C_int, newlimit *Rlimit, oldlimit *Rlimit) _C_int
195+
196+
func Prlimit(pid int, resource int, newlimit *Rlimit, oldlimit *Rlimit) error {
197+
return prlimit(pid, resource, newlimit, oldlimit)
198+
}
199+
192200
//sys Removexattr(path string, attr string) (err error)
193201
//removexattr(path *byte, name *byte) _C_int
194202

0 commit comments

Comments
 (0)