Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
//go:build linux
package magick
import (
"fmt"
"os"
"golang.org/x/sys/unix"
)
var _ = fmt.Print
func memfd(data []byte) (ans *os.File, err error) {
fd, err := unix.MemfdCreate("memfile", unix.O_CLOEXEC)
if err != nil {
return nil, err
}
_, err = unix.Write(fd, data)
if err != nil {
return nil, err
}
_, err = unix.Seek(fd, 0, unix.SEEK_SET)
if err != nil {
return nil, err
}
ans = os.NewFile(uintptr(fd), "memfile")
return
}