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 <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Ian Lance Taylor 2023-04-19 15:05:54 -07:00
Родитель 0411a2733f
Коммит 737de90a63
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -189,6 +189,14 @@ func Gettid() (tid int) {
//sys PivotRoot(newroot string, putold string) (err error) //sys PivotRoot(newroot string, putold string) (err error)
//pivot_root(newroot *byte, putold *byte) _C_int //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) //sys Removexattr(path string, attr string) (err error)
//removexattr(path *byte, name *byte) _C_int //removexattr(path *byte, name *byte) _C_int