unix

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-3-Clause Imports: 11 Imported by: 23,742

README

Building sys/unix

The sys/unix package provides access to the raw system call interface of the underlying operating system. See: https://godoc.org/golang.org/x/sys/unix

Porting Go to a new architecture/OS combination or adding syscalls, types, or constants to an existing architecture/OS pair requires some manual effort; however, there are tools that automate much of the process.

Build Systems

There are currently two ways we generate the necessary files. We are currently migrating the build system to use containers so the builds are reproducible. This is being done on an OS-by-OS basis. Please update this documentation as components of the build system change.

Old Build System (currently for GOOS != "linux")

The old build system generates the Go files based on the C header files present on your system. This means that files for a given GOOS/GOARCH pair must be generated on a system with that OS and architecture. This also means that the generated code can differ from system to system, based on differences in the header files.

To avoid this, if you are using the old build system, only generate the Go files on an installation with unmodified header files. It is also important to keep track of which version of the OS the files were generated from (ex. Darwin 14 vs Darwin 15). This makes it easier to track the progress of changes and have each OS upgrade correspond to a single change.

To build the files for your current OS and architecture, make sure GOOS and GOARCH are set correctly and run mkall.sh. This will generate the files for your specific system. Running mkall.sh -n shows the commands that will be run.

Requirements: bash, go

New Build System (currently for GOOS == "linux")

The new build system uses a Docker container to generate the go files directly from source checkouts of the kernel and various system libraries. This means that on any platform that supports Docker, all the files using the new build system can be generated at once, and generated files will not change based on what the person running the scripts has installed on their computer.

The OS specific files for the new build system are located in the ${GOOS} directory, and the build is coordinated by the ${GOOS}/mkall.go program. When the kernel or system library updates, modify the Dockerfile at ${GOOS}/Dockerfile to checkout the new release of the source.

To build all the files under the new build system, you must be on an amd64/Linux system and have your GOOS and GOARCH set accordingly. Running mkall.sh will then generate all of the files for all of the GOOS/GOARCH pairs in the new build system. Running mkall.sh -n shows the commands that will be run.

Requirements: bash, go, docker

Component files

This section describes the various files used in the code generation process. It also contains instructions on how to modify these files to add a new architecture/OS or to add additional syscalls, types, or constants. Note that if you are using the new build system, the scripts/programs cannot be called normally. They must be called from within the docker container.

asm files

The hand-written assembly file at asm_${GOOS}_${GOARCH}.s implements system call dispatch. There are three entry points:

  func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)
  func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
  func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr)

The first and second are the standard ones; they differ only in how many arguments can be passed to the kernel. The third is for low-level use by the ForkExec wrapper. Unlike the first two, it does not call into the scheduler to let it know that a system call is running.

When porting Go to a new architecture/OS, this file must be implemented for each GOOS/GOARCH pair.

mksysnum

Mksysnum is a Go program located at ${GOOS}/mksysnum.go (or mksysnum_${GOOS}.go for the old system). This program takes in a list of header files containing the syscall number declarations and parses them to produce the corresponding list of Go numeric constants. See zsysnum_${GOOS}_${GOARCH}.go for the generated constants.

Adding new syscall numbers is mostly done by running the build on a sufficiently new installation of the target OS (or updating the source checkouts for the new build system). However, depending on the OS, you may need to update the parsing in mksysnum.

mksyscall.go

The syscall.go, syscall_${GOOS}.go, syscall_${GOOS}_${GOARCH}.go are hand-written Go files which implement system calls (for unix, the specific OS, or the specific OS/Architecture pair respectively) that need special handling and list //sys comments giving prototypes for ones that can be generated.

The mksyscall.go program takes the //sys and //sysnb comments and converts them into syscalls. This requires the name of the prototype in the comment to match a syscall number in the zsysnum_${GOOS}_${GOARCH}.go file. The function prototype can be exported (capitalized) or not.

Adding a new syscall often just requires adding a new //sys function prototype with the desired arguments and a capitalized name so it is exported. However, if you want the interface to the syscall to be different, often one will make an unexported //sys prototype, and then write a custom wrapper in syscall_${GOOS}.go.

types files

For each OS, there is a hand-written Go file at ${GOOS}/types.go (or types_${GOOS}.go on the old system). This file includes standard C headers and creates Go type aliases to the corresponding C types. The file is then fed through godef to get the Go compatible definitions. Finally, the generated code is fed though mkpost.go to format the code correctly and remove any hidden or private identifiers. This cleaned-up code is written to ztypes_${GOOS}_${GOARCH}.go.

The hardest part about preparing this file is figuring out which headers to include and which symbols need to be #defined to get the actual data structures that pass through to the kernel system calls. Some C libraries preset alternate versions for binary compatibility and translate them on the way in and out of system calls, but there is almost always a #define that can get the real ones. See types_darwin.go and linux/types.go for examples.

To add a new type, add in the necessary include statement at the top of the file (if it is not already there) and add in a type alias line. Note that if your type is significantly different on different architectures, you may need some #if/#elif macros in your include statements.

mkerrors.sh

This script is used to generate the system's various constants. This doesn't just include the error numbers and error strings, but also the signal numbers and a wide variety of miscellaneous constants. The constants come from the list of include files in the includes_${uname} variable. A regex then picks out the desired #define statements, and generates the corresponding Go constants. The error numbers and strings are generated from #include <errno.h>, and the signal numbers and strings are generated from #include <signal.h>. All of these constants are written to zerrors_${GOOS}_${GOARCH}.go via a C program, _errors.c, which prints out all the constants.

To add a constant, add the header that includes it to the appropriate variable. Then, edit the regex (if necessary) to match the desired constant. Avoid making the regex too broad to avoid matching unintended constants.

internal/mkmerge

This program is used to extract duplicate const, func, and type declarations from the generated architecture-specific files listed below, and merge these into a common file for each OS.

The merge is performed in the following steps:

  1. Construct the set of common code that is idential in all architecture-specific files.
  2. Write this common code to the merged file.
  3. Remove the common code from all architecture-specific files.

Generated files

zerrors_${GOOS}_${GOARCH}.go

A file containing all of the system's generated error numbers, error strings, signal numbers, and constants. Generated by mkerrors.sh (see above).

zsyscall_${GOOS}_${GOARCH}.go

A file containing all the generated syscalls for a specific GOOS and GOARCH. Generated by mksyscall.go (see above).

zsysnum_${GOOS}_${GOARCH}.go

A list of numeric constants for all the syscall number of the specific GOOS and GOARCH. Generated by mksysnum (see above).

ztypes_${GOOS}_${GOARCH}.go

A file containing Go types for passing into (or returning from) syscalls. Generated by godefs and the types file (see above).

Documentation

Overview

Package unix contains an interface to the low-level operating system primitives. OS details vary depending on the underlying system, and by default, godoc will display OS-specific documentation for the current system. If you want godoc to display OS documentation for another system, set $GOOS and $GOARCH to the desired system. For example, if you want to view documentation for freebsd/arm on linux/amd64, set $GOOS to freebsd and $GOARCH to arm.

The primary use of this package is inside other packages that provide a more portable interface to the system, such as "os", "time" and "net". Use those packages rather than this one if you can.

For details of the functions and data types in this package consult the manuals for the appropriate operating system.

These calls return err == nil to indicate success; otherwise err represents an operating system error describing the failure and holds a value of type syscall.Errno.

Index

Examples

Constants

View Source
const (
	R_OK = 0x4
	W_OK = 0x2
	X_OK = 0x1
)
View Source
const (
	AF_APPLETALK                            = 0x10
	AF_CCITT                                = 0xa
	AF_CHAOS                                = 0x5
	AF_CNT                                  = 0x15
	AF_COIP                                 = 0x14
	AF_DATAKIT                              = 0x9
	AF_DECnet                               = 0xc
	AF_DLI                                  = 0xd
	AF_E164                                 = 0x1c
	AF_ECMA                                 = 0x8
	AF_HYLINK                               = 0xf
	AF_IEEE80211                            = 0x25
	AF_IMPLINK                              = 0x3
	AF_INET                                 = 0x2
	AF_INET6                                = 0x1e
	AF_IPX                                  = 0x17
	AF_ISDN                                 = 0x1c
	AF_ISO                                  = 0x7
	AF_LAT                                  = 0xe
	AF_LINK                                 = 0x12
	AF_LOCAL                                = 0x1
	AF_MAX                                  = 0x29
	AF_NATM                                 = 0x1f
	AF_NDRV                                 = 0x1b
	AF_NETBIOS                              = 0x21
	AF_NS                                   = 0x6
	AF_OSI                                  = 0x7
	AF_PPP                                  = 0x22
	AF_PUP                                  = 0x4
	AF_RESERVED_36                          = 0x24
	AF_ROUTE                                = 0x11
	AF_SIP                                  = 0x18
	AF_SNA                                  = 0xb
	AF_SYSTEM                               = 0x20
	AF_SYS_CONTROL                          = 0x2
	AF_UNIX                                 = 0x1
	AF_UNSPEC                               = 0x0
	AF_UTUN                                 = 0x26
	AF_VSOCK                                = 0x28
	ALTWERASE                               = 0x200
	ATTR_BIT_MAP_COUNT                      = 0x5
	ATTR_CMN_ACCESSMASK                     = 0x20000
	ATTR_CMN_ACCTIME                        = 0x1000
	ATTR_CMN_ADDEDTIME                      = 0x10000000
	ATTR_CMN_BKUPTIME                       = 0x2000
	ATTR_CMN_CHGTIME                        = 0x800
	ATTR_CMN_CRTIME                         = 0x200
	ATTR_CMN_DATA_PROTECT_FLAGS             = 0x40000000
	ATTR_CMN_DEVID                          = 0x2
	ATTR_CMN_DOCUMENT_ID                    = 0x100000
	ATTR_CMN_ERROR                          = 0x20000000
	ATTR_CMN_EXTENDED_SECURITY              = 0x400000
	ATTR_CMN_FILEID                         = 0x2000000
	ATTR_CMN_FLAGS                          = 0x40000
	ATTR_CMN_FNDRINFO                       = 0x4000
	ATTR_CMN_FSID                           = 0x4
	ATTR_CMN_FULLPATH                       = 0x8000000
	ATTR_CMN_GEN_COUNT                      = 0x80000
	ATTR_CMN_GRPID                          = 0x10000
	ATTR_CMN_GRPUUID                        = 0x1000000
	ATTR_CMN_MODTIME                        = 0x400
	ATTR_CMN_NAME                           = 0x1
	ATTR_CMN_NAMEDATTRCOUNT                 = 0x80000
	ATTR_CMN_NAMEDATTRLIST                  = 0x100000
	ATTR_CMN_OBJID                          = 0x20
	ATTR_CMN_OBJPERMANENTID                 = 0x40
	ATTR_CMN_OBJTAG                         = 0x10
	ATTR_CMN_OBJTYPE                        = 0x8
	ATTR_CMN_OWNERID                        = 0x8000
	ATTR_CMN_PARENTID                       = 0x4000000
	ATTR_CMN_PAROBJID                       = 0x80
	ATTR_CMN_RETURNED_ATTRS                 = 0x80000000
	ATTR_CMN_SCRIPT                         = 0x100
	ATTR_CMN_SETMASK                        = 0x51c7ff00
	ATTR_CMN_USERACCESS                     = 0x200000
	ATTR_CMN_UUID                           = 0x800000
	ATTR_CMN_VALIDMASK                      = 0xffffffff
	ATTR_CMN_VOLSETMASK                     = 0x6700
	ATTR_FILE_ALLOCSIZE                     = 0x4
	ATTR_FILE_CLUMPSIZE                     = 0x10
	ATTR_FILE_DATAALLOCSIZE                 = 0x400
	ATTR_FILE_DATAEXTENTS                   = 0x800
	ATTR_FILE_DATALENGTH                    = 0x200
	ATTR_FILE_DEVTYPE                       = 0x20
	ATTR_FILE_FILETYPE                      = 0x40
	ATTR_FILE_FORKCOUNT                     = 0x80
	ATTR_FILE_FORKLIST                      = 0x100
	ATTR_FILE_IOBLOCKSIZE                   = 0x8
	ATTR_FILE_LINKCOUNT                     = 0x1
	ATTR_FILE_RSRCALLOCSIZE                 = 0x2000
	ATTR_FILE_RSRCEXTENTS                   = 0x4000
	ATTR_FILE_RSRCLENGTH                    = 0x1000
	ATTR_FILE_SETMASK                       = 0x20
	ATTR_FILE_TOTALSIZE                     = 0x2
	ATTR_FILE_VALIDMASK                     = 0x37ff
	ATTR_VOL_ALLOCATIONCLUMP                = 0x40
	ATTR_VOL_ATTRIBUTES                     = 0x40000000
	ATTR_VOL_CAPABILITIES                   = 0x20000
	ATTR_VOL_DIRCOUNT                       = 0x400
	ATTR_VOL_ENCODINGSUSED                  = 0x10000
	ATTR_VOL_FILECOUNT                      = 0x200
	ATTR_VOL_FSTYPE                         = 0x1
	ATTR_VOL_INFO                           = 0x80000000
	ATTR_VOL_IOBLOCKSIZE                    = 0x80
	ATTR_VOL_MAXOBJCOUNT                    = 0x800
	ATTR_VOL_MINALLOCATION                  = 0x20
	ATTR_VOL_MOUNTEDDEVICE                  = 0x8000
	ATTR_VOL_MOUNTFLAGS                     = 0x4000
	ATTR_VOL_MOUNTPOINT                     = 0x1000
	ATTR_VOL_NAME                           = 0x2000
	ATTR_VOL_OBJCOUNT                       = 0x100
	ATTR_VOL_QUOTA_SIZE                     = 0x10000000
	ATTR_VOL_RESERVED_SIZE                  = 0x20000000
	ATTR_VOL_SETMASK                        = 0x80002000
	ATTR_VOL_SIGNATURE                      = 0x2
	ATTR_VOL_SIZE                           = 0x4
	ATTR_VOL_SPACEAVAIL                     = 0x10
	ATTR_VOL_SPACEFREE                      = 0x8
	ATTR_VOL_SPACEUSED                      = 0x800000
	ATTR_VOL_UUID                           = 0x40000
	ATTR_VOL_VALIDMASK                      = 0xf087ffff
	B0                                      = 0x0
	B110                                    = 0x6e
	B115200                                 = 0x1c200
	B1200                                   = 0x4b0
	B134                                    = 0x86
	B14400                                  = 0x3840
	B150                                    = 0x96
	B1800                                   = 0x708
	B19200                                  = 0x4b00
	B200                                    = 0xc8
	B230400                                 = 0x38400
	B2400                                   = 0x960
	B28800                                  = 0x7080
	B300                                    = 0x12c
	B38400                                  = 0x9600
	B4800                                   = 0x12c0
	B50                                     = 0x32
	B57600                                  = 0xe100
	B600                                    = 0x258
	B7200                                   = 0x1c20
	B75                                     = 0x4b
	B76800                                  = 0x12c00
	B9600                                   = 0x2580
	BIOCFLUSH                               = 0x20004268
	BIOCGBLEN                               = 0x40044266
	BIOCGDLT                                = 0x4004426a
	BIOCGDLTLIST                            = 0xc00c4279
	BIOCGETIF                               = 0x4020426b
	BIOCGHDRCMPLT                           = 0x40044274
	BIOCGRSIG                               = 0x40044272
	BIOCGRTIMEOUT                           = 0x4010426e
	BIOCGSEESENT                            = 0x40044276
	BIOCGSTATS                              = 0x4008426f
	BIOCIMMEDIATE                           = 0x80044270
	BIOCPROMISC                             = 0x20004269
	BIOCSBLEN                               = 0xc0044266
	BIOCSDLT                                = 0x80044278
	BIOCSETF                                = 0x80104267
	BIOCSETFNR                              = 0x8010427e
	BIOCSETIF                               = 0x8020426c
	BIOCSHDRCMPLT                           = 0x80044275
	BIOCSRSIG                               = 0x80044273
	BIOCSRTIMEOUT                           = 0x8010426d
	BIOCSSEESENT                            = 0x80044277
	BIOCVERSION                             = 0x40044271
	BPF_A                                   = 0x10
	BPF_ABS                                 = 0x20
	BPF_ADD                                 = 0x0
	BPF_ALIGNMENT                           = 0x4
	BPF_ALU                                 = 0x4
	BPF_AND                                 = 0x50
	BPF_B                                   = 0x10
	BPF_DIV                                 = 0x30
	BPF_H                                   = 0x8
	BPF_IMM                                 = 0x0
	BPF_IND                                 = 0x40
	BPF_JA                                  = 0x0
	BPF_JEQ                                 = 0x10
	BPF_JGE                                 = 0x30
	BPF_JGT                                 = 0x20
	BPF_JMP                                 = 0x5
	BPF_JSET                                = 0x40
	BPF_K                                   = 0x0
	BPF_LD                                  = 0x0
	BPF_LDX                                 = 0x1
	BPF_LEN                                 = 0x80
	BPF_LSH                                 = 0x60
	BPF_MAJOR_VERSION                       = 0x1
	BPF_MAXBUFSIZE                          = 0x80000
	BPF_MAXINSNS                            = 0x200
	BPF_MEM                                 = 0x60
	BPF_MEMWORDS                            = 0x10
	BPF_MINBUFSIZE                          = 0x20
	BPF_MINOR_VERSION                       = 0x1
	BPF_MISC                                = 0x7
	BPF_MSH                                 = 0xa0
	BPF_MUL                                 = 0x20
	BPF_NEG                                 = 0x80
	BPF_OR                                  = 0x40
	BPF_RELEASE                             = 0x30bb6
	BPF_RET                                 = 0x6
	BPF_RSH                                 = 0x70
	BPF_ST                                  = 0x2
	BPF_STX                                 = 0x3
	BPF_SUB                                 = 0x10
	BPF_TAX                                 = 0x0
	BPF_TXA                                 = 0x80
	BPF_W                                   = 0x0
	BPF_X                                   = 0x8
	BRKINT                                  = 0x2
	BS0                                     = 0x0
	BS1                                     = 0x8000
	BSDLY                                   = 0x8000
	CFLUSH                                  = 0xf
	CLOCAL                                  = 0x8000
	CLOCK_MONOTONIC                         = 0x6
	CLOCK_MONOTONIC_RAW                     = 0x4
	CLOCK_MONOTONIC_RAW_APPROX              = 0x5
	CLOCK_PROCESS_CPUTIME_ID                = 0xc
	CLOCK_REALTIME                          = 0x0
	CLOCK_THREAD_CPUTIME_ID                 = 0x10
	CLOCK_UPTIME_RAW                        = 0x8
	CLOCK_UPTIME_RAW_APPROX                 = 0x9
	CLONE_NOFOLLOW                          = 0x1
	CLONE_NOOWNERCOPY                       = 0x2
	CR0                                     = 0x0
	CR1                                     = 0x1000
	CR2                                     = 0x2000
	CR3                                     = 0x3000
	CRDLY                                   = 0x3000
	CREAD                                   = 0x800
	CRTSCTS                                 = 0x30000
	CS5                                     = 0x0
	CS6                                     = 0x100
	CS7                                     = 0x200
	CS8                                     = 0x300
	CSIZE                                   = 0x300
	CSTART                                  = 0x11
	CSTATUS                                 = 0x14
	CSTOP                                   = 0x13
	CSTOPB                                  = 0x400
	CSUSP                                   = 0x1a
	CTLIOCGINFO                             = 0xc0644e03
	CTL_HW                                  = 0x6
	CTL_KERN                                = 0x1
	CTL_MAXNAME                             = 0xc
	CTL_NET                                 = 0x4
	DLT_A429                                = 0xb8
	DLT_A653_ICM                            = 0xb9
	DLT_AIRONET_HEADER                      = 0x78
	DLT_AOS                                 = 0xde
	DLT_APPLE_IP_OVER_IEEE1394              = 0x8a
	DLT_ARCNET                              = 0x7
	DLT_ARCNET_LINUX                        = 0x81
	DLT_ATM_CLIP                            = 0x13
	DLT_ATM_RFC1483                         = 0xb
	DLT_AURORA                              = 0x7e
	DLT_AX25                                = 0x3
	DLT_AX25_KISS                           = 0xca
	DLT_BACNET_MS_TP                        = 0xa5
	DLT_BLUETOOTH_HCI_H4                    = 0xbb
	DLT_BLUETOOTH_HCI_H4_WITH_PHDR          = 0xc9
	DLT_CAN20B                              = 0xbe
	DLT_CAN_SOCKETCAN                       = 0xe3
	DLT_CHAOS                               = 0x5
	DLT_CHDLC                               = 0x68
	DLT_CISCO_IOS                           = 0x76
	DLT_C_HDLC                              = 0x68
	DLT_C_HDLC_WITH_DIR                     = 0xcd
	DLT_DBUS                                = 0xe7
	DLT_DECT                                = 0xdd
	DLT_DOCSIS                              = 0x8f
	DLT_DVB_CI                              = 0xeb
	DLT_ECONET                              = 0x73
	DLT_EN10MB                              = 0x1
	DLT_EN3MB                               = 0x2
	DLT_ENC                                 = 0x6d
	DLT_ERF                                 = 0xc5
	DLT_ERF_ETH                             = 0xaf
	DLT_ERF_POS                             = 0xb0
	DLT_FC_2                                = 0xe0
	DLT_FC_2_WITH_FRAME_DELIMS              = 0xe1
	DLT_FDDI                                = 0xa
	DLT_FLEXRAY                             = 0xd2
	DLT_FRELAY                              = 0x6b
	DLT_FRELAY_WITH_DIR                     = 0xce
	DLT_GCOM_SERIAL                         = 0xad
	DLT_GCOM_T1E1                           = 0xac
	DLT_GPF_F                               = 0xab
	DLT_GPF_T                               = 0xaa
	DLT_GPRS_LLC                            = 0xa9
	DLT_GSMTAP_ABIS                         = 0xda
	DLT_GSMTAP_UM                           = 0xd9
	DLT_HHDLC                               = 0x79
	DLT_IBM_SN                              = 0x92
	DLT_IBM_SP                              = 0x91
	DLT_IEEE802                             = 0x6
	DLT_IEEE802_11                          = 0x69
	DLT_IEEE802_11_RADIO                    = 0x7f
	DLT_IEEE802_11_RADIO_AVS                = 0xa3
	DLT_IEEE802_15_4                        = 0xc3
	DLT_IEEE802_15_4_LINUX                  = 0xbf
	DLT_IEEE802_15_4_NOFCS                  = 0xe6
	DLT_IEEE802_15_4_NONASK_PHY             = 0xd7
	DLT_IEEE802_16_MAC_CPS                  = 0xbc
	DLT_IEEE802_16_MAC_CPS_RADIO            = 0xc1
	DLT_IPFILTER                            = 0x74
	DLT_IPMB                                = 0xc7
	DLT_IPMB_LINUX                          = 0xd1
	DLT_IPNET                               = 0xe2
	DLT_IPOIB                               = 0xf2
	DLT_IPV4                                = 0xe4
	DLT_IPV6                                = 0xe5
	DLT_IP_OVER_FC                          = 0x7a
	DLT_JUNIPER_ATM1                        = 0x89
	DLT_JUNIPER_ATM2                        = 0x87
	DLT_JUNIPER_ATM_CEMIC                   = 0xee
	DLT_JUNIPER_CHDLC                       = 0xb5
	DLT_JUNIPER_ES                          = 0x84
	DLT_JUNIPER_ETHER                       = 0xb2
	DLT_JUNIPER_FIBRECHANNEL                = 0xea
	DLT_JUNIPER_FRELAY                      = 0xb4
	DLT_JUNIPER_GGSN                        = 0x85
	DLT_JUNIPER_ISM                         = 0xc2
	DLT_JUNIPER_MFR                         = 0x86
	DLT_JUNIPER_MLFR                        = 0x83
	DLT_JUNIPER_MLPPP                       = 0x82
	DLT_JUNIPER_MONITOR                     = 0xa4
	DLT_JUNIPER_PIC_PEER                    = 0xae
	DLT_JUNIPER_PPP                         = 0xb3
	DLT_JUNIPER_PPPOE                       = 0xa7
	DLT_JUNIPER_PPPOE_ATM                   = 0xa8
	DLT_JUNIPER_SERVICES                    = 0x88
	DLT_JUNIPER_SRX_E2E                     = 0xe9
	DLT_JUNIPER_ST                          = 0xc8
	DLT_JUNIPER_VP                          = 0xb7
	DLT_JUNIPER_VS                          = 0xe8
	DLT_LAPB_WITH_DIR                       = 0xcf
	DLT_LAPD                                = 0xcb
	DLT_LIN                                 = 0xd4
	DLT_LINUX_EVDEV                         = 0xd8
	DLT_LINUX_IRDA                          = 0x90
	DLT_LINUX_LAPD                          = 0xb1
	DLT_LINUX_PPP_WITHDIRECTION             = 0xa6
	DLT_LINUX_SLL                           = 0x71
	DLT_LOOP                                = 0x6c
	DLT_LTALK                               = 0x72
	DLT_MATCHING_MAX                        = 0x10a
	DLT_MATCHING_MIN                        = 0x68
	DLT_MFR                                 = 0xb6
	DLT_MOST                                = 0xd3
	DLT_MPEG_2_TS                           = 0xf3
	DLT_MPLS                                = 0xdb
	DLT_MTP2                                = 0x8c
	DLT_MTP2_WITH_PHDR                      = 0x8b
	DLT_MTP3                                = 0x8d
	DLT_MUX27010                            = 0xec
	DLT_NETANALYZER                         = 0xf0
	DLT_NETANALYZER_TRANSPARENT             = 0xf1
	DLT_NFC_LLCP                            = 0xf5
	DLT_NFLOG                               = 0xef
	DLT_NG40                                = 0xf4
	DLT_NULL                                = 0x0
	DLT_PCI_EXP                             = 0x7d
	DLT_PFLOG                               = 0x75
	DLT_PFSYNC                              = 0x12
	DLT_PPI                                 = 0xc0
	DLT_PPP                                 = 0x9
	DLT_PPP_BSDOS                           = 0x10
	DLT_PPP_ETHER                           = 0x33
	DLT_PPP_PPPD                            = 0xa6
	DLT_PPP_SERIAL                          = 0x32
	DLT_PPP_WITH_DIR                        = 0xcc
	DLT_PPP_WITH_DIRECTION                  = 0xa6
	DLT_PRISM_HEADER                        = 0x77
	DLT_PRONET                              = 0x4
	DLT_RAIF1                               = 0xc6
	DLT_RAW                                 = 0xc
	DLT_RIO                                 = 0x7c
	DLT_SCCP                                = 0x8e
	DLT_SITA                                = 0xc4
	DLT_SLIP                                = 0x8
	DLT_SLIP_BSDOS                          = 0xf
	DLT_STANAG_5066_D_PDU                   = 0xed
	DLT_SUNATM                              = 0x7b
	DLT_SYMANTEC_FIREWALL                   = 0x63
	DLT_TZSP                                = 0x80
	DLT_USB                                 = 0xba
	DLT_USB_DARWIN                          = 0x10a
	DLT_USB_LINUX                           = 0xbd
	DLT_USB_LINUX_MMAPPED                   = 0xdc
	DLT_USER0                               = 0x93
	DLT_USER1                               = 0x94
	DLT_USER10                              = 0x9d
	DLT_USER11                              = 0x9e
	DLT_USER12                              = 0x9f
	DLT_USER13                              = 0xa0
	DLT_USER14                              = 0xa1
	DLT_USER15                              = 0xa2
	DLT_USER2                               = 0x95
	DLT_USER3                               = 0x96
	DLT_USER4                               = 0x97
	DLT_USER5                               = 0x98
	DLT_USER6                               = 0x99
	DLT_USER7                               = 0x9a
	DLT_USER8                               = 0x9b
	DLT_USER9                               = 0x9c
	DLT_WIHART                              = 0xdf
	DLT_X2E_SERIAL                          = 0xd5
	DLT_X2E_XORAYA                          = 0xd6
	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
	ECHO                                    = 0x8
	ECHOCTL                                 = 0x40
	ECHOE                                   = 0x2
	ECHOK                                   = 0x4
	ECHOKE                                  = 0x1
	ECHONL                                  = 0x10
	ECHOPRT                                 = 0x20
	EVFILT_AIO                              = -0x3
	EVFILT_EXCEPT                           = -0xf
	EVFILT_FS                               = -0x9
	EVFILT_MACHPORT                         = -0x8
	EVFILT_PROC                             = -0x5
	EVFILT_READ                             = -0x1
	EVFILT_SIGNAL                           = -0x6
	EVFILT_SYSCOUNT                         = 0x11
	EVFILT_THREADMARKER                     = 0x11
	EVFILT_TIMER                            = -0x7
	EVFILT_USER                             = -0xa
	EVFILT_VM                               = -0xc
	EVFILT_VNODE                            = -0x4
	EVFILT_WRITE                            = -0x2
	EV_ADD                                  = 0x1
	EV_CLEAR                                = 0x20
	EV_DELETE                               = 0x2
	EV_DISABLE                              = 0x8
	EV_DISPATCH                             = 0x80
	EV_DISPATCH2                            = 0x180
	EV_ENABLE                               = 0x4
	EV_EOF                                  = 0x8000
	EV_ERROR                                = 0x4000
	EV_FLAG0                                = 0x1000
	EV_FLAG1                                = 0x2000
	EV_ONESHOT                              = 0x10
	EV_OOBAND                               = 0x2000
	EV_POLL                                 = 0x1000
	EV_RECEIPT                              = 0x40
	EV_SYSFLAGS                             = 0xf000
	EV_UDATA_SPECIFIC                       = 0x100
	EV_VANISHED                             = 0x200
	EXTA                                    = 0x4b00
	EXTB                                    = 0x9600
	EXTPROC                                 = 0x800
	FD_CLOEXEC                              = 0x1
	FD_SETSIZE                              = 0x400
	FF0                                     = 0x0
	FF1                                     = 0x4000
	FFDLY                                   = 0x4000
	FLUSHO                                  = 0x800000
	FSOPT_ATTR_CMN_EXTENDED                 = 0x20
	FSOPT_NOFOLLOW                          = 0x1
	FSOPT_NOINMEMUPDATE                     = 0x2
	FSOPT_PACK_INVAL_ATTRS                  = 0x8
	FSOPT_REPORT_FULLSIZE                   = 0x4
	FSOPT_RETURN_REALDEV                    = 0x200
	F_ADDFILESIGS                           = 0x3d
	F_ADDFILESIGS_FOR_DYLD_SIM              = 0x53
	F_ADDFILESIGS_INFO                      = 0x67
	F_ADDFILESIGS_RETURN                    = 0x61
	F_ADDFILESUPPL                          = 0x68
	F_ADDSIGS                               = 0x3b
	F_ALLOCATEALL                           = 0x4
	F_ALLOCATECONTIG                        = 0x2
	F_BARRIERFSYNC                          = 0x55
	F_CHECK_LV                              = 0x62
	F_CHKCLEAN                              = 0x29
	F_DUPFD                                 = 0x0
	F_DUPFD_CLOEXEC                         = 0x43
	F_FINDSIGS                              = 0x4e
	F_FLUSH_DATA                            = 0x28
	F_FREEZE_FS                             = 0x35
	F_FULLFSYNC                             = 0x33
	F_GETCODEDIR                            = 0x48
	F_GETFD                                 = 0x1
	F_GETFL                                 = 0x3
	F_GETLK                                 = 0x7
	F_GETLKPID                              = 0x42
	F_GETNOSIGPIPE                          = 0x4a
	F_GETOWN                                = 0x5
	F_GETPATH                               = 0x32
	F_GETPATH_MTMINFO                       = 0x47
	F_GETPATH_NOFIRMLINK                    = 0x66
	F_GETPROTECTIONCLASS                    = 0x3f
	F_GETPROTECTIONLEVEL                    = 0x4d
	F_GETSIGSINFO                           = 0x69
	F_GLOBAL_NOCACHE                        = 0x37
	F_LOG2PHYS                              = 0x31
	F_LOG2PHYS_EXT                          = 0x41
	F_NOCACHE                               = 0x30
	F_NODIRECT                              = 0x3e
	F_OK                                    = 0x0
	F_PATHPKG_CHECK                         = 0x34
	F_PEOFPOSMODE                           = 0x3
	F_PREALLOCATE                           = 0x2a
	F_PUNCHHOLE                             = 0x63
	F_RDADVISE                              = 0x2c
	F_RDAHEAD                               = 0x2d
	F_RDLCK                                 = 0x1
	F_SETBACKINGSTORE                       = 0x46
	F_SETFD                                 = 0x2
	F_SETFL                                 = 0x4
	F_SETLK                                 = 0x8
	F_SETLKW                                = 0x9
	F_SETLKWTIMEOUT                         = 0xa
	F_SETNOSIGPIPE                          = 0x49
	F_SETOWN                                = 0x6
	F_SETPROTECTIONCLASS                    = 0x40
	F_SETSIZE                               = 0x2b
	F_SINGLE_WRITER                         = 0x4c
	F_SPECULATIVE_READ                      = 0x65
	F_THAW_FS                               = 0x36
	F_TRANSCODEKEY                          = 0x4b
	F_TRIM_ACTIVE_FILE                      = 0x64
	F_UNLCK                                 = 0x2
	F_VOLPOSMODE                            = 0x4
	F_WRLCK                                 = 0x3
	HUPCL                                   = 0x4000
	HW_MACHINE                              = 0x1
	ICANON                                  = 0x100
	ICMP6_FILTER                            = 0x12
	ICRNL                                   = 0x100
	IEXTEN                                  = 0x400
	IFF_ALLMULTI                            = 0x200
	IFF_ALTPHYS                             = 0x4000
	IFF_BROADCAST                           = 0x2
	IFF_DEBUG                               = 0x4
	IFF_LINK0                               = 0x1000
	IFF_LINK1                               = 0x2000
	IFF_LINK2                               = 0x4000
	IFF_LOOPBACK                            = 0x8
	IFF_MULTICAST                           = 0x8000
	IFF_NOARP                               = 0x80
	IFF_NOTRAILERS                          = 0x20
	IFF_OACTIVE                             = 0x400
	IFF_POINTOPOINT                         = 0x10
	IFF_PROMISC                             = 0x100
	IFF_RUNNING                             = 0x40
	IFF_SIMPLEX                             = 0x800
	IFF_UP                                  = 0x1
	IFNAMSIZ                                = 0x10
	IFT_1822                                = 0x2
	IFT_6LOWPAN                             = 0x40
	IFT_AAL5                                = 0x31
	IFT_ARCNET                              = 0x23
	IFT_ARCNETPLUS                          = 0x24
	IFT_ATM                                 = 0x25
	IFT_BRIDGE                              = 0xd1
	IFT_CARP                                = 0xf8
	IFT_CELLULAR                            = 0xff
	IFT_CEPT                                = 0x13
	IFT_DS3                                 = 0x1e
	IFT_ENC                                 = 0xf4
	IFT_EON                                 = 0x19
	IFT_ETHER                               = 0x6
	IFT_FAITH                               = 0x38
	IFT_FDDI                                = 0xf
	IFT_FRELAY                              = 0x20
	IFT_FRELAYDCE                           = 0x2c
	IFT_GIF                                 = 0x37
	IFT_HDH1822                             = 0x3
	IFT_HIPPI                               = 0x2f
	IFT_HSSI                                = 0x2e
	IFT_HY                                  = 0xe
	IFT_IEEE1394                            = 0x90
	IFT_IEEE8023ADLAG                       = 0x88
	IFT_ISDNBASIC                           = 0x14
	IFT_ISDNPRIMARY                         = 0x15
	IFT_ISO88022LLC                         = 0x29
	IFT_ISO88023                            = 0x7
	IFT_ISO88024                            = 0x8
	IFT_ISO88025                            = 0x9
	IFT_ISO88026                            = 0xa
	IFT_L2VLAN                              = 0x87
	IFT_LAPB                                = 0x10
	IFT_LOCALTALK                           = 0x2a
	IFT_LOOP                                = 0x18
	IFT_MIOX25                              = 0x26
	IFT_MODEM                               = 0x30
	IFT_NSIP                                = 0x1b
	IFT_OTHER                               = 0x1
	IFT_P10                                 = 0xc
	IFT_P80                                 = 0xd
	IFT_PARA                                = 0x22
	IFT_PDP                                 = 0xff
	IFT_PFLOG                               = 0xf5
	IFT_PFSYNC                              = 0xf6
	IFT_PKTAP                               = 0xfe
	IFT_PPP                                 = 0x17
	IFT_PROPMUX                             = 0x36
	IFT_PROPVIRTUAL                         = 0x35
	IFT_PTPSERIAL                           = 0x16
	IFT_RS232                               = 0x21
	IFT_SDLC                                = 0x11
	IFT_SIP                                 = 0x1f
	IFT_SLIP                                = 0x1c
	IFT_SMDSDXI                             = 0x2b
	IFT_SMDSICIP                            = 0x34
	IFT_SONET                               = 0x27
	IFT_SONETPATH                           = 0x32
	IFT_SONETVT                             = 0x33
	IFT_STARLAN                             = 0xb
	IFT_STF                                 = 0x39
	IFT_T1                                  = 0x12
	IFT_ULTRA                               = 0x1d
	IFT_V35                                 = 0x2d
	IFT_X25                                 = 0x5
	IFT_X25DDN                              = 0x4
	IFT_X25PLE                              = 0x28
	IFT_XETHER                              = 0x1a
	IGNBRK                                  = 0x1
	IGNCR                                   = 0x80
	IGNPAR                                  = 0x4
	IMAXBEL                                 = 0x2000
	INLCR                                   = 0x40
	INPCK                                   = 0x10
	IN_CLASSA_HOST                          = 0xffffff
	IN_CLASSA_MAX                           = 0x80
	IN_CLASSA_NET                           = 0xff000000
	IN_CLASSA_NSHIFT                        = 0x18
	IN_CLASSB_HOST                          = 0xffff
	IN_CLASSB_MAX                           = 0x10000
	IN_CLASSB_NET                           = 0xffff0000
	IN_CLASSB_NSHIFT                        = 0x10
	IN_CLASSC_HOST                          = 0xff
	IN_CLASSC_NET                           = 0xffffff00
	IN_CLASSC_NSHIFT                        = 0x8
	IN_CLASSD_HOST                          = 0xfffffff
	IN_CLASSD_NET                           = 0xf0000000
	IN_CLASSD_NSHIFT                        = 0x1c
	IN_LINKLOCALNETNUM                      = 0xa9fe0000
	IN_LOOPBACKNET                          = 0x7f
	IOCTL_VM_SOCKETS_GET_LOCAL_CID          = 0x400473d1
	IPPROTO_3PC                             = 0x22
	IPPROTO_ADFS                            = 0x44
	IPPROTO_AH                              = 0x33
	IPPROTO_AHIP                            = 0x3d
	IPPROTO_APES                            = 0x63
	IPPROTO_ARGUS                           = 0xd
	IPPROTO_AX25                            = 0x5d
	IPPROTO_BHA                             = 0x31
	IPPROTO_BLT                             = 0x1e
	IPPROTO_BRSATMON                        = 0x4c
	IPPROTO_CFTP                            = 0x3e
	IPPROTO_CHAOS                           = 0x10
	IPPROTO_CMTP                            = 0x26
	IPPROTO_CPHB                            = 0x49
	IPPROTO_CPNX                            = 0x48
	IPPROTO_DDP                             = 0x25
	IPPROTO_DGP                             = 0x56
	IPPROTO_DIVERT                          = 0xfe
	IPPROTO_DONE                            = 0x101
	IPPROTO_DSTOPTS                         = 0x3c
	IPPROTO_EGP                             = 0x8
	IPPROTO_EMCON                           = 0xe
	IPPROTO_ENCAP                           = 0x62
	IPPROTO_EON                             = 0x50
	IPPROTO_ESP                             = 0x32
	IPPROTO_ETHERIP                         = 0x61
	IPPROTO_FRAGMENT                        = 0x2c
	IPPROTO_GGP                             = 0x3
	IPPROTO_GMTP                            = 0x64
	IPPROTO_GRE                             = 0x2f
	IPPROTO_HELLO                           = 0x3f
	IPPROTO_HMP                             = 0x14
	IPPROTO_HOPOPTS                         = 0x0
	IPPROTO_ICMP                            = 0x1
	IPPROTO_ICMPV6                          = 0x3a
	IPPROTO_IDP                             = 0x16
	IPPROTO_IDPR                            = 0x23
	IPPROTO_IDRP                            = 0x2d
	IPPROTO_IGMP                            = 0x2
	IPPROTO_IGP                             = 0x55
	IPPROTO_IGRP                            = 0x58
	IPPROTO_IL                              = 0x28
	IPPROTO_INLSP                           = 0x34
	IPPROTO_INP                             = 0x20
	IPPROTO_IP                              = 0x0
	IPPROTO_IPCOMP                          = 0x6c
	IPPROTO_IPCV                            = 0x47
	IPPROTO_IPEIP                           = 0x5e
	IPPROTO_IPIP                            = 0x4
	IPPROTO_IPPC                            = 0x43
	IPPROTO_IPV4                            = 0x4
	IPPROTO_IPV6                            = 0x29
	IPPROTO_IRTP                            = 0x1c
	IPPROTO_KRYPTOLAN                       = 0x41
	IPPROTO_LARP                            = 0x5b
	IPPROTO_LEAF1                           = 0x19
	IPPROTO_LEAF2                           = 0x1a
	IPPROTO_MAX                             = 0x100
	IPPROTO_MAXID                           = 0x34
	IPPROTO_MEAS                            = 0x13
	IPPROTO_MHRP                            = 0x30
	IPPROTO_MICP                            = 0x5f
	IPPROTO_MTP                             = 0x5c
	IPPROTO_MUX                             = 0x12
	IPPROTO_ND                              = 0x4d
	IPPROTO_NHRP                            = 0x36
	IPPROTO_NONE                            = 0x3b
	IPPROTO_NSP                             = 0x1f
	IPPROTO_NVPII                           = 0xb
	IPPROTO_OSPFIGP                         = 0x59
	IPPROTO_PGM                             = 0x71
	IPPROTO_PIGP                            = 0x9
	IPPROTO_PIM                             = 0x67
	IPPROTO_PRM                             = 0x15
	IPPROTO_PUP                             = 0xc
	IPPROTO_PVP                             = 0x4b
	IPPROTO_RAW                             = 0xff
	IPPROTO_RCCMON                          = 0xa
	IPPROTO_RDP                             = 0x1b
	IPPROTO_ROUTING                         = 0x2b
	IPPROTO_RSVP                            = 0x2e
	IPPROTO_RVD                             = 0x42
	IPPROTO_SATEXPAK                        = 0x40
	IPPROTO_SATMON                          = 0x45
	IPPROTO_SCCSP                           = 0x60
	IPPROTO_SCTP                            = 0x84
	IPPROTO_SDRP                            = 0x2a
	IPPROTO_SEP                             = 0x21
	IPPROTO_SRPC                            = 0x5a
	IPPROTO_ST                              = 0x7
	IPPROTO_SVMTP                           = 0x52
	IPPROTO_SWIPE                           = 0x35
	IPPROTO_TCF                             = 0x57
	IPPROTO_TCP                             = 0x6
	IPPROTO_TP                              = 0x1d
	IPPROTO_TPXX                            = 0x27
	IPPROTO_TRUNK1                          = 0x17
	IPPROTO_TRUNK2                          = 0x18
	IPPROTO_TTP                             = 0x54
	IPPROTO_UDP                             = 0x11
	IPPROTO_VINES                           = 0x53
	IPPROTO_VISA                            = 0x46
	IPPROTO_VMTP                            = 0x51
	IPPROTO_WBEXPAK                         = 0x4f
	IPPROTO_WBMON                           = 0x4e
	IPPROTO_WSN                             = 0x4a
	IPPROTO_XNET                            = 0xf
	IPPROTO_XTP                             = 0x24
	IPV6_2292DSTOPTS                        = 0x17
	IPV6_2292HOPLIMIT                       = 0x14
	IPV6_2292HOPOPTS                        = 0x16
	IPV6_2292NEXTHOP                        = 0x15
	IPV6_2292PKTINFO                        = 0x13
	IPV6_2292PKTOPTIONS                     = 0x19
	IPV6_2292RTHDR                          = 0x18
	IPV6_3542DSTOPTS                        = 0x32
	IPV6_3542HOPLIMIT                       = 0x2f
	IPV6_3542HOPOPTS                        = 0x31
	IPV6_3542NEXTHOP                        = 0x30
	IPV6_3542PKTINFO                        = 0x2e
	IPV6_3542RTHDR                          = 0x33
	IPV6_ADDR_MC_FLAGS_PREFIX               = 0x20
	IPV6_ADDR_MC_FLAGS_TRANSIENT            = 0x10
	IPV6_ADDR_MC_FLAGS_UNICAST_BASED        = 0x30
	IPV6_AUTOFLOWLABEL                      = 0x3b
	IPV6_BINDV6ONLY                         = 0x1b
	IPV6_BOUND_IF                           = 0x7d
	IPV6_CHECKSUM                           = 0x1a
	IPV6_DEFAULT_MULTICAST_HOPS             = 0x1
	IPV6_DEFAULT_MULTICAST_LOOP             = 0x1
	IPV6_DEFHLIM                            = 0x40
	IPV6_DONTFRAG                           = 0x3e
	IPV6_DSTOPTS                            = 0x32
	IPV6_FAITH                              = 0x1d
	IPV6_FLOWINFO_MASK                      = 0xffffff0f
	IPV6_FLOWLABEL_MASK                     = 0xffff0f00
	IPV6_FLOW_ECN_MASK                      = 0x3000
	IPV6_FRAGTTL                            = 0x3c
	IPV6_FW_ADD                             = 0x1e
	IPV6_FW_DEL                             = 0x1f
	IPV6_FW_FLUSH                           = 0x20
	IPV6_FW_GET                             = 0x22
	IPV6_FW_ZERO                            = 0x21
	IPV6_HLIMDEC                            = 0x1
	IPV6_HOPLIMIT                           = 0x2f
	IPV6_HOPOPTS                            = 0x31
	IPV6_IPSEC_POLICY                       = 0x1c
	IPV6_JOIN_GROUP                         = 0xc
	IPV6_LEAVE_GROUP                        = 0xd
	IPV6_MAXHLIM                            = 0xff
	IPV6_MAXOPTHDR                          = 0x800
	IPV6_MAXPACKET                          = 0xffff
	IPV6_MAX_GROUP_SRC_FILTER               = 0x200
	IPV6_MAX_MEMBERSHIPS                    = 0xfff
	IPV6_MAX_SOCK_SRC_FILTER                = 0x80
	IPV6_MIN_MEMBERSHIPS                    = 0x1f
	IPV6_MMTU                               = 0x500
	IPV6_MSFILTER                           = 0x4a
	IPV6_MULTICAST_HOPS                     = 0xa
	IPV6_MULTICAST_IF                       = 0x9
	IPV6_MULTICAST_LOOP                     = 0xb
	IPV6_NEXTHOP                            = 0x30
	IPV6_PATHMTU                            = 0x2c
	IPV6_PKTINFO                            = 0x2e
	IPV6_PORTRANGE                          = 0xe
	IPV6_PORTRANGE_DEFAULT                  = 0x0
	IPV6_PORTRANGE_HIGH                     = 0x1
	IPV6_PORTRANGE_LOW                      = 0x2
	IPV6_PREFER_TEMPADDR                    = 0x3f
	IPV6_RECVDSTOPTS                        = 0x28
	IPV6_RECVHOPLIMIT                       = 0x25
	IPV6_RECVHOPOPTS                        = 0x27
	IPV6_RECVPATHMTU                        = 0x2b
	IPV6_RECVPKTINFO                        = 0x3d
	IPV6_RECVRTHDR                          = 0x26
	IPV6_RECVTCLASS                         = 0x23
	IPV6_RTHDR                              = 0x33
	IPV6_RTHDRDSTOPTS                       = 0x39
	IPV6_RTHDR_LOOSE                        = 0x0
	IPV6_RTHDR_STRICT                       = 0x1
	IPV6_RTHDR_TYPE_0                       = 0x0
	IPV6_SOCKOPT_RESERVED1                  = 0x3
	IPV6_TCLASS                             = 0x24
	IPV6_UNICAST_HOPS                       = 0x4
	IPV6_USE_MIN_MTU                        = 0x2a
	IPV6_V6ONLY                             = 0x1b
	IPV6_VERSION                            = 0x60
	IPV6_VERSION_MASK                       = 0xf0
	IP_ADD_MEMBERSHIP                       = 0xc
	IP_ADD_SOURCE_MEMBERSHIP                = 0x46
	IP_BLOCK_SOURCE                         = 0x48
	IP_BOUND_IF                             = 0x19
	IP_DEFAULT_MULTICAST_LOOP               = 0x1
	IP_DEFAULT_MULTICAST_TTL                = 0x1
	IP_DF                                   = 0x4000
	IP_DONTFRAG                             = 0x1c
	IP_DROP_MEMBERSHIP                      = 0xd
	IP_DROP_SOURCE_MEMBERSHIP               = 0x47
	IP_DUMMYNET_CONFIGURE                   = 0x3c
	IP_DUMMYNET_DEL                         = 0x3d
	IP_DUMMYNET_FLUSH                       = 0x3e
	IP_DUMMYNET_GET                         = 0x40
	IP_FAITH                                = 0x16
	IP_FW_ADD                               = 0x28
	IP_FW_DEL                               = 0x29
	IP_FW_FLUSH                             = 0x2a
	IP_FW_GET                               = 0x2c
	IP_FW_RESETLOG                          = 0x2d
	IP_FW_ZERO                              = 0x2b
	IP_HDRINCL                              = 0x2
	IP_IPSEC_POLICY                         = 0x15
	IP_MAXPACKET                            = 0xffff
	IP_MAX_GROUP_SRC_FILTER                 = 0x200
	IP_MAX_MEMBERSHIPS                      = 0xfff
	IP_MAX_SOCK_MUTE_FILTER                 = 0x80
	IP_MAX_SOCK_SRC_FILTER                  = 0x80
	IP_MF                                   = 0x2000
	IP_MIN_MEMBERSHIPS                      = 0x1f
	IP_MSFILTER                             = 0x4a
	IP_MSS                                  = 0x240
	IP_MULTICAST_IF                         = 0x9
	IP_MULTICAST_IFINDEX                    = 0x42
	IP_MULTICAST_LOOP                       = 0xb
	IP_MULTICAST_TTL                        = 0xa
	IP_MULTICAST_VIF                        = 0xe
	IP_NAT__XXX                             = 0x37
	IP_OFFMASK                              = 0x1fff
	IP_OLD_FW_ADD                           = 0x32
	IP_OLD_FW_DEL                           = 0x33
	IP_OLD_FW_FLUSH                         = 0x34
	IP_OLD_FW_GET                           = 0x36
	IP_OLD_FW_RESETLOG                      = 0x38
	IP_OLD_FW_ZERO                          = 0x35
	IP_OPTIONS                              = 0x1
	IP_PKTINFO                              = 0x1a
	IP_PORTRANGE                            = 0x13
	IP_PORTRANGE_DEFAULT                    = 0x0
	IP_PORTRANGE_HIGH                       = 0x1
	IP_PORTRANGE_LOW                        = 0x2
	IP_RECVDSTADDR                          = 0x7
	IP_RECVIF                               = 0x14
	IP_RECVOPTS                             = 0x5
	IP_RECVPKTINFO                          = 0x1a
	IP_RECVRETOPTS                          = 0x6
	IP_RECVTOS                              = 0x1b
	IP_RECVTTL                              = 0x18
	IP_RETOPTS                              = 0x8
	IP_RF                                   = 0x8000
	IP_RSVP_OFF                             = 0x10
	IP_RSVP_ON                              = 0xf
	IP_RSVP_VIF_OFF                         = 0x12
	IP_RSVP_VIF_ON                          = 0x11
	IP_STRIPHDR                             = 0x17
	IP_TOS                                  = 0x3
	IP_TRAFFIC_MGT_BACKGROUND               = 0x41
	IP_TTL                                  = 0x4
	IP_UNBLOCK_SOURCE                       = 0x49
	ISIG                                    = 0x80
	ISTRIP                                  = 0x20
	IUTF8                                   = 0x4000
	IXANY                                   = 0x800
	IXOFF                                   = 0x400
	IXON                                    = 0x200
	KERN_HOSTNAME                           = 0xa
	KERN_OSRELEASE                          = 0x2
	KERN_OSTYPE                             = 0x1
	KERN_VERSION                            = 0x4
	LOCAL_PEERCRED                          = 0x1
	LOCAL_PEEREPID                          = 0x3
	LOCAL_PEEREUUID                         = 0x5
	LOCAL_PEERPID                           = 0x2
	LOCAL_PEERTOKEN                         = 0x6
	LOCAL_PEERUUID                          = 0x4
	LOCK_EX                                 = 0x2
	LOCK_NB                                 = 0x4
	LOCK_SH                                 = 0x1
	LOCK_UN                                 = 0x8
	MADV_CAN_REUSE                          = 0x9
	MADV_DONTNEED                           = 0x4
	MADV_FREE                               = 0x5
	MADV_FREE_REUSABLE                      = 0x7
	MADV_FREE_REUSE                         = 0x8
	MADV_NORMAL                             = 0x0
	MADV_PAGEOUT                            = 0xa
	MADV_RANDOM                             = 0x1
	MADV_SEQUENTIAL                         = 0x2
	MADV_WILLNEED                           = 0x3
	MADV_ZERO_WIRED_PAGES                   = 0x6
	MAP_32BIT                               = 0x8000
	MAP_ANON                                = 0x1000
	MAP_ANONYMOUS                           = 0x1000
	MAP_COPY                                = 0x2
	MAP_FILE                                = 0x0
	MAP_FIXED                               = 0x10
	MAP_HASSEMAPHORE                        = 0x200
	MAP_JIT                                 = 0x800
	MAP_NOCACHE                             = 0x400
	MAP_NOEXTEND                            = 0x100
	MAP_NORESERVE                           = 0x40
	MAP_PRIVATE                             = 0x2
	MAP_RENAME                              = 0x20
	MAP_RESERVED0080                        = 0x80
	MAP_RESILIENT_CODESIGN                  = 0x2000
	MAP_RESILIENT_MEDIA                     = 0x4000
	MAP_SHARED                              = 0x1
	MAP_TRANSLATED_ALLOW_EXECUTE            = 0x20000
	MAP_UNIX03                              = 0x40000
	MCAST_BLOCK_SOURCE                      = 0x54
	MCAST_EXCLUDE                           = 0x2
	MCAST_INCLUDE                           = 0x1
	MCAST_JOIN_GROUP                        = 0x50
	MCAST_JOIN_SOURCE_GROUP                 = 0x52
	MCAST_LEAVE_GROUP                       = 0x51
	MCAST_LEAVE_SOURCE_GROUP                = 0x53
	MCAST_UNBLOCK_SOURCE                    = 0x55
	MCAST_UNDEFINED                         = 0x0
	MCL_CURRENT                             = 0x1
	MCL_FUTURE                              = 0x2
	MNT_ASYNC                               = 0x40
	MNT_AUTOMOUNTED                         = 0x400000
	MNT_CMDFLAGS                            = 0xf0000
	MNT_CPROTECT                            = 0x80
	MNT_DEFWRITE                            = 0x2000000
	MNT_DONTBROWSE                          = 0x100000
	MNT_DOVOLFS                             = 0x8000
	MNT_DWAIT                               = 0x4
	MNT_EXPORTED                            = 0x100
	MNT_EXT_ROOT_DATA_VOL                   = 0x1
	MNT_FORCE                               = 0x80000
	MNT_IGNORE_OWNERSHIP                    = 0x200000
	MNT_JOURNALED                           = 0x800000
	MNT_LOCAL                               = 0x1000
	MNT_MULTILABEL                          = 0x4000000
	MNT_NOATIME                             = 0x10000000
	MNT_NOBLOCK                             = 0x20000
	MNT_NODEV                               = 0x10
	MNT_NOEXEC                              = 0x4
	MNT_NOSUID                              = 0x8
	MNT_NOUSERXATTR                         = 0x1000000
	MNT_NOWAIT                              = 0x2
	MNT_QUARANTINE                          = 0x400
	MNT_QUOTA                               = 0x2000
	MNT_RDONLY                              = 0x1
	MNT_RELOAD                              = 0x40000
	MNT_REMOVABLE                           = 0x200
	MNT_ROOTFS                              = 0x4000
	MNT_SNAPSHOT                            = 0x40000000
	MNT_STRICTATIME                         = 0x80000000
	MNT_SYNCHRONOUS                         = 0x2
	MNT_UNION                               = 0x20
	MNT_UNKNOWNPERMISSIONS                  = 0x200000
	MNT_UPDATE                              = 0x10000
	MNT_VISFLAGMASK                         = 0xd7f0f7ff
	MNT_WAIT                                = 0x1
	MSG_CTRUNC                              = 0x20
	MSG_DONTROUTE                           = 0x4
	MSG_DONTWAIT                            = 0x80
	MSG_EOF                                 = 0x100
	MSG_EOR                                 = 0x8
	MSG_FLUSH                               = 0x400
	MSG_HAVEMORE                            = 0x2000
	MSG_HOLD                                = 0x800
	MSG_NEEDSA                              = 0x10000
	MSG_NOSIGNAL                            = 0x80000
	MSG_OOB                                 = 0x1
	MSG_PEEK                                = 0x2
	MSG_RCVMORE                             = 0x4000
	MSG_SEND                                = 0x1000
	MSG_TRUNC                               = 0x10
	MSG_WAITALL                             = 0x40
	MSG_WAITSTREAM                          = 0x200
	MS_ASYNC                                = 0x1
	MS_DEACTIVATE                           = 0x8
	MS_INVALIDATE                           = 0x2
	MS_KILLPAGES                            = 0x4
	MS_SYNC                                 = 0x10
	NAME_MAX                                = 0xff
	NET_RT_DUMP                             = 0x1
	NET_RT_DUMP2                            = 0x7
	NET_RT_FLAGS                            = 0x2
	NET_RT_FLAGS_PRIV                       = 0xa
	NET_RT_IFLIST                           = 0x3
	NET_RT_IFLIST2                          = 0x6
	NET_RT_MAXID                            = 0xb
	NET_RT_STAT                             = 0x4
	NET_RT_TRASH                            = 0x5
	NFDBITS                                 = 0x20
	NL0                                     = 0x0
	NL1                                     = 0x100
	NL2                                     = 0x200
	NL3                                     = 0x300
	NLDLY                                   = 0x300
	NOFLSH                                  = 0x80000000
	NOKERNINFO                              = 0x2000000
	NOTE_ABSOLUTE                           = 0x8
	NOTE_ATTRIB                             = 0x8
	NOTE_BACKGROUND                         = 0x40
	NOTE_CHILD                              = 0x4
	NOTE_CRITICAL                           = 0x20
	NOTE_DELETE                             = 0x1
	NOTE_EXEC                               = 0x20000000
	NOTE_EXIT                               = 0x80000000
	NOTE_EXITSTATUS                         = 0x4000000
	NOTE_EXIT_CSERROR                       = 0x40000
	NOTE_EXIT_DECRYPTFAIL                   = 0x10000
	NOTE_EXIT_DETAIL                        = 0x2000000
	NOTE_EXIT_DETAIL_MASK                   = 0x70000
	NOTE_EXIT_MEMORY                        = 0x20000
	NOTE_EXIT_REPARENTED                    = 0x80000
	NOTE_EXTEND                             = 0x4
	NOTE_FFAND                              = 0x40000000
	NOTE_FFCOPY                             = 0xc0000000
	NOTE_FFCTRLMASK                         = 0xc0000000
	NOTE_FFLAGSMASK                         = 0xffffff
	NOTE_FFNOP                              = 0x0
	NOTE_FFOR                               = 0x80000000
	NOTE_FORK                               = 0x40000000
	NOTE_FUNLOCK                            = 0x100
	NOTE_LEEWAY                             = 0x10
	NOTE_LINK                               = 0x10
	NOTE_LOWAT                              = 0x1
	NOTE_MACHTIME                           = 0x100
	NOTE_MACH_CONTINUOUS_TIME               = 0x80
	NOTE_NONE                               = 0x80
	NOTE_NSECONDS                           = 0x4
	NOTE_OOB                                = 0x2
	NOTE_PCTRLMASK                          = -0x100000
	NOTE_PDATAMASK                          = 0xfffff
	NOTE_REAP                               = 0x10000000
	NOTE_RENAME                             = 0x20
	NOTE_REVOKE                             = 0x40
	NOTE_SECONDS                            = 0x1
	NOTE_SIGNAL                             = 0x8000000
	NOTE_TRACK                              = 0x1
	NOTE_TRACKERR                           = 0x2
	NOTE_TRIGGER                            = 0x1000000
	NOTE_USECONDS                           = 0x2
	NOTE_VM_ERROR                           = 0x10000000
	NOTE_VM_PRESSURE                        = 0x80000000
	NOTE_VM_PRESSURE_SUDDEN_TERMINATE       = 0x20000000
	NOTE_VM_PRESSURE_TERMINATE              = 0x40000000
	NOTE_WRITE                              = 0x2
	OCRNL                                   = 0x10
	OFDEL                                   = 0x20000
	OFILL                                   = 0x80
	ONLCR                                   = 0x2
	ONLRET                                  = 0x40
	ONOCR                                   = 0x20
	ONOEOT                                  = 0x8
	OPOST                                   = 0x1
	OXTABS                                  = 0x4
	O_ACCMODE                               = 0x3
	O_ALERT                                 = 0x20000000
	O_APPEND                                = 0x8
	O_ASYNC                                 = 0x40
	O_CLOEXEC                               = 0x1000000
	O_CREAT                                 = 0x200
	O_DIRECTORY                             = 0x100000
	O_DP_GETRAWENCRYPTED                    = 0x1
	O_DP_GETRAWUNENCRYPTED                  = 0x2
	O_DSYNC                                 = 0x400000
	O_EVTONLY                               = 0x8000
	O_EXCL                                  = 0x800
	O_EXLOCK                                = 0x20
	O_FSYNC                                 = 0x80
	O_NDELAY                                = 0x4
	O_NOCTTY                                = 0x20000
	O_NOFOLLOW                              = 0x100
	O_NOFOLLOW_ANY                          = 0x20000000
	O_NONBLOCK                              = 0x4
	O_POPUP                                 = 0x80000000
	O_RDONLY                                = 0x0
	O_RDWR                                  = 0x2
	O_SHLOCK                                = 0x10
	O_SYMLINK                               = 0x200000
	O_SYNC                                  = 0x80
	O_TRUNC                                 = 0x400
	O_WRONLY                                = 0x1
	PARENB                                  = 0x1000
	PARMRK                                  = 0x8
	PARODD                                  = 0x2000
	PENDIN                                  = 0x20000000
	PRIO_PGRP                               = 0x1
	PRIO_PROCESS                            = 0x0
	PRIO_USER                               = 0x2
	PROT_EXEC                               = 0x4
	PROT_NONE                               = 0x0
	PROT_READ                               = 0x1
	PROT_WRITE                              = 0x2
	PT_ATTACH                               = 0xa
	PT_ATTACHEXC                            = 0xe
	PT_CONTINUE                             = 0x7
	PT_DENY_ATTACH                          = 0x1f
	PT_DETACH                               = 0xb
	PT_FIRSTMACH                            = 0x20
	PT_FORCEQUOTA                           = 0x1e
	PT_KILL                                 = 0x8
	PT_READ_D                               = 0x2
	PT_READ_I                               = 0x1
	PT_READ_U                               = 0x3
	PT_SIGEXC                               = 0xc
	PT_STEP                                 = 0x9
	PT_THUPDATE                             = 0xd
	PT_TRACE_ME                             = 0x0
	PT_WRITE_D                              = 0x5
	PT_WRITE_I                              = 0x4
	PT_WRITE_U                              = 0x6
	RLIMIT_AS                               = 0x5
	RLIMIT_CORE                             = 0x4
	RLIMIT_CPU                              = 0x0
	RLIMIT_CPU_USAGE_MONITOR                = 0x2
	RLIMIT_DATA                             = 0x2
	RLIMIT_FSIZE                            = 0x1
	RLIMIT_MEMLOCK                          = 0x6
	RLIMIT_NOFILE                           = 0x8
	RLIMIT_NPROC                            = 0x7
	RLIMIT_RSS                              = 0x5
	RLIMIT_STACK                            = 0x3
	RLIM_INFINITY                           = 0x7fffffffffffffff
	RTAX_AUTHOR                             = 0x6
	RTAX_BRD                                = 0x7
	RTAX_DST                                = 0x0
	RTAX_GATEWAY                            = 0x1
	RTAX_GENMASK                            = 0x3
	RTAX_IFA                                = 0x5
	RTAX_IFP                                = 0x4
	RTAX_MAX                                = 0x8
	RTAX_NETMASK                            = 0x2
	RTA_AUTHOR                              = 0x40
	RTA_BRD                                 = 0x80
	RTA_DST                                 = 0x1
	RTA_GATEWAY                             = 0x2
	RTA_GENMASK                             = 0x8
	RTA_IFA                                 = 0x20
	RTA_IFP                                 = 0x10
	RTA_NETMASK                             = 0x4
	RTF_BLACKHOLE                           = 0x1000
	RTF_BROADCAST                           = 0x400000
	RTF_CLONING                             = 0x100
	RTF_CONDEMNED                           = 0x2000000
	RTF_DEAD                                = 0x20000000
	RTF_DELCLONE                            = 0x80
	RTF_DONE                                = 0x40
	RTF_DYNAMIC                             = 0x10
	RTF_GATEWAY                             = 0x2
	RTF_GLOBAL                              = 0x40000000
	RTF_HOST                                = 0x4
	RTF_IFREF                               = 0x4000000
	RTF_IFSCOPE                             = 0x1000000
	RTF_LLDATA                              = 0x400
	RTF_LLINFO                              = 0x400
	RTF_LOCAL                               = 0x200000
	RTF_MODIFIED                            = 0x20
	RTF_MULTICAST                           = 0x800000
	RTF_NOIFREF                             = 0x2000
	RTF_PINNED                              = 0x100000
	RTF_PRCLONING                           = 0x10000
	RTF_PROTO1                              = 0x8000
	RTF_PROTO2                              = 0x4000
	RTF_PROTO3                              = 0x40000
	RTF_PROXY                               = 0x8000000
	RTF_REJECT                              = 0x8
	RTF_ROUTER                              = 0x10000000
	RTF_STATIC                              = 0x800
	RTF_UP                                  = 0x1
	RTF_WASCLONED                           = 0x20000
	RTF_XRESOLVE                            = 0x200
	RTM_ADD                                 = 0x1
	RTM_CHANGE                              = 0x3
	RTM_DELADDR                             = 0xd
	RTM_DELETE                              = 0x2
	RTM_DELMADDR                            = 0x10
	RTM_GET                                 = 0x4
	RTM_GET2                                = 0x14
	RTM_IFINFO                              = 0xe
	RTM_IFINFO2                             = 0x12
	RTM_LOCK                                = 0x8
	RTM_LOSING                              = 0x5
	RTM_MISS                                = 0x7
	RTM_NEWADDR                             = 0xc
	RTM_NEWMADDR                            = 0xf
	RTM_NEWMADDR2                           = 0x13
	RTM_OLDADD                              = 0x9
	RTM_OLDDEL                              = 0xa
	RTM_REDIRECT                            = 0x6
	RTM_RESOLVE                             = 0xb
	RTM_RTTUNIT                             = 0xf4240
	RTM_VERSION                             = 0x5
	RTV_EXPIRE                              = 0x4
	RTV_HOPCOUNT                            = 0x2
	RTV_MTU                                 = 0x1
	RTV_RPIPE                               = 0x8
	RTV_RTT                                 = 0x40
	RTV_RTTVAR                              = 0x80
	RTV_SPIPE                               = 0x10
	RTV_SSTHRESH                            = 0x20
	RUSAGE_CHILDREN                         = -0x1
	RUSAGE_SELF                             = 0x0
	SCM_CREDS                               = 0x3
	SCM_RIGHTS                              = 0x1
	SCM_TIMESTAMP                           = 0x2
	SCM_TIMESTAMP_MONOTONIC                 = 0x4
	SEEK_CUR                                = 0x1
	SEEK_DATA                               = 0x4
	SEEK_END                                = 0x2
	SEEK_HOLE                               = 0x3
	SEEK_SET                                = 0x0
	SF_APPEND                               = 0x40000
	SF_ARCHIVED                             = 0x10000
	SF_DATALESS                             = 0x40000000
	SF_FIRMLINK                             = 0x800000
	SF_IMMUTABLE                            = 0x20000
	SF_NOUNLINK                             = 0x100000
	SF_RESTRICTED                           = 0x80000
	SF_SETTABLE                             = 0x3fff0000
	SF_SUPPORTED                            = 0x9f0000
	SF_SYNTHETIC                            = 0xc0000000
	SHUT_RD                                 = 0x0
	SHUT_RDWR                               = 0x2
	SHUT_WR                                 = 0x1
	SIOCADDMULTI                            = 0x80206931
	SIOCAIFADDR                             = 0x8040691a
	SIOCARPIPLL                             = 0xc0206928
	SIOCATMARK                              = 0x40047307
	SIOCAUTOADDR                            = 0xc0206926
	SIOCAUTONETMASK                         = 0x80206927
	SIOCDELMULTI                            = 0x80206932
	SIOCDIFADDR                             = 0x80206919
	SIOCDIFPHYADDR                          = 0x80206941
	SIOCGDRVSPEC                            = 0xc028697b
	SIOCGETVLAN                             = 0xc020697f
	SIOCGHIWAT                              = 0x40047301
	SIOCGIF6LOWPAN                          = 0xc02069c5
	SIOCGIFADDR                             = 0xc0206921
	SIOCGIFALTMTU                           = 0xc0206948
	SIOCGIFASYNCMAP                         = 0xc020697c
	SIOCGIFBOND                             = 0xc0206947
	SIOCGIFBRDADDR                          = 0xc0206923
	SIOCGIFCAP                              = 0xc020695b
	SIOCGIFCONF                             = 0xc00c6924
	SIOCGIFDEVMTU                           = 0xc0206944
	SIOCGIFDSTADDR                          = 0xc0206922
	SIOCGIFFLAGS                            = 0xc0206911
	SIOCGIFFUNCTIONALTYPE                   = 0xc02069ad
	SIOCGIFGENERIC                          = 0xc020693a
	SIOCGIFKPI                              = 0xc0206987
	SIOCGIFMAC                              = 0xc0206982
	SIOCGIFMEDIA                            = 0xc02c6938
	SIOCGIFMETRIC                           = 0xc0206917
	SIOCGIFMTU                              = 0xc0206933
	SIOCGIFNETMASK                          = 0xc0206925
	SIOCGIFPDSTADDR                         = 0xc0206940
	SIOCGIFPHYS                             = 0xc0206935
	SIOCGIFPSRCADDR                         = 0xc020693f
	SIOCGIFSTATUS                           = 0xc331693d
	SIOCGIFVLAN                             = 0xc020697f
	SIOCGIFWAKEFLAGS                        = 0xc0206988
	SIOCGIFXMEDIA                           = 0xc02c6948
	SIOCGLOWAT                              = 0x40047303
	SIOCGPGRP                               = 0x40047309
	SIOCIFCREATE                            = 0xc0206978
	SIOCIFCREATE2                           = 0xc020697a
	SIOCIFDESTROY                           = 0x80206979
	SIOCIFGCLONERS                          = 0xc0106981
	SIOCRSLVMULTI                           = 0xc010693b
	SIOCSDRVSPEC                            = 0x8028697b
	SIOCSETVLAN                             = 0x8020697e
	SIOCSHIWAT                              = 0x80047300
	SIOCSIF6LOWPAN                          = 0x802069c4
	SIOCSIFADDR                             = 0x8020690c
	SIOCSIFALTMTU                           = 0x80206945
	SIOCSIFASYNCMAP                         = 0x8020697d
	SIOCSIFBOND                             = 0x80206946
	SIOCSIFBRDADDR                          = 0x80206913
	SIOCSIFCAP                              = 0x8020695a
	SIOCSIFDSTADDR                          = 0x8020690e
	SIOCSIFFLAGS                            = 0x80206910
	SIOCSIFGENERIC                          = 0x80206939
	SIOCSIFKPI                              = 0x80206986
	SIOCSIFLLADDR                           = 0x8020693c
	SIOCSIFMAC                              = 0x80206983
	SIOCSIFMEDIA                            = 0xc0206937
	SIOCSIFMETRIC                           = 0x80206918
	SIOCSIFMTU                              = 0x80206934
	SIOCSIFNETMASK                          = 0x80206916
	SIOCSIFPHYADDR                          = 0x8040693e
	SIOCSIFPHYS                             = 0x80206936
	SIOCSIFVLAN                             = 0x8020697e
	SIOCSLOWAT                              = 0x80047302
	SIOCSPGRP                               = 0x80047308
	SOCK_DGRAM                              = 0x2
	SOCK_MAXADDRLEN                         = 0xff
	SOCK_RAW                                = 0x3
	SOCK_RDM                                = 0x4
	SOCK_SEQPACKET                          = 0x5
	SOCK_STREAM                             = 0x1
	SOL_LOCAL                               = 0x0
	SOL_SOCKET                              = 0xffff
	SOMAXCONN                               = 0x80
	SO_ACCEPTCONN                           = 0x2
	SO_BROADCAST                            = 0x20
	SO_DEBUG                                = 0x1
	SO_DONTROUTE                            = 0x10
	SO_DONTTRUNC                            = 0x2000
	SO_ERROR                                = 0x1007
	SO_KEEPALIVE                            = 0x8
	SO_LABEL                                = 0x1010
	SO_LINGER                               = 0x80
	SO_LINGER_SEC                           = 0x1080
	SO_NETSVC_MARKING_LEVEL                 = 0x1119
	SO_NET_SERVICE_TYPE                     = 0x1116
	SO_NKE                                  = 0x1021
	SO_NOADDRERR                            = 0x1023
	SO_NOSIGPIPE                            = 0x1022
	SO_NOTIFYCONFLICT                       = 0x1026
	SO_NP_EXTENSIONS                        = 0x1083
	SO_NREAD                                = 0x1020
	SO_NUMRCVPKT                            = 0x1112
	SO_NWRITE                               = 0x1024
	SO_OOBINLINE                            = 0x100
	SO_PEERLABEL                            = 0x1011
	SO_RANDOMPORT                           = 0x1082
	SO_RCVBUF                               = 0x1002
	SO_RCVLOWAT                             = 0x1004
	SO_RCVTIMEO                             = 0x1006
	SO_REUSEADDR                            = 0x4
	SO_REUSEPORT                            = 0x200
	SO_REUSESHAREUID                        = 0x1025
	SO_SNDBUF                               = 0x1001
	SO_SNDLOWAT                             = 0x1003
	SO_SNDTIMEO                             = 0x1005
	SO_TIMESTAMP                            = 0x400
	SO_TIMESTAMP_MONOTONIC                  = 0x800
	SO_TRACKER_ATTRIBUTE_FLAGS_APP_APPROVED = 0x1
	SO_TRACKER_ATTRIBUTE_FLAGS_DOMAIN_SHORT = 0x4
	SO_TRACKER_ATTRIBUTE_FLAGS_TRACKER      = 0x2
	SO_TRACKER_TRANSPARENCY_VERSION         = 0x3
	SO_TYPE                                 = 0x1008
	SO_UPCALLCLOSEWAIT                      = 0x1027
	SO_USELOOPBACK                          = 0x40
	SO_WANTMORE                             = 0x4000
	SO_WANTOOBFLAG                          = 0x8000
	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
	TAB0                                    = 0x0
	TAB1                                    = 0x400
	TAB2                                    = 0x800
	TAB3                                    = 0x4
	TABDLY                                  = 0xc04
	TCIFLUSH                                = 0x1
	TCIOFF                                  = 0x3
	TCIOFLUSH                               = 0x3
	TCION                                   = 0x4
	TCOFLUSH                                = 0x2
	TCOOFF                                  = 0x1
	TCOON                                   = 0x2
	TCPOPT_CC                               = 0xb
	TCPOPT_CCECHO                           = 0xd
	TCPOPT_CCNEW                            = 0xc
	TCPOPT_EOL                              = 0x0
	TCPOPT_FASTOPEN                         = 0x22
	TCPOPT_MAXSEG                           = 0x2
	TCPOPT_NOP                              = 0x1
	TCPOPT_SACK                             = 0x5
	TCPOPT_SACK_HDR                         = 0x1010500
	TCPOPT_SACK_PERMITTED                   = 0x4
	TCPOPT_SACK_PERMIT_HDR                  = 0x1010402
	TCPOPT_SIGNATURE                        = 0x13
	TCPOPT_TIMESTAMP                        = 0x8
	TCPOPT_TSTAMP_HDR                       = 0x101080a
	TCPOPT_WINDOW                           = 0x3
	TCP_CONNECTIONTIMEOUT                   = 0x20
	TCP_CONNECTION_INFO                     = 0x106
	TCP_ENABLE_ECN                          = 0x104
	TCP_FASTOPEN                            = 0x105
	TCP_KEEPALIVE                           = 0x10
	TCP_KEEPCNT                             = 0x102
	TCP_KEEPINTVL                           = 0x101
	TCP_MAXHLEN                             = 0x3c
	TCP_MAXOLEN                             = 0x28
	TCP_MAXSEG                              = 0x2
	TCP_MAXWIN                              = 0xffff
	TCP_MAX_SACK                            = 0x4
	TCP_MAX_WINSHIFT                        = 0xe
	TCP_MINMSS                              = 0xd8
	TCP_MSS                                 = 0x200
	TCP_NODELAY                             = 0x1
	TCP_NOOPT                               = 0x8
	TCP_NOPUSH                              = 0x4
	TCP_NOTSENT_LOWAT                       = 0x201
	TCP_RXT_CONNDROPTIME                    = 0x80
	TCP_RXT_FINDROP                         = 0x100
	TCP_SENDMOREACKS                        = 0x103
	TCSAFLUSH                               = 0x2
	TIOCCBRK                                = 0x2000747a
	TIOCCDTR                                = 0x20007478
	TIOCCONS                                = 0x80047462
	TIOCDCDTIMESTAMP                        = 0x40107458
	TIOCDRAIN                               = 0x2000745e
	TIOCDSIMICROCODE                        = 0x20007455
	TIOCEXCL                                = 0x2000740d
	TIOCEXT                                 = 0x80047460
	TIOCFLUSH                               = 0x80047410
	TIOCGDRAINWAIT                          = 0x40047456
	TIOCGETA                                = 0x40487413
	TIOCGETD                                = 0x4004741a
	TIOCGPGRP                               = 0x40047477
	TIOCGWINSZ                              = 0x40087468
	TIOCIXOFF                               = 0x20007480
	TIOCIXON                                = 0x20007481
	TIOCMBIC                                = 0x8004746b
	TIOCMBIS                                = 0x8004746c
	TIOCMGDTRWAIT                           = 0x4004745a
	TIOCMGET                                = 0x4004746a
	TIOCMODG                                = 0x40047403
	TIOCMODS                                = 0x80047404
	TIOCMSDTRWAIT                           = 0x8004745b
	TIOCMSET                                = 0x8004746d
	TIOCM_CAR                               = 0x40
	TIOCM_CD                                = 0x40
	TIOCM_CTS                               = 0x20
	TIOCM_DSR                               = 0x100
	TIOCM_DTR                               = 0x2
	TIOCM_LE                                = 0x1
	TIOCM_RI                                = 0x80
	TIOCM_RNG                               = 0x80
	TIOCM_RTS                               = 0x4
	TIOCM_SR                                = 0x10
	TIOCM_ST                                = 0x8
	TIOCNOTTY                               = 0x20007471
	TIOCNXCL                                = 0x2000740e
	TIOCOUTQ                                = 0x40047473
	TIOCPKT                                 = 0x80047470
	TIOCPKT_DATA                            = 0x0
	TIOCPKT_DOSTOP                          = 0x20
	TIOCPKT_FLUSHREAD                       = 0x1
	TIOCPKT_FLUSHWRITE                      = 0x2
	TIOCPKT_IOCTL                           = 0x40
	TIOCPKT_NOSTOP                          = 0x10
	TIOCPKT_START                           = 0x8
	TIOCPKT_STOP                            = 0x4
	TIOCPTYGNAME                            = 0x40807453
	TIOCPTYGRANT                            = 0x20007454
	TIOCPTYUNLK                             = 0x20007452
	TIOCREMOTE                              = 0x80047469
	TIOCSBRK                                = 0x2000747b
	TIOCSCONS                               = 0x20007463
	TIOCSCTTY                               = 0x20007461
	TIOCSDRAINWAIT                          = 0x80047457
	TIOCSDTR                                = 0x20007479
	TIOCSETA                                = 0x80487414
	TIOCSETAF                               = 0x80487416
	TIOCSETAW                               = 0x80487415
	TIOCSETD                                = 0x8004741b
	TIOCSIG                                 = 0x2000745f
	TIOCSPGRP                               = 0x80047476
	TIOCSTART                               = 0x2000746e
	TIOCSTAT                                = 0x20007465
	TIOCSTI                                 = 0x80017472
	TIOCSTOP                                = 0x2000746f
	TIOCSWINSZ                              = 0x80087467
	TIOCTIMESTAMP                           = 0x40107459
	TIOCUCNTL                               = 0x80047466
	TOSTOP                                  = 0x400000
	UF_APPEND                               = 0x4
	UF_COMPRESSED                           = 0x20
	UF_DATAVAULT                            = 0x80
	UF_HIDDEN                               = 0x8000
	UF_IMMUTABLE                            = 0x2
	UF_NODUMP                               = 0x1
	UF_OPAQUE                               = 0x8
	UF_SETTABLE                             = 0xffff
	UF_TRACKED                              = 0x40
	VDISCARD                                = 0xf
	VDSUSP                                  = 0xb
	VEOF                                    = 0x0
	VEOL                                    = 0x1
	VEOL2                                   = 0x2
	VERASE                                  = 0x3
	VINTR                                   = 0x8
	VKILL                                   = 0x5
	VLNEXT                                  = 0xe
	VMADDR_CID_ANY                          = 0xffffffff
	VMADDR_CID_HOST                         = 0x2
	VMADDR_CID_HYPERVISOR                   = 0x0
	VMADDR_CID_RESERVED                     = 0x1
	VMADDR_PORT_ANY                         = 0xffffffff
	VMIN                                    = 0x10
	VM_LOADAVG                              = 0x2
	VM_MACHFACTOR                           = 0x4
	VM_MAXID                                = 0x6
	VM_METER                                = 0x1
	VM_SWAPUSAGE                            = 0x5
	VQUIT                                   = 0x9
	VREPRINT                                = 0x6
	VSTART                                  = 0xc
	VSTATUS                                 = 0x12
	VSTOP                                   = 0xd
	VSUSP                                   = 0xa
	VT0                                     = 0x0
	VT1                                     = 0x10000
	VTDLY                                   = 0x10000
	VTIME                                   = 0x11
	VWERASE                                 = 0x4
	WCONTINUED                              = 0x10
	WCOREFLAG                               = 0x80
	WEXITED                                 = 0x4
	WNOHANG                                 = 0x1
	WNOWAIT                                 = 0x20
	WORDSIZE                                = 0x40
	WSTOPPED                                = 0x8
	WUNTRACED                               = 0x2
	XATTR_CREATE                            = 0x2
	XATTR_NODEFAULT                         = 0x10
	XATTR_NOFOLLOW                          = 0x1
	XATTR_NOSECURITY                        = 0x8
	XATTR_REPLACE                           = 0x4
	XATTR_SHOWCOMPRESSION                   = 0x20
)
View Source
const (
	E2BIG           = syscall.Errno(0x7)
	EACCES          = syscall.Errno(0xd)
	EADDRINUSE      = syscall.Errno(0x30)
	EADDRNOTAVAIL   = syscall.Errno(0x31)
	EAFNOSUPPORT    = syscall.Errno(0x2f)
	EAGAIN          = syscall.Errno(0x23)
	EALREADY        = syscall.Errno(0x25)
	EAUTH           = syscall.Errno(0x50)
	EBADARCH        = syscall.Errno(0x56)
	EBADEXEC        = syscall.Errno(0x55)
	EBADF           = syscall.Errno(0x9)
	EBADMACHO       = syscall.Errno(0x58)
	EBADMSG         = syscall.Errno(0x5e)
	EBADRPC         = syscall.Errno(0x48)
	EBUSY           = syscall.Errno(0x10)
	ECANCELED       = syscall.Errno(0x59)
	ECHILD          = syscall.Errno(0xa)
	ECONNABORTED    = syscall.Errno(0x35)
	ECONNREFUSED    = syscall.Errno(0x3d)
	ECONNRESET      = syscall.Errno(0x36)
	EDEADLK         = syscall.Errno(0xb)
	EDESTADDRREQ    = syscall.Errno(0x27)
	EDEVERR         = syscall.Errno(0x53)
	EDOM            = syscall.Errno(0x21)
	EDQUOT          = syscall.Errno(0x45)
	EEXIST          = syscall.Errno(0x11)
	EFAULT          = syscall.Errno(0xe)
	EFBIG           = syscall.Errno(0x1b)
	EFTYPE          = syscall.Errno(0x4f)
	EHOSTDOWN       = syscall.Errno(0x40)
	EHOSTUNREACH    = syscall.Errno(0x41)
	EIDRM           = syscall.Errno(0x5a)
	EILSEQ          = syscall.Errno(0x5c)
	EINPROGRESS     = syscall.Errno(0x24)
	EINTR           = syscall.Errno(0x4)
	EINVAL          = syscall.Errno(0x16)
	EIO             = syscall.Errno(0x5)
	EISCONN         = syscall.Errno(0x38)
	EISDIR          = syscall.Errno(0x15)
	ELAST           = syscall.Errno(0x6a)
	ELOOP           = syscall.Errno(0x3e)
	EMFILE          = syscall.Errno(0x18)
	EMLINK          = syscall.Errno(0x1f)
	EMSGSIZE        = syscall.Errno(0x28)
	EMULTIHOP       = syscall.Errno(0x5f)
	ENAMETOOLONG    = syscall.Errno(0x3f)
	ENEEDAUTH       = syscall.Errno(0x51)
	ENETDOWN        = syscall.Errno(0x32)
	ENETRESET       = syscall.Errno(0x34)
	ENETUNREACH     = syscall.Errno(0x33)
	ENFILE          = syscall.Errno(0x17)
	ENOATTR         = syscall.Errno(0x5d)
	ENOBUFS         = syscall.Errno(0x37)
	ENODATA         = syscall.Errno(0x60)
	ENODEV          = syscall.Errno(0x13)
	ENOENT          = syscall.Errno(0x2)
	ENOEXEC         = syscall.Errno(0x8)
	ENOLCK          = syscall.Errno(0x4d)
	ENOLINK         = syscall.Errno(0x61)
	ENOMEM          = syscall.Errno(0xc)
	ENOMSG          = syscall.Errno(0x5b)
	ENOPOLICY       = syscall.Errno(0x67)
	ENOPROTOOPT     = syscall.Errno(0x2a)
	ENOSPC          = syscall.Errno(0x1c)
	ENOSR           = syscall.Errno(0x62)
	ENOSTR          = syscall.Errno(0x63)
	ENOSYS          = syscall.Errno(0x4e)
	ENOTBLK         = syscall.Errno(0xf)
	ENOTCONN        = syscall.Errno(0x39)
	ENOTDIR         = syscall.Errno(0x14)
	ENOTEMPTY       = syscall.Errno(0x42)
	ENOTRECOVERABLE = syscall.Errno(0x68)
	ENOTSOCK        = syscall.Errno(0x26)
	ENOTSUP         = syscall.Errno(0x2d)
	ENOTTY          = syscall.Errno(0x19)
	ENXIO           = syscall.Errno(0x6)
	EOPNOTSUPP      = syscall.Errno(0x66)
	EOVERFLOW       = syscall.Errno(0x54)
	EOWNERDEAD      = syscall.Errno(0x69)
	EPERM           = syscall.Errno(0x1)
	EPFNOSUPPORT    = syscall.Errno(0x2e)
	EPIPE           = syscall.Errno(0x20)
	EPROCLIM        = syscall.Errno(0x43)
	EPROCUNAVAIL    = syscall.Errno(0x4c)
	EPROGMISMATCH   = syscall.Errno(0x4b)
	EPROGUNAVAIL    = syscall.Errno(0x4a)
	EPROTO          = syscall.Errno(0x64)
	EPROTONOSUPPORT = syscall.Errno(0x2b)
	EPROTOTYPE      = syscall.Errno(0x29)
	EPWROFF         = syscall.Errno(0x52)
	EQFULL          = syscall.Errno(0x6a)
	ERANGE          = syscall.Errno(0x22)
	EREMOTE         = syscall.Errno(0x47)
	EROFS           = syscall.Errno(0x1e)
	ERPCMISMATCH    = syscall.Errno(0x49)
	ESHLIBVERS      = syscall.Errno(0x57)
	ESHUTDOWN       = syscall.Errno(0x3a)
	ESOCKTNOSUPPORT = syscall.Errno(0x2c)
	ESPIPE          = syscall.Errno(0x1d)
	ESRCH           = syscall.Errno(0x3)
	ESTALE          = syscall.Errno(0x46)
	ETIME           = syscall.Errno(0x65)
	ETIMEDOUT       = syscall.Errno(0x3c)
	ETOOMANYREFS    = syscall.Errno(0x3b)
	ETXTBSY         = syscall.Errno(0x1a)
	EUSERS          = syscall.Errno(0x44)
	EWOULDBLOCK     = syscall.Errno(0x23)
	EXDEV           = syscall.Errno(0x12)
)

Errors

View Source
const (
	SIGABRT   = syscall.Signal(0x6)
	SIGALRM   = syscall.Signal(0xe)
	SIGBUS    = syscall.Signal(0xa)
	SIGCHLD   = syscall.Signal(0x14)
	SIGCONT   = syscall.Signal(0x13)
	SIGEMT    = syscall.Signal(0x7)
	SIGFPE    = syscall.Signal(0x8)
	SIGHUP    = syscall.Signal(0x1)
	SIGILL    = syscall.Signal(0x4)
	SIGINFO   = syscall.Signal(0x1d)
	SIGINT    = syscall.Signal(0x2)
	SIGIO     = syscall.Signal(0x17)
	SIGIOT    = syscall.Signal(0x6)
	SIGKILL   = syscall.Signal(0x9)
	SIGPIPE   = syscall.Signal(0xd)
	SIGPROF   = syscall.Signal(0x1b)
	SIGQUIT   = syscall.Signal(0x3)
	SIGSEGV   = syscall.Signal(0xb)
	SIGSTOP   = syscall.Signal(0x11)
	SIGSYS    = syscall.Signal(0xc)
	SIGTERM   = syscall.Signal(0xf)
	SIGTRAP   = syscall.Signal(0x5)
	SIGTSTP   = syscall.Signal(0x12)
	SIGTTIN   = syscall.Signal(0x15)
	SIGTTOU   = syscall.Signal(0x16)
	SIGURG    = syscall.Signal(0x10)
	SIGUSR1   = syscall.Signal(0x1e)
	SIGUSR2   = syscall.Signal(0x1f)
	SIGVTALRM = syscall.Signal(0x1a)
	SIGWINCH  = syscall.Signal(0x1c)
	SIGXCPU   = syscall.Signal(0x18)
	SIGXFSZ   = syscall.Signal(0x19)
)

Signals

View Source
const (
	SYS_SYSCALL                        = 0
	SYS_EXIT                           = 1
	SYS_FORK                           = 2
	SYS_READ                           = 3
	SYS_WRITE                          = 4
	SYS_OPEN                           = 5
	SYS_CLOSE                          = 6
	SYS_WAIT4                          = 7
	SYS_LINK                           = 9
	SYS_UNLINK                         = 10
	SYS_CHDIR                          = 12
	SYS_FCHDIR                         = 13
	SYS_MKNOD                          = 14
	SYS_CHMOD                          = 15
	SYS_CHOWN                          = 16
	SYS_GETFSSTAT                      = 18
	SYS_GETPID                         = 20
	SYS_SETUID                         = 23
	SYS_GETUID                         = 24
	SYS_GETEUID                        = 25
	SYS_PTRACE                         = 26
	SYS_RECVMSG                        = 27
	SYS_SENDMSG                        = 28
	SYS_RECVFROM                       = 29
	SYS_ACCEPT                         = 30
	SYS_GETPEERNAME                    = 31
	SYS_GETSOCKNAME                    = 32
	SYS_ACCESS                         = 33
	SYS_CHFLAGS                        = 34
	SYS_FCHFLAGS                       = 35
	SYS_SYNC                           = 36
	SYS_KILL                           = 37
	SYS_GETPPID                        = 39
	SYS_DUP                            = 41
	SYS_PIPE                           = 42
	SYS_GETEGID                        = 43
	SYS_SIGACTION                      = 46
	SYS_GETGID                         = 47
	SYS_SIGPROCMASK                    = 48
	SYS_GETLOGIN                       = 49
	SYS_SETLOGIN                       = 50
	SYS_ACCT                           = 51
	SYS_SIGPENDING                     = 52
	SYS_SIGALTSTACK                    = 53
	SYS_IOCTL                          = 54
	SYS_REBOOT                         = 55
	SYS_REVOKE                         = 56
	SYS_SYMLINK                        = 57
	SYS_READLINK                       = 58
	SYS_EXECVE                         = 59
	SYS_UMASK                          = 60
	SYS_CHROOT                         = 61
	SYS_MSYNC                          = 65
	SYS_VFORK                          = 66
	SYS_MUNMAP                         = 73
	SYS_MPROTECT                       = 74
	SYS_MADVISE                        = 75
	SYS_MINCORE                        = 78
	SYS_GETGROUPS                      = 79
	SYS_SETGROUPS                      = 80
	SYS_GETPGRP                        = 81
	SYS_SETPGID                        = 82
	SYS_SETITIMER                      = 83
	SYS_SWAPON                         = 85
	SYS_GETITIMER                      = 86
	SYS_GETDTABLESIZE                  = 89
	SYS_DUP2                           = 90
	SYS_FCNTL                          = 92
	SYS_SELECT                         = 93
	SYS_FSYNC                          = 95
	SYS_SETPRIORITY                    = 96
	SYS_SOCKET                         = 97
	SYS_CONNECT                        = 98
	SYS_GETPRIORITY                    = 100
	SYS_BIND                           = 104
	SYS_SETSOCKOPT                     = 105
	SYS_LISTEN                         = 106
	SYS_SIGSUSPEND                     = 111
	SYS_GETTIMEOFDAY                   = 116
	SYS_GETRUSAGE                      = 117
	SYS_GETSOCKOPT                     = 118
	SYS_READV                          = 120
	SYS_WRITEV                         = 121
	SYS_SETTIMEOFDAY                   = 122
	SYS_FCHOWN                         = 123
	SYS_FCHMOD                         = 124
	SYS_SETREUID                       = 126
	SYS_SETREGID                       = 127
	SYS_RENAME                         = 128
	SYS_FLOCK                          = 131
	SYS_MKFIFO                         = 132
	SYS_SENDTO                         = 133
	SYS_SHUTDOWN                       = 134
	SYS_SOCKETPAIR                     = 135
	SYS_MKDIR                          = 136
	SYS_RMDIR                          = 137
	SYS_UTIMES                         = 138
	SYS_FUTIMES                        = 139
	SYS_ADJTIME                        = 140
	SYS_GETHOSTUUID                    = 142
	SYS_SETSID                         = 147
	SYS_GETPGID                        = 151
	SYS_SETPRIVEXEC                    = 152
	SYS_PREAD                          = 153
	SYS_PWRITE                         = 154
	SYS_NFSSVC                         = 155
	SYS_STATFS                         = 157
	SYS_FSTATFS                        = 158
	SYS_UNMOUNT                        = 159
	SYS_GETFH                          = 161
	SYS_QUOTACTL                       = 165
	SYS_MOUNT                          = 167
	SYS_CSOPS                          = 169
	SYS_CSOPS_AUDITTOKEN               = 170
	SYS_WAITID                         = 173
	SYS_KDEBUG_TYPEFILTER              = 177
	SYS_KDEBUG_TRACE_STRING            = 178
	SYS_KDEBUG_TRACE64                 = 179
	SYS_KDEBUG_TRACE                   = 180
	SYS_SETGID                         = 181
	SYS_SETEGID                        = 182
	SYS_SETEUID                        = 183
	SYS_SIGRETURN                      = 184
	SYS_THREAD_SELFCOUNTS              = 186
	SYS_FDATASYNC                      = 187
	SYS_STAT                           = 188
	SYS_FSTAT                          = 189
	SYS_LSTAT                          = 190
	SYS_PATHCONF                       = 191
	SYS_FPATHCONF                      = 192
	SYS_GETRLIMIT                      = 194
	SYS_SETRLIMIT                      = 195
	SYS_GETDIRENTRIES                  = 196
	SYS_MMAP                           = 197
	SYS_LSEEK                          = 199
	SYS_TRUNCATE                       = 200
	SYS_FTRUNCATE                      = 201
	SYS_SYSCTL                         = 202
	SYS_MLOCK                          = 203
	SYS_MUNLOCK                        = 204
	SYS_UNDELETE                       = 205
	SYS_OPEN_DPROTECTED_NP             = 216
	SYS_GETATTRLIST                    = 220
	SYS_SETATTRLIST                    = 221
	SYS_GETDIRENTRIESATTR              = 222
	SYS_EXCHANGEDATA                   = 223
	SYS_SEARCHFS                       = 225
	SYS_DELETE                         = 226
	SYS_COPYFILE                       = 227
	SYS_FGETATTRLIST                   = 228
	SYS_FSETATTRLIST                   = 229
	SYS_POLL                           = 230
	SYS_WATCHEVENT                     = 231
	SYS_WAITEVENT                      = 232
	SYS_MODWATCH                       = 233
	SYS_GETXATTR                       = 234
	SYS_FGETXATTR                      = 235
	SYS_SETXATTR                       = 236
	SYS_FSETXATTR                      = 237
	SYS_REMOVEXATTR                    = 238
	SYS_FREMOVEXATTR                   = 239
	SYS_LISTXATTR                      = 240
	SYS_FLISTXATTR                     = 241
	SYS_FSCTL                          = 242
	SYS_INITGROUPS                     = 243
	SYS_POSIX_SPAWN                    = 244
	SYS_FFSCTL                         = 245
	SYS_NFSCLNT                        = 247
	SYS_FHOPEN                         = 248
	SYS_MINHERIT                       = 250
	SYS_SEMSYS                         = 251
	SYS_MSGSYS                         = 252
	SYS_SHMSYS                         = 253
	SYS_SEMCTL                         = 254
	SYS_SEMGET                         = 255
	SYS_SEMOP                          = 256
	SYS_MSGCTL                         = 258
	SYS_MSGGET                         = 259
	SYS_MSGSND                         = 260
	SYS_MSGRCV                         = 261
	SYS_SHMAT                          = 262
	SYS_SHMCTL                         = 263
	SYS_SHMDT                          = 264
	SYS_SHMGET                         = 265
	SYS_SHM_OPEN                       = 266
	SYS_SHM_UNLINK                     = 267
	SYS_SEM_OPEN                       = 268
	SYS_SEM_CLOSE                      = 269
	SYS_SEM_UNLINK                     = 270
	SYS_SEM_WAIT                       = 271
	SYS_SEM_TRYWAIT                    = 272
	SYS_SEM_POST                       = 273
	SYS_SYSCTLBYNAME                   = 274
	SYS_OPEN_EXTENDED                  = 277
	SYS_UMASK_EXTENDED                 = 278
	SYS_STAT_EXTENDED                  = 279
	SYS_LSTAT_EXTENDED                 = 280
	SYS_FSTAT_EXTENDED                 = 281
	SYS_CHMOD_EXTENDED                 = 282
	SYS_FCHMOD_EXTENDED                = 283
	SYS_ACCESS_EXTENDED                = 284
	SYS_SETTID                         = 285
	SYS_GETTID                         = 286
	SYS_SETSGROUPS                     = 287
	SYS_GETSGROUPS                     = 288
	SYS_SETWGROUPS                     = 289
	SYS_GETWGROUPS                     = 290
	SYS_MKFIFO_EXTENDED                = 291
	SYS_MKDIR_EXTENDED                 = 292
	SYS_IDENTITYSVC                    = 293
	SYS_SHARED_REGION_CHECK_NP         = 294
	SYS_VM_PRESSURE_MONITOR            = 296
	SYS_PSYNCH_RW_LONGRDLOCK           = 297
	SYS_PSYNCH_RW_YIELDWRLOCK          = 298
	SYS_PSYNCH_RW_DOWNGRADE            = 299
	SYS_PSYNCH_RW_UPGRADE              = 300
	SYS_PSYNCH_MUTEXWAIT               = 301
	SYS_PSYNCH_MUTEXDROP               = 302
	SYS_PSYNCH_CVBROAD                 = 303
	SYS_PSYNCH_CVSIGNAL                = 304
	SYS_PSYNCH_CVWAIT                  = 305
	SYS_PSYNCH_RW_RDLOCK               = 306
	SYS_PSYNCH_RW_WRLOCK               = 307
	SYS_PSYNCH_RW_UNLOCK               = 308
	SYS_PSYNCH_RW_UNLOCK2              = 309
	SYS_GETSID                         = 310
	SYS_SETTID_WITH_PID                = 311
	SYS_PSYNCH_CVCLRPREPOST            = 312
	SYS_AIO_FSYNC                      = 313
	SYS_AIO_RETURN                     = 314
	SYS_AIO_SUSPEND                    = 315
	SYS_AIO_CANCEL                     = 316
	SYS_AIO_ERROR                      = 317
	SYS_AIO_READ                       = 318
	SYS_AIO_WRITE                      = 319
	SYS_LIO_LISTIO                     = 320
	SYS_IOPOLICYSYS                    = 322
	SYS_PROCESS_POLICY                 = 323
	SYS_MLOCKALL                       = 324
	SYS_MUNLOCKALL                     = 325
	SYS_ISSETUGID                      = 327
	SYS___PTHREAD_KILL                 = 328
	SYS___PTHREAD_SIGMASK              = 329
	SYS___SIGWAIT                      = 330
	SYS___DISABLE_THREADSIGNAL         = 331
	SYS___PTHREAD_MARKCANCEL           = 332
	SYS___PTHREAD_CANCELED             = 333
	SYS___SEMWAIT_SIGNAL               = 334
	SYS_PROC_INFO                      = 336
	SYS_SENDFILE                       = 337
	SYS_STAT64                         = 338
	SYS_FSTAT64                        = 339
	SYS_LSTAT64                        = 340
	SYS_STAT64_EXTENDED                = 341
	SYS_LSTAT64_EXTENDED               = 342
	SYS_FSTAT64_EXTENDED               = 343
	SYS_GETDIRENTRIES64                = 344
	SYS_STATFS64                       = 345
	SYS_FSTATFS64                      = 346
	SYS_GETFSSTAT64                    = 347
	SYS___PTHREAD_CHDIR                = 348
	SYS___PTHREAD_FCHDIR               = 349
	SYS_AUDIT                          = 350
	SYS_AUDITON                        = 351
	SYS_GETAUID                        = 353
	SYS_SETAUID                        = 354
	SYS_GETAUDIT_ADDR                  = 357
	SYS_SETAUDIT_ADDR                  = 358
	SYS_AUDITCTL                       = 359
	SYS_BSDTHREAD_CREATE               = 360
	SYS_BSDTHREAD_TERMINATE            = 361
	SYS_KQUEUE                         = 362
	SYS_KEVENT                         = 363
	SYS_LCHOWN                         = 364
	SYS_BSDTHREAD_REGISTER             = 366
	SYS_WORKQ_OPEN                     = 367
	SYS_WORKQ_KERNRETURN               = 368
	SYS_KEVENT64                       = 369
	SYS___OLD_SEMWAIT_SIGNAL           = 370
	SYS___OLD_SEMWAIT_SIGNAL_NOCANCEL  = 371
	SYS_THREAD_SELFID                  = 372
	SYS_LEDGER                         = 373
	SYS_KEVENT_QOS                     = 374
	SYS_KEVENT_ID                      = 375
	SYS___MAC_EXECVE                   = 380
	SYS___MAC_SYSCALL                  = 381
	SYS___MAC_GET_FILE                 = 382
	SYS___MAC_SET_FILE                 = 383
	SYS___MAC_GET_LINK                 = 384
	SYS___MAC_SET_LINK                 = 385
	SYS___MAC_GET_PROC                 = 386
	SYS___MAC_SET_PROC                 = 387
	SYS___MAC_GET_FD                   = 388
	SYS___MAC_SET_FD                   = 389
	SYS___MAC_GET_PID                  = 390
	SYS_PSELECT                        = 394
	SYS_PSELECT_NOCANCEL               = 395
	SYS_READ_NOCANCEL                  = 396
	SYS_WRITE_NOCANCEL                 = 397
	SYS_OPEN_NOCANCEL                  = 398
	SYS_CLOSE_NOCANCEL                 = 399
	SYS_WAIT4_NOCANCEL                 = 400
	SYS_RECVMSG_NOCANCEL               = 401
	SYS_SENDMSG_NOCANCEL               = 402
	SYS_RECVFROM_NOCANCEL              = 403
	SYS_ACCEPT_NOCANCEL                = 404
	SYS_MSYNC_NOCANCEL                 = 405
	SYS_FCNTL_NOCANCEL                 = 406
	SYS_SELECT_NOCANCEL                = 407
	SYS_FSYNC_NOCANCEL                 = 408
	SYS_CONNECT_NOCANCEL               = 409
	SYS_SIGSUSPEND_NOCANCEL            = 410
	SYS_READV_NOCANCEL                 = 411
	SYS_WRITEV_NOCANCEL                = 412
	SYS_SENDTO_NOCANCEL                = 413
	SYS_PREAD_NOCANCEL                 = 414
	SYS_PWRITE_NOCANCEL                = 415
	SYS_WAITID_NOCANCEL                = 416
	SYS_POLL_NOCANCEL                  = 417
	SYS_MSGSND_NOCANCEL                = 418
	SYS_MSGRCV_NOCANCEL                = 419
	SYS_SEM_WAIT_NOCANCEL              = 420
	SYS_AIO_SUSPEND_NOCANCEL           = 421
	SYS___SIGWAIT_NOCANCEL             = 422
	SYS___SEMWAIT_SIGNAL_NOCANCEL      = 423
	SYS___MAC_MOUNT                    = 424
	SYS___MAC_GET_MOUNT                = 425
	SYS___MAC_GETFSSTAT                = 426
	SYS_FSGETPATH                      = 427
	SYS_AUDIT_SESSION_SELF             = 428
	SYS_AUDIT_SESSION_JOIN             = 429
	SYS_FILEPORT_MAKEPORT              = 430
	SYS_FILEPORT_MAKEFD                = 431
	SYS_AUDIT_SESSION_PORT             = 432
	SYS_PID_SUSPEND                    = 433
	SYS_PID_RESUME                     = 434
	SYS_PID_HIBERNATE                  = 435
	SYS_PID_SHUTDOWN_SOCKETS           = 436
	SYS_SHARED_REGION_MAP_AND_SLIDE_NP = 438
	SYS_KAS_INFO                       = 439
	SYS_MEMORYSTATUS_CONTROL           = 440
	SYS_GUARDED_OPEN_NP                = 441
	SYS_GUARDED_CLOSE_NP               = 442
	SYS_GUARDED_KQUEUE_NP              = 443
	SYS_CHANGE_FDGUARD_NP              = 444
	SYS_USRCTL                         = 445
	SYS_PROC_RLIMIT_CONTROL            = 446
	SYS_CONNECTX                       = 447
	SYS_DISCONNECTX                    = 448
	SYS_PEELOFF                        = 449
	SYS_SOCKET_DELEGATE                = 450
	SYS_TELEMETRY                      = 451
	SYS_PROC_UUID_POLICY               = 452
	SYS_MEMORYSTATUS_GET_LEVEL         = 453
	SYS_SYSTEM_OVERRIDE                = 454
	SYS_VFS_PURGE                      = 455
	SYS_SFI_CTL                        = 456
	SYS_SFI_PIDCTL                     = 457
	SYS_COALITION                      = 458
	SYS_COALITION_INFO                 = 459
	SYS_NECP_MATCH_POLICY              = 460
	SYS_GETATTRLISTBULK                = 461
	SYS_CLONEFILEAT                    = 462
	SYS_OPENAT                         = 463
	SYS_OPENAT_NOCANCEL                = 464
	SYS_RENAMEAT                       = 465
	SYS_FACCESSAT                      = 466
	SYS_FCHMODAT                       = 467
	SYS_FCHOWNAT                       = 468
	SYS_FSTATAT                        = 469
	SYS_FSTATAT64                      = 470
	SYS_LINKAT                         = 471
	SYS_UNLINKAT                       = 472
	SYS_READLINKAT                     = 473
	SYS_SYMLINKAT                      = 474
	SYS_MKDIRAT                        = 475
	SYS_GETATTRLISTAT                  = 476
	SYS_PROC_TRACE_LOG                 = 477
	SYS_BSDTHREAD_CTL                  = 478
	SYS_OPENBYID_NP                    = 479
	SYS_RECVMSG_X                      = 480
	SYS_SENDMSG_X                      = 481
	SYS_THREAD_SELFUSAGE               = 482
	SYS_CSRCTL                         = 483
	SYS_GUARDED_OPEN_DPROTECTED_NP     = 484
	SYS_GUARDED_WRITE_NP               = 485
	SYS_GUARDED_PWRITE_NP              = 486
	SYS_GUARDED_WRITEV_NP              = 487
	SYS_RENAMEATX_NP                   = 488
	SYS_MREMAP_ENCRYPTED               = 489
	SYS_NETAGENT_TRIGGER               = 490
	SYS_STACK_SNAPSHOT_WITH_CONFIG     = 491
	SYS_MICROSTACKSHOT                 = 492
	SYS_GRAB_PGO_DATA                  = 493
	SYS_PERSONA                        = 494
	SYS_WORK_INTERVAL_CTL              = 499
	SYS_GETENTROPY                     = 500
	SYS_NECP_OPEN                      = 501
	SYS_NECP_CLIENT_ACTION             = 502
	SYS___NEXUS_OPEN                   = 503
	SYS___NEXUS_REGISTER               = 504
	SYS___NEXUS_DEREGISTER             = 505
	SYS___NEXUS_CREATE                 = 506
	SYS___NEXUS_DESTROY                = 507
	SYS___NEXUS_GET_OPT                = 508
	SYS___NEXUS_SET_OPT                = 509
	SYS___CHANNEL_OPEN                 = 510
	SYS___CHANNEL_GET_INFO             = 511
	SYS___CHANNEL_SYNC                 = 512
	SYS___CHANNEL_GET_OPT              = 513
	SYS___CHANNEL_SET_OPT              = 514
	SYS_ULOCK_WAIT                     = 515
	SYS_ULOCK_WAKE                     = 516
	SYS_FCLONEFILEAT                   = 517
	SYS_FS_SNAPSHOT                    = 518
	SYS_TERMINATE_WITH_PAYLOAD         = 520
	SYS_ABORT_WITH_PAYLOAD             = 521
	SYS_NECP_SESSION_OPEN              = 522
	SYS_NECP_SESSION_ACTION            = 523
	SYS_SETATTRLISTAT                  = 524
	SYS_NET_QOS_GUIDELINE              = 525
	SYS_FMOUNT                         = 526
	SYS_NTP_ADJTIME                    = 527
	SYS_NTP_GETTIME                    = 528
	SYS_OS_FAULT_WITH_PAYLOAD          = 529
	SYS_KQUEUE_WORKLOOP_CTL            = 530
	SYS___MACH_BRIDGE_REMOTE_TIME      = 531
	SYS_MAXSYSCALL                     = 532
	SYS_INVALID                        = 63
)

Deprecated: Use libSystem wrappers instead of direct syscalls.

View Source
const (
	SizeofPtr      = 0x8
	SizeofShort    = 0x2
	SizeofInt      = 0x4
	SizeofLong     = 0x8
	SizeofLongLong = 0x8
)
View Source
const (
	SizeofSockaddrInet4     = 0x10
	SizeofSockaddrInet6     = 0x1c
	SizeofSockaddrAny       = 0x6c
	SizeofSockaddrUnix      = 0x6a
	SizeofSockaddrDatalink  = 0x14
	SizeofSockaddrCtl       = 0x20
	SizeofSockaddrVM        = 0xc
	SizeofXvsockpcb         = 0xa8
	SizeofXSocket           = 0x64
	SizeofXSockbuf          = 0x18
	SizeofXVSockPgen        = 0x20
	SizeofXucred            = 0x4c
	SizeofLinger            = 0x8
	SizeofIovec             = 0x10
	SizeofIPMreq            = 0x8
	SizeofIPMreqn           = 0xc
	SizeofIPv6Mreq          = 0x14
	SizeofMsghdr            = 0x30
	SizeofCmsghdr           = 0xc
	SizeofInet4Pktinfo      = 0xc
	SizeofInet6Pktinfo      = 0x14
	SizeofIPv6MTUInfo       = 0x20
	SizeofICMPv6Filter      = 0x20
	SizeofTCPConnectionInfo = 0x70
)
View Source
const (
	PTRACE_TRACEME = 0x0
	PTRACE_CONT    = 0x7
	PTRACE_KILL    = 0x8
)
View Source
const (
	SizeofIfMsghdr    = 0x70
	SizeofIfData      = 0x60
	SizeofIfaMsghdr   = 0x14
	SizeofIfmaMsghdr  = 0x10
	SizeofIfmaMsghdr2 = 0x14
	SizeofRtMsghdr    = 0x5c
	SizeofRtMetrics   = 0x38
)
View Source
const (
	SizeofBpfVersion = 0x4
	SizeofBpfStat    = 0x8
	SizeofBpfProgram = 0x10
	SizeofBpfInsn    = 0x8
	SizeofBpfHdr     = 0x14
)
View Source
const (
	AT_FDCWD            = -0x2
	AT_REMOVEDIR        = 0x80
	AT_SYMLINK_FOLLOW   = 0x40
	AT_SYMLINK_NOFOLLOW = 0x20
	AT_EACCESS          = 0x10
)
View Source
const (
	POLLERR    = 0x8
	POLLHUP    = 0x10
	POLLIN     = 0x1
	POLLNVAL   = 0x20
	POLLOUT    = 0x4
	POLLPRI    = 0x2
	POLLRDBAND = 0x80
	POLLRDNORM = 0x40
	POLLWRBAND = 0x100
	POLLWRNORM = 0x4
)
View Source
const (
	IPC_CREAT   = 0x200
	IPC_EXCL    = 0x400
	IPC_NOWAIT  = 0x800
	IPC_PRIVATE = 0x0
)
View Source
const (
	IPC_RMID = 0x0
	IPC_SET  = 0x1
	IPC_STAT = 0x2
)
View Source
const (
	SHM_RDONLY = 0x1000
	SHM_RND    = 0x2000
)
View Source
const ImplementsGetwd = true
View Source
const (
	PathMax = 0x400
)
View Source
const SYS___SYSCTL = SYS_SYSCTL

Some external packages rely on SYS___SYSCTL being defined to implement their own sysctl wrappers. Provide it here, even though direct syscalls are no longer supported on darwin.

View Source
const SizeofClockinfo = 0x14
View Source
const SizeofKinfoProc = 0x288

Variables

View Source
var (
	Stdin  = 0
	Stdout = 1
	Stderr = 2
)
View Source
var SocketDisableIPv6 bool

For testing: clients can set this flag to force creation of IPv6 sockets to return EAFNOSUPPORT.

Functions

func Access

func Access(path string, mode uint32) (err error)

func Adjtime

func Adjtime(delta *Timeval, olddelta *Timeval) (err error)

func Bind

func Bind(fd int, sa Sockaddr) (err error)

func BytePtrFromString

func BytePtrFromString(s string) (*byte, error)

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 BytePtrToString

func BytePtrToString(p *byte) string

BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated at a zero byte; if the zero byte is not present, the program may crash.

func ByteSliceFromString

func ByteSliceFromString(s string) ([]byte, error)

ByteSliceFromString returns a NUL-terminated slice of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, EINVAL).

func ByteSliceToString

func ByteSliceToString(s []byte) string

ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any bytes after the NUL removed.

func Chdir

func Chdir(path string) (err error)

func Chflags

func Chflags(path string, flags int) (err error)

func Chmod

func Chmod(path string, mode uint32) (err error)

func Chown

func Chown(path string, uid int, gid int) (err error)

func Chroot

func Chroot(path string) (err error)

func Clearenv

func Clearenv()

func ClockGettime

func ClockGettime(clockid int32, time *Timespec) (err error)

func Clonefile

func Clonefile(src string, dst string, flags int) (err error)

func Clonefileat

func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error)

func Close

func Close(fd int) (err error)

func CloseOnExec

func CloseOnExec(fd int)

func CmsgLen

func CmsgLen(datalen int) int

CmsgLen returns the value to store in the Len field of the Cmsghdr structure, taking into account any necessary alignment.

func CmsgSpace

func CmsgSpace(datalen int) int

CmsgSpace returns the number of bytes an ancillary element with payload of the passed data length occupies.

func Connect

func Connect(fd int, sa Sockaddr) (err error)

func Dup

func Dup(fd int) (nfd int, err error)

func Dup2

func Dup2(from int, to int) (err error)

func Environ

func Environ() []string

func ErrnoName

func ErrnoName(e syscall.Errno) string

ErrnoName returns the error name for error number e.

func Exchangedata

func Exchangedata(path1 string, path2 string, options int) (err error)

func Exec

func Exec(argv0 string, argv []string, envv []string) error

Exec calls execve(2), which replaces the calling executable in the process tree. argv0 should be the full path to an executable ("/bin/ls") and the executable name should also be the first argument in argv (["ls", "-l"]). envv are the environment variables that should be passed to the new process (["USER=go", "PWD=/tmp"]).

Example
package main

import (
	"log"
	"os"

	"golang.org/x/sys/unix"
)

func main() {
	err := unix.Exec("/bin/ls", []string{"ls", "-al"}, os.Environ())
	log.Fatal(err)
}
Output:

func Exit

func Exit(code int)

func Faccessat

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

func Fchdir

func Fchdir(fd int) (err error)

func Fchflags

func Fchflags(fd int, flags int) (err error)

func Fchmod

func Fchmod(fd int, mode uint32) (err error)

func Fchmodat

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

func Fchown

func Fchown(fd int, uid int, gid int) (err error)

func Fchownat

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

func Fclonefileat

func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error)

func FcntlFlock

func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error

FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.

func FcntlFstore

func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error

FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command.

func FcntlInt

func FcntlInt(fd uintptr, cmd, arg int) (int, error)

FcntlInt performs a fcntl syscall on fd with the provided command and argument.

func Fgetxattr

func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error)

func Flistxattr

func Flistxattr(fd int, dest []byte) (sz int, err error)

func Flock

func Flock(fd int, how int) (err error)
Example
package main

import (
	"log"
	"os"

	"golang.org/x/sys/unix"
)

func main() {
	f, _ := os.Create("example.lock")
	if err := unix.Flock(int(f.Fd()), unix.LOCK_EX); err != nil {
		log.Fatal(err)
	}
	// Do work here that requires the lock. When finished, release the lock:
	if err := unix.Flock(int(f.Fd()), unix.LOCK_UN); err != nil {
		log.Fatal(err)
	}
}
Output:

func Fpathconf

func Fpathconf(fd int, name int) (val int, err error)

func Fremovexattr

func Fremovexattr(fd int, attr string) (err error)

func Fsetxattr

func Fsetxattr(fd int, attr string, data []byte, flags int) (err error)

func Fstat

func Fstat(fd int, stat *Stat_t) (err error)

func Fstatat

func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)

func Fstatfs

func Fstatfs(fd int, stat *Statfs_t) (err error)

func Fsync

func Fsync(fd int) (err error)

func Ftruncate

func Ftruncate(fd int, length int64) (err error)

func Futimes

func Futimes(fd int, tv []Timeval) error

func Getcwd

func Getcwd(buf []byte) (n int, err error)

func Getdirentries

func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)

func Getdtablesize

func Getdtablesize() (size int)

func Getegid

func Getegid() (egid int)

func Getenv

func Getenv(key string) (value string, found bool)

func Geteuid

func Geteuid() (uid int)

func Getfsstat

func Getfsstat(buf []Statfs_t, flags int) (n int, err error)

func Getgid

func Getgid() (gid int)

func Getgroups

func Getgroups() (gids []int, err error)

func Getpagesize

func Getpagesize() int

func Getpgid

func Getpgid(pid int) (pgid int, err error)

func Getpgrp

func Getpgrp() (pgrp int)

func Getpid

func Getpid() (pid int)

func Getppid

func Getppid() (ppid int)

func Getpriority

func Getpriority(which int, who int) (prio int, err error)

func Getrlimit

func Getrlimit(which int, lim *Rlimit) (err error)

func Getrusage

func Getrusage(who int, rusage *Rusage) (err error)

func Getsid

func Getsid(pid int) (sid int, err error)

func GetsockoptByte

func GetsockoptByte(fd, level, opt int) (value byte, err error)

func GetsockoptInet4Addr

func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error)

func GetsockoptInt

func GetsockoptInt(fd, level, opt int) (value int, err error)

func GetsockoptString

func GetsockoptString(fd, level, opt int) (string, error)

GetsockoptString returns the string value of the socket option opt for the socket associated with fd at the given socket level.

func GetsockoptUint64

func GetsockoptUint64(fd, level, opt int) (value uint64, err error)

func Gettimeofday

func Gettimeofday(tp *Timeval) (err error)

func Getuid

func Getuid() (uid int)

func Getwd

func Getwd() (string, error)

func Getxattr

func Getxattr(path string, attr string, dest []byte) (sz int, err error)

func IoctlCtlInfo

func IoctlCtlInfo(fd int, ctlInfo *CtlInfo) error

func IoctlGetInt

func IoctlGetInt(fd int, req uint) (int, error)

IoctlGetInt performs an ioctl operation which gets an integer value from fd, using the specified request number.

A few ioctl requests use the return value as an output parameter; for those, IoctlRetInt should be used instead of this function.

func IoctlSetIfreqMTU

func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error

IoctlSetIfreqMTU performs the SIOCSIFMTU ioctl operation on fd to set the MTU of the network device specified by ifreq.Name.

func IoctlSetInt

func IoctlSetInt(fd int, req uint, value int) error

IoctlSetInt performs an ioctl operation which sets an integer value on fd, using the specified request number.

func IoctlSetPointerInt

func IoctlSetPointerInt(fd int, req uint, value int) error

IoctlSetPointerInt performs an ioctl operation which sets an integer value on fd, using the specified request number. The ioctl argument is called with a pointer to the integer value, rather than passing the integer value directly.

func IoctlSetTermios

func IoctlSetTermios(fd int, req uint, value *Termios) error

IoctlSetTermios performs an ioctl on fd with a *Termios.

The req value will usually be TCSETA or TIOCSETA.

func IoctlSetWinsize

func IoctlSetWinsize(fd int, req uint, value *Winsize) error

IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.

To change fd's window size, the req argument should be TIOCSWINSZ.

func Issetugid

func Issetugid() (tainted bool)

func Kevent

func Kevent(kq int, changes, events []Kevent_t, timeout *Timespec) (n int, err error)

func Kill

func Kill(pid int, signum syscall.Signal) (err error)

func Kqueue

func Kqueue() (fd int, err error)

func Lchown

func Lchown(path string, uid int, gid int) (err error)

func Lgetxattr

func Lgetxattr(link string, attr string, dest []byte) (sz int, err error)
func Link(path string, link string) (err error)

func Linkat

func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)

func Listen

func Listen(s int, backlog int) (err error)

func Listxattr

func Listxattr(path string, dest []byte) (sz int, err error)

func Llistxattr

func Llistxattr(link string, dest []byte) (sz int, err error)

func Lremovexattr

func Lremovexattr(link string, attr string) (err error)

func Lsetxattr

func Lsetxattr(link string, attr string, data []byte, flags int) (err error)

func Lstat

func Lstat(path string, stat *Stat_t) (err error)

func Lutimes

func Lutimes(path string, tv []Timeval) error

Lutimes sets the access and modification times tv on path. If path refers to a symlink, it is not dereferenced and the timestamps are set on the symlink. If tv is nil, the access and modification times are set to the current time. Otherwise tv must contain exactly 2 elements, with access time as the first element and modification time as the second element.

func Madvise

func Madvise(b []byte, behav int) (err error)

func Major

func Major(dev uint64) uint32

Major returns the major component of a Darwin device number.

func Minor

func Minor(dev uint64) uint32

Minor returns the minor component of a Darwin device number.

func Mkdev

func Mkdev(major, minor uint32) uint64

Mkdev returns a Darwin device number generated from the given major and minor components.

func Mkdir

func Mkdir(path string, mode uint32) (err error)

func Mkdirat

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

func Mkfifo

func Mkfifo(path string, mode uint32) (err error)

func Mknod

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

func Mlock

func Mlock(b []byte) (err error)

func Mlockall

func Mlockall(flags int) (err error)

func Mmap

func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error)

func Mount

func Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error)

func Mprotect

func Mprotect(b []byte, prot int) (err error)

func Msync

func Msync(b []byte, flags int) (err error)

func Munlock

func Munlock(b []byte) (err error)

func Munlockall

func Munlockall() (err error)

func Munmap

func Munmap(b []byte) (err error)

func Open

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

func Openat

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

func ParseDirent

func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string)

ParseDirent parses up to max directory entries in buf, appending the names to names. It returns the number of bytes consumed from buf, the number of entries added to names, and the new names slice.

func ParseUnixRights

func ParseUnixRights(m *SocketControlMessage) ([]int, error)

ParseUnixRights decodes a socket control message that contains an integer array of open file descriptors from another process.

func Pathconf

func Pathconf(path string, name int) (val int, err error)

func Pipe

func Pipe(p []int) (err error)

func Poll

func Poll(fds []PollFd, timeout int) (n int, err error)

func Pread

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

func PtraceAttach

func PtraceAttach(pid int) (err error)

func PtraceDenyAttach added in v0.5.0

func PtraceDenyAttach() (err error)

func PtraceDetach

func PtraceDetach(pid int) (err error)

func Pwrite

func Pwrite(fd int, p []byte, offset int64) (n int, err error)

func RawSyscall

func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)

func RawSyscall6

func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)

func Read

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

func ReadDirent

func ReadDirent(fd int, buf []byte) (n int, err error)

ReadDirent reads directory entries from fd and writes them into buf.

func Readlink(path string, buf []byte) (n int, err error)

func Readlinkat

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

func Removexattr

func Removexattr(path string, attr string) (err error)

func Rename

func Rename(from string, to string) (err error)

func Renameat

func Renameat(fromfd int, from string, tofd int, to string) (err error)

func Revoke

func Revoke(path string) (err error)

func Rmdir

func Rmdir(path string) (err error)

func Seek

func Seek(fd int, offset int64, whence int) (newoffset int64, err error)

func Select

func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)

func Send

func Send(s int, buf []byte, flags int) (err error)

func Sendfile

func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)

func Sendmsg

func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error)

Sendmsg sends a message on a socket to an address using the sendmsg system call. This function is equivalent to SendmsgN, but does not return the number of bytes actually sent.

func SendmsgBuffers

func SendmsgBuffers(fd int, buffers [][]byte, oob []byte, to Sockaddr, flags int) (n int, err error)

SendmsgBuffers sends a message on a socket to an address using the sendmsg system call. This function is equivalent to SendmsgN, but the non-control data is gathered from buffers.

func SendmsgN

func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)

SendmsgN sends a message on a socket to an address using the sendmsg system call. p contains the non-control data to send, and oob contains the "out of band" control data. The flags are passed to sendmsg. The number of non-control bytes actually written to the socket is returned.

Some socket types do not support sending control data without accompanying non-control data. If p is empty, and oob contains control data, and the underlying socket type is not SOCK_DGRAM, p will be treated as containing a single '\0' and the return value will indicate zero bytes sent.

The Go function Recvmsg, if called with an empty p and a non-empty oob, will read and ignore this additional '\0'. If the message is received by code that does not use Recvmsg, or that does not use Go at all, that code will need to be written to expect and ignore the additional '\0'.

If you need to send non-empty oob with p actually empty, and if the underlying socket type supports it, you can do so via a raw system call as follows:

msg := &unix.Msghdr{
    Control: &oob[0],
}
msg.SetControllen(len(oob))
n, _, errno := unix.Syscall(unix.SYS_SENDMSG, uintptr(fd), uintptr(unsafe.Pointer(msg)), flags)

func Sendto

func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error)

func SetKevent

func SetKevent(k *Kevent_t, fd, mode, flags int)

func SetNonblock

func SetNonblock(fd int, nonblocking bool) (err error)

func Setattrlist added in v0.7.0

func Setattrlist(path string, attrlist *Attrlist, attrBuf []byte, options int) (err error)

func Setegid

func Setegid(egid int) (err error)

func Setenv

func Setenv(key, value string) error

func Seteuid

func Seteuid(euid int) (err error)

func Setgid

func Setgid(gid int) (err error)

func Setgroups

func Setgroups(gids []int) (err error)

func Setlogin

func Setlogin(name string) (err error)

func Setpgid

func Setpgid(pid int, pgid int) (err error)

func Setpriority

func Setpriority(which int, who int, prio int) (err error)

func Setprivexec

func Setprivexec(flag int) (err error)

func Setregid

func Setregid(rgid int, egid int) (err error)

func Setreuid

func Setreuid(ruid int, euid int) (err error)

func Setrlimit

func Setrlimit(resource int, rlim *Rlimit) error

Setrlimit sets a resource limit.

func Setsid

func Setsid() (pid int, err error)

func SetsockoptByte

func SetsockoptByte(fd, level, opt int, value byte) (err error)

func SetsockoptICMPv6Filter

func SetsockoptICMPv6Filter(fd, level, opt int, filter *ICMPv6Filter) error

func SetsockoptIPMreq

func SetsockoptIPMreq(fd, level, opt int, mreq *IPMreq) (err error)

func SetsockoptIPMreqn

func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error)

func SetsockoptIPv6Mreq

func SetsockoptIPv6Mreq(fd, level, opt int, mreq *IPv6Mreq) (err error)

func SetsockoptInet4Addr

func SetsockoptInet4Addr(fd, level, opt int, value [4]byte) (err error)

func SetsockoptInt

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

func SetsockoptLinger

func SetsockoptLinger(fd, level, opt int, l *Linger) (err error)

func SetsockoptString

func SetsockoptString(fd, level, opt int, s string) (err error)

func SetsockoptTimeval

func SetsockoptTimeval(fd, level, opt int, tv *Timeval) (err error)

func SetsockoptUint64

func SetsockoptUint64(fd, level, opt int, value uint64) (err error)

func Settimeofday

func Settimeofday(tp *Timeval) (err error)

func Setuid

func Setuid(uid int) (err error)

func Setxattr

func Setxattr(path string, attr string, data []byte, flags int) (err error)

func Shutdown

func Shutdown(s int, how int) (err error)

func SignalName

func SignalName(s syscall.Signal) string

SignalName returns the signal name for signal number s.

func SignalNum

func SignalNum(s string) syscall.Signal

SignalNum returns the syscall.Signal for signal named s, or 0 if a signal with such name is not found. The signal name should start with "SIG".

func Socket

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

func Socketpair

func Socketpair(domain, typ, proto int) (fd [2]int, err error)

func Stat

func Stat(path string, stat *Stat_t) (err error)

func Statfs

func Statfs(path string, stat *Statfs_t) (err error)
func Symlink(path string, link string) (err error)

func Symlinkat

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

func Sync

func Sync() (err error)

func Syscall

func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno)

func Syscall6

func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)

func Syscall9

func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)

func Sysctl

func Sysctl(name string) (string, error)

func SysctlArgs

func SysctlArgs(name string, args ...int) (string, error)

func SysctlRaw

func SysctlRaw(name string, args ...int) ([]byte, error)

func SysctlUint32

func SysctlUint32(name string) (uint32, error)

func SysctlUint32Args

func SysctlUint32Args(name string, args ...int) (uint32, error)

func SysctlUint64

func SysctlUint64(name string, args ...int) (uint64, error)

func SysvShmAttach

func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error)

SysvShmAttach attaches the Sysv shared memory segment associated with the shared memory identifier id.

func SysvShmCtl

func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error)

SysvShmCtl performs control operations on the shared memory segment specified by id.

func SysvShmDetach

func SysvShmDetach(data []byte) error

SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach.

It is not safe to use the slice after calling this function.

func SysvShmGet

func SysvShmGet(key, size, flag int) (id int, err error)

SysvShmGet returns the Sysv shared memory identifier associated with key. If the IPC_CREAT flag is specified a new segment is created.

Example
package main

import (
	"log"

	"golang.org/x/sys/unix"
)

func main() {
	// create shared memory region of 1024 bytes
	id, err := unix.SysvShmGet(unix.IPC_PRIVATE, 1024, unix.IPC_CREAT|unix.IPC_EXCL|0o600)
	if err != nil {
		log.Fatal("sysv shm create failed:", err)
	}

	// warning: sysv shared memory segments persist even after after a process
	// is destroyed, so it's very important to explicitly delete it when you
	// don't need it anymore.
	defer func() {
		_, err := unix.SysvShmCtl(id, unix.IPC_RMID, nil)
		if err != nil {
			log.Fatal(err)
		}
	}()

	// to use a shared memory region you must attach to it
	b, err := unix.SysvShmAttach(id, 0, 0)
	if err != nil {
		log.Fatal("sysv attach failed:", err)
	}

	// you should detach from the segment when finished with it. The byte
	// slice is no longer valid after detaching
	defer func() {
		if err = unix.SysvShmDetach(b); err != nil {
			log.Fatal("sysv detach failed:", err)
		}
	}()

	// Changes to the contents of the byte slice are reflected in other
	// mappings of the shared memory identifer in this and other processes
	b[42] = 'h'
	b[43] = 'i'
}
Output:

func TimespecToNsec

func TimespecToNsec(ts Timespec) int64

TimespecToNsec returns the time stored in ts as nanoseconds.

func TimevalToNsec

func TimevalToNsec(tv Timeval) int64

TimevalToNsec returns the time stored in tv as nanoseconds.

func Truncate

func Truncate(path string, length int64) (err error)

func Umask

func Umask(newmask int) (oldmask int)

func Uname

func Uname(uname *Utsname) error

func Undelete

func Undelete(path string) (err error)

func UnixRights

func UnixRights(fds ...int) []byte

UnixRights encodes a set of open file descriptors into a socket control message for sending to another process.

func Unlink(path string) (err error)

func Unlinkat

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

func Unmount

func Unmount(path string, flags int) (err error)

func Unsetenv

func Unsetenv(key string) error

func Utimes

func Utimes(path string, tv []Timeval) error

func UtimesNano

func UtimesNano(path string, ts []Timespec) error

func UtimesNanoAt

func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error

func Wait4

func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error)

func Write

func Write(fd int, p []byte) (n int, err error)

Types

type Attrlist added in v0.7.0

type Attrlist struct {
	Bitmapcount uint16
	Reserved    uint16
	Commonattr  uint32
	Volattr     uint32
	Dirattr     uint32
	Fileattr    uint32
	Forkattr    uint32
}

type BpfHdr

type BpfHdr struct {
	Tstamp  Timeval32
	Caplen  uint32
	Datalen uint32
	Hdrlen  uint16
	// contains filtered or unexported fields
}

type BpfInsn

type BpfInsn struct {
	Code uint16
	Jt   uint8
	Jf   uint8
	K    uint32
}

type BpfProgram

type BpfProgram struct {
	Len   uint32
	Insns *BpfInsn
}

type BpfStat

type BpfStat struct {
	Recv uint32
	Drop uint32
}

type BpfVersion

type BpfVersion struct {
	Major uint16
	Minor uint16
}

type Clockinfo

type Clockinfo struct {
	Hz      int32
	Tick    int32
	Tickadj int32
	Stathz  int32
	Profhz  int32
}

func SysctlClockinfo

func SysctlClockinfo(name string) (*Clockinfo, error)

type Cmsghdr

type Cmsghdr struct {
	Len   uint32
	Level int32
	Type  int32
}

func ParseOneSocketControlMessage added in v0.2.0

func ParseOneSocketControlMessage(b []byte) (hdr Cmsghdr, data []byte, remainder []byte, err error)

ParseOneSocketControlMessage parses a single socket control message from b, returning the message header, message data (a slice of b), and the remainder of b after that single message. When there are no remaining messages, len(remainder) == 0.

func (*Cmsghdr) SetLen

func (cmsg *Cmsghdr) SetLen(length int)

type CtlInfo

type CtlInfo struct {
	Id   uint32
	Name [96]byte
}

type Dirent

type Dirent struct {
	Ino     uint64
	Seekoff uint64
	Reclen  uint16
	Namlen  uint16
	Type    uint8
	Name    [1024]int8
	// contains filtered or unexported fields
}

type Eproc

type Eproc struct {
	Paddr   uintptr
	Sess    uintptr
	Pcred   Pcred
	Ucred   Ucred
	Vm      Vmspace
	Ppid    int32
	Pgid    int32
	Jobc    int16
	Tdev    int32
	Tpgid   int32
	Tsess   uintptr
	Wmesg   [8]byte
	Xsize   int32
	Xrssize int16
	Xccount int16
	Xswrss  int16
	Flag    int32
	Login   [12]byte
	Spare   [4]int32
	// contains filtered or unexported fields
}

type Errno

type Errno = syscall.Errno

type ExternProc

type ExternProc struct {
	P_starttime Timeval
	P_vmspace   *Vmspace
	P_sigacts   uintptr
	P_flag      int32
	P_stat      int8
	P_pid       int32
	P_oppid     int32
	P_dupfd     int32
	User_stack  *int8
	Exit_thread *byte
	P_debugger  int32
	Sigwait     int32
	P_estcpu    uint32
	P_cpticks   int32
	P_pctcpu    uint32
	P_wchan     *byte
	P_wmesg     *int8
	P_swtime    uint32
	P_slptime   uint32
	P_realtimer Itimerval
	P_rtime     Timeval
	P_uticks    uint64
	P_sticks    uint64
	P_iticks    uint64
	P_traceflag int32
	P_tracep    uintptr
	P_siglist   int32
	P_textvp    uintptr
	P_holdcnt   int32
	P_sigmask   uint32
	P_sigignore uint32
	P_sigcatch  uint32
	P_priority  uint8
	P_usrpri    uint8
	P_nice      int8
	P_comm      [17]byte
	P_pgrp      uintptr
	P_addr      uintptr
	P_xstat     uint16
	P_acflag    uint16
	P_ru        *Rusage
}

type Fbootstraptransfer_t

type Fbootstraptransfer_t struct {
	Offset int64
	Length uint64
	Buffer *byte
}

type FdSet

type FdSet struct {
	Bits [32]int32
}

func (*FdSet) Clear

func (fds *FdSet) Clear(fd int)

Clear removes fd from the set fds.

func (*FdSet) IsSet

func (fds *FdSet) IsSet(fd int) bool

IsSet returns whether fd is in the set fds.

func (*FdSet) Set

func (fds *FdSet) Set(fd int)

Set adds fd to the set fds.

func (*FdSet) Zero

func (fds *FdSet) Zero()

Zero clears the set fds.

type Flock_t

type Flock_t struct {
	Start  int64
	Len    int64
	Pid    int32
	Type   int16
	Whence int16
}

type Fsid

type Fsid struct {
	Val [2]int32
}

type Fstore_t

type Fstore_t struct {
	Flags      uint32
	Posmode    int32
	Offset     int64
	Length     int64
	Bytesalloc int64
}

type ICMPv6Filter

type ICMPv6Filter struct {
	Filt [8]uint32
}

func GetsockoptICMPv6Filter

func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error)

type IPMreq

type IPMreq struct {
	Multiaddr [4]byte /* in_addr */
	Interface [4]byte /* in_addr */
}

func GetsockoptIPMreq

func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error)

type IPMreqn

type IPMreqn struct {
	Multiaddr [4]byte /* in_addr */
	Address   [4]byte /* in_addr */
	Ifindex   int32
}

func GetsockoptIPMreqn

func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error)

type IPv6MTUInfo

type IPv6MTUInfo struct {
	Addr RawSockaddrInet6
	Mtu  uint32
}

func GetsockoptIPv6MTUInfo

func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error)

type IPv6Mreq

type IPv6Mreq struct {
	Multiaddr [16]byte /* in6_addr */
	Interface uint32
}

func GetsockoptIPv6Mreq

func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error)

type IfData

type IfData struct {
	Type       uint8
	Typelen    uint8
	Physical   uint8
	Addrlen    uint8
	Hdrlen     uint8
	Recvquota  uint8
	Xmitquota  uint8
	Unused1    uint8
	Mtu        uint32
	Metric     uint32
	Baudrate   uint32
	Ipackets   uint32
	Ierrors    uint32
	Opackets   uint32
	Oerrors    uint32
	Collisions uint32
	Ibytes     uint32
	Obytes     uint32
	Imcasts    uint32
	Omcasts    uint32
	Iqdrops    uint32
	Noproto    uint32
	Recvtiming uint32
	Xmittiming uint32
	Lastchange Timeval32
	Unused2    uint32
	Hwassist   uint32
	Reserved1  uint32
	Reserved2  uint32
}

type IfMsghdr

type IfMsghdr struct {
	Msglen  uint16
	Version uint8
	Type    uint8
	Addrs   int32
	Flags   int32
	Index   uint16
	Data    IfData
}

type IfaMsghdr

type IfaMsghdr struct {
	Msglen  uint16
	Version uint8
	Type    uint8
	Addrs   int32
	Flags   int32
	Index   uint16
	Metric  int32
}

type IfmaMsghdr

type IfmaMsghdr struct {
	Msglen  uint16
	Version uint8
	Type    uint8
	Addrs   int32
	Flags   int32
	Index   uint16
	// contains filtered or unexported fields
}

type IfmaMsghdr2

type IfmaMsghdr2 struct {
	Msglen   uint16
	Version  uint8
	Type     uint8
	Addrs    int32
	Flags    int32
	Index    uint16
	Refcount int32
}

type IfreqMTU

type IfreqMTU struct {
	Name [IFNAMSIZ]byte
	MTU  int32
}

IfreqMTU is struct ifreq used to get or set a network device's MTU.

func IoctlGetIfreqMTU

func IoctlGetIfreqMTU(fd int, ifname string) (*IfreqMTU, error)

IoctlGetIfreqMTU performs the SIOCGIFMTU ioctl operation on fd to get the MTU of the network device specified by ifname.

type Inet4Pktinfo

type Inet4Pktinfo struct {
	Ifindex  uint32
	Spec_dst [4]byte /* in_addr */
	Addr     [4]byte /* in_addr */
}

type Inet6Pktinfo

type Inet6Pktinfo struct {
	Addr    [16]byte /* in6_addr */
	Ifindex uint32
}

type Iovec

type Iovec struct {
	Base *byte
	Len  uint64
}

func (*Iovec) SetLen

func (iov *Iovec) SetLen(length int)

type Itimerval

type Itimerval struct {
	Interval Timeval
	Value    Timeval
}

type Kevent_t

type Kevent_t struct {
	Ident  uint64
	Filter int16
	Flags  uint16
	Fflags uint32
	Data   int64
	Udata  *byte
}

type KinfoProc

type KinfoProc struct {
	Proc  ExternProc
	Eproc Eproc
}

func SysctlKinfoProc

func SysctlKinfoProc(name string, args ...int) (*KinfoProc, error)

func SysctlKinfoProcSlice

func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error)

type Linger

type Linger struct {
	Onoff  int32
	Linger int32
}

func GetsockoptLinger

func GetsockoptLinger(fd, level, opt int) (*Linger, error)

type Log2phys_t

type Log2phys_t struct {
	Flags uint32
	// contains filtered or unexported fields
}

type Msghdr

type Msghdr struct {
	Name       *byte
	Namelen    uint32
	Iov        *Iovec
	Iovlen     int32
	Control    *byte
	Controllen uint32
	Flags      int32
}

func (*Msghdr) SetControllen

func (msghdr *Msghdr) SetControllen(length int)

func (*Msghdr) SetIovlen

func (msghdr *Msghdr) SetIovlen(length int)

type Pcred

type Pcred struct {
	Pc_lock  [72]int8
	Pc_ucred uintptr
	P_ruid   uint32
	P_svuid  uint32
	P_rgid   uint32
	P_svgid  uint32
	P_refcnt int32
	// contains filtered or unexported fields
}

type PollFd

type PollFd struct {
	Fd      int32
	Events  int16
	Revents int16
}

type Radvisory_t

type Radvisory_t struct {
	Offset int64
	Count  int32
	// contains filtered or unexported fields
}

type RawSockaddr

type RawSockaddr struct {
	Len    uint8
	Family uint8
	Data   [14]int8
}

type RawSockaddrAny

type RawSockaddrAny struct {
	Addr RawSockaddr
	Pad  [92]int8
}

type RawSockaddrCtl

type RawSockaddrCtl struct {
	Sc_len      uint8
	Sc_family   uint8
	Ss_sysaddr  uint16
	Sc_id       uint32
	Sc_unit     uint32
	Sc_reserved [5]uint32
}
type RawSockaddrDatalink struct {
	Len    uint8
	Family uint8
	Index  uint16
	Type   uint8
	Nlen   uint8
	Alen   uint8
	Slen   uint8
	Data   [12]int8
}

type RawSockaddrInet4

type RawSockaddrInet4 struct {
	Len    uint8
	Family uint8
	Port   uint16
	Addr   [4]byte /* in_addr */
	Zero   [8]int8
}

type RawSockaddrInet6

type RawSockaddrInet6 struct {
	Len      uint8
	Family   uint8
	Port     uint16
	Flowinfo uint32
	Addr     [16]byte /* in6_addr */
	Scope_id uint32
}

type RawSockaddrUnix

type RawSockaddrUnix struct {
	Len    uint8
	Family uint8
	Path   [104]int8
}

type RawSockaddrVM

type RawSockaddrVM struct {
	Len       uint8
	Family    uint8
	Reserved1 uint16
	Port      uint32
	Cid       uint32
}

type Rlimit

type Rlimit struct {
	Cur uint64
	Max uint64
}

type RtMetrics

type RtMetrics struct {
	Locks    uint32
	Mtu      uint32
	Hopcount uint32
	Expire   int32
	Recvpipe uint32
	Sendpipe uint32
	Ssthresh uint32
	Rtt      uint32
	Rttvar   uint32
	Pksent   uint32
	State    uint32
	Filler   [3]uint32
}

type RtMsghdr

type RtMsghdr struct {
	Msglen  uint16
	Version uint8
	Type    uint8
	Index   uint16
	Flags   int32
	Addrs   int32
	Pid     int32
	Seq     int32
	Errno   int32
	Use     int32
	Inits   uint32
	Rmx     RtMetrics
}

type Rusage

type Rusage struct {
	Utime    Timeval
	Stime    Timeval
	Maxrss   int64
	Ixrss    int64
	Idrss    int64
	Isrss    int64
	Minflt   int64
	Majflt   int64
	Nswap    int64
	Inblock  int64
	Oublock  int64
	Msgsnd   int64
	Msgrcv   int64
	Nsignals int64
	Nvcsw    int64
	Nivcsw   int64
}

type Signal

type Signal = syscall.Signal

type Sockaddr

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

Sockaddr represents a socket address.

func Accept

func Accept(fd int) (nfd int, sa Sockaddr, err error)

func Getpeername

func Getpeername(fd int) (sa Sockaddr, err error)

func Getsockname

func Getsockname(fd int) (sa Sockaddr, err error)

func Recvfrom

func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error)

func Recvmsg

func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error)

Recvmsg receives a message from a socket using the recvmsg system call. The received non-control data will be written to p, and any "out of band" control data will be written to oob. The flags are passed to recvmsg.

The results are:

  • n is the number of non-control data bytes read into p
  • oobn is the number of control data bytes read into oob; this may be interpreted using ParseSocketControlMessage
  • recvflags is flags returned by recvmsg
  • from is the address of the sender

If the underlying socket type is not SOCK_DGRAM, a received message containing oob data and a single '\0' of non-control data is treated as if the message contained only control data, i.e. n will be zero on return.

func RecvmsgBuffers

func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error)

RecvmsgBuffers receives a message from a socket using the recvmsg system call. This function is equivalent to Recvmsg, but non-control data read is scattered into the buffers slices.

type SockaddrCtl

type SockaddrCtl struct {
	ID   uint32
	Unit uint32
	// contains filtered or unexported fields
}

SockaddrCtl implements the Sockaddr interface for AF_SYSTEM type sockets.

type SockaddrDatalink struct {
	Len    uint8
	Family uint8
	Index  uint16
	Type   uint8
	Nlen   uint8
	Alen   uint8
	Slen   uint8
	Data   [12]int8
	// contains filtered or unexported fields
}

SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.

type SockaddrInet4

type SockaddrInet4 struct {
	Port int
	Addr [4]byte
	// contains filtered or unexported fields
}

SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets.

type SockaddrInet6

type SockaddrInet6 struct {
	Port   int
	ZoneId uint32
	Addr   [16]byte
	// contains filtered or unexported fields
}

SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets.

type SockaddrUnix

type SockaddrUnix struct {
	Name string
	// contains filtered or unexported fields
}

SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets.

type SockaddrVM

type SockaddrVM struct {
	// CID and Port specify a context ID and port address for a VM socket.
	// Guests have a unique CID, and hosts may have a well-known CID of:
	//  - VMADDR_CID_HYPERVISOR: refers to the hypervisor process.
	//  - VMADDR_CID_LOCAL: refers to local communication (loopback).
	//  - VMADDR_CID_HOST: refers to other processes on the host.
	CID  uint32
	Port uint32
	// contains filtered or unexported fields
}

SockaddrVM implements the Sockaddr interface for AF_VSOCK type sockets. SockaddrVM provides access to Darwin VM sockets: a mechanism that enables bidirectional communication between a hypervisor and its guest virtual machines.

type SocketControlMessage

type SocketControlMessage struct {
	Header Cmsghdr
	Data   []byte
}

SocketControlMessage represents a socket control message.

func ParseSocketControlMessage

func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error)

ParseSocketControlMessage parses b as an array of socket control messages.

type Stat_t

type Stat_t struct {
	Dev     int32
	Mode    uint16
	Nlink   uint16
	Ino     uint64
	Uid     uint32
	Gid     uint32
	Rdev    int32
	Atim    Timespec
	Mtim    Timespec
	Ctim    Timespec
	Btim    Timespec
	Size    int64
	Blocks  int64
	Blksize int32
	Flags   uint32
	Gen     uint32
	Lspare  int32
	Qspare  [2]int64
}

type Statfs_t

type Statfs_t struct {
	Bsize       uint32
	Iosize      int32
	Blocks      uint64
	Bfree       uint64
	Bavail      uint64
	Files       uint64
	Ffree       uint64
	Fsid        Fsid
	Owner       uint32
	Type        uint32
	Flags       uint32
	Fssubtype   uint32
	Fstypename  [16]byte
	Mntonname   [1024]byte
	Mntfromname [1024]byte
	Flags_ext   uint32
	Reserved    [7]uint32
}

type SysProcAttr

type SysProcAttr = syscall.SysProcAttr

type SysvIpcPerm

type SysvIpcPerm struct {
	Uid  uint32
	Gid  uint32
	Cuid uint32
	Cgid uint32
	Mode uint16
	// contains filtered or unexported fields
}

type SysvShmDesc

type SysvShmDesc struct {
	Perm   SysvIpcPerm
	Segsz  uint64
	Lpid   int32
	Cpid   int32
	Nattch uint16
	// contains filtered or unexported fields
}

type TCPConnectionInfo

type TCPConnectionInfo struct {
	State      uint8
	Snd_wscale uint8
	Rcv_wscale uint8

	Options             uint32
	Flags               uint32
	Rto                 uint32
	Maxseg              uint32
	Snd_ssthresh        uint32
	Snd_cwnd            uint32
	Snd_wnd             uint32
	Snd_sbbytes         uint32
	Rcv_wnd             uint32
	Rttcur              uint32
	Srtt                uint32
	Rttvar              uint32
	Txpackets           uint64
	Txbytes             uint64
	Txretransmitbytes   uint64
	Rxpackets           uint64
	Rxbytes             uint64
	Rxoutoforderbytes   uint64
	Txretransmitpackets uint64
	// contains filtered or unexported fields
}

func GetsockoptTCPConnectionInfo

func GetsockoptTCPConnectionInfo(fd, level, opt int) (*TCPConnectionInfo, error)

type Termios

type Termios struct {
	Iflag  uint64
	Oflag  uint64
	Cflag  uint64
	Lflag  uint64
	Cc     [20]uint8
	Ispeed uint64
	Ospeed uint64
}

func IoctlGetTermios

func IoctlGetTermios(fd int, req uint) (*Termios, error)

type Timespec

type Timespec struct {
	Sec  int64
	Nsec int64
}

func NsecToTimespec

func NsecToTimespec(nsec int64) Timespec

NsecToTimespec converts a number of nanoseconds into a Timespec.

func TimeToTimespec

func TimeToTimespec(t time.Time) (Timespec, error)

TimeToTimespec converts t into a Timespec. On some 32-bit systems the range of valid Timespec values are smaller than that of time.Time values. So if t is out of the valid range of Timespec, it returns a zero Timespec and ERANGE.

func (*Timespec) Nano

func (ts *Timespec) Nano() int64

Nano returns the time stored in ts as nanoseconds.

func (*Timespec) Unix

func (ts *Timespec) Unix() (sec int64, nsec int64)

Unix returns the time stored in ts as seconds plus nanoseconds.

type Timeval

type Timeval struct {
	Sec  int64
	Usec int32
	// contains filtered or unexported fields
}

func GetsockoptTimeval

func GetsockoptTimeval(fd, level, opt int) (*Timeval, error)

func NsecToTimeval

func NsecToTimeval(nsec int64) Timeval

NsecToTimeval converts a number of nanoseconds into a Timeval.

func SysctlTimeval

func SysctlTimeval(name string) (*Timeval, error)

func (*Timeval) Nano

func (tv *Timeval) Nano() int64

Nano returns the time stored in tv as nanoseconds.

func (*Timeval) Unix

func (tv *Timeval) Unix() (sec int64, nsec int64)

Unix returns the time stored in tv as seconds plus nanoseconds.

type Timeval32

type Timeval32 struct {
	Sec  int32
	Usec int32
}

type Ucred

type Ucred struct {
	Ref     int32
	Uid     uint32
	Ngroups int16
	Groups  [16]uint32
}

type Utsname

type Utsname struct {
	Sysname  [256]byte
	Nodename [256]byte
	Release  [256]byte
	Version  [256]byte
	Machine  [256]byte
}

type Vmspace

type Vmspace struct {
	Dummy  int32
	Dummy2 *int8
	Dummy3 [5]int32
	Dummy4 [3]*int8
}

type WaitStatus

type WaitStatus uint32

func (WaitStatus) Continued

func (w WaitStatus) Continued() bool

func (WaitStatus) CoreDump

func (w WaitStatus) CoreDump() bool

func (WaitStatus) ExitStatus

func (w WaitStatus) ExitStatus() int

func (WaitStatus) Exited

func (w WaitStatus) Exited() bool

func (WaitStatus) Killed

func (w WaitStatus) Killed() bool

func (WaitStatus) Signal

func (w WaitStatus) Signal() syscall.Signal

func (WaitStatus) Signaled

func (w WaitStatus) Signaled() bool

func (WaitStatus) StopSignal

func (w WaitStatus) StopSignal() syscall.Signal

func (WaitStatus) Stopped

func (w WaitStatus) Stopped() bool

func (WaitStatus) TrapCause

func (w WaitStatus) TrapCause() int

type Winsize

type Winsize struct {
	Row    uint16
	Col    uint16
	Xpixel uint16
	Ypixel uint16
}

func IoctlGetWinsize

func IoctlGetWinsize(fd int, req uint) (*Winsize, error)

type XSockbuf

type XSockbuf struct {
	Cc    uint32
	Hiwat uint32
	Mbcnt uint32
	Mbmax uint32
	Lowat int32
	Flags int16
	Timeo int16
}

type XSocket

type XSocket struct {
	Xso_len      uint32
	Xso_so       uint32
	So_type      int16
	So_options   int16
	So_linger    int16
	So_state     int16
	So_pcb       uint32
	Xso_protocol int32
	Xso_family   int32
	So_qlen      int16
	So_incqlen   int16
	So_qlimit    int16
	So_timeo     int16
	So_error     uint16
	So_pgid      int32
	So_oobmark   uint32
	So_rcv       XSockbuf
	So_snd       XSockbuf
	So_uid       uint32
}

type XSocket64

type XSocket64 struct {
	Xso_len uint32

	So_type    int16
	So_options int16
	So_linger  int16
	So_state   int16

	Xso_protocol int32
	Xso_family   int32
	So_qlen      int16
	So_incqlen   int16
	So_qlimit    int16
	So_timeo     int16
	So_error     uint16
	So_pgid      int32
	So_oobmark   uint32
	So_rcv       XSockbuf
	So_snd       XSockbuf
	So_uid       uint32
	// contains filtered or unexported fields
}

type XVSockPCB

type XVSockPCB struct {
	Xv_len           uint32
	Xv_vsockpp       uint64
	Xvp_local_cid    uint32
	Xvp_local_port   uint32
	Xvp_remote_cid   uint32
	Xvp_remote_port  uint32
	Xvp_rxcnt        uint32
	Xvp_txcnt        uint32
	Xvp_peer_rxhiwat uint32
	Xvp_peer_rxcnt   uint32
	Xvp_last_pid     int32
	Xvp_gencnt       uint64
	Xv_socket        XSocket
	// contains filtered or unexported fields
}

type XVSockPgen

type XVSockPgen struct {
	Len   uint32
	Count uint64
	Gen   uint64
	Sogen uint64
}

type Xucred

type Xucred struct {
	Version uint32
	Uid     uint32
	Ngroups int16
	Groups  [16]uint32
}

func GetsockoptXucred

func GetsockoptXucred(fd, level, opt int) (*Xucred, error)

GetsockoptXucred is a getsockopt wrapper that returns an Xucred struct. The usual level and opt are SOL_LOCAL and LOCAL_PEERCRED, respectively.

Directories

Path Synopsis
internal
mkmerge
The mkmerge command parses generated source files and merges common consts, funcs, and types into a common source file, per GOOS.
The mkmerge command parses generated source files and merges common consts, funcs, and types into a common source file, per GOOS.

Jump to

Keyboard shortcuts

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