Skip to content

Commit

Permalink
syscall: add prlimit
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ianlancetaylor committed May 11, 2023
1 parent 0d0c467 commit fd95566
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/go/gofrontend/MERGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0411a2733fd468e69f1998edd91e8fe3ba40ff9e
737de90a63002d4872b19772a7116404ee5815b4

The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
8 changes: 8 additions & 0 deletions libgo/go/syscall/libcall_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fd95566

Please sign in to comment.