msyscall

package
v0.0.0-...-6e4af05 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2017 License: MIT Imports: 3 Imported by: 0

README

Go Memfd syscall library

GoDoc

This provides the low level syscalls and constants for working with memfd_create and related Linux syscalls.

Documentation

Overview

msyscall is a package for the raw syscall handling for memfd_create and related syscalls. Used by github.com/justincormack/go-memfd

Index

Constants

View Source
const (
	MFD_CLOEXEC       uint = 1
	MFD_ALLOW_SEALING uint = 2

	F_ADD_SEALS int = (f_LINUX_SPECIFIC_BASE + 9)
	F_GET_SEALS int = (f_LINUX_SPECIFIC_BASE + 10)

	F_SEAL_SEAL   int = 0x0001
	F_SEAL_SHRINK int = 0x0002
	F_SEAL_GROW   int = 0x0004
	F_SEAL_WRITE  int = 0x0008
)

Linux kernel constants

View Source
const (
	// SYS_FCNTL is the fcntl syscall to use for this architecture
	SYS_FCNTL = syscall.SYS_FCNTL
	// SYS_MEMFD_CREATE is the syscall number for this architecture
	SYS_MEMFD_CREATE = 319
)

Variables

This section is empty.

Functions

func FcntlCloexec

func FcntlCloexec(fd uintptr, flag int) (err error)

FcntlCloexec clears the cloexec flag (0 arg) or sets it (1), useful just before we exec another process.

func FcntlSeals

func FcntlSeals(fd uintptr) (seals int, err error)

FcntlSeals calls the raw fcntl syscall to get the current seals it will return EINVAL if the file does not support sealing

func FcntlSetSeals

func FcntlSetSeals(fd uintptr, seals int) (err error)

FcntlSetSeals calls the raw fcntl syscall to set the specified seals it will return EINVAL if the file does not support sealing, or an error if already sealed.

func MemfdCreate

func MemfdCreate(name string, flags uint) (fd uintptr, err error)

MemfdCreate exposes the raw memfd_create syscall which returns a file descriptor

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL