libc

package
v0.0.0-...-f75486c Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PtrSize = 4

Variables

This section is empty.

Functions

func OpenFileFlags

func OpenFileFlags(df Lookupflag, of Oflag, fd Fdflag, rights Rights) int

Types

type Ciovec

type Ciovec struct {
	Buf Ptr
	Len Size
}

type Dirent

type Dirent struct {
	Next   uint64
	Ino    uint64
	Namlen Size
	Dtype  uint8
}

type Errno

type Errno = int32
const (
	ErrnoSuccess        Errno = iota // No error occurred. System call completed successfully.
	Errno2big                        // Argument list too long.
	ErrnoAcces                       // Permission denied.
	ErrnoAddrinuse                   // Address in use.
	ErrnoAddrnotavail                // Address not available.
	ErrnoAfnosupport                 // Address family not supported.
	ErrnoAgain                       // Resource unavailable, or operation would block.
	ErrnoAlready                     // Connection already in progress.
	ErrnoBadf                        // Bad file descriptor.
	ErrnoBadmsg                      // Bad message.
	ErrnoBusy                        // Device or resource busy.
	ErrnoCanceled                    // Operation canceled.
	ErrnoChild                       // No child processes.
	ErrnoConnaborted                 // Connection aborted.
	ErrnoConnrefused                 // Connection refused.
	ErrnoConnreset                   // Connection reset.
	ErrnoDeadlk                      // Resource deadlock would occur.
	ErrnoDestaddrreq                 // Destination address required.
	ErrnoDom                         // Mathematics argument out of domain of function.
	ErrnoDquot                       // Reserved.
	ErrnoExist                       // File exists.
	ErrnoFault                       // Bad address.
	ErrnoFbig                        // File too large.
	ErrnoHostunreach                 // Host is unreachable.
	ErrnoIdrm                        // Identifier removed.
	ErrnoIlseq                       // Illegal byte sequence.
	ErrnoInprogress                  // Operation in progress.
	ErrnoIntr                        // Interrupted function.
	ErrnoInval                       // Invalid argument.
	ErrnoIo                          // I/O error.
	ErrnoIsconn                      // Socket is connected.
	ErrnoIsdir                       // Is a directory.
	ErrnoLoop                        // Too many levels of symbolic links.
	ErrnoMfile                       // File descriptor value too large.
	ErrnoMlink                       // Too many links.
	ErrnoMsgsize                     // Message too large.
	ErrnoMultihop                    // Reserved.
	ErrnoNametoolong                 // Filename too long.
	ErrnoNetdown                     // Network is down.
	ErrnoNetreset                    // Connection aborted by network.
	ErrnoNetunreach                  // Network unreachable.
	ErrnoNfile                       // Too many files open in system.
	ErrnoNobufs                      // No buffer space available.
	ErrnoNodev                       // No such device.
	ErrnoNoent                       // No such file or directory.
	ErrnoNoexec                      // Executable file format error.
	ErrnoNolck                       // No locks available.
	ErrnoNolink                      // Reserved.
	ErrnoNomem                       // Not enough space.
	ErrnoNomsg                       // No message of the desired type.
	ErrnoNoprotoopt                  // Protocol not available.
	ErrnoNospc                       // No space left on device.
	ErrnoNosys                       // Function not supported.
	ErrnoNotconn                     // The socket is not connected.
	ErrnoNotdir                      // Not a directory or a symbolic link to a directory.
	ErrnoNotempty                    // Directory not empty.
	ErrnoNotrecoverable              // State not recoverable.
	ErrnoNotsock                     // Not a socket.
	ErrnoNotsup                      // Not supported, or operation not supported on socket.
	ErrnoNotty                       // Inappropriate I/O control operation.
	ErrnoNxio                        // No such device or address.
	ErrnoOverflow                    // Value too large to be stored in data type.
	ErrnoOwnerdead                   // Previous owner died.
	ErrnoPerm                        // Operation not permitted.
	ErrnoPipe                        // Broken pipe.
	ErrnoProto                       // Protocol error.
	ErrnoProtonosupport              // Protocol not supported.
	ErrnoPrototype                   // Protocol wrong type for socket.
	ErrnoRange                       // Result too large.
	ErrnoRofs                        // Read-only file system.
	ErrnoSpipe                       // Invalid seek.
	ErrnoSrch                        // No such process.
	ErrnoStale                       // Reserved.
	ErrnoTimedout                    // Connection timed out.
	ErrnoTxtbsy                      // Text file busy.
	ErrnoXdev                        // Cross-device link.
	ErrnoNotcapable                  // Extension: Capabilities insufficient.
)

func Error

func Error(err error) Errno

type Fdflag

type Fdflag = uint16
const (
	// Append mode: Data written to the file is always appended to the file's end.
	FdflagAppend Fdflag = 1 << iota
	// Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized.
	FdflagDSync
	// Non-blocking mode.
	FdflagNonBlock
	// Synchronized read I/O operations.
	FdflagRSync
	// Write according to synchronized I/O file integrity completion. In addition to synchronizing the data stored in the file, the implementation may also synchronously update the file's metadata.
	FdflagSync
)

type Fdstat

type Fdstat struct {
	Filetype         Filetype
	Flags            Fdflag
	RightsBase       uint64
	RightsInheriting uint64
}

type Filestat

type Filestat struct {
	// Device ID of device containing the file.
	Dev uint64
	// File serial number.
	Ino uint64
	// File type.
	Filetype Filetype
	// Number of hard links to the file.
	Nlink uint64
	// For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link.
	Size uint64
	// Last data access timestamp.
	Atim uint64
	// Last data modification timestamp.
	Mtim uint64
	// Last file status change timestamp.
	Ctim uint64
}

type Filetype

type Filetype = uint8
const (
	// The type of a file descriptor or file is unknown or is different from any of the other types specified.
	FiletypeUnknown Filetype = 0
	// The file descriptor or file refers to a block device inode.
	FiletypeBlockDevice Filetype = 1
	// The file descriptor or file refers to a character device inode.
	FiletypeCharacterDevice Filetype = 2
	// The file descriptor or file refers to a directory inode.
	FiletypeDirectory Filetype = 3
	// The file descriptor or file refers to a regular file inode.
	FiletypeRegularFile Filetype = 4
	// The file descriptor or file refers to a datagram socket.
	FiletypeSocketDgram Filetype = 5
	// The file descriptor or file refers to a byte-stream socket.
	FiletypeSocketStream Filetype = 6
	// The file refers to a symbolic link inode.
	FiletypeSymbolicLink Filetype = 7
)

type Int

type Int = int32 // int

type Iovec

type Iovec struct {
	Buf Ptr
	Len Size
}

type Lookupflag

type Lookupflag = Uint
const (
	LookupflagSymlinkfollow Lookupflag = (1 << 0)
)

type Oflag

type Oflag = uint16
const (
	OflagCreat     Oflag = (1 << 0)
	OflagDirectory Oflag = (1 << 1)
	OflagExcl      Oflag = (1 << 2)
	OflagTrunc     Oflag = (1 << 3)
)

type PrestatDir

type PrestatDir struct {
	Tag    uint8
	DirLen Size
}

type Ptr

type Ptr = uint32 // uintptr_t

type Ptrdiff

type Ptrdiff = int32 // ptrdiff_t

type Rights

type Rights = uint64
const (
	RightFdDatasync           Rights = (1 << 0)
	RightFdRead               Rights = (1 << 1)
	RightFdSeek               Rights = (1 << 2)
	RightFdFdstatSetFlags     Rights = (1 << 3)
	RightFdSync               Rights = (1 << 4)
	RightFdTell               Rights = (1 << 5)
	RightFdWrite              Rights = (1 << 6)
	RightFdAdvise             Rights = (1 << 7)
	RightFdAllocate           Rights = (1 << 8)
	RightPathCreateDirectory  Rights = (1 << 9)
	RightPathCreateFile       Rights = (1 << 10)
	RightPathLinkSource       Rights = (1 << 11)
	RightPathLinkTarget       Rights = (1 << 12)
	RightPathOpen             Rights = (1 << 13)
	RightFdReaddir            Rights = (1 << 14)
	RightPathReadlink         Rights = (1 << 15)
	RightPathRenameSource     Rights = (1 << 16)
	RightPathRenameTarget     Rights = (1 << 17)
	RightPathFilestatGet      Rights = (1 << 18)
	RightPathFilestatSetSize  Rights = (1 << 19)
	RightPathFilestatSetTimes Rights = (1 << 20)
	RightFdFilestatGet        Rights = (1 << 21)
	RightFdFilestatSetSize    Rights = (1 << 22)
	RightFdFilestatSetTimes   Rights = (1 << 23)
	RightPathSymlink          Rights = (1 << 24)
	RightPathRemoveDirectory  Rights = (1 << 25)
	RightPathUnlinkFile       Rights = (1 << 26)
	RightPollFdReadwrite      Rights = (1 << 27)
	RightSockShutdown         Rights = (1 << 28)
	RightSockAccept           Rights = (1 << 29)
)

type Size

type Size = uint32 // size_t

type Ssize

type Ssize = int32 // ssize_t

type Uint

type Uint = uint32 // unsigned int

Jump to

Keyboard shortcuts

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