package unix
import "github.com/cilium/ebpf/internal/unix"
Package unix re-exports Linux specific parts of golang.org/x/sys/unix.
It avoids breaking compilation on other OS by providing stubs as follows:
- Invoking a function always returns an error.
- Errnos have distinct, non-zero values.
- Constants have distinct but meaningless values.
- Types use the same names for members, but may or may not follow the Linux layout.
Index ¶
- Constants
- func Auxv() ([][2]uintptr, error)
- func BytePtrFromString(s string) (*byte, error)
- func ByteSliceFromString(s string) ([]byte, error)
- func ByteSliceToString(s []byte) string
- func Close(fd int) (err error)
- func EpollCreate1(flag int) (fd int, err error)
- func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
- func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
- func Eventfd(initval uint, flags int) (fd int, err error)
- func FcntlInt(fd uintptr, cmd, arg int) (int, error)
- func Fstat(fd int, stat *Stat_t) error
- func Getpid() int
- func Gettid() int
- func IoctlSetInt(fd int, req uint, value int) error
- func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)
- func Munmap(b []byte) (err error)
- func Open(path string, mode int, perm uint32) (int, error)
- func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
- func Prlimit(pid, resource int, new, old *Rlimit) error
- func PthreadSigmask(how int, set, oldset *Sigset_t) error
- func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) error
- func SchedGetaffinity(pid int, set *CPUSet) error
- func SchedSetaffinity(pid int, set *CPUSet) error
- func SetNonblock(fd int, nonblocking bool) (err error)
- func SetsockoptInt(fd, level, opt, value int) error
- func Statfs(path string, buf *Statfs_t) (err error)
- func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)
- func Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
- func Uname(buf *Utsname) (err error)
- func Write(fd int, p []byte) (n int, err error)
- type CPUSet
- type EpollEvent
- type Errno
- type PerfEventAttr
- type PerfEventMmapPage
- type Rlimit
- type Signal
- type Sigset_t
- type Stat_t
- type Statfs_t
- type Utsname
Constants ¶
const ( E2BIG = linux.E2BIG EACCES = linux.EACCES EAGAIN = linux.EAGAIN EBADF = linux.EBADF EEXIST = linux.EEXIST EFAULT = linux.EFAULT EILSEQ = linux.EILSEQ EINTR = linux.EINTR EINVAL = linux.EINVAL ENODEV = linux.ENODEV ENOENT = linux.ENOENT ENOSPC = linux.ENOSPC EOPNOTSUPP = linux.EOPNOTSUPP EPERM = linux.EPERM EPOLLIN = linux.EPOLLIN ESRCH = linux.ESRCH ESTALE = linux.ESTALE )
const ( BPF_F_NO_PREALLOC = linux.BPF_F_NO_PREALLOC BPF_F_NUMA_NODE = linux.BPF_F_NUMA_NODE BPF_F_RDONLY = linux.BPF_F_RDONLY BPF_F_WRONLY = linux.BPF_F_WRONLY BPF_F_RDONLY_PROG = linux.BPF_F_RDONLY_PROG BPF_F_WRONLY_PROG = linux.BPF_F_WRONLY_PROG BPF_F_SLEEPABLE = linux.BPF_F_SLEEPABLE BPF_F_XDP_HAS_FRAGS = linux.BPF_F_XDP_HAS_FRAGS BPF_F_MMAPABLE = linux.BPF_F_MMAPABLE BPF_F_INNER_MAP = linux.BPF_F_INNER_MAP BPF_F_KPROBE_MULTI_RETURN = linux.BPF_F_KPROBE_MULTI_RETURN BPF_F_UPROBE_MULTI_RETURN = linux.BPF_F_UPROBE_MULTI_RETURN BPF_F_LOCK = linux.BPF_F_LOCK BPF_OBJ_NAME_LEN = linux.BPF_OBJ_NAME_LEN BPF_TAG_SIZE = linux.BPF_TAG_SIZE BPF_RINGBUF_BUSY_BIT = linux.BPF_RINGBUF_BUSY_BIT BPF_RINGBUF_DISCARD_BIT = linux.BPF_RINGBUF_DISCARD_BIT BPF_RINGBUF_HDR_SZ = linux.BPF_RINGBUF_HDR_SZ SYS_BPF = linux.SYS_BPF F_DUPFD_CLOEXEC = linux.F_DUPFD_CLOEXEC EPOLL_CTL_ADD = linux.EPOLL_CTL_ADD EPOLL_CLOEXEC = linux.EPOLL_CLOEXEC O_CLOEXEC = linux.O_CLOEXEC O_NONBLOCK = linux.O_NONBLOCK PROT_NONE = linux.PROT_NONE PROT_READ = linux.PROT_READ PROT_WRITE = linux.PROT_WRITE MAP_ANON = linux.MAP_ANON MAP_SHARED = linux.MAP_SHARED MAP_PRIVATE = linux.MAP_PRIVATE PERF_ATTR_SIZE_VER1 = linux.PERF_ATTR_SIZE_VER1 PERF_TYPE_SOFTWARE = linux.PERF_TYPE_SOFTWARE PERF_TYPE_TRACEPOINT = linux.PERF_TYPE_TRACEPOINT PERF_COUNT_SW_BPF_OUTPUT = linux.PERF_COUNT_SW_BPF_OUTPUT PERF_EVENT_IOC_DISABLE = linux.PERF_EVENT_IOC_DISABLE PERF_EVENT_IOC_ENABLE = linux.PERF_EVENT_IOC_ENABLE PERF_EVENT_IOC_SET_BPF = linux.PERF_EVENT_IOC_SET_BPF PerfBitWatermark = linux.PerfBitWatermark PerfBitWriteBackward = linux.PerfBitWriteBackward PERF_SAMPLE_RAW = linux.PERF_SAMPLE_RAW PERF_FLAG_FD_CLOEXEC = linux.PERF_FLAG_FD_CLOEXEC RLIM_INFINITY = linux.RLIM_INFINITY RLIMIT_MEMLOCK = linux.RLIMIT_MEMLOCK BPF_STATS_RUN_TIME = linux.BPF_STATS_RUN_TIME PERF_RECORD_LOST = linux.PERF_RECORD_LOST PERF_RECORD_SAMPLE = linux.PERF_RECORD_SAMPLE AT_FDCWD = linux.AT_FDCWD RENAME_NOREPLACE = linux.RENAME_NOREPLACE SO_ATTACH_BPF = linux.SO_ATTACH_BPF SO_DETACH_BPF = linux.SO_DETACH_BPF SOL_SOCKET = linux.SOL_SOCKET SIGPROF = linux.SIGPROF SIGUSR1 = linux.SIGUSR1 SIG_BLOCK = linux.SIG_BLOCK SIG_UNBLOCK = linux.SIG_UNBLOCK BPF_FS_MAGIC = linux.BPF_FS_MAGIC TRACEFS_MAGIC = linux.TRACEFS_MAGIC DEBUGFS_MAGIC = linux.DEBUGFS_MAGIC BPF_RB_NO_WAKEUP = linux.BPF_RB_NO_WAKEUP BPF_RB_FORCE_WAKEUP = linux.BPF_RB_FORCE_WAKEUP AF_UNSPEC = linux.AF_UNSPEC IFF_UP = linux.IFF_UP )
Functions ¶
func Auxv ¶
func BytePtrFromString ¶
func ByteSliceFromString ¶
func ByteSliceToString ¶
func Close ¶
func EpollCreate1 ¶
func EpollCtl ¶
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
func EpollWait ¶
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
func Eventfd ¶
func FcntlInt ¶
func Fstat ¶
func Getpid ¶
func Getpid() int
func Gettid ¶
func Gettid() int
func IoctlSetInt ¶
func Mmap ¶
func Munmap ¶
func Open ¶
func PerfEventOpen ¶
func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
func Prlimit ¶
func PthreadSigmask ¶
func Renameat2 ¶
func SchedGetaffinity ¶
func SchedSetaffinity ¶
func SetNonblock ¶
func SetsockoptInt ¶
func Statfs ¶
func Syscall ¶
func Tgkill ¶
func Uname ¶
func Write ¶
Types ¶
type CPUSet ¶
type EpollEvent ¶
type EpollEvent = linux.EpollEvent
type Errno ¶
type PerfEventAttr ¶
type PerfEventAttr = linux.PerfEventAttr
type PerfEventMmapPage ¶
type PerfEventMmapPage = linux.PerfEventMmapPage
type Rlimit ¶
type Signal ¶
type Sigset_t ¶
type Stat_t ¶
type Statfs_t ¶
type Utsname ¶
Source Files ¶
doc.go errno_linux.go error.go types_linux.go
- Version
- v0.18.0 (latest)
- Published
- Apr 2, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 week ago –
Tools for package owners.