summaryrefslogtreecommitdiffstats
path: root/vendor/modernc.org/memory/mmap_linux_64.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2022-03-19 22:04:13 +0100
committerWim <wim@42.be>2022-03-20 14:57:48 +0100
commit2623a412c42a81104b97ae8c81a5f66760fee4b6 (patch)
tree502c6d4473baac3792d14fda51dbb56179f19424 /vendor/modernc.org/memory/mmap_linux_64.go
parentd64eed49bc6f2e8a01f922727795eea158cbc56d (diff)
downloadmatterbridge-msglm-2623a412c42a81104b97ae8c81a5f66760fee4b6.tar.gz
matterbridge-msglm-2623a412c42a81104b97ae8c81a5f66760fee4b6.tar.bz2
matterbridge-msglm-2623a412c42a81104b97ae8c81a5f66760fee4b6.zip
Update vendor (whatsapp)
Diffstat (limited to 'vendor/modernc.org/memory/mmap_linux_64.go')
-rw-r--r--vendor/modernc.org/memory/mmap_linux_64.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/modernc.org/memory/mmap_linux_64.go b/vendor/modernc.org/memory/mmap_linux_64.go
new file mode 100644
index 00000000..9f65896d
--- /dev/null
+++ b/vendor/modernc.org/memory/mmap_linux_64.go
@@ -0,0 +1,24 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE-GO file.
+
+//go:build linux && (amd64 || arm64 || mips64 || mips64le || riscv64)
+
+package memory
+
+import (
+ "syscall"
+)
+
+// Function syscall.mmap is same for linux/amd64, linux/arm64, linux/mips64,
+// linux/mips64le and linux/riscv64.
+
+// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_amd64.go;l=1575-1584
+func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
+ r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
+ xaddr = uintptr(r0)
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}