Documentation
¶
Index ¶
- Constants
- func BytePtrFromString(s string) (*byte, error)
- func Chdir(path string) (err error)
- func Chmod(path string, mode uint32) (err error)
- func Clearenv()
- func Close(fd int) (err error)
- func Dup(fd int) (fd2 int, err error)
- func Environ() []string
- func Exec(argv0 string, argv []string, envv []string) (err error)
- func Exit(code int)
- func Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
- func Fdopendir(fd int) (dir uintptr, err error)
- func Fstat(fd int, p *Stat_t) (err error)
- func Fsync(fd int) (err error)
- func Getegid() int
- func Getenv(key string) (value string, found bool)
- func Geteuid() int
- func Getgid() int
- func Getpagesize() int
- func Getpid() int
- func Getppid() int
- func Getuid() int
- func Getwd() (string, error)
- func Kill(pid int, sig Signal) (err error)
- func Lstat(path string, p *Stat_t) (err error)
- func Mkdir(path string, mode uint32) (err error)
- func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)
- func Mprotect(b []byte, prot int) (err error)
- func Munmap(b []byte) (err error)
- func Open(path string, flag int, mode uint32) (fd int, err error)
- func Pipe2(fds []int, flags int) (err error)
- func Pread(fd int, p []byte, offset int64) (n int, err error)
- func Pwrite(fd int, p []byte, offset int64) (n int, err error)
- func Read(fd int, p []byte) (n int, err error)
- func Readlink(path string, p []byte) (n int, err error)
- func Rename(from, to string) (err error)
- func Rmdir(path string) (err error)
- func Seek(fd int, offset int64, whence int) (newoffset int64, err error)
- func Setenv(key, val string) (err error)
- func Stat(path string, p *Stat_t) (err error)
- func Symlink(from, to string) (err error)
- func Unlink(path string) (err error)
- func Unsetenv(key string) (err error)
- func Write(fd int, p []byte) (n int, err error)
- type Conn
- type Dirent
- type Errno
- type RawConn
- type RawSockaddr
- type RawSockaddrInet4
- type RawSockaddrInet6
- type Signal
- type SockaddrInet4
- type SockaddrInet6
- type Stat_t
- type SysProcAttr
- type Timespec
- type WaitStatus
- func (w WaitStatus) Continued() bool
- func (w WaitStatus) CoreDump() bool
- func (w WaitStatus) ExitStatus() int
- func (w WaitStatus) Exited() bool
- func (w WaitStatus) Signal() Signal
- func (w WaitStatus) Signaled() bool
- func (w WaitStatus) StopSignal() Signal
- func (w WaitStatus) Stopped() bool
- func (w WaitStatus) TrapCause() int
Constants ¶
const ( DT_BLK = 0x6 DT_CHR = 0x2 DT_DIR = 0x4 DT_FIFO = 0x1 DT_LNK = 0xa DT_REG = 0x8 DT_SOCK = 0xc DT_UNKNOWN = 0x0 DT_WHT = 0xe F_GETFL = 0x3 F_SETFL = 0x4 O_NONBLOCK = 0x4 )
Source: upstream zerrors_darwin_amd64.go
const ( Stdin = 0 Stdout = 1 Stderr = 2 )
const ( O_RDONLY = 0x0 O_WRONLY = 0x1 O_RDWR = 0x2 O_APPEND = 0x8 O_SYNC = 0x80 O_CREAT = 0x200 O_TRUNC = 0x400 O_EXCL = 0x800 O_CLOEXEC = 0x01000000 )
const ( PROT_NONE = 0x00 // no permissions PROT_READ = 0x01 // pages can be read PROT_WRITE = 0x02 // pages can be written PROT_EXEC = 0x04 // pages can be executed MAP_SHARED = 0x0001 // share changes MAP_PRIVATE = 0x0002 // changes are private MAP_FILE = 0x0000 // map from file (default) MAP_ANON = 0x1000 // allocated from memory, swap space MAP_ANONYMOUS = MAP_ANON )
Source: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/mman.h.auto.html
const ( S_IEXEC = 0x40 S_IFBLK = 0x6000 S_IFCHR = 0x2000 S_IFDIR = 0x4000 S_IFIFO = 0x1000 S_IFLNK = 0xa000 S_IFMT = 0xf000 S_IFREG = 0x8000 S_IFSOCK = 0xc000 S_IFWHT = 0xe000 S_IREAD = 0x100 S_IRGRP = 0x20 S_IROTH = 0x4 S_IRUSR = 0x100 S_IRWXG = 0x38 S_IRWXO = 0x7 S_IRWXU = 0x1c0 S_ISGID = 0x400 S_ISTXT = 0x200 S_ISUID = 0x800 S_ISVTX = 0x200 S_IWGRP = 0x10 S_IWOTH = 0x2 S_IWRITE = 0x80 S_IWUSR = 0x80 S_IXGRP = 0x8 S_IXOTH = 0x1 S_IXUSR = 0x40 )
Source: https://github.com/apple/darwin-xnu/blob/main/bsd/sys/_types/_s_ifmt.h
Variables ¶
This section is empty.
Functions ¶
func BytePtrFromString ¶ added in v0.27.0
BytePtrFromString returns a pointer to a NUL-terminated array of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).
func Getpagesize ¶ added in v0.23.0
func Getpagesize() int
Types ¶
type Conn ¶ added in v0.14.0
type Conn interface { // SyscallConn returns a raw network connection. SyscallConn() (RawConn, error) }
Conn is implemented by some types in the net and os packages to provide access to the underlying file descriptor or handle.
type Dirent ¶ added in v0.23.0
type Dirent struct { Ino uint64 Seekoff uint64 Reclen uint16 Namlen uint16 Type uint8 Name [1024]int8 Pad_cgo_0 [3]byte }
Source: upstream ztypes_darwin_amd64.go
type Errno ¶
type Errno uintptr
An Errno is an unsigned number describing an error condition. It implements the error interface. The zero Errno is by convention a non-error, so code to convert from Errno to error should use:
err = nil if errno != 0 { err = errno }
const ( EPERM Errno = 1 ENOENT Errno = 2 EACCES Errno = 13 EEXIST Errno = 17 EINTR Errno = 4 ENOTDIR Errno = 20 EISDIR Errno = 21 EINVAL Errno = 22 EMFILE Errno = 24 EROFS Errno = 30 EPIPE Errno = 32 EAGAIN Errno = 35 ENOTCONN Errno = 57 ETIMEDOUT Errno = 60 ENOSYS Errno = 78 EWOULDBLOCK Errno = EAGAIN )
Source: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/errno.h.auto.html
type RawConn ¶ added in v0.14.0
type RawConn interface { // Control invokes f on the underlying connection's file // descriptor or handle. // The file descriptor fd is guaranteed to remain valid while // f executes but not after f returns. Control(f func(fd uintptr)) error // Read invokes f on the underlying connection's file // descriptor or handle; f is expected to try to read from the // file descriptor. // If f returns true, Read returns. Otherwise Read blocks // waiting for the connection to be ready for reading and // tries again repeatedly. // The file descriptor is guaranteed to remain valid while f // executes but not after f returns. Read(f func(fd uintptr) (done bool)) error // Write is like Read but for writing. Write(f func(fd uintptr) (done bool)) error }
A RawConn is a raw network connection.
type RawSockaddr ¶ added in v0.27.0
type RawSockaddrInet4 ¶ added in v0.27.0
type RawSockaddrInet6 ¶ added in v0.27.0
type Signal ¶
type Signal int
const ( SIGINT Signal = 2 /* interrupt */ SIGQUIT Signal = 3 /* quit */ SIGILL Signal = 4 /* illegal instruction (not reset when caught) */ SIGTRAP Signal = 5 /* trace trap (not reset when caught) */ SIGABRT Signal = 6 /* abort() */ SIGFPE Signal = 8 /* floating point exception */ SIGKILL Signal = 9 /* kill (cannot be caught or ignored) */ SIGBUS Signal = 10 /* bus error */ SIGSEGV Signal = 11 /* segmentation violation */ SIGPIPE Signal = 13 /* write on a pipe with no one to read it */ SIGTERM Signal = 15 /* software termination signal from kill */ SIGCHLD Signal = 20 /* to parent on child stop or exit */ )
Source: https://opensource.apple.com/source/xnu/xnu-7195.81.3/bsd/sys/signal.h
type SockaddrInet4 ¶ added in v0.27.0
type SockaddrInet6 ¶ added in v0.27.0
type SysProcAttr ¶ added in v0.22.0
type SysProcAttr struct{}
type WaitStatus ¶ added in v0.23.0
type WaitStatus uint32
TODO
func (WaitStatus) Continued ¶ added in v0.23.0
func (w WaitStatus) Continued() bool
func (WaitStatus) CoreDump ¶ added in v0.23.0
func (w WaitStatus) CoreDump() bool
func (WaitStatus) ExitStatus ¶ added in v0.23.0
func (w WaitStatus) ExitStatus() int
func (WaitStatus) Exited ¶ added in v0.23.0
func (w WaitStatus) Exited() bool
func (WaitStatus) Signal ¶ added in v0.23.0
func (w WaitStatus) Signal() Signal
func (WaitStatus) Signaled ¶ added in v0.23.0
func (w WaitStatus) Signaled() bool
func (WaitStatus) StopSignal ¶ added in v0.23.0
func (w WaitStatus) StopSignal() Signal
func (WaitStatus) Stopped ¶ added in v0.23.0
func (w WaitStatus) Stopped() bool
func (WaitStatus) TrapCause ¶ added in v0.23.0
func (w WaitStatus) TrapCause() int