Files
opencloud/vendor/github.com/kovidgoyal/imaging/magick/memfd_linux.go
dependabot[bot] 85361fca67 build(deps): bump github.com/kovidgoyal/imaging from 1.7.2 to 1.8.17
Bumps [github.com/kovidgoyal/imaging](https://github.com/kovidgoyal/imaging) from 1.7.2 to 1.8.17.
- [Release notes](https://github.com/kovidgoyal/imaging/releases)
- [Changelog](https://github.com/kovidgoyal/imaging/blob/master/.goreleaser.yaml)
- [Commits](https://github.com/kovidgoyal/imaging/compare/v1.7.2...v1.8.17)

---
updated-dependencies:
- dependency-name: github.com/kovidgoyal/imaging
  dependency-version: 1.8.17
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-26 14:46:30 +01:00

30 lines
451 B
Go

//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
}