unix

package
v0.0.0-...-371cdc4 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NAME_MAX       = 255
	PATH_MAX       = 4096
	PATH_MAX_LIMIT = 1 << 16

	O_NOFOLLOW = unix.O_NOFOLLOW
	O_PATH     = unix.O_PATH
	O_RDONLY   = unix.O_RDONLY
	O_RDWR     = unix.O_RDWR
	O_WRONLY   = unix.O_WRONLY

	S_IFMT   = unix.S_IFMT
	S_IFBLK  = unix.S_IFBLK
	S_IFCHR  = unix.S_IFCHR
	S_IFDIR  = unix.S_IFDIR
	S_IFIFO  = unix.S_IFIFO
	S_IFLNK  = unix.S_IFLNK
	S_IFREG  = unix.S_IFREG
	S_IFSOCK = unix.S_IFSOCK

	S_ISGID = unix.S_ISGID
	S_ISUID = unix.S_ISUID
	S_ISVTX = unix.S_ISVTX

	EACCES  = unix.EACCES
	EBADF   = unix.EBADF
	EINVAL  = unix.EINVAL
	EIO     = unix.EIO
	EISDIR  = unix.EISDIR
	ENODATA = unix.ENODATA
	ENOENT  = unix.ENOENT
	ENOSYS  = unix.ENOSYS
	ENOTDIR = unix.ENOTDIR
	ENOTSUP = unix.ENOTSUP
	EROFS   = unix.EROFS

	DT_UNKNOWN = 0
	DT_FIFO    = S_IFIFO >> 12
	DT_CHR     = S_IFCHR >> 12
	DT_DIR     = S_IFDIR >> 12
	DT_BLK     = S_IFBLK >> 12
	DT_REG     = S_IFREG >> 12
	DT_LNK     = S_IFLNK >> 12
	DT_SOCK    = S_IFSOCK >> 12

	AT_SYMLINK_NOFOLLOW = 0x100
)

Variables

Functions

func Close

func Close(fd int) error

func FileStatToUnixMode

func FileStatToUnixMode(fsMode os.FileMode) uint32

func Fstat

func Fstat(fd int, stat *Stat_t) error

func Fstatat

func Fstatat(dirfd int, pathname string, stat *unix.Stat_t, flags int) error

func Getdents

func Getdents(fd int, buf []byte) (int, error)

func Makedev

func Makedev(major, minor uint64) (uint64, error)

Supports basic makedev implementation. Most kernels support major/minors larger than 255 however how this is encoded varies between kernels therefore we only support 8 bit major/minors which is consistently represented.

func Open

func Open(path string, mode int, perm uint32) (int, error)

func Openat

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

func Pread

func Pread(fd int, p []byte, offset int64) (int, error)

func Read

func Read(fd int, p []byte) (int, error)

func Readlinkat

func Readlinkat(dirfd int, path string, buf []byte) (int, error)

func RetrySyscall6

func RetrySyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (uintptr, uintptr, error)

Invoke a syscall that returns an int and an error, retrying on EINTR

func RetrySyscallE

func RetrySyscallE(callSyscallE func() error) error

Invoke a syscall that returns just an error, retrying on EINTR

func RetrySyscallIE

func RetrySyscallIE(callSyscallIE func() (int, error)) (int, error)

Invoke a syscall that returns an int and an error, retrying on EINTR

func S_ISBLK

func S_ISBLK(mode uint32) bool

func S_ISCHR

func S_ISCHR(mode uint32) bool

func S_ISDIR

func S_ISDIR(mode uint32) bool

func S_ISLNK

func S_ISLNK(mode uint32) bool

func S_ISREG

func S_ISREG(mode uint32) bool

func Stat

func Stat(path string, stat *Stat_t) error

func Statfs

func Statfs(path string, buf *Statfs_t) error

func TestAccess

func TestAccess(user, group bool, mode, mask uint32) bool

func UnixToFileStatMode

func UnixToFileStatMode(unixMode uint32) os.FileMode

Types

type Errno

type Errno = unix.Errno

type Stat_t

type Stat_t = unix.Stat_t

type Statfs_t

type Statfs_t = unix.Statfs_t

Jump to

Keyboard shortcuts

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