From cde4660eb9c519b4373bebe3d42deebc744368f2 Mon Sep 17 00:00:00 2001 From: Mauri de Souza Meneguzzo Date: Sat, 27 Jul 2024 09:20:42 +0000 Subject: [PATCH] unix: add linux mseal system call The mseal system call was added in Linux 6.10. See https://lwn.net/Articles/954936. Change-Id: Ic812a5d784effbc1f362045ffeb6f7e50ee5f8bb GitHub-Last-Rev: de3924e954b1182e974c008b41e07fd21f283c30 GitHub-Pull-Request: golang/sys#209 Reviewed-on: https://go-review.googlesource.com/c/sys/+/600518 Reviewed-by: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor Reviewed-by: Michael Knyszek --- unix/syscall_linux.go | 1 + unix/zsyscall_linux.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go index 5682e2628..3f1d3d4cb 100644 --- a/unix/syscall_linux.go +++ b/unix/syscall_linux.go @@ -2592,3 +2592,4 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { } //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) +//sys Mseal(b []byte, flags uint) (err error) diff --git a/unix/zsyscall_linux.go b/unix/zsyscall_linux.go index 87d8612a1..1bc1a5adb 100644 --- a/unix/zsyscall_linux.go +++ b/unix/zsyscall_linux.go @@ -2229,3 +2229,19 @@ func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Mseal(b []byte, flags uint) (err error) { + var _p0 unsafe.Pointer + if len(b) > 0 { + _p0 = unsafe.Pointer(&b[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall(SYS_MSEAL, uintptr(_p0), uintptr(len(b)), uintptr(flags)) + if e1 != 0 { + err = errnoErr(e1) + } + return +}