summaryrefslogtreecommitdiff
path: root/vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go')
-rw-r--r--vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go b/vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go
new file mode 100644
index 000000000..6fe96d6f6
--- /dev/null
+++ b/vendor/github.com/tetratelabs/wazero/internal/platform/mprotect_syscall.go
@@ -0,0 +1,10 @@
+//go:build (linux || darwin) && !tinygo
+
+package platform
+
+import "syscall"
+
+// MprotectRX is like syscall.Mprotect with RX permission.
+func MprotectRX(b []byte) (err error) {
+ return syscall.Mprotect(b, syscall.PROT_READ|syscall.PROT_EXEC)
+}