syscall

package
v0.0.0-...-168ccc2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package syscall contains low-level interface to operating system.

Index

Constants

View Source
const (
	O_ACCMODE   = 0x3
	O_APPEND    = 0x400
	O_ASYNC     = 0x2000
	O_CLOEXEC   = 0x80000
	O_CREAT     = 0x40
	O_DIRECT    = 0x4000
	O_DIRECTORY = 0x10000
	O_DSYNC     = 0x1000
	O_EXCL      = 0x80
	O_FSYNC     = 0x101000
	O_LARGEFILE = 0x0
	O_NDELAY    = 0x800
	O_NOATIME   = 0x40000
	O_NOCTTY    = 0x100
	O_NOFOLLOW  = 0x20000
	O_NONBLOCK  = 0x800
	O_RDONLY    = 0x0
	O_RDWR      = 0x2
	O_RSYNC     = 0x101000
	O_SYNC      = 0x101000
	O_TRUNC     = 0x200
	O_WRONLY    = 0x1
)
View Source
const (
	PROT_EXEC      = 0x4
	PROT_GROWSDOWN = 0x1000000
	PROT_GROWSUP   = 0x2000000
	PROT_NONE      = 0x0
	PROT_READ      = 0x1
	PROT_WRITE     = 0x2

	MAP_32BIT      = 0x40
	MAP_ANON       = 0x20
	MAP_ANONYMOUS  = 0x20
	MAP_DENYWRITE  = 0x800
	MAP_EXECUTABLE = 0x1000
	MAP_FILE       = 0x0
	MAP_FIXED      = 0x10
	MAP_GROWSDOWN  = 0x100
	MAP_HUGETLB    = 0x40000
	MAP_LOCKED     = 0x2000
	MAP_NONBLOCK   = 0x10000
	MAP_NORESERVE  = 0x4000
	MAP_POPULATE   = 0x8000
	MAP_PRIVATE    = 0x2
	MAP_SHARED     = 0x1
	MAP_STACK      = 0x20000
	MAP_TYPE       = 0xf
)
View Source
const (
	AF_ALG        = 0x26
	AF_APPLETALK  = 0x5
	AF_ASH        = 0x12
	AF_ATMPVC     = 0x8
	AF_ATMSVC     = 0x14
	AF_AX25       = 0x3
	AF_BLUETOOTH  = 0x1f
	AF_BRIDGE     = 0x7
	AF_CAIF       = 0x25
	AF_CAN        = 0x1d
	AF_DECnet     = 0xc
	AF_ECONET     = 0x13
	AF_FILE       = 0x1
	AF_IEEE802154 = 0x24
	AF_INET       = 0x2
	AF_INET6      = 0xa
	AF_IPX        = 0x4
	AF_IRDA       = 0x17
	AF_ISDN       = 0x22
	AF_IUCV       = 0x20
	AF_KEY        = 0xf
	AF_LLC        = 0x1a
	AF_LOCAL      = 0x1
	AF_MAX        = 0x27
	AF_NETBEUI    = 0xd
	AF_NETLINK    = 0x10
	AF_NETROM     = 0x6
	AF_PACKET     = 0x11
	AF_PHONET     = 0x23
	AF_PPPOX      = 0x18
	AF_RDS        = 0x15
	AF_ROSE       = 0xb
	AF_ROUTE      = 0x10
	AF_RXRPC      = 0x21
	AF_SECURITY   = 0xe
	AF_SNA        = 0x16
	AF_TIPC       = 0x1e
	AF_UNIX       = 0x1
	AF_UNSPEC     = 0x0
	AF_WANPIPE    = 0x19
	AF_X25        = 0x9
)
View Source
const (
	SOCK_CLOEXEC   = 0x80000
	SOCK_DCCP      = 0x6
	SOCK_DGRAM     = 0x2
	SOCK_NONBLOCK  = 0x800
	SOCK_PACKET    = 0xa
	SOCK_RAW       = 0x3
	SOCK_RDM       = 0x4
	SOCK_SEQPACKET = 0x5
	SOCK_STREAM    = 0x1
)
View Source
const (
	SOL_AAL    = 0x109
	SOL_ATM    = 0x108
	SOL_DECNET = 0x105
	SOL_ICMPV6 = 0x3a
	SOL_IP     = 0x0
	SOL_IPV6   = 0x29
	SOL_IRDA   = 0x10a
	SOL_PACKET = 0x107
	SOL_RAW    = 0xff
	SOL_SOCKET = 0x1
	SOL_TCP    = 0x6
	SOL_X25    = 0x106
)
View Source
const (
	SO_ACCEPTCONN                    = 0x1e
	SO_ATTACH_FILTER                 = 0x1a
	SO_BINDTODEVICE                  = 0x19
	SO_BROADCAST                     = 0x6
	SO_BSDCOMPAT                     = 0xe
	SO_DEBUG                         = 0x1
	SO_DETACH_FILTER                 = 0x1b
	SO_DOMAIN                        = 0x27
	SO_DONTROUTE                     = 0x5
	SO_ERROR                         = 0x4
	SO_KEEPALIVE                     = 0x9
	SO_LINGER                        = 0xd
	SO_MARK                          = 0x24
	SO_NO_CHECK                      = 0xb
	SO_OOBINLINE                     = 0xa
	SO_PASSCRED                      = 0x10
	SO_PASSSEC                       = 0x22
	SO_PEERCRED                      = 0x11
	SO_PEERNAME                      = 0x1c
	SO_PEERSEC                       = 0x1f
	SO_PRIORITY                      = 0xc
	SO_PROTOCOL                      = 0x26
	SO_RCVBUF                        = 0x8
	SO_RCVBUFFORCE                   = 0x21
	SO_RCVLOWAT                      = 0x12
	SO_RCVTIMEO                      = 0x14
	SO_REUSEADDR                     = 0x2
	SO_RXQ_OVFL                      = 0x28
	SO_SECURITY_AUTHENTICATION       = 0x16
	SO_SECURITY_ENCRYPTION_NETWORK   = 0x18
	SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17
	SO_SNDBUF                        = 0x7
	SO_SNDBUFFORCE                   = 0x20
	SO_SNDLOWAT                      = 0x13
	SO_SNDTIMEO                      = 0x15
	SO_TIMESTAMP                     = 0x1d
	SO_TIMESTAMPING                  = 0x25
	SO_TIMESTAMPNS                   = 0x23
	SO_TYPE                          = 0x3
)
View Source
const (
	CLOCK_REALTIME  = 0
	CLOCK_MONOTONIC = 1
)
View Source
const (
	FUTEX_WAIT            = 0
	FUTEX_WAKE            = 1
	FUTEX_FD              = 2
	FUTEX_REQUEUE         = 3
	FUTEX_CMP_REQUEUE     = 4
	FUTEX_WAKE_OP         = 5
	FUTEX_LOCK_PI         = 6
	FUTEX_UNLOCK_PI       = 7
	FUTEX_TRYLOCK_PI      = 8
	FUTEX_WAIT_BITSET     = 9
	FUTEX_WAKE_BITSET     = 10
	FUTEX_WAIT_REQUEUE_PI = 11
	FUTEX_CMP_REQUEUE_PI  = 12

	FUTEX_PRIVATE_FLAG   = 128
	FUTEX_CLOCK_REALTIME = 256
)

Variables

This section is empty.

Functions

func Bind

func Bind(fd int, sa Sockaddr) error

func Brk

func Brk(brk unsafe.Pointer) uintptr

func ClockGettime

func ClockGettime(clkid int, tp *Timespec) error

func Close

func Close(fd int) error

func Exit

func Exit(code int)

func Futex

func Futex(uaddr *int32, op, val int, utime *Timespec, uaddr2 *int32, val3 int) (int, error)

func Htons

func Htons(u uint16) uint16

func Mmap

func Mmap(addr, length uintptr, prot, flags, fd, offset4k int) (uintptr, error)

func Open

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

func Read

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

func SetsockoptInt

func SetsockoptInt(fd, level, opt, value int) error

func Socket

func Socket(domain, typ, proto int) (int, error)

func Write

func Write(fd int, b []byte) (int, error)

func WriteString

func WriteString(fd int, s string) (int, error)

Types

type Errno

type Errno int
const (
	EPERM           Errno = 1
	ENOENT          Errno = 2
	ESRCH           Errno = 3
	EINTR           Errno = 4
	EIO             Errno = 5
	ENXIO           Errno = 6
	E2BIG           Errno = 7
	ENOEXEC         Errno = 8
	EBADF           Errno = 9
	ECHILD          Errno = 10
	EAGAIN          Errno = 11
	ENOMEM          Errno = 12
	EACCES          Errno = 13
	EFAULT          Errno = 14
	ENOTBLK         Errno = 15
	EBUSY           Errno = 16
	EEXIST          Errno = 17
	EXDEV           Errno = 18
	ENODEV          Errno = 19
	ENOTDIR         Errno = 20
	EISDIR          Errno = 21
	EINVAL          Errno = 22
	ENFILE          Errno = 23
	EMFILE          Errno = 24
	ENOTTY          Errno = 25
	ETXTBSY         Errno = 26
	EFBIG           Errno = 27
	ENOSPC          Errno = 28
	ESPIPE          Errno = 29
	EROFS           Errno = 30
	EMLINK          Errno = 31
	EPIPE           Errno = 32
	EDOM            Errno = 33
	ERANGE          Errno = 34
	EDEADLK         Errno = 35
	ENAMETOOLONG    Errno = 36
	ENOLCK          Errno = 37
	ENOSYS          Errno = 38
	ENOTEMPTY       Errno = 39
	ELOOP           Errno = 40
	EWOULDBLOCK     Errno = 41
	ENOMSG          Errno = 42
	EIDRM           Errno = 43
	ECHRNG          Errno = 44
	EL2NSYNC        Errno = 45
	EL3HLT          Errno = 46
	EL3RST          Errno = 47
	ELNRNG          Errno = 48
	EUNATCH         Errno = 49
	ENOCSI          Errno = 50
	EL2HLT          Errno = 51
	EBADE           Errno = 52
	EBADR           Errno = 53
	EXFULL          Errno = 54
	ENOANO          Errno = 55
	EBADRQC         Errno = 56
	EBADSLT         Errno = 57
	EDEADLOCK       Errno = 58
	EBFONT          Errno = 59
	ENOSTR          Errno = 60
	ENODATA         Errno = 61
	ETIME           Errno = 62
	ENOSR           Errno = 63
	ENONET          Errno = 64
	ENOPKG          Errno = 65
	EREMOTE         Errno = 66
	ENOLINK         Errno = 67
	EADV            Errno = 68
	ESRMNT          Errno = 69
	ECOMM           Errno = 70
	EPROTO          Errno = 71
	EMULTIHOP       Errno = 72
	EDOTDOT         Errno = 73
	EBADMSG         Errno = 74
	EOVERFLOW       Errno = 75
	ENOTUNIQ        Errno = 76
	EBADFD          Errno = 77
	EREMCHG         Errno = 78
	ELIBACC         Errno = 79
	ELIBBAD         Errno = 80
	ELIBSCN         Errno = 81
	ELIBMAX         Errno = 82
	ELIBEXEC        Errno = 83
	EILSEQ          Errno = 84
	ERESTART        Errno = 85
	ESTRPIPE        Errno = 86
	EUSERS          Errno = 87
	ENOTSOCK        Errno = 88
	EDESTADDRREQ    Errno = 89
	EMSGSIZE        Errno = 90
	EPROTOTYPE      Errno = 91
	ENOPROTOOPT     Errno = 92
	EPROTONOSUPPORT Errno = 93
	ESOCKTNOSUPPORT Errno = 94
	EOPNOTSUPP      Errno = 95
	EPFNOSUPPORT    Errno = 96
	EAFNOSUPPORT    Errno = 97
	EADDRINUSE      Errno = 98
	EADDRNOTAVAIL   Errno = 99
	ENETDOWN        Errno = 100
	ENETUNREACH     Errno = 101
	ENETRESET       Errno = 102
	ECONNABORTED    Errno = 103
	ECONNRESET      Errno = 104
	ENOBUFS         Errno = 105
	EISCONN         Errno = 106
	ENOTCONN        Errno = 107
	ESHUTDOWN       Errno = 108
	ETOOMANYREFS    Errno = 109
	ETIMEDOUT       Errno = 110
	ECONNREFUSED    Errno = 111
	EHOSTDOWN       Errno = 112
	EHOSTUNREACH    Errno = 113
	EALREADY        Errno = 114
	EINPROGRESS     Errno = 115
	ESTALE          Errno = 116
	EUCLEAN         Errno = 117
	ENOTNAM         Errno = 118
	ENAVAIL         Errno = 119
	EISNAM          Errno = 120
	EREMOTEIO       Errno = 121
	EDQUOT          Errno = 122
	ENOMEDIUM       Errno = 123
	EMEDIUMTYPE     Errno = 124
	ECANCELED       Errno = 125
	ENOKEY          Errno = 126
	EKEYEXPIRED     Errno = 127
	EKEYREVOKED     Errno = 128
	EKEYREJECTED    Errno = 129
	EOWNERDEAD      Errno = 130
	ENOTRECOVERABLE Errno = 131
	ERFKILL         Errno = 132
	EHWPOISON       Errno = 133
)

func (Errno) Error

func (e Errno) Error() string

type RawSockaddrInet4

type RawSockaddrInet4 struct {
	Family uint16
	Port   uint16
	Addr   [4]byte
	Zero   [8]uint8
}

type Sockaddr

type Sockaddr interface {
	// contains filtered or unexported methods
}

type Timespec

type Timespec struct {
	Sec  int64
	Nsec int64
}

Jump to

Keyboard shortcuts

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