Black Lives Matter. Support the Equal Justice Initiative.

Package unix

import "internal/syscall/unix"

Overview ▾


const AT_REMOVEDIR = 0x200


FcntlSyscall is the number for the fcntl system call. This is usually SYS_FCNTL, but can be overridden to SYS_FCNTL64.

var FcntlSyscall uintptr = syscall.SYS_FCNTL

func CopyFileRange

func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)

func Fstatat

func Fstatat(dirfd int, path string, stat *syscall.Stat_t, flags int) error

func GetRandom

func GetRandom(p []byte, flags GetRandomFlag) (n int, err error)

GetRandom calls the Linux getrandom system call. See

func IsNonblock

func IsNonblock(fd int) (nonblocking bool, err error)

func Openat

func Openat(dirfd int, path string, flags int, perm uint32) (int, error)

func Unlinkat

func Unlinkat(dirfd int, path string, flags int) error

type GetRandomFlag

GetRandomFlag is a flag supported by the getrandom system call.

type GetRandomFlag uintptr
const (
    // GRND_NONBLOCK means return EAGAIN rather than blocking.
    GRND_NONBLOCK GetRandomFlag = 0x0001

    // GRND_RANDOM means use the /dev/random pool instead of /dev/urandom.
    GRND_RANDOM GetRandomFlag = 0x0002