syscallcompat

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package syscallcompat wraps Linux-specific syscalls.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dup3 added in v1.4.1

func Dup3(oldfd int, newfd int, flags int) (err error)

Dup3 wraps the Dup3 syscall. We want to use Dup3 rather than Dup2 because Dup2 is not implemented on arm64.

func EnospcPrealloc

func EnospcPrealloc(fd int, off int64, len int64) (err error)

EnospcPrealloc preallocates ciphertext space without changing the file size. This guarantees that we don't run out of space while writing a ciphertext block (that would corrupt the block).

func Faccessat added in v1.4.3

func Faccessat(dirfd int, path string, mode uint32) error

Faccessat exists both in Linux and in MacOS 10.10+, but the Linux version DOES NOT support any flags. Emulate AT_SYMLINK_NOFOLLOW like glibc does.

func Fallocate

func Fallocate(fd int, mode uint32, off int64, len int64) (err error)

Fallocate wraps the Fallocate syscall.

func Fchmodat added in v1.4.3

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

Fchmodat syscall.

func Fchownat added in v1.4.3

func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)

Fchownat syscall.

func Fstatat added in v1.4.3

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

Fstatat syscall.

func Getdents added in v1.4.1

func Getdents(fd int) ([]fuse.DirEntry, error)

Getdents syscall.

func Linkat added in v1.4.3

func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)

Linkat exists both in Linux and in MacOS 10.10+.

func Mkdirat added in v1.4.3

func Mkdirat(dirfd int, path string, mode uint32) (err error)

Mkdirat syscall.

func Mknodat

func Mknodat(dirfd int, path string, mode uint32, dev int) (err error)

Mknodat wraps the Mknodat syscall.

func OpenNofollow added in v1.4.3

func OpenNofollow(baseDir string, relPath string, flags int, mode uint32) (fd int, err error)

OpenNofollow opens the file/dir at "relPath" in a way that is secure against symlink attacks. Symlinks that are part of "relPath" are never followed. This function is implemented by walking the directory tree, starting at "baseDir", using the Openat syscall with the O_NOFOLLOW flag. Symlinks that are part of the "baseDir" path are followed.

func Openat

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

Openat wraps the Openat syscall.

func Readlinkat added in v1.4.3

func Readlinkat(dirfd int, path string) (string, error)

Readlinkat exists both in Linux and in MacOS 10.10+. We may add an emulated version for users on older MacOS versions if there is demand. Buffer allocation is handled internally, unlike the bare unix.Readlinkat.

func Renameat

func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)

Renameat wraps the Renameat syscall.

func Symlinkat added in v1.4.3

func Symlinkat(oldpath string, newdirfd int, newpath string) (err error)

Symlinkat syscall.

func Unix2syscall added in v1.4.3

func Unix2syscall(u unix.Stat_t) syscall.Stat_t

Unix2syscall converts a unix.Stat_t struct to a syscall.Stat_t struct. A direct cast does not work because the padding is named differently in unix.Stat_t for some reason ("X__unused" in syscall, "_" in unix).

func Unlinkat

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

Unlinkat syscall.

Types

This section is empty.

Jump to

Keyboard shortcuts

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