aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/syscall_linux_amd64.go
diff options
context:
space:
mode:
authorCherry Mui <cherryyz@google.com>2026-02-25 12:26:54 -0500
committerCherry Mui <cherryyz@google.com>2026-04-02 13:12:00 -0700
commitcaa169ee4804ba0dbe1c430e8e9a4d2940f5145b (patch)
tree24486172c5b6a6ac45e864233d692bf2f26dae2e /src/syscall/syscall_linux_amd64.go
parent3a0f18376fb974b6f5d30613f1a20d826a2564aa (diff)
downloadgo-caa169ee4804ba0dbe1c430e8e9a4d2940f5145b.tar.xz
all: add export linknames for assembly symbols accessed from other package
For Go symbols accessed from other package via linkname or assembly, we have an export linkname from the definition side. We currently don't always have the linkname directive for assembly functions, for which external accesses are allowed. We may want to tighten up the restriction. So add export linknames for the ones that are needed. Change-Id: If664634c81580edd49086d916024f23f86871092 Reviewed-on: https://go-review.googlesource.com/c/go/+/749981 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/syscall/syscall_linux_amd64.go')
-rw-r--r--src/syscall/syscall_linux_amd64.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/syscall/syscall_linux_amd64.go b/src/syscall/syscall_linux_amd64.go
index 725ebdba22..1a8b70b1c1 100644
--- a/src/syscall/syscall_linux_amd64.go
+++ b/src/syscall/syscall_linux_amd64.go
@@ -4,6 +4,8 @@
package syscall
+import _ "unsafe" // for linkname
+
const (
_SYS_setgroups = SYS_SETGROUPS
_SYS_clone3 = 435
@@ -71,7 +73,10 @@ func Lstat(path string, stat *Stat_t) (err error) {
//sys futimesat(dirfd int, path string, times *[2]Timeval) (err error)
+// Accessed via assembly in x/sys/unix.
+//
//go:noescape
+//go:linkname gettimeofday
func gettimeofday(tv *Timeval) (err Errno)
func Gettimeofday(tv *Timeval) (err error) {