aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_linux.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2024-05-21 22:38:02 -0400
committerGopher Robot <gobot@golang.org>2024-05-22 20:12:46 +0000
commitef225d1c57a97af984af114ee52005314530bbe2 (patch)
tree745ef06d093490ff1c486249904cc189d1eabf34 /src/syscall/syscall_linux.go
parentdca577d882f989e41a753537e9607f0c22e4a798 (diff)
downloadgo-ef225d1c57a97af984af114ee52005314530bbe2.tar.xz
all: document legacy //go:linkname for modules with ≥100,000 dependents
For #67401. Change-Id: I51f5b561ee11eb242e3b1585d591281d0df4fc24 Reviewed-on: https://go-review.googlesource.com/c/go/+/587215 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/syscall/syscall_linux.go')
-rw-r--r--src/syscall/syscall_linux.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/syscall/syscall_linux.go b/src/syscall/syscall_linux.go
index 28727dc98a..2706973596 100644
--- a/src/syscall/syscall_linux.go
+++ b/src/syscall/syscall_linux.go
@@ -1284,12 +1284,13 @@ func Munmap(b []byte) (err error) {
//sys Mlockall(flags int) (err error)
//sys Munlockall() (err error)
-// prlimit is accessed from x/sys/unix.
-//go:linkname prlimit
-
// prlimit changes a resource limit. We use a single definition so that
// we can tell StartProcess to not restore the original NOFILE limit.
-// This is unexported but can be called from x/sys/unix.
+//
+// golang.org/x/sys linknames prlimit.
+// Do not remove or change the type signature.
+//
+//go:linkname prlimit
func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
err = prlimit1(pid, resource, newlimit, old)
if err == nil && newlimit != nil && resource == RLIMIT_NOFILE && (pid == 0 || pid == Getpid()) {