commit
ad49f97aed
|
@ -18,8 +18,9 @@ func setupDebugHandlers(addr string) error {
|
|||
m.Handle("/debug/pprof/profile", http.HandlerFunc(pprof.Profile))
|
||||
m.Handle("/debug/pprof/symbol", http.HandlerFunc(pprof.Symbol))
|
||||
m.Handle("/debug/pprof/trace", http.HandlerFunc(pprof.Trace))
|
||||
m.Handle("/debug/requests", http.HandlerFunc(trace.Traces))
|
||||
m.Handle("/debug/events", http.HandlerFunc(trace.Events))
|
||||
// TODO: reenable after golang.org/x/net update
|
||||
// m.Handle("/debug/requests", http.HandlerFunc(trace.Traces))
|
||||
// m.Handle("/debug/events", http.HandlerFunc(trace.Events))
|
||||
|
||||
// setting debugaddr is opt-in. permission is defined by listener address
|
||||
trace.AuthRequest = func(_ *http.Request) (bool, bool) {
|
||||
|
|
28
vendor.conf
28
vendor.conf
|
@ -1,38 +1,38 @@
|
|||
github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
|
||||
github.com/pkg/errors c605e284fe17294bda444b34710735b29d1a9d90
|
||||
github.com/pkg/errors v0.8.0
|
||||
|
||||
github.com/stretchr/testify v1.1.4
|
||||
github.com/davecgh/go-spew v1.1.0
|
||||
github.com/pmezard/go-difflib v1.0.0
|
||||
golang.org/x/sys 739734461d1c916b6c72a63d7efda2b27edb369f
|
||||
golang.org/x/sys 7ddbeae9ae08c6a06a59597f0c9edbc5ff2444ce
|
||||
|
||||
github.com/containerd/containerd d1e11f17ec7b325f89608dd46c128300b8727d50
|
||||
golang.org/x/sync f52d1811a62927559de87708c8913c1650ce4f26
|
||||
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
|
||||
github.com/sirupsen/logrus v1.0.0
|
||||
google.golang.org/grpc v1.3.0
|
||||
github.com/opencontainers/go-digest 21dfd564fd89c944783d00d069f33e3e7123c448
|
||||
golang.org/x/net 1f9224279e98554b6a6432d4dd998a739f8b2b7c
|
||||
golang.org/x/net 7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6
|
||||
github.com/gogo/protobuf d2e1ade2d719b78fe5b061b4c18a9f7111b5bdc8
|
||||
github.com/golang/protobuf 5a0f697c9ed9d68fef0116532c6e05cfeae00e55
|
||||
github.com/containerd/continuity 86cec1535a968310e7532819f699ff2830ed7463
|
||||
github.com/containerd/continuity cf279e6ac893682272b4479d4c67fd3abf878b4e
|
||||
github.com/opencontainers/image-spec v1.0.0
|
||||
github.com/opencontainers/runc e775f0fba3ea329b8b766451c892c41a3d49594d
|
||||
github.com/Microsoft/go-winio v0.4.1
|
||||
github.com/containerd/fifo 69b99525e472735860a5269b75af1970142b3062
|
||||
github.com/opencontainers/runtime-spec 96de01bbb42c7af89bff100e10a9f0fb62e75bfb
|
||||
github.com/containerd/go-runc 2774a2ea124a5c2d0aba13b5c2dd8a5a9a48775d
|
||||
github.com/containerd/console 7fed77e673ca4abcd0cbd6d4d0e0e22137cbd778
|
||||
github.com/opencontainers/runc 593914b8bd5448a93f7c3e4902a03408b6d5c0ce
|
||||
github.com/Microsoft/go-winio v0.4.4
|
||||
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6
|
||||
github.com/opencontainers/runtime-spec v1.0.0
|
||||
github.com/containerd/go-runc b3c048c028ddd789c6f9510c597f8b9c62f25359
|
||||
github.com/containerd/console 76d18fd1d66972718ab2284449591db0b3cdb4de
|
||||
github.com/Azure/go-ansiterm 19f72df4d05d31cbe1c56bfc8045c96babff6c7e
|
||||
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
||||
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
|
||||
github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
|
||||
|
||||
github.com/urfave/cli d70f47eeca3afd795160003bc6e28b001d60c67c
|
||||
github.com/docker/go-units 0dadbb0345b35ec7ef35e228dabb8de89a65bf52
|
||||
github.com/urfave/cli 8ba6f23b6e36d03666a14bd9421f5e3efcb59aca
|
||||
github.com/docker/go-units v0.3.1
|
||||
github.com/google/shlex 6f45313302b9c56850fc17f99e40caebce98c716
|
||||
golang.org/x/time 8be79e1e0910c292df4e79c241bb7e8f7e725959
|
||||
|
||||
github.com/BurntSushi/locker 392720b78f44e9d0249fcac6c43b111b47a370b8
|
||||
github.com/BurntSushi/locker a6e239ea1c69bff1cfdb20c4b73dadf52f784b6a
|
||||
github.com/docker/docker 6f723db8c6f0c7f0b252674a9673a25b5978db04 https://github.com/tonistiigi/docker.git
|
||||
github.com/pkg/profile 5b67d428864e92711fcbd2f8629456121a56d91f
|
||||
|
||||
|
|
|
@ -82,6 +82,9 @@ func (lker *Locker) newLock(key string) *sync.RWMutex {
|
|||
lker.locksRW.Lock()
|
||||
defer lker.locksRW.Unlock()
|
||||
|
||||
if lk, ok := lker.locks[key]; ok {
|
||||
return lk
|
||||
}
|
||||
lk := new(sync.RWMutex)
|
||||
lker.locks[key] = lk
|
||||
return lk
|
||||
|
|
|
@ -23,6 +23,13 @@ type atomicBool int32
|
|||
func (b *atomicBool) isSet() bool { return atomic.LoadInt32((*int32)(b)) != 0 }
|
||||
func (b *atomicBool) setFalse() { atomic.StoreInt32((*int32)(b), 0) }
|
||||
func (b *atomicBool) setTrue() { atomic.StoreInt32((*int32)(b), 1) }
|
||||
func (b *atomicBool) swap(new bool) bool {
|
||||
var newInt int32
|
||||
if new {
|
||||
newInt = 1
|
||||
}
|
||||
return atomic.SwapInt32((*int32)(b), newInt) == 1
|
||||
}
|
||||
|
||||
const (
|
||||
cFILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1
|
||||
|
@ -71,7 +78,7 @@ func initIo() {
|
|||
type win32File struct {
|
||||
handle syscall.Handle
|
||||
wg sync.WaitGroup
|
||||
closing bool
|
||||
closing atomicBool
|
||||
readDeadline deadlineHandler
|
||||
writeDeadline deadlineHandler
|
||||
}
|
||||
|
@ -107,9 +114,9 @@ func MakeOpenFile(h syscall.Handle) (io.ReadWriteCloser, error) {
|
|||
|
||||
// closeHandle closes the resources associated with a Win32 handle
|
||||
func (f *win32File) closeHandle() {
|
||||
if !f.closing {
|
||||
// Atomically set that we are closing, releasing the resources only once.
|
||||
if !f.closing.swap(true) {
|
||||
// cancel all IO and wait for it to complete
|
||||
f.closing = true
|
||||
cancelIoEx(f.handle, nil)
|
||||
f.wg.Wait()
|
||||
// at this point, no new IO can start
|
||||
|
@ -127,10 +134,10 @@ func (f *win32File) Close() error {
|
|||
// prepareIo prepares for a new IO operation.
|
||||
// The caller must call f.wg.Done() when the IO is finished, prior to Close() returning.
|
||||
func (f *win32File) prepareIo() (*ioOperation, error) {
|
||||
f.wg.Add(1)
|
||||
if f.closing {
|
||||
if f.closing.isSet() {
|
||||
return nil, ErrFileClosed
|
||||
}
|
||||
f.wg.Add(1)
|
||||
c := &ioOperation{}
|
||||
c.ch = make(chan ioResult)
|
||||
return c, nil
|
||||
|
@ -159,7 +166,7 @@ func (f *win32File) asyncIo(c *ioOperation, d *deadlineHandler, bytes uint32, er
|
|||
return int(bytes), err
|
||||
}
|
||||
|
||||
if f.closing {
|
||||
if f.closing.isSet() {
|
||||
cancelIoEx(f.handle, &c.o)
|
||||
}
|
||||
|
||||
|
@ -175,7 +182,7 @@ func (f *win32File) asyncIo(c *ioOperation, d *deadlineHandler, bytes uint32, er
|
|||
case r = <-c.ch:
|
||||
err = r.err
|
||||
if err == syscall.ERROR_OPERATION_ABORTED {
|
||||
if f.closing {
|
||||
if f.closing.isSet() {
|
||||
err = ErrFileClosed
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,19 +13,12 @@ import (
|
|||
)
|
||||
|
||||
//sys connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) = ConnectNamedPipe
|
||||
//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *securityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW
|
||||
//sys createFile(name string, access uint32, mode uint32, sa *securityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateFileW
|
||||
//sys createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateNamedPipeW
|
||||
//sys createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) [failretval==syscall.InvalidHandle] = CreateFileW
|
||||
//sys waitNamedPipe(name string, timeout uint32) (err error) = WaitNamedPipeW
|
||||
//sys getNamedPipeInfo(pipe syscall.Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) = GetNamedPipeInfo
|
||||
//sys getNamedPipeHandleState(pipe syscall.Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) = GetNamedPipeHandleStateW
|
||||
//sys localAlloc(uFlags uint32, length uint32) (ptr uintptr) = LocalAlloc
|
||||
//sys copyMemory(dst uintptr, src uintptr, length uint32) = RtlCopyMemory
|
||||
|
||||
type securityAttributes struct {
|
||||
Length uint32
|
||||
SecurityDescriptor uintptr
|
||||
InheritHandle uint32
|
||||
}
|
||||
|
||||
const (
|
||||
cERROR_PIPE_BUSY = syscall.Errno(231)
|
||||
|
@ -233,13 +226,13 @@ func makeServerPipeHandle(path string, securityDescriptor []byte, c *PipeConfig,
|
|||
mode |= cPIPE_TYPE_MESSAGE
|
||||
}
|
||||
|
||||
sa := &securityAttributes{}
|
||||
sa := &syscall.SecurityAttributes{}
|
||||
sa.Length = uint32(unsafe.Sizeof(*sa))
|
||||
if securityDescriptor != nil {
|
||||
len := uint32(len(securityDescriptor))
|
||||
sa.SecurityDescriptor = localAlloc(0, len)
|
||||
defer localFree(sa.SecurityDescriptor)
|
||||
copyMemory(sa.SecurityDescriptor, uintptr(unsafe.Pointer(&securityDescriptor[0])), len)
|
||||
copy((*[0xffff]byte)(unsafe.Pointer(sa.SecurityDescriptor))[:], securityDescriptor)
|
||||
}
|
||||
h, err := createNamedPipe(path, flags, mode, cPIPE_UNLIMITED_INSTANCES, uint32(c.OutputBufferSize), uint32(c.InputBufferSize), 0, sa)
|
||||
if err != nil {
|
||||
|
|
|
@ -53,7 +53,6 @@ var (
|
|||
procGetNamedPipeInfo = modkernel32.NewProc("GetNamedPipeInfo")
|
||||
procGetNamedPipeHandleStateW = modkernel32.NewProc("GetNamedPipeHandleStateW")
|
||||
procLocalAlloc = modkernel32.NewProc("LocalAlloc")
|
||||
procRtlCopyMemory = modkernel32.NewProc("RtlCopyMemory")
|
||||
procLookupAccountNameW = modadvapi32.NewProc("LookupAccountNameW")
|
||||
procConvertSidToStringSidW = modadvapi32.NewProc("ConvertSidToStringSidW")
|
||||
procConvertStringSecurityDescriptorToSecurityDescriptorW = modadvapi32.NewProc("ConvertStringSecurityDescriptorToSecurityDescriptorW")
|
||||
|
@ -141,7 +140,7 @@ func connectNamedPipe(pipe syscall.Handle, o *syscall.Overlapped) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *securityAttributes) (handle syscall.Handle, err error) {
|
||||
func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) {
|
||||
var _p0 *uint16
|
||||
_p0, err = syscall.UTF16PtrFromString(name)
|
||||
if err != nil {
|
||||
|
@ -150,7 +149,7 @@ func createNamedPipe(name string, flags uint32, pipeMode uint32, maxInstances ui
|
|||
return _createNamedPipe(_p0, flags, pipeMode, maxInstances, outSize, inSize, defaultTimeout, sa)
|
||||
}
|
||||
|
||||
func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *securityAttributes) (handle syscall.Handle, err error) {
|
||||
func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *syscall.SecurityAttributes) (handle syscall.Handle, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0)
|
||||
handle = syscall.Handle(r0)
|
||||
if handle == syscall.InvalidHandle {
|
||||
|
@ -163,7 +162,7 @@ func _createNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances
|
|||
return
|
||||
}
|
||||
|
||||
func createFile(name string, access uint32, mode uint32, sa *securityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) {
|
||||
func createFile(name string, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) {
|
||||
var _p0 *uint16
|
||||
_p0, err = syscall.UTF16PtrFromString(name)
|
||||
if err != nil {
|
||||
|
@ -172,7 +171,7 @@ func createFile(name string, access uint32, mode uint32, sa *securityAttributes,
|
|||
return _createFile(_p0, access, mode, sa, createmode, attrs, templatefile)
|
||||
}
|
||||
|
||||
func _createFile(name *uint16, access uint32, mode uint32, sa *securityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) {
|
||||
func _createFile(name *uint16, access uint32, mode uint32, sa *syscall.SecurityAttributes, createmode uint32, attrs uint32, templatefile syscall.Handle) (handle syscall.Handle, err error) {
|
||||
r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0)
|
||||
handle = syscall.Handle(r0)
|
||||
if handle == syscall.InvalidHandle {
|
||||
|
@ -236,11 +235,6 @@ func localAlloc(uFlags uint32, length uint32) (ptr uintptr) {
|
|||
return
|
||||
}
|
||||
|
||||
func copyMemory(dst uintptr, src uintptr, length uint32) {
|
||||
syscall.Syscall(procRtlCopyMemory.Addr(), 3, uintptr(dst), uintptr(src), uintptr(length))
|
||||
return
|
||||
}
|
||||
|
||||
func lookupAccountName(systemName *uint16, accountName string, sid *byte, sidSize *uint32, refDomain *uint16, refDomainSize *uint32, sidNameUse *uint32) (err error) {
|
||||
var _p0 *uint16
|
||||
_p0, err = syscall.UTF16PtrFromString(accountName)
|
||||
|
|
|
@ -28,6 +28,8 @@ type Console interface {
|
|||
Size() (WinSize, error)
|
||||
// Fd returns the console's file descriptor
|
||||
Fd() uintptr
|
||||
// Name returns the console's file name
|
||||
Name() string
|
||||
}
|
||||
|
||||
// WinSize specifies the window size of the console
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// +build linux
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
// +build darwin freebsd linux
|
||||
// +build darwin freebsd linux solaris
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"os"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
@ -50,11 +49,7 @@ func (m *master) Close() error {
|
|||
}
|
||||
|
||||
func (m *master) Resize(ws WinSize) error {
|
||||
return ioctl(
|
||||
m.f.Fd(),
|
||||
uintptr(unix.TIOCSWINSZ),
|
||||
uintptr(unsafe.Pointer(&ws)),
|
||||
)
|
||||
return tcswinsz(m.f.Fd(), ws)
|
||||
}
|
||||
|
||||
func (m *master) ResizeFrom(c Console) error {
|
||||
|
@ -103,21 +98,17 @@ func (m *master) DisableEcho() error {
|
|||
}
|
||||
|
||||
func (m *master) Size() (WinSize, error) {
|
||||
var ws WinSize
|
||||
if err := ioctl(
|
||||
m.f.Fd(),
|
||||
uintptr(unix.TIOCGWINSZ),
|
||||
uintptr(unsafe.Pointer(&ws)),
|
||||
); err != nil {
|
||||
return ws, err
|
||||
}
|
||||
return ws, nil
|
||||
return tcgwinsz(m.f.Fd())
|
||||
}
|
||||
|
||||
func (m *master) Fd() uintptr {
|
||||
return m.f.Fd()
|
||||
}
|
||||
|
||||
func (m *master) Name() string {
|
||||
return m.f.Name()
|
||||
}
|
||||
|
||||
// checkConsole checks if the provided file is a console
|
||||
func checkConsole(f *os.File) error {
|
||||
var termios unix.Termios
|
||||
|
@ -132,3 +123,12 @@ func newMaster(f *os.File) Console {
|
|||
f: f,
|
||||
}
|
||||
}
|
||||
|
||||
// SaneTerminal sets the necessary tty_ioctl(4)s to ensure that a pty pair
|
||||
// created by us acts normally. In particular, a not-very-well-known default of
|
||||
// Linux unix98 ptys is that they have +onlcr by default. While this isn't a
|
||||
// problem for terminal emulators, because we relay data from the terminal we
|
||||
// also relay that funky line discipline.
|
||||
func SaneTerminal(f *os.File) error {
|
||||
return saneTerminal(f)
|
||||
}
|
||||
|
|
|
@ -154,6 +154,13 @@ func (m *master) Fd() uintptr {
|
|||
return m.in
|
||||
}
|
||||
|
||||
// on windows, console can only be made from os.Std{in,out,err}, hence there
|
||||
// isnt a single name here we can use. Return a dummy "console" value in this
|
||||
// case should be sufficient.
|
||||
func (m *master) Name() string {
|
||||
return "console"
|
||||
}
|
||||
|
||||
// makeInputRaw puts the terminal (Windows Console) connected to the given
|
||||
// file descriptor into raw mode
|
||||
func makeInputRaw(fd uintptr, mode uint32) error {
|
||||
|
|
|
@ -16,6 +16,26 @@ func tcset(fd uintptr, p *unix.Termios) error {
|
|||
return ioctl(fd, unix.TIOCSETA, uintptr(unsafe.Pointer(p)))
|
||||
}
|
||||
|
||||
func tcgwinsz(fd uintptr) (WinSize, error) {
|
||||
var ws WinSize
|
||||
if err := ioctl(
|
||||
fd,
|
||||
uintptr(unix.TIOCGWINSZ),
|
||||
uintptr(unsafe.Pointer(&ws)),
|
||||
); err != nil {
|
||||
return ws, err
|
||||
}
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
func tcswinsz(fd uintptr, ws WinSize) error {
|
||||
return ioctl(
|
||||
fd,
|
||||
uintptr(unix.TIOCSWINSZ),
|
||||
uintptr(unsafe.Pointer(&ws)),
|
||||
)
|
||||
}
|
||||
|
||||
func ioctl(fd, flag, data uintptr) error {
|
||||
if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, flag, data); err != 0 {
|
||||
return err
|
||||
|
|
|
@ -16,6 +16,26 @@ func tcset(fd uintptr, p *unix.Termios) error {
|
|||
return ioctl(fd, unix.TIOCSETA, uintptr(unsafe.Pointer(p)))
|
||||
}
|
||||
|
||||
func tcgwinsz(fd uintptr) (WinSize, error) {
|
||||
var ws WinSize
|
||||
if err := ioctl(
|
||||
fd,
|
||||
uintptr(unix.TIOCGWINSZ),
|
||||
uintptr(unsafe.Pointer(&ws)),
|
||||
); err != nil {
|
||||
return ws, err
|
||||
}
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
func tcswinsz(fd uintptr, ws WinSize) error {
|
||||
return ioctl(
|
||||
fd,
|
||||
uintptr(unix.TIOCSWINSZ),
|
||||
uintptr(unsafe.Pointer(&ws)),
|
||||
)
|
||||
}
|
||||
|
||||
func ioctl(fd, flag, data uintptr) error {
|
||||
if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, flag, data); err != 0 {
|
||||
return err
|
||||
|
|
|
@ -8,19 +8,6 @@ import (
|
|||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func tcget(fd uintptr, p *unix.Termios) error {
|
||||
termios, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*p = *termios
|
||||
return nil
|
||||
}
|
||||
|
||||
func tcset(fd uintptr, p *unix.Termios) error {
|
||||
return unix.IoctlSetTermios(int(fd), unix.TCSETS, p)
|
||||
}
|
||||
|
||||
func ioctl(fd, flag, data uintptr) error {
|
||||
if _, _, err := unix.Syscall(unix.SYS_IOCTL, fd, flag, data); err != 0 {
|
||||
return err
|
||||
|
@ -43,25 +30,3 @@ func ptsname(f *os.File) (string, error) {
|
|||
}
|
||||
return fmt.Sprintf("/dev/pts/%d", n), nil
|
||||
}
|
||||
|
||||
func saneTerminal(f *os.File) error {
|
||||
var termios unix.Termios
|
||||
if err := tcget(f.Fd(), &termios); err != nil {
|
||||
return err
|
||||
}
|
||||
// Set -onlcr so we don't have to deal with \r.
|
||||
termios.Oflag &^= unix.ONLCR
|
||||
return tcset(f.Fd(), &termios)
|
||||
}
|
||||
|
||||
func cfmakeraw(t unix.Termios) unix.Termios {
|
||||
t.Iflag = t.Iflag & ^uint32((unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON))
|
||||
t.Oflag = t.Oflag & ^uint32(unix.OPOST)
|
||||
t.Lflag = t.Lflag & ^(uint32(unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN))
|
||||
t.Cflag = t.Cflag & ^(uint32(unix.CSIZE | unix.PARENB))
|
||||
t.Cflag = t.Cflag | unix.CS8
|
||||
t.Cc[unix.VMIN] = 1
|
||||
t.Cc[unix.VTIME] = 0
|
||||
|
||||
return t
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// +build solaris,cgo
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
//#include <stdlib.h>
|
||||
import "C"
|
||||
|
||||
// ptsname retrieves the name of the first available pts for the given master.
|
||||
func ptsname(f *os.File) (string, error) {
|
||||
ptspath, err := C.ptsname(C.int(f.Fd()))
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return C.GoString(ptspath), nil
|
||||
}
|
||||
|
||||
// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f.
|
||||
// unlockpt should be called before opening the slave side of a pty.
|
||||
func unlockpt(f *os.File) error {
|
||||
if _, err := C.grantpt(C.int(f.Fd())); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// +build solaris,!cgo
|
||||
|
||||
//
|
||||
// Implementing the functions below requires cgo support. Non-cgo stubs
|
||||
// versions are defined below to enable cross-compilation of source code
|
||||
// that depends on these functions, but the resultant cross-compiled
|
||||
// binaries cannot actually be used. If the stub function(s) below are
|
||||
// actually invoked they will display an error message and cause the
|
||||
// calling process to exit.
|
||||
//
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func ptsname(f *os.File) (string, error) {
|
||||
panic("ptsname() support requires cgo.")
|
||||
}
|
||||
|
||||
func unlockpt(f *os.File) error {
|
||||
panic("unlockpt() support requires cgo.")
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
// +build linux solaris
|
||||
|
||||
package console
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func tcget(fd uintptr, p *unix.Termios) error {
|
||||
termios, err := unix.IoctlGetTermios(int(fd), unix.TCGETS)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*p = *termios
|
||||
return nil
|
||||
}
|
||||
|
||||
func tcset(fd uintptr, p *unix.Termios) error {
|
||||
return unix.IoctlSetTermios(int(fd), unix.TCSETS, p)
|
||||
}
|
||||
|
||||
func tcgwinsz(fd uintptr) (WinSize, error) {
|
||||
var ws WinSize
|
||||
|
||||
uws, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ)
|
||||
if err != nil {
|
||||
return ws, err
|
||||
}
|
||||
|
||||
// Translate from unix.Winsize to console.WinSize
|
||||
ws.Height = uws.Row
|
||||
ws.Width = uws.Col
|
||||
ws.x = uws.Xpixel
|
||||
ws.y = uws.Ypixel
|
||||
return ws, nil
|
||||
}
|
||||
|
||||
func tcswinsz(fd uintptr, ws WinSize) error {
|
||||
// Translate from console.WinSize to unix.Winsize
|
||||
|
||||
var uws unix.Winsize
|
||||
uws.Row = ws.Height
|
||||
uws.Col = ws.Width
|
||||
uws.Xpixel = ws.x
|
||||
uws.Ypixel = ws.y
|
||||
|
||||
return unix.IoctlSetWinsize(int(fd), unix.TIOCSWINSZ, &uws)
|
||||
}
|
||||
|
||||
func saneTerminal(f *os.File) error {
|
||||
var termios unix.Termios
|
||||
if err := tcget(f.Fd(), &termios); err != nil {
|
||||
return err
|
||||
}
|
||||
// Set -onlcr so we don't have to deal with \r.
|
||||
termios.Oflag &^= unix.ONLCR
|
||||
return tcset(f.Fd(), &termios)
|
||||
}
|
||||
|
||||
func cfmakeraw(t unix.Termios) unix.Termios {
|
||||
t.Iflag = t.Iflag & ^uint32((unix.IGNBRK | unix.BRKINT | unix.PARMRK | unix.ISTRIP | unix.INLCR | unix.IGNCR | unix.ICRNL | unix.IXON))
|
||||
t.Oflag = t.Oflag & ^uint32(unix.OPOST)
|
||||
t.Lflag = t.Lflag & ^(uint32(unix.ECHO | unix.ECHONL | unix.ICANON | unix.ISIG | unix.IEXTEN))
|
||||
t.Cflag = t.Cflag & ^(uint32(unix.CSIZE | unix.PARENB))
|
||||
t.Cflag = t.Cflag | unix.CS8
|
||||
t.Cc[unix.VMIN] = 1
|
||||
t.Cc[unix.VTIME] = 0
|
||||
|
||||
return t
|
||||
}
|
|
@ -10,10 +10,65 @@ metadata storage.
|
|||
|
||||
Please see https://github.com/opencontainers/specs/issues/11 for more details.
|
||||
|
||||
## Building Proto Package
|
||||
## Manifest Format
|
||||
|
||||
A continuity manifest encodes filesystem metadata in Protocol Buffers.
|
||||
Please refer to [proto/manifest.proto](proto/manifest.proto).
|
||||
|
||||
## Usage
|
||||
|
||||
Build:
|
||||
|
||||
```console
|
||||
$ make
|
||||
```
|
||||
|
||||
Create a manifest (of this repo itself):
|
||||
|
||||
```console
|
||||
$ ./bin/continuity build . > /tmp/a.pb
|
||||
```
|
||||
|
||||
Dump a manifest:
|
||||
|
||||
```console
|
||||
$ ./bin/continuity ls /tmp/a.pb
|
||||
...
|
||||
-rw-rw-r-- 270 B /.gitignore
|
||||
-rw-rw-r-- 88 B /.mailmap
|
||||
-rw-rw-r-- 187 B /.travis.yml
|
||||
-rw-rw-r-- 359 B /AUTHORS
|
||||
-rw-rw-r-- 11 kB /LICENSE
|
||||
-rw-rw-r-- 1.5 kB /Makefile
|
||||
...
|
||||
-rw-rw-r-- 986 B /testutil_test.go
|
||||
drwxrwxr-x 0 B /version
|
||||
-rw-rw-r-- 478 B /version/version.go
|
||||
```
|
||||
|
||||
Verify a manifest:
|
||||
|
||||
```console
|
||||
$ ./bin/continuity verify . /tmp/a.pb
|
||||
```
|
||||
|
||||
Break the directory and restore using the manifest:
|
||||
```console
|
||||
$ chmod 777 Makefile
|
||||
$ ./bin/continuity verify . /tmp/a.pb
|
||||
2017/06/23 08:00:34 error verifying manifest: resource "/Makefile" has incorrect mode: -rwxrwxrwx != -rw-rw-r--
|
||||
$ ./bin/continuity apply . /tmp/a.pb
|
||||
$ stat -c %a Makefile
|
||||
664
|
||||
$ ./bin/continuity verify . /tmp/a.pb
|
||||
```
|
||||
|
||||
|
||||
## Contribution Guide
|
||||
### Building Proto Package
|
||||
|
||||
If you change the proto file you will need to rebuild the generated Go with `go generate`.
|
||||
|
||||
```
|
||||
go generate ./proto
|
||||
```console
|
||||
$ go generate ./proto
|
||||
```
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
package sysx
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
const (
|
||||
AtSymlinkNofollow = unix.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) error {
|
||||
return unix.Fchmodat(dirfd, path, mode, flags)
|
||||
}
|
|
@ -5,5 +5,7 @@ package sysx
|
|||
// $ GOOS=linux GOARCH=amd64 ./generate.sh copy
|
||||
// $ GOOS=linux GOARCH=arm ./generate.sh copy
|
||||
// $ GOOS=linux GOARCH=arm64 ./generate.sh copy
|
||||
// $ GOOS=linux GOARCH=ppc64le ./generate.sh copy
|
||||
// $ GOOS=linux GOARCH=s390x ./generate.sh copy
|
||||
|
||||
//sys CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error)
|
||||
|
|
20
vendor/github.com/containerd/continuity/sysx/copy_linux_ppc64le.go
generated
vendored
Normal file
20
vendor/github.com/containerd/continuity/sysx/copy_linux_ppc64le.go
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
// mksyscall.pl copy_linux.go
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
// mksyscall.pl copy_linux.go
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func CopyFileRange(fdin uintptr, offin *int64, fdout uintptr, offout *int64, len int, flags int) (n int, err error) {
|
||||
r0, _, e1 := syscall.Syscall6(SYS_COPY_FILE_RANGE, uintptr(fdin), uintptr(unsafe.Pointer(offin)), uintptr(fdout), uintptr(unsafe.Pointer(offout)), uintptr(len), uintptr(flags))
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package sysx
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// This should actually be a set that contains ENOENT and EPERM
|
||||
const ENODATA = syscall.ENOENT
|
7
vendor/github.com/containerd/continuity/sysx/sysnum_linux_ppc64le.go
generated
vendored
Normal file
7
vendor/github.com/containerd/continuity/sysx/sysnum_linux_ppc64le.go
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
package sysx
|
||||
|
||||
const (
|
||||
// SYS_COPYFILERANGE defined in Kernel 4.5+
|
||||
// Number defined in /usr/include/asm/unistd_64.h
|
||||
SYS_COPY_FILE_RANGE = 379
|
||||
)
|
|
@ -0,0 +1,7 @@
|
|||
package sysx
|
||||
|
||||
const (
|
||||
// SYS_COPYFILERANGE defined in Kernel 4.5+
|
||||
// Number defined in /usr/include/asm/unistd_64.h
|
||||
SYS_COPY_FILE_RANGE = 375
|
||||
)
|
|
@ -9,45 +9,4 @@ import (
|
|||
// it is also not widely used. It is not exposed at all by the
|
||||
// Go syscall package, so we need to implement directly eventually.
|
||||
|
||||
var unsupported error = errors.New("extended attributes unsupported on FreeBSD")
|
||||
|
||||
// Listxattr calls syscall listxattr and reads all content
|
||||
// and returns a string array
|
||||
func Listxattr(path string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// Removexattr calls syscall removexattr
|
||||
func Removexattr(path string, attr string) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// Setxattr calls syscall setxattr
|
||||
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// Getxattr calls syscall getxattr
|
||||
func Getxattr(path, attr string) ([]byte, error) {
|
||||
return []byte{}, nil
|
||||
}
|
||||
|
||||
// LListxattr lists xattrs, not following symlinks
|
||||
func LListxattr(path string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// LRemovexattr removes an xattr, not following symlinks
|
||||
func LRemovexattr(path string, attr string) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// LSetxattr sets an xattr, not following symlinks
|
||||
func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// LGetxattr gets an xattr, not following symlinks
|
||||
func LGetxattr(path, attr string) ([]byte, error) {
|
||||
return []byte{}, nil
|
||||
}
|
||||
var unsupported = errors.New("extended attributes unsupported on FreeBSD")
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package sysx
|
||||
|
||||
import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Initial stub version for Solaris. Solaris has a different
|
||||
// syscall API from Darwin and Linux for extended attributes;
|
||||
// it is also not widely used. It is not exposed at all by the
|
||||
// Go syscall package, so we need to implement directly eventually.
|
||||
|
||||
var unsupported = errors.New("extended attributes unsupported on Solaris")
|
|
@ -0,0 +1,44 @@
|
|||
// +build freebsd solaris
|
||||
|
||||
package sysx
|
||||
|
||||
// Listxattr calls syscall listxattr and reads all content
|
||||
// and returns a string array
|
||||
func Listxattr(path string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// Removexattr calls syscall removexattr
|
||||
func Removexattr(path string, attr string) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// Setxattr calls syscall setxattr
|
||||
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// Getxattr calls syscall getxattr
|
||||
func Getxattr(path, attr string) ([]byte, error) {
|
||||
return []byte{}, unsupported
|
||||
}
|
||||
|
||||
// LListxattr lists xattrs, not following symlinks
|
||||
func LListxattr(path string) ([]string, error) {
|
||||
return []string{}, nil
|
||||
}
|
||||
|
||||
// LRemovexattr removes an xattr, not following symlinks
|
||||
func LRemovexattr(path string, attr string) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// LSetxattr sets an xattr, not following symlinks
|
||||
func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return unsupported
|
||||
}
|
||||
|
||||
// LGetxattr gets an xattr, not following symlinks
|
||||
func LGetxattr(path, attr string) ([]byte, error) {
|
||||
return []byte{}, nil
|
||||
}
|
|
@ -15,6 +15,7 @@ const O_PATH = 010000000
|
|||
|
||||
type handle struct {
|
||||
f *os.File
|
||||
fd uintptr
|
||||
dev uint64
|
||||
ino uint64
|
||||
closeOnce sync.Once
|
||||
|
@ -27,10 +28,13 @@ func getHandle(fn string) (*handle, error) {
|
|||
return nil, errors.Wrapf(err, "failed to open %v with O_PATH", fn)
|
||||
}
|
||||
|
||||
var stat syscall.Stat_t
|
||||
if err := syscall.Fstat(int(f.Fd()), &stat); err != nil {
|
||||
var (
|
||||
stat syscall.Stat_t
|
||||
fd = f.Fd()
|
||||
)
|
||||
if err := syscall.Fstat(int(fd), &stat); err != nil {
|
||||
f.Close()
|
||||
return nil, errors.Wrapf(err, "failed to stat handle %v", f.Fd())
|
||||
return nil, errors.Wrapf(err, "failed to stat handle %v", fd)
|
||||
}
|
||||
|
||||
h := &handle{
|
||||
|
@ -38,6 +42,7 @@ func getHandle(fn string) (*handle, error) {
|
|||
name: fn,
|
||||
dev: uint64(stat.Dev),
|
||||
ino: stat.Ino,
|
||||
fd: fd,
|
||||
}
|
||||
|
||||
// check /proc just in case
|
||||
|
@ -50,7 +55,7 @@ func getHandle(fn string) (*handle, error) {
|
|||
}
|
||||
|
||||
func (h *handle) procPath() string {
|
||||
return fmt.Sprintf("/proc/self/fd/%d", h.f.Fd())
|
||||
return fmt.Sprintf("/proc/self/fd/%d", h.fd)
|
||||
}
|
||||
|
||||
func (h *handle) Name() string {
|
||||
|
|
|
@ -4,8 +4,6 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
type IO interface {
|
||||
|
@ -21,7 +19,7 @@ type StartCloser interface {
|
|||
}
|
||||
|
||||
// NewPipeIO creates pipe pairs to be used with runc
|
||||
func NewPipeIO(uid, gid int) (i IO, err error) {
|
||||
func NewPipeIO() (i IO, err error) {
|
||||
var pipes []*pipe
|
||||
// cleanup in case of an error
|
||||
defer func() {
|
||||
|
@ -31,19 +29,19 @@ func NewPipeIO(uid, gid int) (i IO, err error) {
|
|||
}
|
||||
}
|
||||
}()
|
||||
stdin, err := newPipe(uid, gid)
|
||||
stdin, err := newPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pipes = append(pipes, stdin)
|
||||
|
||||
stdout, err := newPipe(uid, gid)
|
||||
stdout, err := newPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pipes = append(pipes, stdout)
|
||||
|
||||
stderr, err := newPipe(uid, gid)
|
||||
stderr, err := newPipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -56,17 +54,11 @@ func NewPipeIO(uid, gid int) (i IO, err error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
func newPipe(uid, gid int) (*pipe, error) {
|
||||
func newPipe() (*pipe, error) {
|
||||
r, w, err := os.Pipe()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := unix.Fchown(int(r.Fd()), uid, gid); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := unix.Fchown(int(w.Fd()), uid, gid); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &pipe{
|
||||
r: r,
|
||||
w: w,
|
||||
|
@ -163,3 +155,47 @@ func (s *stdio) Stdout() io.ReadCloser {
|
|||
func (s *stdio) Stderr() io.ReadCloser {
|
||||
return os.Stderr
|
||||
}
|
||||
|
||||
// NewNullIO returns IO setup for /dev/null use with runc
|
||||
func NewNullIO() (IO, error) {
|
||||
f, err := os.Open(os.DevNull)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &nullIO{
|
||||
devNull: f,
|
||||
}, nil
|
||||
}
|
||||
|
||||
type nullIO struct {
|
||||
devNull *os.File
|
||||
}
|
||||
|
||||
func (n *nullIO) Close() error {
|
||||
// this should be closed after start but if not
|
||||
// make sure we close the file but don't return the error
|
||||
n.devNull.Close()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *nullIO) Stdin() io.WriteCloser {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *nullIO) Stdout() io.ReadCloser {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *nullIO) Stderr() io.ReadCloser {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (n *nullIO) Set(c *exec.Cmd) {
|
||||
// don't set STDIN here
|
||||
c.Stdout = n.devNull
|
||||
c.Stderr = n.devNull
|
||||
}
|
||||
|
||||
func (n *nullIO) CloseAfterStart() error {
|
||||
return n.devNull.Close()
|
||||
}
|
||||
|
|
|
@ -3,10 +3,17 @@ package runc
|
|||
import (
|
||||
"os/exec"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
var Monitor ProcessMonitor = &defaultMonitor{}
|
||||
|
||||
type Exit struct {
|
||||
Timestamp time.Time
|
||||
Pid int
|
||||
Status int
|
||||
}
|
||||
|
||||
// ProcessMonitor is an interface for process monitoring
|
||||
//
|
||||
// It allows daemons using go-runc to have a SIGCHLD handler
|
||||
|
@ -15,40 +22,39 @@ var Monitor ProcessMonitor = &defaultMonitor{}
|
|||
// These methods should match the methods exposed by exec.Cmd to provide
|
||||
// a consistent experience for the caller
|
||||
type ProcessMonitor interface {
|
||||
Output(*exec.Cmd) ([]byte, error)
|
||||
CombinedOutput(*exec.Cmd) ([]byte, error)
|
||||
Run(*exec.Cmd) error
|
||||
Start(*exec.Cmd) error
|
||||
Wait(*exec.Cmd) (int, error)
|
||||
Start(*exec.Cmd) (chan Exit, error)
|
||||
Wait(*exec.Cmd, chan Exit) (int, error)
|
||||
}
|
||||
|
||||
type defaultMonitor struct {
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) Output(c *exec.Cmd) ([]byte, error) {
|
||||
return c.Output()
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) CombinedOutput(c *exec.Cmd) ([]byte, error) {
|
||||
return c.CombinedOutput()
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) Run(c *exec.Cmd) error {
|
||||
return c.Run()
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) Start(c *exec.Cmd) error {
|
||||
return c.Start()
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) Wait(c *exec.Cmd) (int, error) {
|
||||
if err := c.Wait(); err != nil {
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
if status, ok := exitErr.Sys().(syscall.WaitStatus); ok {
|
||||
return status.ExitStatus(), nil
|
||||
func (m *defaultMonitor) Start(c *exec.Cmd) (chan Exit, error) {
|
||||
if err := c.Start(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ec := make(chan Exit, 1)
|
||||
go func() {
|
||||
var status int
|
||||
if err := c.Wait(); err != nil {
|
||||
status = 255
|
||||
if exitErr, ok := err.(*exec.ExitError); ok {
|
||||
if ws, ok := exitErr.Sys().(syscall.WaitStatus); ok {
|
||||
status = ws.ExitStatus()
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1, err
|
||||
}
|
||||
return 0, nil
|
||||
ec <- Exit{
|
||||
Timestamp: time.Now(),
|
||||
Pid: c.Process.Pid,
|
||||
Status: status,
|
||||
}
|
||||
close(ec)
|
||||
}()
|
||||
return ec, nil
|
||||
}
|
||||
|
||||
func (m *defaultMonitor) Wait(c *exec.Cmd, ec chan Exit) (int, error) {
|
||||
e := <-ec
|
||||
return e.Status, nil
|
||||
}
|
||||
|
|
|
@ -41,12 +41,12 @@ type Runc struct {
|
|||
PdeathSignal syscall.Signal
|
||||
Setpgid bool
|
||||
Criu string
|
||||
SystemdCgroup string
|
||||
SystemdCgroup bool
|
||||
}
|
||||
|
||||
// List returns all containers created inside the provided runc root directory
|
||||
func (r *Runc) List(context context.Context) ([]*Container, error) {
|
||||
data, err := Monitor.Output(r.command(context, "list", "--format=json"))
|
||||
data, err := cmdOutput(r.command(context, "list", "--format=json"), false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ func (r *Runc) List(context context.Context) ([]*Container, error) {
|
|||
|
||||
// State returns the state for the container provided by id
|
||||
func (r *Runc) State(context context.Context, id string) (*Container, error) {
|
||||
data, err := Monitor.CombinedOutput(r.command(context, "state", id))
|
||||
data, err := cmdOutput(r.command(context, "state", id), true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s: %s", err, data)
|
||||
}
|
||||
|
@ -128,13 +128,14 @@ func (r *Runc) Create(context context.Context, id, bundle string, opts *CreateOp
|
|||
cmd.ExtraFiles = opts.ExtraFiles
|
||||
|
||||
if cmd.Stdout == nil && cmd.Stderr == nil {
|
||||
data, err := Monitor.CombinedOutput(cmd)
|
||||
data, err := cmdOutput(cmd, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %s", err, data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err := Monitor.Start(cmd); err != nil {
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if opts != nil && opts.IO != nil {
|
||||
|
@ -144,7 +145,10 @@ func (r *Runc) Create(context context.Context, id, bundle string, opts *CreateOp
|
|||
}
|
||||
}
|
||||
}
|
||||
_, err := Monitor.Wait(cmd)
|
||||
status, err := Monitor.Wait(cmd, ec)
|
||||
if err == nil && status != 0 {
|
||||
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -203,13 +207,14 @@ func (r *Runc) Exec(context context.Context, id string, spec specs.Process, opts
|
|||
opts.Set(cmd)
|
||||
}
|
||||
if cmd.Stdout == nil && cmd.Stderr == nil {
|
||||
data, err := Monitor.CombinedOutput(cmd)
|
||||
data, err := cmdOutput(cmd, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %s", err, data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
if err := Monitor.Start(cmd); err != nil {
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if opts != nil && opts.IO != nil {
|
||||
|
@ -219,7 +224,10 @@ func (r *Runc) Exec(context context.Context, id string, spec specs.Process, opts
|
|||
}
|
||||
}
|
||||
}
|
||||
_, err = Monitor.Wait(cmd)
|
||||
status, err := Monitor.Wait(cmd, ec)
|
||||
if err == nil && status != 0 {
|
||||
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -238,10 +246,11 @@ func (r *Runc) Run(context context.Context, id, bundle string, opts *CreateOpts)
|
|||
if opts != nil {
|
||||
opts.Set(cmd)
|
||||
}
|
||||
if err := Monitor.Start(cmd); err != nil {
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
return Monitor.Wait(cmd)
|
||||
return Monitor.Wait(cmd, ec)
|
||||
}
|
||||
|
||||
type DeleteOpts struct {
|
||||
|
@ -294,13 +303,14 @@ func (r *Runc) Stats(context context.Context, id string) (*Stats, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
rd.Close()
|
||||
Monitor.Wait(cmd)
|
||||
}()
|
||||
if err := Monitor.Start(cmd); err != nil {
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer func() {
|
||||
rd.Close()
|
||||
Monitor.Wait(cmd, ec)
|
||||
}()
|
||||
var e Event
|
||||
if err := json.NewDecoder(rd).Decode(&e); err != nil {
|
||||
return nil, err
|
||||
|
@ -315,7 +325,8 @@ func (r *Runc) Events(context context.Context, id string, interval time.Duration
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := Monitor.Start(cmd); err != nil {
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
rd.Close()
|
||||
return nil, err
|
||||
}
|
||||
|
@ -327,7 +338,7 @@ func (r *Runc) Events(context context.Context, id string, interval time.Duration
|
|||
defer func() {
|
||||
close(c)
|
||||
rd.Close()
|
||||
Monitor.Wait(cmd)
|
||||
Monitor.Wait(cmd, ec)
|
||||
}()
|
||||
for {
|
||||
var e Event
|
||||
|
@ -358,7 +369,7 @@ func (r *Runc) Resume(context context.Context, id string) error {
|
|||
|
||||
// Ps lists all the processes inside the container returning their pids
|
||||
func (r *Runc) Ps(context context.Context, id string) ([]int, error) {
|
||||
data, err := Monitor.CombinedOutput(r.command(context, "ps", "--format", "json", id))
|
||||
data, err := cmdOutput(r.command(context, "ps", "--format", "json", id), true)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("%s: %s", err, data)
|
||||
}
|
||||
|
@ -505,7 +516,8 @@ func (r *Runc) Restore(context context.Context, id, bundle string, opts *Restore
|
|||
if opts != nil {
|
||||
opts.Set(cmd)
|
||||
}
|
||||
if err := Monitor.Start(cmd); err != nil {
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
if opts != nil && opts.IO != nil {
|
||||
|
@ -515,7 +527,7 @@ func (r *Runc) Restore(context context.Context, id, bundle string, opts *Restore
|
|||
}
|
||||
}
|
||||
}
|
||||
return Monitor.Wait(cmd)
|
||||
return Monitor.Wait(cmd, ec)
|
||||
}
|
||||
|
||||
// Update updates the current container with the provided resource spec
|
||||
|
@ -540,7 +552,7 @@ type Version struct {
|
|||
|
||||
// Version returns the runc and runtime-spec versions
|
||||
func (r *Runc) Version(context context.Context) (Version, error) {
|
||||
data, err := Monitor.Output(r.command(context, "--version"))
|
||||
data, err := cmdOutput(r.command(context, "--version"), false)
|
||||
if err != nil {
|
||||
return Version{}, err
|
||||
}
|
||||
|
@ -596,8 +608,8 @@ func (r *Runc) args() (out []string) {
|
|||
if r.Criu != "" {
|
||||
out = append(out, "--criu", r.Criu)
|
||||
}
|
||||
if r.SystemdCgroup != "" {
|
||||
out = append(out, "--systemd-cgroup", r.SystemdCgroup)
|
||||
if r.SystemdCgroup {
|
||||
out = append(out, "--systemd-cgroup")
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
@ -608,11 +620,39 @@ func (r *Runc) args() (out []string) {
|
|||
// <stderr>
|
||||
func (r *Runc) runOrError(cmd *exec.Cmd) error {
|
||||
if cmd.Stdout != nil || cmd.Stderr != nil {
|
||||
return Monitor.Run(cmd)
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
status, err := Monitor.Wait(cmd, ec)
|
||||
if err == nil && status != 0 {
|
||||
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
|
||||
}
|
||||
return err
|
||||
}
|
||||
data, err := Monitor.CombinedOutput(cmd)
|
||||
data, err := cmdOutput(cmd, true)
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s: %s", err, data)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func cmdOutput(cmd *exec.Cmd, combined bool) ([]byte, error) {
|
||||
var b bytes.Buffer
|
||||
|
||||
cmd.Stdout = &b
|
||||
if combined {
|
||||
cmd.Stderr = &b
|
||||
}
|
||||
ec, err := Monitor.Start(cmd)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
status, err := Monitor.Wait(cmd, ec)
|
||||
if err == nil && status != 0 {
|
||||
err = fmt.Errorf("%s did not terminate sucessfully", cmd.Args[0])
|
||||
}
|
||||
|
||||
return b.Bytes(), err
|
||||
}
|
||||
|
|
|
@ -12,21 +12,19 @@ import (
|
|||
func HumanDuration(d time.Duration) string {
|
||||
if seconds := int(d.Seconds()); seconds < 1 {
|
||||
return "Less than a second"
|
||||
} else if seconds == 1 {
|
||||
return "1 second"
|
||||
} else if seconds < 60 {
|
||||
return fmt.Sprintf("%d seconds", seconds)
|
||||
} else if minutes := int(d.Minutes()); minutes == 1 {
|
||||
return "About a minute"
|
||||
} else if minutes < 46 {
|
||||
} else if minutes < 60 {
|
||||
return fmt.Sprintf("%d minutes", minutes)
|
||||
} else if hours := int(d.Hours() + 0.5); hours == 1 {
|
||||
} else if hours := int(d.Hours()); hours == 1 {
|
||||
return "About an hour"
|
||||
} else if hours < 48 {
|
||||
return fmt.Sprintf("%d hours", hours)
|
||||
} else if hours < 24*7*2 {
|
||||
return fmt.Sprintf("%d days", hours/24)
|
||||
} else if hours < 24*30*2 {
|
||||
} else if hours < 24*30*3 {
|
||||
return fmt.Sprintf("%d weeks", hours/24/7)
|
||||
} else if hours < 24*365*2 {
|
||||
return fmt.Sprintf("%d months", hours/24/30)
|
||||
|
|
|
@ -37,40 +37,28 @@ var (
|
|||
var decimapAbbrs = []string{"B", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"}
|
||||
var binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"}
|
||||
|
||||
func getSizeAndUnit(size float64, base float64, _map []string) (float64, string) {
|
||||
// CustomSize returns a human-readable approximation of a size
|
||||
// using custom format.
|
||||
func CustomSize(format string, size float64, base float64, _map []string) string {
|
||||
i := 0
|
||||
unitsLimit := len(_map) - 1
|
||||
for size >= base && i < unitsLimit {
|
||||
size = size / base
|
||||
i++
|
||||
}
|
||||
return size, _map[i]
|
||||
}
|
||||
|
||||
// CustomSize returns a human-readable approximation of a size
|
||||
// using custom format.
|
||||
func CustomSize(format string, size float64, base float64, _map []string) string {
|
||||
size, unit := getSizeAndUnit(size, base, _map)
|
||||
return fmt.Sprintf(format, size, unit)
|
||||
}
|
||||
|
||||
// HumanSizeWithPrecision allows the size to be in any precision,
|
||||
// instead of 4 digit precision used in units.HumanSize.
|
||||
func HumanSizeWithPrecision(size float64, precision int) string {
|
||||
size, unit := getSizeAndUnit(size, 1000.0, decimapAbbrs)
|
||||
return fmt.Sprintf("%.*g%s", precision, size, unit)
|
||||
return fmt.Sprintf(format, size, _map[i])
|
||||
}
|
||||
|
||||
// HumanSize returns a human-readable approximation of a size
|
||||
// capped at 4 valid numbers (eg. "2.746 MB", "796 KB").
|
||||
func HumanSize(size float64) string {
|
||||
return HumanSizeWithPrecision(size, 4)
|
||||
return CustomSize("%.4g %s", size, 1000.0, decimapAbbrs)
|
||||
}
|
||||
|
||||
// BytesSize returns a human-readable size in bytes, kibibytes,
|
||||
// mebibytes, gibibytes, or tebibytes (eg. "44kiB", "17MiB").
|
||||
func BytesSize(size float64) string {
|
||||
return CustomSize("%.4g%s", size, 1024.0, binaryAbbrs)
|
||||
return CustomSize("%.4g %s", size, 1024.0, binaryAbbrs)
|
||||
}
|
||||
|
||||
// FromHumanSize returns an integer from a human-readable specification of a
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
|
||||
#define _GNU_SOURCE
|
||||
#include <endian.h>
|
||||
#include <errno.h>
|
||||
|
@ -19,6 +20,8 @@
|
|||
#include <sys/prctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
|
||||
#include <linux/limits.h>
|
||||
#include <linux/netlink.h>
|
||||
|
@ -64,7 +67,13 @@ struct clone_t {
|
|||
|
||||
struct nlconfig_t {
|
||||
char *data;
|
||||
|
||||
/* Process settings. */
|
||||
uint32_t cloneflags;
|
||||
char *oom_score_adj;
|
||||
size_t oom_score_adj_len;
|
||||
|
||||
/* User namespace settings.*/
|
||||
char *uidmap;
|
||||
size_t uidmap_len;
|
||||
char *gidmap;
|
||||
|
@ -72,9 +81,13 @@ struct nlconfig_t {
|
|||
char *namespaces;
|
||||
size_t namespaces_len;
|
||||
uint8_t is_setgroup;
|
||||
|
||||
/* Rootless container settings.*/
|
||||
uint8_t is_rootless;
|
||||
char *oom_score_adj;
|
||||
size_t oom_score_adj_len;
|
||||
char *uidmappath;
|
||||
size_t uidmappath_len;
|
||||
char *gidmappath;
|
||||
size_t gidmappath_len;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -89,6 +102,8 @@ struct nlconfig_t {
|
|||
#define SETGROUP_ATTR 27285
|
||||
#define OOM_SCORE_ADJ_ATTR 27286
|
||||
#define ROOTLESS_ATTR 27287
|
||||
#define UIDMAPPATH_ATTR 27288
|
||||
#define GIDMAPPATH_ATTR 27289
|
||||
|
||||
/*
|
||||
* Use the raw syscall for versions of glibc which don't include a function for
|
||||
|
@ -191,22 +206,96 @@ static void update_setgroups(int pid, enum policy_t setgroup)
|
|||
}
|
||||
}
|
||||
|
||||
static void update_uidmap(int pid, char *map, size_t map_len)
|
||||
static int try_mapping_tool(const char *app, int pid, char *map, size_t map_len)
|
||||
{
|
||||
if (map == NULL || map_len <= 0)
|
||||
return;
|
||||
int child;
|
||||
|
||||
if (write_file(map, map_len, "/proc/%d/uid_map", pid) < 0)
|
||||
bail("failed to update /proc/%d/uid_map", pid);
|
||||
/*
|
||||
* If @app is NULL, execve will segfault. Just check it here and bail (if
|
||||
* we're in this path, the caller is already getting desparate and there
|
||||
* isn't a backup to this failing). This usually would be a configuration
|
||||
* or programming issue.
|
||||
*/
|
||||
if (!app)
|
||||
bail("mapping tool not present");
|
||||
|
||||
child = fork();
|
||||
if (child < 0)
|
||||
bail("failed to fork");
|
||||
|
||||
if (!child) {
|
||||
#define MAX_ARGV 20
|
||||
char *argv[MAX_ARGV];
|
||||
char *envp[] = {NULL};
|
||||
char pid_fmt[16];
|
||||
int argc = 0;
|
||||
char *next;
|
||||
|
||||
snprintf(pid_fmt, 16, "%d", pid);
|
||||
|
||||
argv[argc++] = (char *) app;
|
||||
argv[argc++] = pid_fmt;
|
||||
/*
|
||||
* Convert the map string into a list of argument that
|
||||
* newuidmap/newgidmap can understand.
|
||||
*/
|
||||
|
||||
while (argc < MAX_ARGV) {
|
||||
if (*map == '\0') {
|
||||
argv[argc++] = NULL;
|
||||
break;
|
||||
}
|
||||
argv[argc++] = map;
|
||||
next = strpbrk(map, "\n ");
|
||||
if (next == NULL)
|
||||
break;
|
||||
*next++ = '\0';
|
||||
map = next + strspn(next, "\n ");
|
||||
}
|
||||
|
||||
execve(app, argv, envp);
|
||||
bail("failed to execv");
|
||||
} else {
|
||||
int status;
|
||||
|
||||
while (true) {
|
||||
if (waitpid(child, &status, 0) < 0) {
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
bail("failed to waitpid");
|
||||
}
|
||||
if (WIFEXITED(status) || WIFSIGNALED(status))
|
||||
return WEXITSTATUS(status);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void update_gidmap(int pid, char *map, size_t map_len)
|
||||
static void update_uidmap(const char *path, int pid, char *map, size_t map_len)
|
||||
{
|
||||
if (map == NULL || map_len <= 0)
|
||||
return;
|
||||
|
||||
if (write_file(map, map_len, "/proc/%d/gid_map", pid) < 0)
|
||||
bail("failed to update /proc/%d/gid_map", pid);
|
||||
if (write_file(map, map_len, "/proc/%d/uid_map", pid) < 0) {
|
||||
if (errno != EPERM)
|
||||
bail("failed to update /proc/%d/uid_map", pid);
|
||||
if (try_mapping_tool(path, pid, map, map_len))
|
||||
bail("failed to use newuid map on %d", pid);
|
||||
}
|
||||
}
|
||||
|
||||
static void update_gidmap(const char *path, int pid, char *map, size_t map_len)
|
||||
{
|
||||
if (map == NULL || map_len <= 0)
|
||||
return;
|
||||
|
||||
if (write_file(map, map_len, "/proc/%d/gid_map", pid) < 0) {
|
||||
if (errno != EPERM)
|
||||
bail("failed to update /proc/%d/gid_map", pid);
|
||||
if (try_mapping_tool(path, pid, map, map_len))
|
||||
bail("failed to use newgid map on %d", pid);
|
||||
}
|
||||
}
|
||||
|
||||
static void update_oom_score_adj(char *data, size_t len)
|
||||
|
@ -350,6 +439,14 @@ static void nl_parse(int fd, struct nlconfig_t *config)
|
|||
config->gidmap = current;
|
||||
config->gidmap_len = payload_len;
|
||||
break;
|
||||
case UIDMAPPATH_ATTR:
|
||||
config->uidmappath = current;
|
||||
config->uidmappath_len = payload_len;
|
||||
break;
|
||||
case GIDMAPPATH_ATTR:
|
||||
config->gidmappath = current;
|
||||
config->gidmappath_len = payload_len;
|
||||
break;
|
||||
case SETGROUP_ATTR:
|
||||
config->is_setgroup = readint8(current);
|
||||
break;
|
||||
|
@ -542,7 +639,7 @@ void nsexec(void)
|
|||
*/
|
||||
case JUMP_PARENT: {
|
||||
int len;
|
||||
pid_t child;
|
||||
pid_t child, first_child = -1;
|
||||
char buf[JSON_MAX];
|
||||
bool ready = false;
|
||||
|
||||
|
@ -596,8 +693,8 @@ void nsexec(void)
|
|||
update_setgroups(child, SETGROUPS_DENY);
|
||||
|
||||
/* Set up mappings. */
|
||||
update_uidmap(child, config.uidmap, config.uidmap_len);
|
||||
update_gidmap(child, config.gidmap, config.gidmap_len);
|
||||
update_uidmap(config.uidmappath, child, config.uidmap, config.uidmap_len);
|
||||
update_gidmap(config.gidmappath, child, config.gidmap, config.gidmap_len);
|
||||
|
||||
s = SYNC_USERMAP_ACK;
|
||||
if (write(syncfd, &s, sizeof(s)) != sizeof(s)) {
|
||||
|
@ -606,18 +703,18 @@ void nsexec(void)
|
|||
}
|
||||
break;
|
||||
case SYNC_RECVPID_PLS: {
|
||||
pid_t old = child;
|
||||
first_child = child;
|
||||
|
||||
/* Get the init_func pid. */
|
||||
if (read(syncfd, &child, sizeof(child)) != sizeof(child)) {
|
||||
kill(old, SIGKILL);
|
||||
kill(first_child, SIGKILL);
|
||||
bail("failed to sync with child: read(childpid)");
|
||||
}
|
||||
|
||||
/* Send ACK. */
|
||||
s = SYNC_RECVPID_ACK;
|
||||
if (write(syncfd, &s, sizeof(s)) != sizeof(s)) {
|
||||
kill(old, SIGKILL);
|
||||
kill(first_child, SIGKILL);
|
||||
kill(child, SIGKILL);
|
||||
bail("failed to sync with child: write(SYNC_RECVPID_ACK)");
|
||||
}
|
||||
|
@ -665,8 +762,13 @@ void nsexec(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* Send the init_func pid back to our parent. */
|
||||
len = snprintf(buf, JSON_MAX, "{\"pid\": %d}\n", child);
|
||||
/*
|
||||
* Send the init_func pid and the pid of the first child back to our parent.
|
||||
*
|
||||
* We need to send both back because we can't reap the first child we created (CLONE_PARENT).
|
||||
* It becomes the responsibility of our parent to reap the first child.
|
||||
*/
|
||||
len = snprintf(buf, JSON_MAX, "{\"pid\": %d, \"pid_first\": %d}\n", child, first_child);
|
||||
if (len < 0) {
|
||||
kill(child, SIGKILL);
|
||||
bail("unable to generate JSON for child pid");
|
||||
|
|
|
@ -2,8 +2,6 @@ package user
|
|||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -37,13 +35,6 @@ func lookupUser(filter func(u User) bool) (User, error) {
|
|||
return users[0], nil
|
||||
}
|
||||
|
||||
// CurrentUser looks up the current user by their user id in /etc/passwd. If the
|
||||
// user cannot be found (or there is no /etc/passwd file on the filesystem),
|
||||
// then CurrentUser returns an error.
|
||||
func CurrentUser() (User, error) {
|
||||
return LookupUid(unix.Getuid())
|
||||
}
|
||||
|
||||
// LookupUser looks up a user by their username in /etc/passwd. If the user
|
||||
// cannot be found (or there is no /etc/passwd file on the filesystem), then
|
||||
// LookupUser returns an error.
|
||||
|
@ -85,13 +76,6 @@ func lookupGroup(filter func(g Group) bool) (Group, error) {
|
|||
return groups[0], nil
|
||||
}
|
||||
|
||||
// CurrentGroup looks up the current user's group by their primary group id's
|
||||
// entry in /etc/passwd. If the group cannot be found (or there is no
|
||||
// /etc/group file on the filesystem), then CurrentGroup returns an error.
|
||||
func CurrentGroup() (Group, error) {
|
||||
return LookupGid(unix.Getgid())
|
||||
}
|
||||
|
||||
// LookupGroup looks up a group by its name in /etc/group. If the group cannot
|
||||
// be found (or there is no /etc/group file on the filesystem), then LookupGroup
|
||||
// returns an error.
|
||||
|
|
|
@ -5,6 +5,8 @@ package user
|
|||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// Unix-specific path to the passwd and group formatted files.
|
||||
|
@ -28,3 +30,17 @@ func GetGroupPath() (string, error) {
|
|||
func GetGroup() (io.ReadCloser, error) {
|
||||
return os.Open(unixGroupPath)
|
||||
}
|
||||
|
||||
// CurrentUser looks up the current user by their user id in /etc/passwd. If the
|
||||
// user cannot be found (or there is no /etc/passwd file on the filesystem),
|
||||
// then CurrentUser returns an error.
|
||||
func CurrentUser() (User, error) {
|
||||
return LookupUid(unix.Getuid())
|
||||
}
|
||||
|
||||
// CurrentGroup looks up the current user's group by their primary group id's
|
||||
// entry in /etc/passwd. If the group cannot be found (or there is no
|
||||
// /etc/group file on the filesystem), then CurrentGroup returns an error.
|
||||
func CurrentGroup() (Group, error) {
|
||||
return LookupGid(unix.Getgid())
|
||||
}
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
package user
|
||||
|
||||
import "io"
|
||||
import (
|
||||
"io"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func GetPasswdPath() (string, error) {
|
||||
return "", ErrUnsupported
|
||||
|
@ -19,3 +22,17 @@ func GetGroupPath() (string, error) {
|
|||
func GetGroup() (io.ReadCloser, error) {
|
||||
return nil, ErrUnsupported
|
||||
}
|
||||
|
||||
// CurrentUser looks up the current user by their user id in /etc/passwd. If the
|
||||
// user cannot be found (or there is no /etc/passwd file on the filesystem),
|
||||
// then CurrentUser returns an error.
|
||||
func CurrentUser() (User, error) {
|
||||
return LookupUid(syscall.Getuid())
|
||||
}
|
||||
|
||||
// CurrentGroup looks up the current user's group by their primary group id's
|
||||
// entry in /etc/passwd. If the group cannot be found (or there is no
|
||||
// /etc/group file on the filesystem), then CurrentGroup returns an error.
|
||||
func CurrentGroup() (Group, error) {
|
||||
return LookupGid(syscall.Getgid())
|
||||
}
|
||||
|
|
|
@ -358,8 +358,8 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (
|
|||
|
||||
// Okay, so it's numeric. We can just roll with this.
|
||||
}
|
||||
} else if len(groups) > 0 && uidErr != nil {
|
||||
// Supplementary group ids only make sense if in the implicit form for non-numeric users.
|
||||
} else if len(groups) > 0 {
|
||||
// Supplementary group ids only make sense if in the implicit form.
|
||||
user.Sgids = make([]int, len(groups))
|
||||
for i, group := range groups {
|
||||
user.Sgids[i] = group.Gid
|
||||
|
|
|
@ -19,3 +19,8 @@ github.com/docker/docker 0f5c9d301b9b1cca66b3ea0f9dec3b5317d3686d
|
|||
github.com/docker/go-units v0.2.0
|
||||
github.com/urfave/cli d53eb991652b1d438abdd34ce4bfa3ef1539108e
|
||||
golang.org/x/sys 0e0164865330d5cf1c00247be08330bf96e2f87c https://github.com/golang/sys
|
||||
|
||||
# console dependencies
|
||||
github.com/containerd/console 2ce1c681f3c3c0dfa7d0af289428d36567c9a6bc
|
||||
github.com/Azure/go-ansiterm fa152c58bc15761d0200cb75fe958b89a9d4888e
|
||||
github.com/pkg/errors v0.8.0
|
||||
|
|
|
@ -11,7 +11,7 @@ const (
|
|||
VersionPatch = 0
|
||||
|
||||
// VersionDev indicates development branch. Releases will be empty string.
|
||||
VersionDev = "-rc6-dev"
|
||||
VersionDev = ""
|
||||
)
|
||||
|
||||
// Version is the specification version that the package types support.
|
||||
|
|
|
@ -79,14 +79,6 @@ func (f Frame) Format(s fmt.State, verb rune) {
|
|||
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
|
||||
type StackTrace []Frame
|
||||
|
||||
// Format formats the stack of Frames according to the fmt.Formatter interface.
|
||||
//
|
||||
// %s lists source files for each Frame in the stack
|
||||
// %v lists the source file and line number for each Frame in the stack
|
||||
//
|
||||
// Format accepts flags that alter the printing of some verbs, as follows:
|
||||
//
|
||||
// %+v Prints filename, function, and line number for each Frame in the stack.
|
||||
func (st StackTrace) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
case 'v':
|
||||
|
|
|
@ -154,20 +154,19 @@ func (c Command) Run(ctx *Context) (err error) {
|
|||
}
|
||||
|
||||
context := NewContext(ctx.App, set, ctx)
|
||||
context.Command = c
|
||||
if checkCommandCompletions(context, c.Name) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if c.OnUsageError != nil {
|
||||
err := c.OnUsageError(context, err, false)
|
||||
err := c.OnUsageError(ctx, err, false)
|
||||
HandleExitCoder(err)
|
||||
return err
|
||||
}
|
||||
fmt.Fprintln(context.App.Writer, "Incorrect Usage:", err.Error())
|
||||
fmt.Fprintln(context.App.Writer)
|
||||
ShowCommandHelp(context, c.Name)
|
||||
fmt.Fprintln(ctx.App.Writer, "Incorrect Usage:", err.Error())
|
||||
fmt.Fprintln(ctx.App.Writer)
|
||||
ShowCommandHelp(ctx, c.Name)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -192,9 +191,9 @@ func (c Command) Run(ctx *Context) (err error) {
|
|||
if c.Before != nil {
|
||||
err = c.Before(context)
|
||||
if err != nil {
|
||||
fmt.Fprintln(context.App.Writer, err)
|
||||
fmt.Fprintln(context.App.Writer)
|
||||
ShowCommandHelp(context, c.Name)
|
||||
fmt.Fprintln(ctx.App.Writer, err)
|
||||
fmt.Fprintln(ctx.App.Writer)
|
||||
ShowCommandHelp(ctx, c.Name)
|
||||
HandleExitCoder(err)
|
||||
return err
|
||||
}
|
||||
|
@ -204,6 +203,7 @@ func (c Command) Run(ctx *Context) (err error) {
|
|||
c.Action = helpSubcommand.Action
|
||||
}
|
||||
|
||||
context.Command = c
|
||||
err = HandleAction(c.Action, context)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -56,7 +56,7 @@ func configureTransport(t1 *http.Transport) (*Transport, error) {
|
|||
}
|
||||
|
||||
// registerHTTPSProtocol calls Transport.RegisterProtocol but
|
||||
// converting panics into errors.
|
||||
// convering panics into errors.
|
||||
func registerHTTPSProtocol(t *http.Transport, rt http.RoundTripper) (err error) {
|
||||
defer func() {
|
||||
if e := recover(); e != nil {
|
||||
|
|
|
@ -87,16 +87,13 @@ type goAwayFlowError struct{}
|
|||
|
||||
func (goAwayFlowError) Error() string { return "connection exceeded flow control window size" }
|
||||
|
||||
// connError represents an HTTP/2 ConnectionError error code, along
|
||||
// with a string (for debugging) explaining why.
|
||||
//
|
||||
// connErrorReason wraps a ConnectionError with an informative error about why it occurs.
|
||||
|
||||
// Errors of this type are only returned by the frame parser functions
|
||||
// and converted into ConnectionError(Code), after stashing away
|
||||
// the Reason into the Framer's errDetail field, accessible via
|
||||
// the (*Framer).ErrorDetail method.
|
||||
// and converted into ConnectionError(ErrCodeProtocol).
|
||||
type connError struct {
|
||||
Code ErrCode // the ConnectionError error code
|
||||
Reason string // additional reason
|
||||
Code ErrCode
|
||||
Reason string
|
||||
}
|
||||
|
||||
func (e connError) Error() string {
|
||||
|
|
|
@ -52,5 +52,3 @@ func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
|
|||
func reqBodyIsNoBody(body io.ReadCloser) bool {
|
||||
return body == http.NoBody
|
||||
}
|
||||
|
||||
func go18httpNoBody() io.ReadCloser { return http.NoBody } // for tests only
|
||||
|
|
|
@ -376,16 +376,12 @@ func (s *sorter) SortStrings(ss []string) {
|
|||
// validPseudoPath reports whether v is a valid :path pseudo-header
|
||||
// value. It must be either:
|
||||
//
|
||||
// *) a non-empty string starting with '/'
|
||||
// *) a non-empty string starting with '/', but not with with "//",
|
||||
// *) the string '*', for OPTIONS requests.
|
||||
//
|
||||
// For now this is only used a quick check for deciding when to clean
|
||||
// up Opaque URLs before sending requests from the Transport.
|
||||
// See golang.org/issue/16847
|
||||
//
|
||||
// We used to enforce that the path also didn't start with "//", but
|
||||
// Google's GFE accepts such paths and Chrome sends them, so ignore
|
||||
// that part of the spec. See golang.org/issue/19103.
|
||||
func validPseudoPath(v string) bool {
|
||||
return (len(v) > 0 && v[0] == '/') || v == "*"
|
||||
return (len(v) > 0 && v[0] == '/' && (len(v) == 1 || v[1] != '/')) || v == "*"
|
||||
}
|
||||
|
|
|
@ -25,5 +25,3 @@ func reqGetBody(req *http.Request) func() (io.ReadCloser, error) {
|
|||
}
|
||||
|
||||
func reqBodyIsNoBody(io.ReadCloser) bool { return false }
|
||||
|
||||
func go18httpNoBody() io.ReadCloser { return nil } // for tests only
|
||||
|
|
|
@ -50,7 +50,7 @@ func (p *pipe) Read(d []byte) (n int, err error) {
|
|||
if p.breakErr != nil {
|
||||
return 0, p.breakErr
|
||||
}
|
||||
if p.b != nil && p.b.Len() > 0 {
|
||||
if p.b.Len() > 0 {
|
||||
return p.b.Read(d)
|
||||
}
|
||||
if p.err != nil {
|
||||
|
|
|
@ -2252,7 +2252,6 @@ type responseWriterState struct {
|
|||
wroteHeader bool // WriteHeader called (explicitly or implicitly). Not necessarily sent to user yet.
|
||||
sentHeader bool // have we sent the header frame?
|
||||
handlerDone bool // handler has finished
|
||||
dirty bool // a Write failed; don't reuse this responseWriterState
|
||||
|
||||
sentContentLen int64 // non-zero if handler set a Content-Length header
|
||||
wroteBytes int64
|
||||
|
@ -2334,7 +2333,6 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
|
|||
date: date,
|
||||
})
|
||||
if err != nil {
|
||||
rws.dirty = true
|
||||
return 0, err
|
||||
}
|
||||
if endStream {
|
||||
|
@ -2356,7 +2354,6 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
|
|||
if len(p) > 0 || endStream {
|
||||
// only send a 0 byte DATA frame if we're ending the stream.
|
||||
if err := rws.conn.writeDataFromHandler(rws.stream, p, endStream); err != nil {
|
||||
rws.dirty = true
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
|
@ -2368,9 +2365,6 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) {
|
|||
trailers: rws.trailers,
|
||||
endStream: true,
|
||||
})
|
||||
if err != nil {
|
||||
rws.dirty = true
|
||||
}
|
||||
return len(p), err
|
||||
}
|
||||
return len(p), nil
|
||||
|
@ -2510,7 +2504,7 @@ func cloneHeader(h http.Header) http.Header {
|
|||
//
|
||||
// * Handler calls w.Write or w.WriteString ->
|
||||
// * -> rws.bw (*bufio.Writer) ->
|
||||
// * (Handler might call Flush)
|
||||
// * (Handler migth call Flush)
|
||||
// * -> chunkWriter{rws}
|
||||
// * -> responseWriterState.writeChunk(p []byte)
|
||||
// * -> responseWriterState.writeChunk (most of the magic; see comment there)
|
||||
|
@ -2549,19 +2543,10 @@ func (w *responseWriter) write(lenData int, dataB []byte, dataS string) (n int,
|
|||
|
||||
func (w *responseWriter) handlerDone() {
|
||||
rws := w.rws
|
||||
dirty := rws.dirty
|
||||
rws.handlerDone = true
|
||||
w.Flush()
|
||||
w.rws = nil
|
||||
if !dirty {
|
||||
// Only recycle the pool if all prior Write calls to
|
||||
// the serverConn goroutine completed successfully. If
|
||||
// they returned earlier due to resets from the peer
|
||||
// there might still be write goroutines outstanding
|
||||
// from the serverConn referencing the rws memory. See
|
||||
// issue 20704.
|
||||
responseWriterStatePool.Put(rws)
|
||||
}
|
||||
responseWriterStatePool.Put(rws)
|
||||
}
|
||||
|
||||
// Push errors.
|
||||
|
|
|
@ -694,7 +694,7 @@ func checkConnHeaders(req *http.Request) error {
|
|||
// req.ContentLength, where 0 actually means zero (not unknown) and -1
|
||||
// means unknown.
|
||||
func actualContentLength(req *http.Request) int64 {
|
||||
if req.Body == nil || reqBodyIsNoBody(req.Body) {
|
||||
if req.Body == nil {
|
||||
return 0
|
||||
}
|
||||
if req.ContentLength != 0 {
|
||||
|
@ -725,8 +725,8 @@ func (cc *ClientConn) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||
}
|
||||
|
||||
body := req.Body
|
||||
hasBody := body != nil
|
||||
contentLen := actualContentLength(req)
|
||||
hasBody := contentLen != 0
|
||||
|
||||
// TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
|
||||
var requestedGzip bool
|
||||
|
@ -1713,27 +1713,16 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error {
|
|||
}
|
||||
// Return any padded flow control now, since we won't
|
||||
// refund it later on body reads.
|
||||
var refund int
|
||||
if pad := int(f.Length) - len(data); pad > 0 {
|
||||
refund += pad
|
||||
}
|
||||
// Return len(data) now if the stream is already closed,
|
||||
// since data will never be read.
|
||||
didReset := cs.didReset
|
||||
if didReset {
|
||||
refund += len(data)
|
||||
}
|
||||
if refund > 0 {
|
||||
cc.inflow.add(int32(refund))
|
||||
if pad := int32(f.Length) - int32(len(data)); pad > 0 {
|
||||
cs.inflow.add(pad)
|
||||
cc.inflow.add(pad)
|
||||
cc.wmu.Lock()
|
||||
cc.fr.WriteWindowUpdate(0, uint32(refund))
|
||||
if !didReset {
|
||||
cs.inflow.add(int32(refund))
|
||||
cc.fr.WriteWindowUpdate(cs.ID, uint32(refund))
|
||||
}
|
||||
cc.fr.WriteWindowUpdate(0, uint32(pad))
|
||||
cc.fr.WriteWindowUpdate(cs.ID, uint32(pad))
|
||||
cc.bw.Flush()
|
||||
cc.wmu.Unlock()
|
||||
}
|
||||
didReset := cs.didReset
|
||||
cc.mu.Unlock()
|
||||
|
||||
if len(data) > 0 && !didReset {
|
||||
|
|
|
@ -67,15 +67,6 @@ func VerifyDNSLength(verify bool) Option {
|
|||
return func(o *options) { o.verifyDNSLength = verify }
|
||||
}
|
||||
|
||||
// RemoveLeadingDots removes leading label separators. Leading runes that map to
|
||||
// dots, such as U+3002, are removed as well.
|
||||
//
|
||||
// This is the behavior suggested by the UTS #46 and is adopted by some
|
||||
// browsers.
|
||||
func RemoveLeadingDots(remove bool) Option {
|
||||
return func(o *options) { o.removeLeadingDots = remove }
|
||||
}
|
||||
|
||||
// ValidateLabels sets whether to check the mandatory label validation criteria
|
||||
// as defined in Section 5.4 of RFC 5891. This includes testing for correct use
|
||||
// of hyphens ('-'), normalization, validity of runes, and the context rules.
|
||||
|
@ -142,16 +133,14 @@ func MapForLookup() Option {
|
|||
o.mapping = validateAndMap
|
||||
StrictDomainName(true)(o)
|
||||
ValidateLabels(true)(o)
|
||||
RemoveLeadingDots(true)(o)
|
||||
}
|
||||
}
|
||||
|
||||
type options struct {
|
||||
transitional bool
|
||||
useSTD3Rules bool
|
||||
validateLabels bool
|
||||
verifyDNSLength bool
|
||||
removeLeadingDots bool
|
||||
transitional bool
|
||||
useSTD3Rules bool
|
||||
validateLabels bool
|
||||
verifyDNSLength bool
|
||||
|
||||
trie *idnaTrie
|
||||
|
||||
|
@ -251,23 +240,21 @@ var (
|
|||
|
||||
punycode = &Profile{}
|
||||
lookup = &Profile{options{
|
||||
transitional: true,
|
||||
useSTD3Rules: true,
|
||||
validateLabels: true,
|
||||
removeLeadingDots: true,
|
||||
trie: trie,
|
||||
fromPuny: validateFromPunycode,
|
||||
mapping: validateAndMap,
|
||||
bidirule: bidirule.ValidString,
|
||||
transitional: true,
|
||||
useSTD3Rules: true,
|
||||
validateLabels: true,
|
||||
trie: trie,
|
||||
fromPuny: validateFromPunycode,
|
||||
mapping: validateAndMap,
|
||||
bidirule: bidirule.ValidString,
|
||||
}}
|
||||
display = &Profile{options{
|
||||
useSTD3Rules: true,
|
||||
validateLabels: true,
|
||||
removeLeadingDots: true,
|
||||
trie: trie,
|
||||
fromPuny: validateFromPunycode,
|
||||
mapping: validateAndMap,
|
||||
bidirule: bidirule.ValidString,
|
||||
useSTD3Rules: true,
|
||||
validateLabels: true,
|
||||
trie: trie,
|
||||
fromPuny: validateFromPunycode,
|
||||
mapping: validateAndMap,
|
||||
bidirule: bidirule.ValidString,
|
||||
}}
|
||||
registration = &Profile{options{
|
||||
useSTD3Rules: true,
|
||||
|
@ -306,9 +293,7 @@ func (p *Profile) process(s string, toASCII bool) (string, error) {
|
|||
s, err = p.mapping(p, s)
|
||||
}
|
||||
// Remove leading empty labels.
|
||||
if p.removeLeadingDots {
|
||||
for ; len(s) > 0 && s[0] == '.'; s = s[1:] {
|
||||
}
|
||||
for ; len(s) > 0 && s[0] == '.'; s = s[1:] {
|
||||
}
|
||||
// It seems like we should only create this error on ToASCII, but the
|
||||
// UTS 46 conformance tests suggests we should always check this.
|
||||
|
@ -388,20 +373,23 @@ func validateRegistration(p *Profile, s string) (string, error) {
|
|||
if !norm.NFC.IsNormalString(s) {
|
||||
return s, &labelError{s, "V1"}
|
||||
}
|
||||
var err error
|
||||
for i := 0; i < len(s); {
|
||||
v, sz := trie.lookupString(s[i:])
|
||||
i += sz
|
||||
// Copy bytes not copied so far.
|
||||
switch p.simplify(info(v).category()) {
|
||||
// TODO: handle the NV8 defined in the Unicode idna data set to allow
|
||||
// for strict conformance to IDNA2008.
|
||||
case valid, deviation:
|
||||
case disallowed, mapped, unknown, ignored:
|
||||
r, _ := utf8.DecodeRuneInString(s[i:])
|
||||
return s, runeError(r)
|
||||
if err == nil {
|
||||
r, _ := utf8.DecodeRuneInString(s[i:])
|
||||
err = runeError(r)
|
||||
}
|
||||
}
|
||||
i += sz
|
||||
}
|
||||
return s, nil
|
||||
return s, err
|
||||
}
|
||||
|
||||
func validateAndMap(p *Profile, s string) (string, error) {
|
||||
|
@ -420,7 +408,7 @@ func validateAndMap(p *Profile, s string) (string, error) {
|
|||
continue
|
||||
case disallowed:
|
||||
if err == nil {
|
||||
r, _ := utf8.DecodeRuneInString(s[start:])
|
||||
r, _ := utf8.DecodeRuneInString(s[i:])
|
||||
err = runeError(r)
|
||||
}
|
||||
continue
|
||||
|
|
|
@ -39,9 +39,9 @@ var buckets = []bucket{
|
|||
}
|
||||
|
||||
// RenderEvents renders the HTML page typically served at /debug/events.
|
||||
// It does not do any auth checking. The request may be nil.
|
||||
//
|
||||
// Most users will use the Events handler.
|
||||
// It does not do any auth checking; see AuthRequest for the default auth check
|
||||
// used by the handler registered on http.DefaultServeMux.
|
||||
// req may be nil.
|
||||
func RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) {
|
||||
now := time.Now()
|
||||
data := &struct {
|
||||
|
|
|
@ -110,46 +110,30 @@ var AuthRequest = func(req *http.Request) (any, sensitive bool) {
|
|||
}
|
||||
|
||||
func init() {
|
||||
// TODO(jbd): Serve Traces from /debug/traces in the future?
|
||||
// There is no requirement for a request to be present to have traces.
|
||||
http.HandleFunc("/debug/requests", Traces)
|
||||
http.HandleFunc("/debug/events", Events)
|
||||
}
|
||||
|
||||
// Traces responds with traces from the program.
|
||||
// The package initialization registers it in http.DefaultServeMux
|
||||
// at /debug/requests.
|
||||
//
|
||||
// It performs authorization by running AuthRequest.
|
||||
func Traces(w http.ResponseWriter, req *http.Request) {
|
||||
any, sensitive := AuthRequest(req)
|
||||
if !any {
|
||||
http.Error(w, "not allowed", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
Render(w, req, sensitive)
|
||||
}
|
||||
|
||||
// Events responds with a page of events collected by EventLogs.
|
||||
// The package initialization registers it in http.DefaultServeMux
|
||||
// at /debug/events.
|
||||
//
|
||||
// It performs authorization by running AuthRequest.
|
||||
func Events(w http.ResponseWriter, req *http.Request) {
|
||||
any, sensitive := AuthRequest(req)
|
||||
if !any {
|
||||
http.Error(w, "not allowed", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
RenderEvents(w, req, sensitive)
|
||||
http.HandleFunc("/debug/requests", func(w http.ResponseWriter, req *http.Request) {
|
||||
any, sensitive := AuthRequest(req)
|
||||
if !any {
|
||||
http.Error(w, "not allowed", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
Render(w, req, sensitive)
|
||||
})
|
||||
http.HandleFunc("/debug/events", func(w http.ResponseWriter, req *http.Request) {
|
||||
any, sensitive := AuthRequest(req)
|
||||
if !any {
|
||||
http.Error(w, "not allowed", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
RenderEvents(w, req, sensitive)
|
||||
})
|
||||
}
|
||||
|
||||
// Render renders the HTML page typically served at /debug/requests.
|
||||
// It does not do any auth checking. The request may be nil.
|
||||
//
|
||||
// Most users will use the Traces handler.
|
||||
// It does not do any auth checking; see AuthRequest for the default auth check
|
||||
// used by the handler registered on http.DefaultServeMux.
|
||||
// req may be nil.
|
||||
func Render(w io.Writer, req *http.Request, sensitive bool) {
|
||||
data := &struct {
|
||||
Families []string
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build !gccgo
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
//
|
||||
// System call support for ARM, OpenBSD
|
||||
//
|
||||
|
||||
// Just jump to package syscall's implementation for all these functions.
|
||||
// The runtime may know about them.
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
B syscall·Syscall(SB)
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
B syscall·Syscall6(SB)
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
B syscall·Syscall9(SB)
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
B syscall·RawSyscall(SB)
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
B syscall·RawSyscall6(SB)
|
|
@ -0,0 +1,195 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build freebsd
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
errorspkg "errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Go implementation of C mostly found in /usr/src/sys/kern/subr_capability.c
|
||||
|
||||
const (
|
||||
// This is the version of CapRights this package understands. See C implementation for parallels.
|
||||
capRightsGoVersion = CAP_RIGHTS_VERSION_00
|
||||
capArSizeMin = CAP_RIGHTS_VERSION_00 + 2
|
||||
capArSizeMax = capRightsGoVersion + 2
|
||||
)
|
||||
|
||||
var (
|
||||
bit2idx = []int{
|
||||
-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
|
||||
4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
}
|
||||
)
|
||||
|
||||
func capidxbit(right uint64) int {
|
||||
return int((right >> 57) & 0x1f)
|
||||
}
|
||||
|
||||
func rightToIndex(right uint64) (int, error) {
|
||||
idx := capidxbit(right)
|
||||
if idx < 0 || idx >= len(bit2idx) {
|
||||
return -2, fmt.Errorf("index for right 0x%x out of range", right)
|
||||
}
|
||||
return bit2idx[idx], nil
|
||||
}
|
||||
|
||||
func caprver(right uint64) int {
|
||||
return int(right >> 62)
|
||||
}
|
||||
|
||||
func capver(rights *CapRights) int {
|
||||
return caprver(rights.Rights[0])
|
||||
}
|
||||
|
||||
func caparsize(rights *CapRights) int {
|
||||
return capver(rights) + 2
|
||||
}
|
||||
|
||||
// CapRightsSet sets the permissions in setrights in rights.
|
||||
func CapRightsSet(rights *CapRights, setrights []uint64) error {
|
||||
// This is essentially a copy of cap_rights_vset()
|
||||
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||
return fmt.Errorf("bad rights version %d", capver(rights))
|
||||
}
|
||||
|
||||
n := caparsize(rights)
|
||||
if n < capArSizeMin || n > capArSizeMax {
|
||||
return errorspkg.New("bad rights size")
|
||||
}
|
||||
|
||||
for _, right := range setrights {
|
||||
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||
return errorspkg.New("bad right version")
|
||||
}
|
||||
i, err := rightToIndex(right)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if i >= n {
|
||||
return errorspkg.New("index overflow")
|
||||
}
|
||||
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||
return errorspkg.New("index mismatch")
|
||||
}
|
||||
rights.Rights[i] |= right
|
||||
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||
return errorspkg.New("index mismatch (after assign)")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CapRightsClear clears the permissions in clearrights from rights.
|
||||
func CapRightsClear(rights *CapRights, clearrights []uint64) error {
|
||||
// This is essentially a copy of cap_rights_vclear()
|
||||
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||
return fmt.Errorf("bad rights version %d", capver(rights))
|
||||
}
|
||||
|
||||
n := caparsize(rights)
|
||||
if n < capArSizeMin || n > capArSizeMax {
|
||||
return errorspkg.New("bad rights size")
|
||||
}
|
||||
|
||||
for _, right := range clearrights {
|
||||
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||
return errorspkg.New("bad right version")
|
||||
}
|
||||
i, err := rightToIndex(right)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if i >= n {
|
||||
return errorspkg.New("index overflow")
|
||||
}
|
||||
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||
return errorspkg.New("index mismatch")
|
||||
}
|
||||
rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
|
||||
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||
return errorspkg.New("index mismatch (after assign)")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// CapRightsIsSet checks whether all the permissions in setrights are present in rights.
|
||||
func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
|
||||
// This is essentially a copy of cap_rights_is_vset()
|
||||
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||
return false, fmt.Errorf("bad rights version %d", capver(rights))
|
||||
}
|
||||
|
||||
n := caparsize(rights)
|
||||
if n < capArSizeMin || n > capArSizeMax {
|
||||
return false, errorspkg.New("bad rights size")
|
||||
}
|
||||
|
||||
for _, right := range setrights {
|
||||
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||
return false, errorspkg.New("bad right version")
|
||||
}
|
||||
i, err := rightToIndex(right)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if i >= n {
|
||||
return false, errorspkg.New("index overflow")
|
||||
}
|
||||
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||
return false, errorspkg.New("index mismatch")
|
||||
}
|
||||
if (rights.Rights[i] & right) != right {
|
||||
return false, nil
|
||||
}
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
|
||||
func capright(idx uint64, bit uint64) uint64 {
|
||||
return ((1 << (57 + idx)) | bit)
|
||||
}
|
||||
|
||||
// CapRightsInit returns a pointer to an initialised CapRights structure filled with rights.
|
||||
// See man cap_rights_init(3) and rights(4).
|
||||
func CapRightsInit(rights []uint64) (*CapRights, error) {
|
||||
var r CapRights
|
||||
r.Rights[0] = (capRightsGoVersion << 62) | capright(0, 0)
|
||||
r.Rights[1] = capright(1, 0)
|
||||
|
||||
err := CapRightsSet(&r, rights)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &r, nil
|
||||
}
|
||||
|
||||
// CapRightsLimit reduces the operations permitted on fd to at most those contained in rights.
|
||||
// The capability rights on fd can never be increased by CapRightsLimit.
|
||||
// See man cap_rights_limit(2) and rights(4).
|
||||
func CapRightsLimit(fd uintptr, rights *CapRights) error {
|
||||
return capRightsLimit(int(fd), rights)
|
||||
}
|
||||
|
||||
// CapRightsGet returns a CapRights structure containing the operations permitted on fd.
|
||||
// See man cap_rights_get(3) and rights(4).
|
||||
func CapRightsGet(fd uintptr) (*CapRights, error) {
|
||||
r, err := CapRightsInit(nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = capRightsGet(capRightsGoVersion, int(fd), r)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return r, nil
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Functions to access/create device major and minor numbers matching the
|
||||
// encoding used in Darwin's sys/types.h header.
|
||||
|
||||
package unix
|
||||
|
||||
// Major returns the major component of a Darwin device number.
|
||||
func Major(dev uint64) uint32 {
|
||||
return uint32((dev >> 24) & 0xff)
|
||||
}
|
||||
|
||||
// Minor returns the minor component of a Darwin device number.
|
||||
func Minor(dev uint64) uint32 {
|
||||
return uint32(dev & 0xffffff)
|
||||
}
|
||||
|
||||
// Mkdev returns a Darwin device number generated from the given major and minor
|
||||
// components.
|
||||
func Mkdev(major, minor uint32) uint64 {
|
||||
return uint64((major << 24) | minor)
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Functions to access/create device major and minor numbers matching the
|
||||
// encoding used by the Linux kernel and glibc.
|
||||
//
|
||||
// The information below is extracted and adapted from bits/sysmacros.h in the
|
||||
// glibc sources:
|
||||
//
|
||||
// dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
|
||||
// default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
|
||||
// number and m is a hex digit of the minor number. This is backward compatible
|
||||
// with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
|
||||
// backward compatible with the Linux kernel, which for some architectures uses
|
||||
// 32-bit dev_t, encoded as mmmM MMmm.
|
||||
|
||||
package unix
|
||||
|
||||
// Major returns the major component of a Linux device number.
|
||||
func Major(dev uint64) uint32 {
|
||||
major := uint32((dev & 0x00000000000fff00) >> 8)
|
||||
major |= uint32((dev & 0xfffff00000000000) >> 32)
|
||||
return major
|
||||
}
|
||||
|
||||
// Minor returns the minor component of a Linux device number.
|
||||
func Minor(dev uint64) uint32 {
|
||||
minor := uint32((dev & 0x00000000000000ff) >> 0)
|
||||
minor |= uint32((dev & 0x00000ffffff00000) >> 12)
|
||||
return minor
|
||||
}
|
||||
|
||||
// Mkdev returns a Linux device number generated from the given major and minor
|
||||
// components.
|
||||
func Mkdev(major, minor uint32) uint64 {
|
||||
dev := uint64((major & 0x00000fff) << 8)
|
||||
dev |= uint64((major & 0xfffff000) << 32)
|
||||
dev |= uint64((minor & 0x000000ff) << 0)
|
||||
dev |= uint64((minor & 0xffffff00) << 12)
|
||||
return dev
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Functions to access/create device major and minor numbers matching the
|
||||
// encoding used in NetBSD's sys/types.h header.
|
||||
|
||||
package unix
|
||||
|
||||
// Major returns the major component of a NetBSD device number.
|
||||
func Major(dev uint64) uint32 {
|
||||
return uint32((dev & 0x000fff00) >> 8)
|
||||
}
|
||||
|
||||
// Minor returns the minor component of a NetBSD device number.
|
||||
func Minor(dev uint64) uint32 {
|
||||
minor := uint32((dev & 0x000000ff) >> 0)
|
||||
minor |= uint32((dev & 0xfff00000) >> 12)
|
||||
return minor
|
||||
}
|
||||
|
||||
// Mkdev returns a NetBSD device number generated from the given major and minor
|
||||
// components.
|
||||
func Mkdev(major, minor uint32) uint64 {
|
||||
dev := uint64((major << 8) & 0x000fff00)
|
||||
dev |= uint64((minor << 12) & 0xfff00000)
|
||||
dev |= uint64((minor << 0) & 0x000000ff)
|
||||
return dev
|
||||
}
|
|
@ -0,0 +1,227 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
|
||||
// them here for backwards compatibility.
|
||||
|
||||
package unix
|
||||
|
||||
const (
|
||||
IFF_SMART = 0x20
|
||||
IFT_1822 = 0x2
|
||||
IFT_A12MPPSWITCH = 0x82
|
||||
IFT_AAL2 = 0xbb
|
||||
IFT_AAL5 = 0x31
|
||||
IFT_ADSL = 0x5e
|
||||
IFT_AFLANE8023 = 0x3b
|
||||
IFT_AFLANE8025 = 0x3c
|
||||
IFT_ARAP = 0x58
|
||||
IFT_ARCNET = 0x23
|
||||
IFT_ARCNETPLUS = 0x24
|
||||
IFT_ASYNC = 0x54
|
||||
IFT_ATM = 0x25
|
||||
IFT_ATMDXI = 0x69
|
||||
IFT_ATMFUNI = 0x6a
|
||||
IFT_ATMIMA = 0x6b
|
||||
IFT_ATMLOGICAL = 0x50
|
||||
IFT_ATMRADIO = 0xbd
|
||||
IFT_ATMSUBINTERFACE = 0x86
|
||||
IFT_ATMVCIENDPT = 0xc2
|
||||
IFT_ATMVIRTUAL = 0x95
|
||||
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||
IFT_BSC = 0x53
|
||||
IFT_CCTEMUL = 0x3d
|
||||
IFT_CEPT = 0x13
|
||||
IFT_CES = 0x85
|
||||
IFT_CHANNEL = 0x46
|
||||
IFT_CNR = 0x55
|
||||
IFT_COFFEE = 0x84
|
||||
IFT_COMPOSITELINK = 0x9b
|
||||
IFT_DCN = 0x8d
|
||||
IFT_DIGITALPOWERLINE = 0x8a
|
||||
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||
IFT_DLSW = 0x4a
|
||||
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||
IFT_DS0 = 0x51
|
||||
IFT_DS0BUNDLE = 0x52
|
||||
IFT_DS1FDL = 0xaa
|
||||
IFT_DS3 = 0x1e
|
||||
IFT_DTM = 0x8c
|
||||
IFT_DVBASILN = 0xac
|
||||
IFT_DVBASIOUT = 0xad
|
||||
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||
IFT_DVBRCCMACLAYER = 0x92
|
||||
IFT_DVBRCCUPSTREAM = 0x94
|
||||
IFT_ENC = 0xf4
|
||||
IFT_EON = 0x19
|
||||
IFT_EPLRS = 0x57
|
||||
IFT_ESCON = 0x49
|
||||
IFT_ETHER = 0x6
|
||||
IFT_FAITH = 0xf2
|
||||
IFT_FAST = 0x7d
|
||||
IFT_FASTETHER = 0x3e
|
||||
IFT_FASTETHERFX = 0x45
|
||||
IFT_FDDI = 0xf
|
||||
IFT_FIBRECHANNEL = 0x38
|
||||
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||
IFT_FRAMERELAYMPI = 0x5c
|
||||
IFT_FRDLCIENDPT = 0xc1
|
||||
IFT_FRELAY = 0x20
|
||||
IFT_FRELAYDCE = 0x2c
|
||||
IFT_FRF16MFRBUNDLE = 0xa3
|
||||
IFT_FRFORWARD = 0x9e
|
||||
IFT_G703AT2MB = 0x43
|
||||
IFT_G703AT64K = 0x42
|
||||
IFT_GIF = 0xf0
|
||||
IFT_GIGABITETHERNET = 0x75
|
||||
IFT_GR303IDT = 0xb2
|
||||
IFT_GR303RDT = 0xb1
|
||||
IFT_H323GATEKEEPER = 0xa4
|
||||
IFT_H323PROXY = 0xa5
|
||||
IFT_HDH1822 = 0x3
|
||||
IFT_HDLC = 0x76
|
||||
IFT_HDSL2 = 0xa8
|
||||
IFT_HIPERLAN2 = 0xb7
|
||||
IFT_HIPPI = 0x2f
|
||||
IFT_HIPPIINTERFACE = 0x39
|
||||
IFT_HOSTPAD = 0x5a
|
||||
IFT_HSSI = 0x2e
|
||||
IFT_HY = 0xe
|
||||
IFT_IBM370PARCHAN = 0x48
|
||||
IFT_IDSL = 0x9a
|
||||
IFT_IEEE80211 = 0x47
|
||||
IFT_IEEE80212 = 0x37
|
||||
IFT_IEEE8023ADLAG = 0xa1
|
||||
IFT_IFGSN = 0x91
|
||||
IFT_IMT = 0xbe
|
||||
IFT_INTERLEAVE = 0x7c
|
||||
IFT_IP = 0x7e
|
||||
IFT_IPFORWARD = 0x8e
|
||||
IFT_IPOVERATM = 0x72
|
||||
IFT_IPOVERCDLC = 0x6d
|
||||
IFT_IPOVERCLAW = 0x6e
|
||||
IFT_IPSWITCH = 0x4e
|
||||
IFT_IPXIP = 0xf9
|
||||
IFT_ISDN = 0x3f
|
||||
IFT_ISDNBASIC = 0x14
|
||||
IFT_ISDNPRIMARY = 0x15
|
||||
IFT_ISDNS = 0x4b
|
||||
IFT_ISDNU = 0x4c
|
||||
IFT_ISO88022LLC = 0x29
|
||||
IFT_ISO88023 = 0x7
|
||||
IFT_ISO88024 = 0x8
|
||||
IFT_ISO88025 = 0x9
|
||||
IFT_ISO88025CRFPINT = 0x62
|
||||
IFT_ISO88025DTR = 0x56
|
||||
IFT_ISO88025FIBER = 0x73
|
||||
IFT_ISO88026 = 0xa
|
||||
IFT_ISUP = 0xb3
|
||||
IFT_L3IPXVLAN = 0x89
|
||||
IFT_LAPB = 0x10
|
||||
IFT_LAPD = 0x4d
|
||||
IFT_LAPF = 0x77
|
||||
IFT_LOCALTALK = 0x2a
|
||||
IFT_LOOP = 0x18
|
||||
IFT_MEDIAMAILOVERIP = 0x8b
|
||||
IFT_MFSIGLINK = 0xa7
|
||||
IFT_MIOX25 = 0x26
|
||||
IFT_MODEM = 0x30
|
||||
IFT_MPC = 0x71
|
||||
IFT_MPLS = 0xa6
|
||||
IFT_MPLSTUNNEL = 0x96
|
||||
IFT_MSDSL = 0x8f
|
||||
IFT_MVL = 0xbf
|
||||
IFT_MYRINET = 0x63
|
||||
IFT_NFAS = 0xaf
|
||||
IFT_NSIP = 0x1b
|
||||
IFT_OPTICALCHANNEL = 0xc3
|
||||
IFT_OPTICALTRANSPORT = 0xc4
|
||||
IFT_OTHER = 0x1
|
||||
IFT_P10 = 0xc
|
||||
IFT_P80 = 0xd
|
||||
IFT_PARA = 0x22
|
||||
IFT_PFLOG = 0xf6
|
||||
IFT_PFSYNC = 0xf7
|
||||
IFT_PLC = 0xae
|
||||
IFT_POS = 0xab
|
||||
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||
IFT_PROPBWAP2MP = 0xb8
|
||||
IFT_PROPCNLS = 0x59
|
||||
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||
IFT_PROPMUX = 0x36
|
||||
IFT_PROPWIRELESSP2P = 0x9d
|
||||
IFT_PTPSERIAL = 0x16
|
||||
IFT_PVC = 0xf1
|
||||
IFT_QLLC = 0x44
|
||||
IFT_RADIOMAC = 0xbc
|
||||
IFT_RADSL = 0x5f
|
||||
IFT_REACHDSL = 0xc0
|
||||
IFT_RFC1483 = 0x9f
|
||||
IFT_RS232 = 0x21
|
||||
IFT_RSRB = 0x4f
|
||||
IFT_SDLC = 0x11
|
||||
IFT_SDSL = 0x60
|
||||
IFT_SHDSL = 0xa9
|
||||
IFT_SIP = 0x1f
|
||||
IFT_SLIP = 0x1c
|
||||
IFT_SMDSDXI = 0x2b
|
||||
IFT_SMDSICIP = 0x34
|
||||
IFT_SONET = 0x27
|
||||
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||
IFT_SONETPATH = 0x32
|
||||
IFT_SONETVT = 0x33
|
||||
IFT_SRP = 0x97
|
||||
IFT_SS7SIGLINK = 0x9c
|
||||
IFT_STACKTOSTACK = 0x6f
|
||||
IFT_STARLAN = 0xb
|
||||
IFT_STF = 0xd7
|
||||
IFT_T1 = 0x12
|
||||
IFT_TDLC = 0x74
|
||||
IFT_TERMPAD = 0x5b
|
||||
IFT_TR008 = 0xb0
|
||||
IFT_TRANSPHDLC = 0x7b
|
||||
IFT_TUNNEL = 0x83
|
||||
IFT_ULTRA = 0x1d
|
||||
IFT_USB = 0xa0
|
||||
IFT_V11 = 0x40
|
||||
IFT_V35 = 0x2d
|
||||
IFT_V36 = 0x41
|
||||
IFT_V37 = 0x78
|
||||
IFT_VDSL = 0x61
|
||||
IFT_VIRTUALIPADDRESS = 0x70
|
||||
IFT_VOICEEM = 0x64
|
||||
IFT_VOICEENCAP = 0x67
|
||||
IFT_VOICEFXO = 0x65
|
||||
IFT_VOICEFXS = 0x66
|
||||
IFT_VOICEOVERATM = 0x98
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
IFT_X25HUNTGROUP = 0x7a
|
||||
IFT_X25MLP = 0x79
|
||||
IFT_X25PLE = 0x28
|
||||
IFT_XETHER = 0x1a
|
||||
IPPROTO_MAXID = 0x34
|
||||
IPV6_FAITH = 0x1d
|
||||
IP_FAITH = 0x16
|
||||
MAP_NORESERVE = 0x40
|
||||
MAP_RENAME = 0x20
|
||||
NET_RT_MAXID = 0x6
|
||||
RTF_PRCLONING = 0x10000
|
||||
RTM_OLDADD = 0x9
|
||||
RTM_OLDDEL = 0xa
|
||||
SIOCADDRT = 0x8030720a
|
||||
SIOCALIFADDR = 0x8118691b
|
||||
SIOCDELRT = 0x8030720b
|
||||
SIOCDLIFADDR = 0x8118691d
|
||||
SIOCGLIFADDR = 0xc118691c
|
||||
SIOCGLIFPHYADDR = 0xc118694b
|
||||
SIOCSLIFPHYADDR = 0x8118694a
|
||||
)
|
|
@ -0,0 +1,227 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
|
||||
// them here for backwards compatibility.
|
||||
|
||||
package unix
|
||||
|
||||
const (
|
||||
IFF_SMART = 0x20
|
||||
IFT_1822 = 0x2
|
||||
IFT_A12MPPSWITCH = 0x82
|
||||
IFT_AAL2 = 0xbb
|
||||
IFT_AAL5 = 0x31
|
||||
IFT_ADSL = 0x5e
|
||||
IFT_AFLANE8023 = 0x3b
|
||||
IFT_AFLANE8025 = 0x3c
|
||||
IFT_ARAP = 0x58
|
||||
IFT_ARCNET = 0x23
|
||||
IFT_ARCNETPLUS = 0x24
|
||||
IFT_ASYNC = 0x54
|
||||
IFT_ATM = 0x25
|
||||
IFT_ATMDXI = 0x69
|
||||
IFT_ATMFUNI = 0x6a
|
||||
IFT_ATMIMA = 0x6b
|
||||
IFT_ATMLOGICAL = 0x50
|
||||
IFT_ATMRADIO = 0xbd
|
||||
IFT_ATMSUBINTERFACE = 0x86
|
||||
IFT_ATMVCIENDPT = 0xc2
|
||||
IFT_ATMVIRTUAL = 0x95
|
||||
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||
IFT_BSC = 0x53
|
||||
IFT_CCTEMUL = 0x3d
|
||||
IFT_CEPT = 0x13
|
||||
IFT_CES = 0x85
|
||||
IFT_CHANNEL = 0x46
|
||||
IFT_CNR = 0x55
|
||||
IFT_COFFEE = 0x84
|
||||
IFT_COMPOSITELINK = 0x9b
|
||||
IFT_DCN = 0x8d
|
||||
IFT_DIGITALPOWERLINE = 0x8a
|
||||
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||
IFT_DLSW = 0x4a
|
||||
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||
IFT_DS0 = 0x51
|
||||
IFT_DS0BUNDLE = 0x52
|
||||
IFT_DS1FDL = 0xaa
|
||||
IFT_DS3 = 0x1e
|
||||
IFT_DTM = 0x8c
|
||||
IFT_DVBASILN = 0xac
|
||||
IFT_DVBASIOUT = 0xad
|
||||
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||
IFT_DVBRCCMACLAYER = 0x92
|
||||
IFT_DVBRCCUPSTREAM = 0x94
|
||||
IFT_ENC = 0xf4
|
||||
IFT_EON = 0x19
|
||||
IFT_EPLRS = 0x57
|
||||
IFT_ESCON = 0x49
|
||||
IFT_ETHER = 0x6
|
||||
IFT_FAITH = 0xf2
|
||||
IFT_FAST = 0x7d
|
||||
IFT_FASTETHER = 0x3e
|
||||
IFT_FASTETHERFX = 0x45
|
||||
IFT_FDDI = 0xf
|
||||
IFT_FIBRECHANNEL = 0x38
|
||||
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||
IFT_FRAMERELAYMPI = 0x5c
|
||||
IFT_FRDLCIENDPT = 0xc1
|
||||
IFT_FRELAY = 0x20
|
||||
IFT_FRELAYDCE = 0x2c
|
||||
IFT_FRF16MFRBUNDLE = 0xa3
|
||||
IFT_FRFORWARD = 0x9e
|
||||
IFT_G703AT2MB = 0x43
|
||||
IFT_G703AT64K = 0x42
|
||||
IFT_GIF = 0xf0
|
||||
IFT_GIGABITETHERNET = 0x75
|
||||
IFT_GR303IDT = 0xb2
|
||||
IFT_GR303RDT = 0xb1
|
||||
IFT_H323GATEKEEPER = 0xa4
|
||||
IFT_H323PROXY = 0xa5
|
||||
IFT_HDH1822 = 0x3
|
||||
IFT_HDLC = 0x76
|
||||
IFT_HDSL2 = 0xa8
|
||||
IFT_HIPERLAN2 = 0xb7
|
||||
IFT_HIPPI = 0x2f
|
||||
IFT_HIPPIINTERFACE = 0x39
|
||||
IFT_HOSTPAD = 0x5a
|
||||
IFT_HSSI = 0x2e
|
||||
IFT_HY = 0xe
|
||||
IFT_IBM370PARCHAN = 0x48
|
||||
IFT_IDSL = 0x9a
|
||||
IFT_IEEE80211 = 0x47
|
||||
IFT_IEEE80212 = 0x37
|
||||
IFT_IEEE8023ADLAG = 0xa1
|
||||
IFT_IFGSN = 0x91
|
||||
IFT_IMT = 0xbe
|
||||
IFT_INTERLEAVE = 0x7c
|
||||
IFT_IP = 0x7e
|
||||
IFT_IPFORWARD = 0x8e
|
||||
IFT_IPOVERATM = 0x72
|
||||
IFT_IPOVERCDLC = 0x6d
|
||||
IFT_IPOVERCLAW = 0x6e
|
||||
IFT_IPSWITCH = 0x4e
|
||||
IFT_IPXIP = 0xf9
|
||||
IFT_ISDN = 0x3f
|
||||
IFT_ISDNBASIC = 0x14
|
||||
IFT_ISDNPRIMARY = 0x15
|
||||
IFT_ISDNS = 0x4b
|
||||
IFT_ISDNU = 0x4c
|
||||
IFT_ISO88022LLC = 0x29
|
||||
IFT_ISO88023 = 0x7
|
||||
IFT_ISO88024 = 0x8
|
||||
IFT_ISO88025 = 0x9
|
||||
IFT_ISO88025CRFPINT = 0x62
|
||||
IFT_ISO88025DTR = 0x56
|
||||
IFT_ISO88025FIBER = 0x73
|
||||
IFT_ISO88026 = 0xa
|
||||
IFT_ISUP = 0xb3
|
||||
IFT_L3IPXVLAN = 0x89
|
||||
IFT_LAPB = 0x10
|
||||
IFT_LAPD = 0x4d
|
||||
IFT_LAPF = 0x77
|
||||
IFT_LOCALTALK = 0x2a
|
||||
IFT_LOOP = 0x18
|
||||
IFT_MEDIAMAILOVERIP = 0x8b
|
||||
IFT_MFSIGLINK = 0xa7
|
||||
IFT_MIOX25 = 0x26
|
||||
IFT_MODEM = 0x30
|
||||
IFT_MPC = 0x71
|
||||
IFT_MPLS = 0xa6
|
||||
IFT_MPLSTUNNEL = 0x96
|
||||
IFT_MSDSL = 0x8f
|
||||
IFT_MVL = 0xbf
|
||||
IFT_MYRINET = 0x63
|
||||
IFT_NFAS = 0xaf
|
||||
IFT_NSIP = 0x1b
|
||||
IFT_OPTICALCHANNEL = 0xc3
|
||||
IFT_OPTICALTRANSPORT = 0xc4
|
||||
IFT_OTHER = 0x1
|
||||
IFT_P10 = 0xc
|
||||
IFT_P80 = 0xd
|
||||
IFT_PARA = 0x22
|
||||
IFT_PFLOG = 0xf6
|
||||
IFT_PFSYNC = 0xf7
|
||||
IFT_PLC = 0xae
|
||||
IFT_POS = 0xab
|
||||
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||
IFT_PROPBWAP2MP = 0xb8
|
||||
IFT_PROPCNLS = 0x59
|
||||
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||
IFT_PROPMUX = 0x36
|
||||
IFT_PROPWIRELESSP2P = 0x9d
|
||||
IFT_PTPSERIAL = 0x16
|
||||
IFT_PVC = 0xf1
|
||||
IFT_QLLC = 0x44
|
||||
IFT_RADIOMAC = 0xbc
|
||||
IFT_RADSL = 0x5f
|
||||
IFT_REACHDSL = 0xc0
|
||||
IFT_RFC1483 = 0x9f
|
||||
IFT_RS232 = 0x21
|
||||
IFT_RSRB = 0x4f
|
||||
IFT_SDLC = 0x11
|
||||
IFT_SDSL = 0x60
|
||||
IFT_SHDSL = 0xa9
|
||||
IFT_SIP = 0x1f
|
||||
IFT_SLIP = 0x1c
|
||||
IFT_SMDSDXI = 0x2b
|
||||
IFT_SMDSICIP = 0x34
|
||||
IFT_SONET = 0x27
|
||||
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||
IFT_SONETPATH = 0x32
|
||||
IFT_SONETVT = 0x33
|
||||
IFT_SRP = 0x97
|
||||
IFT_SS7SIGLINK = 0x9c
|
||||
IFT_STACKTOSTACK = 0x6f
|
||||
IFT_STARLAN = 0xb
|
||||
IFT_STF = 0xd7
|
||||
IFT_T1 = 0x12
|
||||
IFT_TDLC = 0x74
|
||||
IFT_TERMPAD = 0x5b
|
||||
IFT_TR008 = 0xb0
|
||||
IFT_TRANSPHDLC = 0x7b
|
||||
IFT_TUNNEL = 0x83
|
||||
IFT_ULTRA = 0x1d
|
||||
IFT_USB = 0xa0
|
||||
IFT_V11 = 0x40
|
||||
IFT_V35 = 0x2d
|
||||
IFT_V36 = 0x41
|
||||
IFT_V37 = 0x78
|
||||
IFT_VDSL = 0x61
|
||||
IFT_VIRTUALIPADDRESS = 0x70
|
||||
IFT_VOICEEM = 0x64
|
||||
IFT_VOICEENCAP = 0x67
|
||||
IFT_VOICEFXO = 0x65
|
||||
IFT_VOICEFXS = 0x66
|
||||
IFT_VOICEOVERATM = 0x98
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
IFT_X25HUNTGROUP = 0x7a
|
||||
IFT_X25MLP = 0x79
|
||||
IFT_X25PLE = 0x28
|
||||
IFT_XETHER = 0x1a
|
||||
IPPROTO_MAXID = 0x34
|
||||
IPV6_FAITH = 0x1d
|
||||
IP_FAITH = 0x16
|
||||
MAP_NORESERVE = 0x40
|
||||
MAP_RENAME = 0x20
|
||||
NET_RT_MAXID = 0x6
|
||||
RTF_PRCLONING = 0x10000
|
||||
RTM_OLDADD = 0x9
|
||||
RTM_OLDDEL = 0xa
|
||||
SIOCADDRT = 0x8040720a
|
||||
SIOCALIFADDR = 0x8118691b
|
||||
SIOCDELRT = 0x8040720b
|
||||
SIOCDLIFADDR = 0x8118691d
|
||||
SIOCGLIFADDR = 0xc118691c
|
||||
SIOCGLIFPHYADDR = 0xc118694b
|
||||
SIOCSLIFPHYADDR = 0x8118694a
|
||||
)
|
|
@ -0,0 +1,226 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package unix
|
||||
|
||||
const (
|
||||
IFT_1822 = 0x2
|
||||
IFT_A12MPPSWITCH = 0x82
|
||||
IFT_AAL2 = 0xbb
|
||||
IFT_AAL5 = 0x31
|
||||
IFT_ADSL = 0x5e
|
||||
IFT_AFLANE8023 = 0x3b
|
||||
IFT_AFLANE8025 = 0x3c
|
||||
IFT_ARAP = 0x58
|
||||
IFT_ARCNET = 0x23
|
||||
IFT_ARCNETPLUS = 0x24
|
||||
IFT_ASYNC = 0x54
|
||||
IFT_ATM = 0x25
|
||||
IFT_ATMDXI = 0x69
|
||||
IFT_ATMFUNI = 0x6a
|
||||
IFT_ATMIMA = 0x6b
|
||||
IFT_ATMLOGICAL = 0x50
|
||||
IFT_ATMRADIO = 0xbd
|
||||
IFT_ATMSUBINTERFACE = 0x86
|
||||
IFT_ATMVCIENDPT = 0xc2
|
||||
IFT_ATMVIRTUAL = 0x95
|
||||
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||
IFT_BSC = 0x53
|
||||
IFT_CCTEMUL = 0x3d
|
||||
IFT_CEPT = 0x13
|
||||
IFT_CES = 0x85
|
||||
IFT_CHANNEL = 0x46
|
||||
IFT_CNR = 0x55
|
||||
IFT_COFFEE = 0x84
|
||||
IFT_COMPOSITELINK = 0x9b
|
||||
IFT_DCN = 0x8d
|
||||
IFT_DIGITALPOWERLINE = 0x8a
|
||||
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||
IFT_DLSW = 0x4a
|
||||
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||
IFT_DS0 = 0x51
|
||||
IFT_DS0BUNDLE = 0x52
|
||||
IFT_DS1FDL = 0xaa
|
||||
IFT_DS3 = 0x1e
|
||||
IFT_DTM = 0x8c
|
||||
IFT_DVBASILN = 0xac
|
||||
IFT_DVBASIOUT = 0xad
|
||||
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||
IFT_DVBRCCMACLAYER = 0x92
|
||||
IFT_DVBRCCUPSTREAM = 0x94
|
||||
IFT_ENC = 0xf4
|
||||
IFT_EON = 0x19
|
||||
IFT_EPLRS = 0x57
|
||||
IFT_ESCON = 0x49
|
||||
IFT_ETHER = 0x6
|
||||
IFT_FAST = 0x7d
|
||||
IFT_FASTETHER = 0x3e
|
||||
IFT_FASTETHERFX = 0x45
|
||||
IFT_FDDI = 0xf
|
||||
IFT_FIBRECHANNEL = 0x38
|
||||
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||
IFT_FRAMERELAYMPI = 0x5c
|
||||
IFT_FRDLCIENDPT = 0xc1
|
||||
IFT_FRELAY = 0x20
|
||||
IFT_FRELAYDCE = 0x2c
|
||||
IFT_FRF16MFRBUNDLE = 0xa3
|
||||
IFT_FRFORWARD = 0x9e
|
||||
IFT_G703AT2MB = 0x43
|
||||
IFT_G703AT64K = 0x42
|
||||
IFT_GIF = 0xf0
|
||||
IFT_GIGABITETHERNET = 0x75
|
||||
IFT_GR303IDT = 0xb2
|
||||
IFT_GR303RDT = 0xb1
|
||||
IFT_H323GATEKEEPER = 0xa4
|
||||
IFT_H323PROXY = 0xa5
|
||||
IFT_HDH1822 = 0x3
|
||||
IFT_HDLC = 0x76
|
||||
IFT_HDSL2 = 0xa8
|
||||
IFT_HIPERLAN2 = 0xb7
|
||||
IFT_HIPPI = 0x2f
|
||||
IFT_HIPPIINTERFACE = 0x39
|
||||
IFT_HOSTPAD = 0x5a
|
||||
IFT_HSSI = 0x2e
|
||||
IFT_HY = 0xe
|
||||
IFT_IBM370PARCHAN = 0x48
|
||||
IFT_IDSL = 0x9a
|
||||
IFT_IEEE80211 = 0x47
|
||||
IFT_IEEE80212 = 0x37
|
||||
IFT_IEEE8023ADLAG = 0xa1
|
||||
IFT_IFGSN = 0x91
|
||||
IFT_IMT = 0xbe
|
||||
IFT_INTERLEAVE = 0x7c
|
||||
IFT_IP = 0x7e
|
||||
IFT_IPFORWARD = 0x8e
|
||||
IFT_IPOVERATM = 0x72
|
||||
IFT_IPOVERCDLC = 0x6d
|
||||
IFT_IPOVERCLAW = 0x6e
|
||||
IFT_IPSWITCH = 0x4e
|
||||
IFT_ISDN = 0x3f
|
||||
IFT_ISDNBASIC = 0x14
|
||||
IFT_ISDNPRIMARY = 0x15
|
||||
IFT_ISDNS = 0x4b
|
||||
IFT_ISDNU = 0x4c
|
||||
IFT_ISO88022LLC = 0x29
|
||||
IFT_ISO88023 = 0x7
|
||||
IFT_ISO88024 = 0x8
|
||||
IFT_ISO88025 = 0x9
|
||||
IFT_ISO88025CRFPINT = 0x62
|
||||
IFT_ISO88025DTR = 0x56
|
||||
IFT_ISO88025FIBER = 0x73
|
||||
IFT_ISO88026 = 0xa
|
||||
IFT_ISUP = 0xb3
|
||||
IFT_L3IPXVLAN = 0x89
|
||||
IFT_LAPB = 0x10
|
||||
IFT_LAPD = 0x4d
|
||||
IFT_LAPF = 0x77
|
||||
IFT_LOCALTALK = 0x2a
|
||||
IFT_LOOP = 0x18
|
||||
IFT_MEDIAMAILOVERIP = 0x8b
|
||||
IFT_MFSIGLINK = 0xa7
|
||||
IFT_MIOX25 = 0x26
|
||||
IFT_MODEM = 0x30
|
||||
IFT_MPC = 0x71
|
||||
IFT_MPLS = 0xa6
|
||||
IFT_MPLSTUNNEL = 0x96
|
||||
IFT_MSDSL = 0x8f
|
||||
IFT_MVL = 0xbf
|
||||
IFT_MYRINET = 0x63
|
||||
IFT_NFAS = 0xaf
|
||||
IFT_NSIP = 0x1b
|
||||
IFT_OPTICALCHANNEL = 0xc3
|
||||
IFT_OPTICALTRANSPORT = 0xc4
|
||||
IFT_OTHER = 0x1
|
||||
IFT_P10 = 0xc
|
||||
IFT_P80 = 0xd
|
||||
IFT_PARA = 0x22
|
||||
IFT_PFLOG = 0xf6
|
||||
IFT_PFSYNC = 0xf7
|
||||
IFT_PLC = 0xae
|
||||
IFT_POS = 0xab
|
||||
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||
IFT_PROPBWAP2MP = 0xb8
|
||||
IFT_PROPCNLS = 0x59
|
||||
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||
IFT_PROPMUX = 0x36
|
||||
IFT_PROPWIRELESSP2P = 0x9d
|
||||
IFT_PTPSERIAL = 0x16
|
||||
IFT_PVC = 0xf1
|
||||
IFT_QLLC = 0x44
|
||||
IFT_RADIOMAC = 0xbc
|
||||
IFT_RADSL = 0x5f
|
||||
IFT_REACHDSL = 0xc0
|
||||
IFT_RFC1483 = 0x9f
|
||||
IFT_RS232 = 0x21
|
||||
IFT_RSRB = 0x4f
|
||||
IFT_SDLC = 0x11
|
||||
IFT_SDSL = 0x60
|
||||
IFT_SHDSL = 0xa9
|
||||
IFT_SIP = 0x1f
|
||||
IFT_SLIP = 0x1c
|
||||
IFT_SMDSDXI = 0x2b
|
||||
IFT_SMDSICIP = 0x34
|
||||
IFT_SONET = 0x27
|
||||
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||
IFT_SONETPATH = 0x32
|
||||
IFT_SONETVT = 0x33
|
||||
IFT_SRP = 0x97
|
||||
IFT_SS7SIGLINK = 0x9c
|
||||
IFT_STACKTOSTACK = 0x6f
|
||||
IFT_STARLAN = 0xb
|
||||
IFT_STF = 0xd7
|
||||
IFT_T1 = 0x12
|
||||
IFT_TDLC = 0x74
|
||||
IFT_TERMPAD = 0x5b
|
||||
IFT_TR008 = 0xb0
|
||||
IFT_TRANSPHDLC = 0x7b
|
||||
IFT_TUNNEL = 0x83
|
||||
IFT_ULTRA = 0x1d
|
||||
IFT_USB = 0xa0
|
||||
IFT_V11 = 0x40
|
||||
IFT_V35 = 0x2d
|
||||
IFT_V36 = 0x41
|
||||
IFT_V37 = 0x78
|
||||
IFT_VDSL = 0x61
|
||||
IFT_VIRTUALIPADDRESS = 0x70
|
||||
IFT_VOICEEM = 0x64
|
||||
IFT_VOICEENCAP = 0x67
|
||||
IFT_VOICEFXO = 0x65
|
||||
IFT_VOICEFXS = 0x66
|
||||
IFT_VOICEOVERATM = 0x98
|
||||
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||
IFT_VOICEOVERIP = 0x68
|
||||
IFT_X213 = 0x5d
|
||||
IFT_X25 = 0x5
|
||||
IFT_X25DDN = 0x4
|
||||
IFT_X25HUNTGROUP = 0x7a
|
||||
IFT_X25MLP = 0x79
|
||||
IFT_X25PLE = 0x28
|
||||
IFT_XETHER = 0x1a
|
||||
|
||||
// missing constants on FreeBSD-11.1-RELEASE, copied from old values in ztypes_freebsd_arm.go
|
||||
IFF_SMART = 0x20
|
||||
IFT_FAITH = 0xf2
|
||||
IFT_IPXIP = 0xf9
|
||||
IPPROTO_MAXID = 0x34
|
||||
IPV6_FAITH = 0x1d
|
||||
IP_FAITH = 0x16
|
||||
MAP_NORESERVE = 0x40
|
||||
MAP_RENAME = 0x20
|
||||
NET_RT_MAXID = 0x6
|
||||
RTF_PRCLONING = 0x10000
|
||||
RTM_OLDADD = 0x9
|
||||
RTM_OLDDEL = 0xa
|
||||
SIOCADDRT = 0x8030720a
|
||||
SIOCALIFADDR = 0x8118691b
|
||||
SIOCDELRT = 0x8030720b
|
||||
SIOCDLIFADDR = 0x8118691d
|
||||
SIOCGLIFADDR = 0xc118691c
|
||||
SIOCGLIFPHYADDR = 0xc118694b
|
||||
SIOCSLIFPHYADDR = 0x8118694a
|
||||
)
|
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package unix
|
||||
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// FIXME: unexported function from os
|
||||
// syscallMode returns the syscall-specific mode bits from Go's portable mode bits.
|
||||
func syscallMode(i os.FileMode) (o uint32) {
|
||||
o |= uint32(i.Perm())
|
||||
if i&os.ModeSetuid != 0 {
|
||||
o |= syscall.S_ISUID
|
||||
}
|
||||
if i&os.ModeSetgid != 0 {
|
||||
o |= syscall.S_ISGID
|
||||
}
|
||||
if i&os.ModeSticky != 0 {
|
||||
o |= syscall.S_ISVTX
|
||||
}
|
||||
// No mapping for Go's ModeTemporary (plan9 only).
|
||||
return
|
||||
}
|
|
@ -1,5 +1,3 @@
|
|||
// +build linux darwin freebsd openbsd netbsd dragonfly
|
||||
|
||||
// Copyright 2014 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
|
|
@ -561,13 +561,19 @@ func Utimes(path string, tv []Timeval) error {
|
|||
|
||||
func UtimesNano(path string, ts []Timespec) error {
|
||||
if ts == nil {
|
||||
err := utimensat(AT_FDCWD, path, nil, 0)
|
||||
if err != ENOSYS {
|
||||
return err
|
||||
}
|
||||
return utimes(path, nil)
|
||||
}
|
||||
// TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it
|
||||
// isn't supported by darwin so this uses utimes instead
|
||||
if len(ts) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
|
||||
if err != ENOSYS {
|
||||
return err
|
||||
}
|
||||
// Not as efficient as it could be because Timespec and
|
||||
// Timeval have different types in the different OSes
|
||||
tv := [2]Timeval{
|
||||
|
@ -577,6 +583,16 @@ func UtimesNano(path string, ts []Timespec) error {
|
|||
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
||||
}
|
||||
|
||||
func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
|
||||
if ts == nil {
|
||||
return utimensat(dirfd, path, nil, flags)
|
||||
}
|
||||
if len(ts) != 2 {
|
||||
return EINVAL
|
||||
}
|
||||
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
|
||||
}
|
||||
|
||||
//sys futimes(fd int, timeval *[2]Timeval) (err error)
|
||||
|
||||
func Futimes(fd int, tv []Timeval) error {
|
||||
|
@ -594,9 +610,6 @@ func Futimes(fd int, tv []Timeval) error {
|
|||
// TODO: wrap
|
||||
// Acct(name nil-string) (err error)
|
||||
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
||||
// Madvise(addr *byte, len int, behav int) (err error)
|
||||
// Mprotect(addr *byte, len int, prot int) (err error)
|
||||
// Msync(addr *byte, len int, flags int) (err error)
|
||||
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
||||
|
||||
var mapper = &mmapper{
|
||||
|
@ -612,3 +625,11 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
|
|||
func Munmap(b []byte) (err error) {
|
||||
return mapper.Munmap(b)
|
||||
}
|
||||
|
||||
//sys Madvise(b []byte, behav int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Msync(b []byte, flags int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
|
|
|
@ -187,6 +187,11 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
|
||||
// Darwin doesn't support SYS_UTIMENSAT
|
||||
return ENOSYS
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapped
|
||||
*/
|
||||
|
@ -195,6 +200,45 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
|
||||
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
|
||||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
// ioctl itself should not be exposed directly, but additional get/set
|
||||
// functions for specific types are permissible.
|
||||
|
||||
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||
// on fd, using the specified request number.
|
||||
func IoctlSetInt(fd int, req uint, value int) error {
|
||||
return ioctl(fd, req, uintptr(value))
|
||||
}
|
||||
|
||||
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
}
|
||||
|
||||
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
}
|
||||
|
||||
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||
// from fd, using the specified request number.
|
||||
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||
var value int
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return value, err
|
||||
}
|
||||
|
||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||
var value Winsize
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return &value, err
|
||||
}
|
||||
|
||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||
var value Termios
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return &value, err
|
||||
}
|
||||
|
||||
/*
|
||||
* Exposed directly
|
||||
*/
|
||||
|
@ -210,10 +254,13 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
//sys Dup2(from int, to int) (err error)
|
||||
//sys Exchangedata(path1 string, path2 string, options int) (err error)
|
||||
//sys Exit(code int)
|
||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//sys Fchdir(fd int) (err error)
|
||||
//sys Fchflags(fd int, flags int) (err error)
|
||||
//sys Fchmod(fd int, mode uint32) (err error)
|
||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||
//sys Flock(fd int, how int) (err error)
|
||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||
|
@ -238,23 +285,23 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
//sys Kqueue() (fd int, err error)
|
||||
//sys Lchown(path string, uid int, gid int) (err error)
|
||||
//sys Link(path string, link string) (err error)
|
||||
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
|
||||
//sys Listen(s int, backlog int) (err error)
|
||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||
//sys Mkfifo(path string, mode uint32) (err error)
|
||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Pathconf(path string, name int) (val int, err error)
|
||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||
//sys read(fd int, p []byte) (n int, err error)
|
||||
//sys Readlink(path string, buf []byte) (n int, err error)
|
||||
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
|
||||
//sys Rename(from string, to string) (err error)
|
||||
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
|
||||
//sys Revoke(path string) (err error)
|
||||
//sys Rmdir(path string) (err error)
|
||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||
|
@ -275,11 +322,13 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||
//sys Symlink(path string, link string) (err error)
|
||||
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||
//sys Sync() (err error)
|
||||
//sys Truncate(path string, length int64) (err error)
|
||||
//sys Umask(newmask int) (oldmask int)
|
||||
//sys Undelete(path string) (err error)
|
||||
//sys Unlink(path string) (err error)
|
||||
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||
//sys Unmount(path string, flags int) (err error)
|
||||
//sys write(fd int, p []byte) (n int, err error)
|
||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||
|
@ -319,9 +368,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
// Add_profil
|
||||
// Kdebug_trace
|
||||
// Sigreturn
|
||||
// Mmap
|
||||
// Mlock
|
||||
// Munlock
|
||||
// Atsocket
|
||||
// Kqueue_from_portset_np
|
||||
// Kqueue_portset
|
||||
|
@ -414,8 +460,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
// Lio_listio
|
||||
// __pthread_cond_wait
|
||||
// Iopolicysys
|
||||
// Mlockall
|
||||
// Munlockall
|
||||
// __pthread_kill
|
||||
// __pthread_sigmask
|
||||
// __sigwait
|
||||
|
@ -469,7 +513,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
|||
// Sendmsg_nocancel
|
||||
// Recvfrom_nocancel
|
||||
// Accept_nocancel
|
||||
// Msync_nocancel
|
||||
// Fcntl_nocancel
|
||||
// Select_nocancel
|
||||
// Fsync_nocancel
|
||||
|
|
|
@ -11,8 +11,6 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
|
||||
func Getpagesize() int { return 4096 }
|
||||
|
||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
||||
|
|
|
@ -174,11 +174,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
//sys Mkfifo(path string, mode uint32) (err error)
|
||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Pathconf(path string, name int) (val int, err error)
|
||||
|
@ -218,6 +213,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
|
@ -252,9 +248,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
// Add_profil
|
||||
// Kdebug_trace
|
||||
// Sigreturn
|
||||
// Mmap
|
||||
// Mlock
|
||||
// Munlock
|
||||
// Atsocket
|
||||
// Kqueue_from_portset_np
|
||||
// Kqueue_portset
|
||||
|
@ -347,8 +340,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
// Lio_listio
|
||||
// __pthread_cond_wait
|
||||
// Iopolicysys
|
||||
// Mlockall
|
||||
// Munlockall
|
||||
// __pthread_kill
|
||||
// __pthread_sigmask
|
||||
// __sigwait
|
||||
|
@ -401,7 +392,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
// Sendmsg_nocancel
|
||||
// Recvfrom_nocancel
|
||||
// Accept_nocancel
|
||||
// Msync_nocancel
|
||||
// Fcntl_nocancel
|
||||
// Select_nocancel
|
||||
// Fsync_nocancel
|
||||
|
|
|
@ -352,11 +352,53 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
return s, e
|
||||
}
|
||||
|
||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||
|
||||
// ioctl itself should not be exposed directly, but additional get/set
|
||||
// functions for specific types are permissible.
|
||||
|
||||
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||
// on fd, using the specified request number.
|
||||
func IoctlSetInt(fd int, req uint, value int) error {
|
||||
return ioctl(fd, req, uintptr(value))
|
||||
}
|
||||
|
||||
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
}
|
||||
|
||||
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
}
|
||||
|
||||
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||
// from fd, using the specified request number.
|
||||
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||
var value int
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return value, err
|
||||
}
|
||||
|
||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||
var value Winsize
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return &value, err
|
||||
}
|
||||
|
||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||
var value Termios
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return &value, err
|
||||
}
|
||||
|
||||
/*
|
||||
* Exposed directly
|
||||
*/
|
||||
//sys Access(path string, mode uint32) (err error)
|
||||
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
|
||||
//sys CapEnter() (err error)
|
||||
//sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET
|
||||
//sys capRightsLimit(fd int, rightsp *CapRights) (err error)
|
||||
//sys Chdir(path string) (err error)
|
||||
//sys Chflags(path string, flags int) (err error)
|
||||
//sys Chmod(path string, mode uint32) (err error)
|
||||
|
@ -379,10 +421,13 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
|
||||
//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
|
||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//sys Fchdir(fd int) (err error)
|
||||
//sys Fchflags(fd int, flags int) (err error)
|
||||
//sys Fchmod(fd int, mode uint32) (err error)
|
||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||
//sys Flock(fd int, how int) (err error)
|
||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||
|
@ -409,24 +454,24 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
//sys Kqueue() (fd int, err error)
|
||||
//sys Lchown(path string, uid int, gid int) (err error)
|
||||
//sys Link(path string, link string) (err error)
|
||||
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
|
||||
//sys Listen(s int, backlog int) (err error)
|
||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||
//sys Mkfifo(path string, mode uint32) (err error)
|
||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Pathconf(path string, name int) (val int, err error)
|
||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||
//sys read(fd int, p []byte) (n int, err error)
|
||||
//sys Readlink(path string, buf []byte) (n int, err error)
|
||||
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
|
||||
//sys Rename(from string, to string) (err error)
|
||||
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
|
||||
//sys Revoke(path string) (err error)
|
||||
//sys Rmdir(path string) (err error)
|
||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||
|
@ -448,11 +493,13 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
//sys Statfs(path string, stat *Statfs_t) (err error)
|
||||
//sys Symlink(path string, link string) (err error)
|
||||
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||
//sys Sync() (err error)
|
||||
//sys Truncate(path string, length int64) (err error)
|
||||
//sys Umask(newmask int) (oldmask int)
|
||||
//sys Undelete(path string) (err error)
|
||||
//sys Unlink(path string) (err error)
|
||||
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||
//sys Unmount(path string, flags int) (err error)
|
||||
//sys write(fd int, p []byte) (n int, err error)
|
||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||
|
@ -460,6 +507,7 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
|
@ -493,9 +541,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
// Add_profil
|
||||
// Kdebug_trace
|
||||
// Sigreturn
|
||||
// Mmap
|
||||
// Mlock
|
||||
// Munlock
|
||||
// Atsocket
|
||||
// Kqueue_from_portset_np
|
||||
// Kqueue_portset
|
||||
|
@ -588,8 +633,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
// Lio_listio
|
||||
// __pthread_cond_wait
|
||||
// Iopolicysys
|
||||
// Mlockall
|
||||
// Munlockall
|
||||
// __pthread_kill
|
||||
// __pthread_sigmask
|
||||
// __sigwait
|
||||
|
@ -642,7 +685,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
|||
// Sendmsg_nocancel
|
||||
// Recvfrom_nocancel
|
||||
// Accept_nocancel
|
||||
// Msync_nocancel
|
||||
// Fcntl_nocancel
|
||||
// Select_nocancel
|
||||
// Fsync_nocancel
|
||||
|
|
|
@ -57,11 +57,15 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|||
|
||||
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||
// on fd, using the specified request number.
|
||||
func IoctlSetInt(fd int, req uint, value int) (err error) {
|
||||
func IoctlSetInt(fd int, req uint, value int) error {
|
||||
return ioctl(fd, req, uintptr(value))
|
||||
}
|
||||
|
||||
func IoctlSetTermios(fd int, req uint, value *Termios) (err error) {
|
||||
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
}
|
||||
|
||||
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||
}
|
||||
|
||||
|
@ -73,6 +77,12 @@ func IoctlGetInt(fd int, req uint) (int, error) {
|
|||
return value, err
|
||||
}
|
||||
|
||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||
var value Winsize
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
return &value, err
|
||||
}
|
||||
|
||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||
var value Termios
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
|
@ -342,10 +352,14 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
|
|||
return
|
||||
}
|
||||
|
||||
func Mkfifo(path string, mode uint32) (err error) {
|
||||
func Mkfifo(path string, mode uint32) error {
|
||||
return Mknod(path, mode|S_IFIFO, 0)
|
||||
}
|
||||
|
||||
func Mkfifoat(dirfd int, path string, mode uint32) error {
|
||||
return Mknodat(dirfd, path, mode|S_IFIFO, 0)
|
||||
}
|
||||
|
||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
if sa.Port < 0 || sa.Port > 0xFFFF {
|
||||
return nil, 0, EINVAL
|
||||
|
@ -917,8 +931,13 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||
}
|
||||
var dummy byte
|
||||
if len(oob) > 0 {
|
||||
var sockType int
|
||||
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
// receive at least one normal byte
|
||||
if len(p) == 0 {
|
||||
if sockType != SOCK_DGRAM && len(p) == 0 {
|
||||
iov.Base = &dummy
|
||||
iov.SetLen(1)
|
||||
}
|
||||
|
@ -964,8 +983,13 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||
}
|
||||
var dummy byte
|
||||
if len(oob) > 0 {
|
||||
var sockType int
|
||||
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
// send at least one normal byte
|
||||
if len(p) == 0 {
|
||||
if sockType != SOCK_DGRAM && len(p) == 0 {
|
||||
iov.Base = &dummy
|
||||
iov.SetLen(1)
|
||||
}
|
||||
|
@ -1265,6 +1289,7 @@ func Setgid(uid int) (err error) {
|
|||
//sys Setpriority(which int, who int, prio int) (err error)
|
||||
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
|
||||
//sys Sync()
|
||||
//sys Syncfs(fd int) (err error)
|
||||
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
||||
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
|
||||
//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
|
||||
|
@ -1299,8 +1324,9 @@ func Munmap(b []byte) (err error) {
|
|||
//sys Madvise(b []byte, advice int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Msync(b []byte, flags int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
|
||||
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
||||
|
@ -1368,7 +1394,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||
// ModifyLdt
|
||||
// Mount
|
||||
// MovePages
|
||||
// Mprotect
|
||||
// MqGetsetattr
|
||||
// MqNotify
|
||||
// MqOpen
|
||||
|
@ -1380,7 +1405,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||
// Msgget
|
||||
// Msgrcv
|
||||
// Msgsnd
|
||||
// Msync
|
||||
// Newfstatat
|
||||
// Nfsservctl
|
||||
// Personality
|
||||
|
|
|
@ -170,11 +170,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
//sys Mkfifo(path string, mode uint32) (err error)
|
||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Pathconf(path string, name int) (val int, err error)
|
||||
|
@ -210,6 +205,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
|
|
|
@ -149,11 +149,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
//sys Mkdir(path string, mode uint32) (err error)
|
||||
//sys Mkfifo(path string, mode uint32) (err error)
|
||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||
//sys Mlock(b []byte) (err error)
|
||||
//sys Mlockall(flags int) (err error)
|
||||
//sys Mprotect(b []byte, prot int) (err error)
|
||||
//sys Munlock(b []byte) (err error)
|
||||
//sys Munlockall() (err error)
|
||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||
//sys Pathconf(path string, name int) (val int, err error)
|
||||
|
@ -193,6 +188,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||
|
||||
/*
|
||||
* Unimplemented
|
||||
|
@ -282,6 +278,5 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
|||
// thrsleep
|
||||
// thrwakeup
|
||||
// unlinkat
|
||||
// utimensat
|
||||
// vfork
|
||||
// writev
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
// Copyright 2017 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// +build arm,openbsd
|
||||
|
||||
package unix
|
||||
|
||||
import "syscall"
|
||||
|
||||
func Getpagesize() int { return syscall.Getpagesize() }
|
||||
|
||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
||||
|
||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
||||
ts.Sec = int64(nsec / 1e9)
|
||||
ts.Nsec = int32(nsec % 1e9)
|
||||
return
|
||||
}
|
||||
|
||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
||||
nsec += 999 // round up to microsecond
|
||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
||||
tv.Sec = int64(nsec / 1e9)
|
||||
return
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint32(fd)
|
||||
k.Filter = int16(mode)
|
||||
k.Flags = uint16(flags)
|
||||
}
|
||||
|
||||
func (iov *Iovec) SetLen(length int) {
|
||||
iov.Len = uint32(length)
|
||||
}
|
||||
|
||||
func (msghdr *Msghdr) SetControllen(length int) {
|
||||
msghdr.Controllen = uint32(length)
|
||||
}
|
||||
|
||||
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||
cmsg.Len = uint32(length)
|
||||
}
|
|
@ -581,6 +581,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
|||
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||
//sys Fdatasync(fd int) (err error)
|
||||
//sys Flock(fd int, how int) (err error)
|
||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||
//sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error)
|
||||
|
|
|
@ -242,9 +242,13 @@ type BpfHdr C.struct_bpf_hdr
|
|||
|
||||
type Termios C.struct_termios
|
||||
|
||||
type Winsize C.struct_winsize
|
||||
|
||||
// fchmodat-like syscalls.
|
||||
|
||||
const (
|
||||
AT_FDCWD = C.AT_FDCWD
|
||||
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
|
|
@ -240,3 +240,10 @@ type BpfHdr C.struct_bpf_hdr
|
|||
// Terminal handling
|
||||
|
||||
type Termios C.struct_termios
|
||||
|
||||
// fchmodat-like syscalls.
|
||||
|
||||
const (
|
||||
AT_FDCWD = C.AT_FDCWD
|
||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
|
|
@ -21,6 +21,7 @@ package unix
|
|||
#include <termios.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/capability.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
|
@ -130,7 +131,10 @@ struct if_data8 {
|
|||
u_long ifi_iqdrops;
|
||||
u_long ifi_noproto;
|
||||
u_long ifi_hwassist;
|
||||
// FIXME: these are now unions, so maybe need to change definitions?
|
||||
#undef ifi_epoch
|
||||
time_t ifi_epoch;
|
||||
#undef ifi_lastchange
|
||||
struct timeval ifi_lastchange;
|
||||
};
|
||||
|
||||
|
@ -351,3 +355,18 @@ type BpfZbufHeader C.struct_bpf_zbuf_header
|
|||
// Terminal handling
|
||||
|
||||
type Termios C.struct_termios
|
||||
|
||||
type Winsize C.struct_winsize
|
||||
|
||||
// fchmodat-like syscalls.
|
||||
|
||||
const (
|
||||
AT_FDCWD = C.AT_FDCWD
|
||||
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
||||
// Capabilities
|
||||
|
||||
type CapRights C.struct_cap_rights
|
||||
|
|
|
@ -227,6 +227,13 @@ type BpfTimeval C.struct_bpf_timeval
|
|||
|
||||
type Termios C.struct_termios
|
||||
|
||||
// fchmodat-like syscalls.
|
||||
|
||||
const (
|
||||
AT_FDCWD = C.AT_FDCWD
|
||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
||||
// Sysctl
|
||||
|
||||
type Sysctlnode C.struct_sysctlnode
|
||||
|
|
|
@ -242,3 +242,10 @@ type BpfTimeval C.struct_bpf_timeval
|
|||
// Terminal handling
|
||||
|
||||
type Termios C.struct_termios
|
||||
|
||||
// fchmodat-like syscalls.
|
||||
|
||||
const (
|
||||
AT_FDCWD = C.AT_FDCWD
|
||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// mkerrors.sh -m32
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build 386,darwin
|
||||
|
||||
|
@ -48,6 +48,7 @@ const (
|
|||
AF_UNIX = 0x1
|
||||
AF_UNSPEC = 0x0
|
||||
AF_UTUN = 0x26
|
||||
ALTWERASE = 0x200
|
||||
B0 = 0x0
|
||||
B110 = 0x6e
|
||||
B115200 = 0x1c200
|
||||
|
@ -138,9 +139,26 @@ const (
|
|||
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
|
||||
CR0 = 0x0
|
||||
CR1 = 0x1000
|
||||
CR2 = 0x2000
|
||||
CR3 = 0x3000
|
||||
CRDLY = 0x3000
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
CS6 = 0x100
|
||||
CS7 = 0x200
|
||||
|
@ -332,13 +350,14 @@ const (
|
|||
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 = 0xe
|
||||
EVFILT_THREADMARKER = 0xe
|
||||
EVFILT_SYSCOUNT = 0xf
|
||||
EVFILT_THREADMARKER = 0xf
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xa
|
||||
EVFILT_VM = -0xc
|
||||
|
@ -349,6 +368,7 @@ const (
|
|||
EV_DELETE = 0x2
|
||||
EV_DISABLE = 0x8
|
||||
EV_DISPATCH = 0x80
|
||||
EV_DISPATCH2 = 0x180
|
||||
EV_ENABLE = 0x4
|
||||
EV_EOF = 0x8000
|
||||
EV_ERROR = 0x4000
|
||||
|
@ -359,16 +379,25 @@ const (
|
|||
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
|
||||
F_ADDFILESIGS = 0x3d
|
||||
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||
F_ADDFILESIGS_RETURN = 0x61
|
||||
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
|
||||
|
@ -770,11 +799,13 @@ const (
|
|||
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_ANON = 0x1000
|
||||
MAP_ANONYMOUS = 0x1000
|
||||
MAP_COPY = 0x2
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
|
@ -786,9 +817,43 @@ const (
|
|||
MAP_PRIVATE = 0x2
|
||||
MAP_RENAME = 0x20
|
||||
MAP_RESERVED0080 = 0x80
|
||||
MAP_RESILIENT_CODESIGN = 0x2000
|
||||
MAP_RESILIENT_MEDIA = 0x4000
|
||||
MAP_SHARED = 0x1
|
||||
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_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_ROOTFS = 0x4000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CTRUNC = 0x20
|
||||
MSG_DONTROUTE = 0x4
|
||||
MSG_DONTWAIT = 0x80
|
||||
|
@ -819,7 +884,13 @@ const (
|
|||
NET_RT_MAXID = 0xa
|
||||
NET_RT_STAT = 0x4
|
||||
NET_RT_TRASH = 0x5
|
||||
NL0 = 0x0
|
||||
NL1 = 0x100
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
NLDLY = 0x300
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSOLUTE = 0x8
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_BACKGROUND = 0x40
|
||||
|
@ -843,11 +914,14 @@ const (
|
|||
NOTE_FFNOP = 0x0
|
||||
NOTE_FFOR = 0x80000000
|
||||
NOTE_FORK = 0x40000000
|
||||
NOTE_FUNLOCK = 0x100
|
||||
NOTE_LEEWAY = 0x10
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||
NOTE_NONE = 0x80
|
||||
NOTE_NSECONDS = 0x4
|
||||
NOTE_OOB = 0x2
|
||||
NOTE_PCTRLMASK = -0x100000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_REAP = 0x10000000
|
||||
|
@ -872,6 +946,7 @@ const (
|
|||
ONOCR = 0x20
|
||||
ONOEOT = 0x8
|
||||
OPOST = 0x1
|
||||
OXTABS = 0x4
|
||||
O_ACCMODE = 0x3
|
||||
O_ALERT = 0x20000000
|
||||
O_APPEND = 0x8
|
||||
|
@ -880,6 +955,7 @@ const (
|
|||
O_CREAT = 0x200
|
||||
O_DIRECTORY = 0x100000
|
||||
O_DP_GETRAWENCRYPTED = 0x1
|
||||
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||
O_DSYNC = 0x400000
|
||||
O_EVTONLY = 0x8000
|
||||
O_EXCL = 0x800
|
||||
|
@ -932,7 +1008,10 @@ const (
|
|||
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
|
||||
|
@ -1102,6 +1181,8 @@ const (
|
|||
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
|
||||
|
@ -1157,11 +1238,22 @@ const (
|
|||
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
|
||||
TCP_CONNECTIONTIMEOUT = 0x20
|
||||
TCP_CONNECTION_INFO = 0x106
|
||||
TCP_ENABLE_ECN = 0x104
|
||||
TCP_FASTOPEN = 0x105
|
||||
TCP_KEEPALIVE = 0x10
|
||||
TCP_KEEPCNT = 0x102
|
||||
TCP_KEEPINTVL = 0x101
|
||||
|
@ -1261,6 +1353,11 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MACHFACTOR = 0x4
|
||||
VM_MAXID = 0x6
|
||||
VM_METER = 0x1
|
||||
VM_SWAPUSAGE = 0x5
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// mkerrors.sh -m64
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build amd64,darwin
|
||||
|
||||
|
@ -48,6 +48,7 @@ const (
|
|||
AF_UNIX = 0x1
|
||||
AF_UNSPEC = 0x0
|
||||
AF_UTUN = 0x26
|
||||
ALTWERASE = 0x200
|
||||
B0 = 0x0
|
||||
B110 = 0x6e
|
||||
B115200 = 0x1c200
|
||||
|
@ -138,9 +139,26 @@ const (
|
|||
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
|
||||
CR0 = 0x0
|
||||
CR1 = 0x1000
|
||||
CR2 = 0x2000
|
||||
CR3 = 0x3000
|
||||
CRDLY = 0x3000
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
CS6 = 0x100
|
||||
CS7 = 0x200
|
||||
|
@ -332,13 +350,14 @@ const (
|
|||
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 = 0xe
|
||||
EVFILT_THREADMARKER = 0xe
|
||||
EVFILT_SYSCOUNT = 0xf
|
||||
EVFILT_THREADMARKER = 0xf
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xa
|
||||
EVFILT_VM = -0xc
|
||||
|
@ -349,6 +368,7 @@ const (
|
|||
EV_DELETE = 0x2
|
||||
EV_DISABLE = 0x8
|
||||
EV_DISPATCH = 0x80
|
||||
EV_DISPATCH2 = 0x180
|
||||
EV_ENABLE = 0x4
|
||||
EV_EOF = 0x8000
|
||||
EV_ERROR = 0x4000
|
||||
|
@ -359,16 +379,25 @@ const (
|
|||
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
|
||||
F_ADDFILESIGS = 0x3d
|
||||
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||
F_ADDFILESIGS_RETURN = 0x61
|
||||
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
|
||||
|
@ -770,11 +799,13 @@ const (
|
|||
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_ANON = 0x1000
|
||||
MAP_ANONYMOUS = 0x1000
|
||||
MAP_COPY = 0x2
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
|
@ -786,9 +817,43 @@ const (
|
|||
MAP_PRIVATE = 0x2
|
||||
MAP_RENAME = 0x20
|
||||
MAP_RESERVED0080 = 0x80
|
||||
MAP_RESILIENT_CODESIGN = 0x2000
|
||||
MAP_RESILIENT_MEDIA = 0x4000
|
||||
MAP_SHARED = 0x1
|
||||
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_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_ROOTFS = 0x4000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CTRUNC = 0x20
|
||||
MSG_DONTROUTE = 0x4
|
||||
MSG_DONTWAIT = 0x80
|
||||
|
@ -819,7 +884,13 @@ const (
|
|||
NET_RT_MAXID = 0xa
|
||||
NET_RT_STAT = 0x4
|
||||
NET_RT_TRASH = 0x5
|
||||
NL0 = 0x0
|
||||
NL1 = 0x100
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
NLDLY = 0x300
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSOLUTE = 0x8
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_BACKGROUND = 0x40
|
||||
|
@ -843,11 +914,14 @@ const (
|
|||
NOTE_FFNOP = 0x0
|
||||
NOTE_FFOR = 0x80000000
|
||||
NOTE_FORK = 0x40000000
|
||||
NOTE_FUNLOCK = 0x100
|
||||
NOTE_LEEWAY = 0x10
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||
NOTE_NONE = 0x80
|
||||
NOTE_NSECONDS = 0x4
|
||||
NOTE_OOB = 0x2
|
||||
NOTE_PCTRLMASK = -0x100000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_REAP = 0x10000000
|
||||
|
@ -872,6 +946,7 @@ const (
|
|||
ONOCR = 0x20
|
||||
ONOEOT = 0x8
|
||||
OPOST = 0x1
|
||||
OXTABS = 0x4
|
||||
O_ACCMODE = 0x3
|
||||
O_ALERT = 0x20000000
|
||||
O_APPEND = 0x8
|
||||
|
@ -880,6 +955,7 @@ const (
|
|||
O_CREAT = 0x200
|
||||
O_DIRECTORY = 0x100000
|
||||
O_DP_GETRAWENCRYPTED = 0x1
|
||||
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||
O_DSYNC = 0x400000
|
||||
O_EVTONLY = 0x8000
|
||||
O_EXCL = 0x800
|
||||
|
@ -932,7 +1008,10 @@ const (
|
|||
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
|
||||
|
@ -1102,6 +1181,8 @@ const (
|
|||
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
|
||||
|
@ -1157,11 +1238,22 @@ const (
|
|||
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
|
||||
TCP_CONNECTIONTIMEOUT = 0x20
|
||||
TCP_CONNECTION_INFO = 0x106
|
||||
TCP_ENABLE_ECN = 0x104
|
||||
TCP_FASTOPEN = 0x105
|
||||
TCP_KEEPALIVE = 0x10
|
||||
TCP_KEEPCNT = 0x102
|
||||
TCP_KEEPINTVL = 0x101
|
||||
|
@ -1261,6 +1353,11 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MACHFACTOR = 0x4
|
||||
VM_MAXID = 0x6
|
||||
VM_METER = 0x1
|
||||
VM_SWAPUSAGE = 0x5
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// mkerrors.sh
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build arm,darwin
|
||||
|
||||
// Created by cgo -godefs - DO NOT EDIT
|
||||
// cgo -godefs -- _const.go
|
||||
|
||||
// +build arm,darwin
|
||||
|
||||
package unix
|
||||
|
||||
import "syscall"
|
||||
|
@ -48,6 +48,7 @@ const (
|
|||
AF_UNIX = 0x1
|
||||
AF_UNSPEC = 0x0
|
||||
AF_UTUN = 0x26
|
||||
ALTWERASE = 0x200
|
||||
B0 = 0x0
|
||||
B110 = 0x6e
|
||||
B115200 = 0x1c200
|
||||
|
@ -86,6 +87,7 @@ const (
|
|||
BIOCSBLEN = 0xc0044266
|
||||
BIOCSDLT = 0x80044278
|
||||
BIOCSETF = 0x80104267
|
||||
BIOCSETFNR = 0x8010427e
|
||||
BIOCSETIF = 0x8020426c
|
||||
BIOCSHDRCMPLT = 0x80044275
|
||||
BIOCSRSIG = 0x80044273
|
||||
|
@ -137,9 +139,26 @@ const (
|
|||
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
|
||||
CR0 = 0x0
|
||||
CR1 = 0x1000
|
||||
CR2 = 0x2000
|
||||
CR3 = 0x3000
|
||||
CRDLY = 0x3000
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
CS6 = 0x100
|
||||
CS7 = 0x200
|
||||
|
@ -152,33 +171,168 @@ const (
|
|||
CSUSP = 0x1a
|
||||
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 = 0xf5
|
||||
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_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
|
||||
|
@ -196,13 +350,14 @@ const (
|
|||
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 = 0xe
|
||||
EVFILT_THREADMARKER = 0xe
|
||||
EVFILT_SYSCOUNT = 0xf
|
||||
EVFILT_THREADMARKER = 0xf
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xa
|
||||
EVFILT_VM = -0xc
|
||||
|
@ -213,6 +368,7 @@ const (
|
|||
EV_DELETE = 0x2
|
||||
EV_DISABLE = 0x8
|
||||
EV_DISPATCH = 0x80
|
||||
EV_DISPATCH2 = 0x180
|
||||
EV_ENABLE = 0x4
|
||||
EV_EOF = 0x8000
|
||||
EV_ERROR = 0x4000
|
||||
|
@ -223,16 +379,25 @@ const (
|
|||
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
|
||||
F_ADDFILESIGS = 0x3d
|
||||
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||
F_ADDFILESIGS_RETURN = 0x61
|
||||
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
|
||||
|
@ -347,6 +512,7 @@ const (
|
|||
IFT_PDP = 0xff
|
||||
IFT_PFLOG = 0xf5
|
||||
IFT_PFSYNC = 0xf6
|
||||
IFT_PKTAP = 0xfe
|
||||
IFT_PPP = 0x17
|
||||
IFT_PROPMUX = 0x36
|
||||
IFT_PROPVIRTUAL = 0x35
|
||||
|
@ -515,7 +681,7 @@ const (
|
|||
IPV6_FAITH = 0x1d
|
||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||
IPV6_FRAGTTL = 0x78
|
||||
IPV6_FRAGTTL = 0x3c
|
||||
IPV6_FW_ADD = 0x1e
|
||||
IPV6_FW_DEL = 0x1f
|
||||
IPV6_FW_FLUSH = 0x20
|
||||
|
@ -633,11 +799,13 @@ const (
|
|||
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_ANON = 0x1000
|
||||
MAP_ANONYMOUS = 0x1000
|
||||
MAP_COPY = 0x2
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
|
@ -649,9 +817,43 @@ const (
|
|||
MAP_PRIVATE = 0x2
|
||||
MAP_RENAME = 0x20
|
||||
MAP_RESERVED0080 = 0x80
|
||||
MAP_RESILIENT_CODESIGN = 0x2000
|
||||
MAP_RESILIENT_MEDIA = 0x4000
|
||||
MAP_SHARED = 0x1
|
||||
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_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_ROOTFS = 0x4000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CTRUNC = 0x20
|
||||
MSG_DONTROUTE = 0x4
|
||||
MSG_DONTWAIT = 0x80
|
||||
|
@ -682,7 +884,13 @@ const (
|
|||
NET_RT_MAXID = 0xa
|
||||
NET_RT_STAT = 0x4
|
||||
NET_RT_TRASH = 0x5
|
||||
NL0 = 0x0
|
||||
NL1 = 0x100
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
NLDLY = 0x300
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSOLUTE = 0x8
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_BACKGROUND = 0x40
|
||||
|
@ -706,11 +914,14 @@ const (
|
|||
NOTE_FFNOP = 0x0
|
||||
NOTE_FFOR = 0x80000000
|
||||
NOTE_FORK = 0x40000000
|
||||
NOTE_FUNLOCK = 0x100
|
||||
NOTE_LEEWAY = 0x10
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||
NOTE_NONE = 0x80
|
||||
NOTE_NSECONDS = 0x4
|
||||
NOTE_OOB = 0x2
|
||||
NOTE_PCTRLMASK = -0x100000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_REAP = 0x10000000
|
||||
|
@ -735,6 +946,7 @@ const (
|
|||
ONOCR = 0x20
|
||||
ONOEOT = 0x8
|
||||
OPOST = 0x1
|
||||
OXTABS = 0x4
|
||||
O_ACCMODE = 0x3
|
||||
O_ALERT = 0x20000000
|
||||
O_APPEND = 0x8
|
||||
|
@ -743,6 +955,7 @@ const (
|
|||
O_CREAT = 0x200
|
||||
O_DIRECTORY = 0x100000
|
||||
O_DP_GETRAWENCRYPTED = 0x1
|
||||
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||
O_DSYNC = 0x400000
|
||||
O_EVTONLY = 0x8000
|
||||
O_EXCL = 0x800
|
||||
|
@ -795,7 +1008,10 @@ const (
|
|||
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
|
||||
|
@ -830,6 +1046,7 @@ const (
|
|||
RTF_LOCAL = 0x200000
|
||||
RTF_MODIFIED = 0x20
|
||||
RTF_MULTICAST = 0x800000
|
||||
RTF_NOIFREF = 0x2000
|
||||
RTF_PINNED = 0x100000
|
||||
RTF_PRCLONING = 0x10000
|
||||
RTF_PROTO1 = 0x8000
|
||||
|
@ -964,6 +1181,8 @@ const (
|
|||
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
|
||||
|
@ -1019,11 +1238,22 @@ const (
|
|||
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
|
||||
TCP_CONNECTIONTIMEOUT = 0x20
|
||||
TCP_CONNECTION_INFO = 0x106
|
||||
TCP_ENABLE_ECN = 0x104
|
||||
TCP_FASTOPEN = 0x105
|
||||
TCP_KEEPALIVE = 0x10
|
||||
TCP_KEEPCNT = 0x102
|
||||
TCP_KEEPINTVL = 0x101
|
||||
|
@ -1123,6 +1353,11 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MACHFACTOR = 0x4
|
||||
VM_MAXID = 0x6
|
||||
VM_METER = 0x1
|
||||
VM_SWAPUSAGE = 0x5
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
@ -1291,3 +1526,148 @@ const (
|
|||
SIGXCPU = syscall.Signal(0x18)
|
||||
SIGXFSZ = syscall.Signal(0x19)
|
||||
)
|
||||
|
||||
// Error table
|
||||
var errors = [...]string{
|
||||
1: "operation not permitted",
|
||||
2: "no such file or directory",
|
||||
3: "no such process",
|
||||
4: "interrupted system call",
|
||||
5: "input/output error",
|
||||
6: "device not configured",
|
||||
7: "argument list too long",
|
||||
8: "exec format error",
|
||||
9: "bad file descriptor",
|
||||
10: "no child processes",
|
||||
11: "resource deadlock avoided",
|
||||
12: "cannot allocate memory",
|
||||
13: "permission denied",
|
||||
14: "bad address",
|
||||
15: "block device required",
|
||||
16: "resource busy",
|
||||
17: "file exists",
|
||||
18: "cross-device link",
|
||||
19: "operation not supported by device",
|
||||
20: "not a directory",
|
||||
21: "is a directory",
|
||||
22: "invalid argument",
|
||||
23: "too many open files in system",
|
||||
24: "too many open files",
|
||||
25: "inappropriate ioctl for device",
|
||||
26: "text file busy",
|
||||
27: "file too large",
|
||||
28: "no space left on device",
|
||||
29: "illegal seek",
|
||||
30: "read-only file system",
|
||||
31: "too many links",
|
||||
32: "broken pipe",
|
||||
33: "numerical argument out of domain",
|
||||
34: "result too large",
|
||||
35: "resource temporarily unavailable",
|
||||
36: "operation now in progress",
|
||||
37: "operation already in progress",
|
||||
38: "socket operation on non-socket",
|
||||
39: "destination address required",
|
||||
40: "message too long",
|
||||
41: "protocol wrong type for socket",
|
||||
42: "protocol not available",
|
||||
43: "protocol not supported",
|
||||
44: "socket type not supported",
|
||||
45: "operation not supported",
|
||||
46: "protocol family not supported",
|
||||
47: "address family not supported by protocol family",
|
||||
48: "address already in use",
|
||||
49: "can't assign requested address",
|
||||
50: "network is down",
|
||||
51: "network is unreachable",
|
||||
52: "network dropped connection on reset",
|
||||
53: "software caused connection abort",
|
||||
54: "connection reset by peer",
|
||||
55: "no buffer space available",
|
||||
56: "socket is already connected",
|
||||
57: "socket is not connected",
|
||||
58: "can't send after socket shutdown",
|
||||
59: "too many references: can't splice",
|
||||
60: "operation timed out",
|
||||
61: "connection refused",
|
||||
62: "too many levels of symbolic links",
|
||||
63: "file name too long",
|
||||
64: "host is down",
|
||||
65: "no route to host",
|
||||
66: "directory not empty",
|
||||
67: "too many processes",
|
||||
68: "too many users",
|
||||
69: "disc quota exceeded",
|
||||
70: "stale NFS file handle",
|
||||
71: "too many levels of remote in path",
|
||||
72: "RPC struct is bad",
|
||||
73: "RPC version wrong",
|
||||
74: "RPC prog. not avail",
|
||||
75: "program version wrong",
|
||||
76: "bad procedure for program",
|
||||
77: "no locks available",
|
||||
78: "function not implemented",
|
||||
79: "inappropriate file type or format",
|
||||
80: "authentication error",
|
||||
81: "need authenticator",
|
||||
82: "device power is off",
|
||||
83: "device error",
|
||||
84: "value too large to be stored in data type",
|
||||
85: "bad executable (or shared library)",
|
||||
86: "bad CPU type in executable",
|
||||
87: "shared library version mismatch",
|
||||
88: "malformed Mach-o file",
|
||||
89: "operation canceled",
|
||||
90: "identifier removed",
|
||||
91: "no message of desired type",
|
||||
92: "illegal byte sequence",
|
||||
93: "attribute not found",
|
||||
94: "bad message",
|
||||
95: "EMULTIHOP (Reserved)",
|
||||
96: "no message available on STREAM",
|
||||
97: "ENOLINK (Reserved)",
|
||||
98: "no STREAM resources",
|
||||
99: "not a STREAM",
|
||||
100: "protocol error",
|
||||
101: "STREAM ioctl timeout",
|
||||
102: "operation not supported on socket",
|
||||
103: "policy not found",
|
||||
104: "state not recoverable",
|
||||
105: "previous owner died",
|
||||
106: "interface output queue is full",
|
||||
}
|
||||
|
||||
// Signal table
|
||||
var signals = [...]string{
|
||||
1: "hangup",
|
||||
2: "interrupt",
|
||||
3: "quit",
|
||||
4: "illegal instruction",
|
||||
5: "trace/BPT trap",
|
||||
6: "abort trap",
|
||||
7: "EMT trap",
|
||||
8: "floating point exception",
|
||||
9: "killed",
|
||||
10: "bus error",
|
||||
11: "segmentation fault",
|
||||
12: "bad system call",
|
||||
13: "broken pipe",
|
||||
14: "alarm clock",
|
||||
15: "terminated",
|
||||
16: "urgent I/O condition",
|
||||
17: "suspended (signal)",
|
||||
18: "suspended",
|
||||
19: "continued",
|
||||
20: "child exited",
|
||||
21: "stopped (tty input)",
|
||||
22: "stopped (tty output)",
|
||||
23: "I/O possible",
|
||||
24: "cputime limit exceeded",
|
||||
25: "filesize limit exceeded",
|
||||
26: "virtual timer expired",
|
||||
27: "profiling timer expired",
|
||||
28: "window size changes",
|
||||
29: "information request",
|
||||
30: "user defined signal 1",
|
||||
31: "user defined signal 2",
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// mkerrors.sh -m64
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build arm64,darwin
|
||||
|
||||
|
@ -48,6 +48,7 @@ const (
|
|||
AF_UNIX = 0x1
|
||||
AF_UNSPEC = 0x0
|
||||
AF_UTUN = 0x26
|
||||
ALTWERASE = 0x200
|
||||
B0 = 0x0
|
||||
B110 = 0x6e
|
||||
B115200 = 0x1c200
|
||||
|
@ -138,9 +139,26 @@ const (
|
|||
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
|
||||
CR0 = 0x0
|
||||
CR1 = 0x1000
|
||||
CR2 = 0x2000
|
||||
CR3 = 0x3000
|
||||
CRDLY = 0x3000
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
CS6 = 0x100
|
||||
CS7 = 0x200
|
||||
|
@ -332,13 +350,14 @@ const (
|
|||
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 = 0xe
|
||||
EVFILT_THREADMARKER = 0xe
|
||||
EVFILT_SYSCOUNT = 0xf
|
||||
EVFILT_THREADMARKER = 0xf
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xa
|
||||
EVFILT_VM = -0xc
|
||||
|
@ -349,6 +368,7 @@ const (
|
|||
EV_DELETE = 0x2
|
||||
EV_DISABLE = 0x8
|
||||
EV_DISPATCH = 0x80
|
||||
EV_DISPATCH2 = 0x180
|
||||
EV_ENABLE = 0x4
|
||||
EV_EOF = 0x8000
|
||||
EV_ERROR = 0x4000
|
||||
|
@ -359,16 +379,25 @@ const (
|
|||
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
|
||||
F_ADDFILESIGS = 0x3d
|
||||
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||
F_ADDFILESIGS_RETURN = 0x61
|
||||
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
|
||||
|
@ -770,11 +799,13 @@ const (
|
|||
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_ANON = 0x1000
|
||||
MAP_ANONYMOUS = 0x1000
|
||||
MAP_COPY = 0x2
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
|
@ -786,9 +817,43 @@ const (
|
|||
MAP_PRIVATE = 0x2
|
||||
MAP_RENAME = 0x20
|
||||
MAP_RESERVED0080 = 0x80
|
||||
MAP_RESILIENT_CODESIGN = 0x2000
|
||||
MAP_RESILIENT_MEDIA = 0x4000
|
||||
MAP_SHARED = 0x1
|
||||
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_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_ROOTFS = 0x4000
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CTRUNC = 0x20
|
||||
MSG_DONTROUTE = 0x4
|
||||
MSG_DONTWAIT = 0x80
|
||||
|
@ -819,7 +884,13 @@ const (
|
|||
NET_RT_MAXID = 0xa
|
||||
NET_RT_STAT = 0x4
|
||||
NET_RT_TRASH = 0x5
|
||||
NL0 = 0x0
|
||||
NL1 = 0x100
|
||||
NL2 = 0x200
|
||||
NL3 = 0x300
|
||||
NLDLY = 0x300
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSOLUTE = 0x8
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_BACKGROUND = 0x40
|
||||
|
@ -843,11 +914,14 @@ const (
|
|||
NOTE_FFNOP = 0x0
|
||||
NOTE_FFOR = 0x80000000
|
||||
NOTE_FORK = 0x40000000
|
||||
NOTE_FUNLOCK = 0x100
|
||||
NOTE_LEEWAY = 0x10
|
||||
NOTE_LINK = 0x10
|
||||
NOTE_LOWAT = 0x1
|
||||
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||
NOTE_NONE = 0x80
|
||||
NOTE_NSECONDS = 0x4
|
||||
NOTE_OOB = 0x2
|
||||
NOTE_PCTRLMASK = -0x100000
|
||||
NOTE_PDATAMASK = 0xfffff
|
||||
NOTE_REAP = 0x10000000
|
||||
|
@ -872,6 +946,7 @@ const (
|
|||
ONOCR = 0x20
|
||||
ONOEOT = 0x8
|
||||
OPOST = 0x1
|
||||
OXTABS = 0x4
|
||||
O_ACCMODE = 0x3
|
||||
O_ALERT = 0x20000000
|
||||
O_APPEND = 0x8
|
||||
|
@ -880,6 +955,7 @@ const (
|
|||
O_CREAT = 0x200
|
||||
O_DIRECTORY = 0x100000
|
||||
O_DP_GETRAWENCRYPTED = 0x1
|
||||
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||
O_DSYNC = 0x400000
|
||||
O_EVTONLY = 0x8000
|
||||
O_EXCL = 0x800
|
||||
|
@ -932,7 +1008,10 @@ const (
|
|||
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
|
||||
|
@ -1102,6 +1181,8 @@ const (
|
|||
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
|
||||
|
@ -1157,11 +1238,22 @@ const (
|
|||
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
|
||||
TCP_CONNECTIONTIMEOUT = 0x20
|
||||
TCP_CONNECTION_INFO = 0x106
|
||||
TCP_ENABLE_ECN = 0x104
|
||||
TCP_FASTOPEN = 0x105
|
||||
TCP_KEEPALIVE = 0x10
|
||||
TCP_KEEPCNT = 0x102
|
||||
TCP_KEEPINTVL = 0x101
|
||||
|
@ -1261,6 +1353,11 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_LOADAVG = 0x2
|
||||
VM_MACHFACTOR = 0x4
|
||||
VM_MAXID = 0x6
|
||||
VM_METER = 0x1
|
||||
VM_SWAPUSAGE = 0x5
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1413,6 +1426,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1420,7 +1443,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1440,13 +1465,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1465,11 +1498,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1602,6 +1639,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x540b
|
||||
TCGETA = 0x5405
|
||||
TCGETS = 0x5401
|
||||
|
@ -1741,6 +1784,7 @@ const (
|
|||
TIOCSWINSZ = 0x5414
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x100
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x400854d5
|
||||
TUNDETACHFILTER = 0x400854d6
|
||||
TUNGETFEATURES = 0x800454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1414,6 +1427,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1421,7 +1444,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1441,13 +1466,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1466,11 +1499,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1603,6 +1640,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x540b
|
||||
TCGETA = 0x5405
|
||||
TCGETS = 0x5401
|
||||
|
@ -1742,6 +1785,7 @@ const (
|
|||
TIOCSWINSZ = 0x5414
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x100
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x401054d5
|
||||
TUNDETACHFILTER = 0x401054d6
|
||||
TUNGETFEATURES = 0x800454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1418,6 +1431,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1425,7 +1448,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1445,13 +1470,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1470,11 +1503,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1607,6 +1644,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x540b
|
||||
TCGETA = 0x5405
|
||||
TCGETS = 0x5401
|
||||
|
@ -1746,6 +1789,7 @@ const (
|
|||
TIOCSWINSZ = 0x5414
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x100
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x400854d5
|
||||
TUNDETACHFILTER = 0x400854d6
|
||||
TUNGETFEATURES = 0x800454cf
|
||||
|
|
|
@ -508,6 +508,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1403,6 +1416,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1410,7 +1433,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1430,13 +1455,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1455,11 +1488,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1592,6 +1629,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x540b
|
||||
TCGETA = 0x5405
|
||||
TCGETS = 0x5401
|
||||
|
@ -1731,6 +1774,7 @@ const (
|
|||
TIOCSWINSZ = 0x5414
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x100
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x401054d5
|
||||
TUNDETACHFILTER = 0x401054d6
|
||||
TUNGETFEATURES = 0x800454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1415,6 +1428,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1422,7 +1445,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1442,13 +1467,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1467,11 +1500,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1605,6 +1642,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x5407
|
||||
TCGETA = 0x5401
|
||||
TCGETS = 0x540d
|
||||
|
@ -1745,6 +1788,7 @@ const (
|
|||
TIOCSWINSZ = 0x80087467
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x8000
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x800854d5
|
||||
TUNDETACHFILTER = 0x800854d6
|
||||
TUNGETFEATURES = 0x400454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1415,6 +1428,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1422,7 +1445,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1442,13 +1467,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1467,11 +1500,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1605,6 +1642,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x5407
|
||||
TCGETA = 0x5401
|
||||
TCGETS = 0x540d
|
||||
|
@ -1745,6 +1788,7 @@ const (
|
|||
TIOCSWINSZ = 0x80087467
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x8000
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x801054d5
|
||||
TUNDETACHFILTER = 0x801054d6
|
||||
TUNGETFEATURES = 0x400454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1415,6 +1428,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1422,7 +1445,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1442,13 +1467,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1467,11 +1500,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1605,6 +1642,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x5407
|
||||
TCGETA = 0x5401
|
||||
TCGETS = 0x540d
|
||||
|
@ -1745,6 +1788,7 @@ const (
|
|||
TIOCSWINSZ = 0x80087467
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x8000
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x801054d5
|
||||
TUNDETACHFILTER = 0x801054d6
|
||||
TUNGETFEATURES = 0x400454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1415,6 +1428,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x40047307
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1422,7 +1445,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1442,13 +1467,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x467f
|
||||
SIOCOUTQ = 0x7472
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1467,11 +1500,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x1
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x80
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1605,6 +1642,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x5407
|
||||
TCGETA = 0x5401
|
||||
TCGETS = 0x540d
|
||||
|
@ -1745,6 +1788,7 @@ const (
|
|||
TIOCSWINSZ = 0x80087467
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x8000
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x800854d5
|
||||
TUNDETACHFILTER = 0x800854d6
|
||||
TUNGETFEATURES = 0x400454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x4000
|
||||
|
@ -1471,6 +1484,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1478,7 +1501,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1498,13 +1523,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x4004667f
|
||||
SIOCOUTQ = 0x40047473
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1523,11 +1556,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1660,6 +1697,12 @@ const (
|
|||
TAB2 = 0x800
|
||||
TAB3 = 0xc00
|
||||
TABDLY = 0xc00
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x2000741f
|
||||
TCGETA = 0x40147417
|
||||
TCGETS = 0x402c7413
|
||||
|
@ -1803,6 +1846,7 @@ const (
|
|||
TIOCSWINSZ = 0x80087467
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x400000
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x801054d5
|
||||
TUNDETACHFILTER = 0x801054d6
|
||||
TUNGETFEATURES = 0x400454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x4000
|
||||
|
@ -1471,6 +1484,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1478,7 +1501,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1498,13 +1523,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x4004667f
|
||||
SIOCOUTQ = 0x40047473
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1523,11 +1556,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1660,6 +1697,12 @@ const (
|
|||
TAB2 = 0x800
|
||||
TAB3 = 0xc00
|
||||
TABDLY = 0xc00
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x2000741f
|
||||
TCGETA = 0x40147417
|
||||
TCGETS = 0x402c7413
|
||||
|
@ -1803,6 +1846,7 @@ const (
|
|||
TIOCSWINSZ = 0x80087467
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x400000
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x801054d5
|
||||
TUNDETACHFILTER = 0x801054d6
|
||||
TUNGETFEATURES = 0x400454cf
|
||||
|
|
|
@ -507,6 +507,19 @@ const (
|
|||
F_ULOCK = 0x0
|
||||
F_UNLCK = 0x2
|
||||
F_WRLCK = 0x1
|
||||
GENL_ADMIN_PERM = 0x1
|
||||
GENL_CMD_CAP_DO = 0x2
|
||||
GENL_CMD_CAP_DUMP = 0x4
|
||||
GENL_CMD_CAP_HASPOL = 0x8
|
||||
GENL_HDRLEN = 0x4
|
||||
GENL_ID_CTRL = 0x10
|
||||
GENL_ID_PMCRAID = 0x12
|
||||
GENL_ID_VFS_DQUOT = 0x11
|
||||
GENL_MAX_ID = 0x3ff
|
||||
GENL_MIN_ID = 0x10
|
||||
GENL_NAMSIZ = 0x10
|
||||
GENL_START_ALLOC = 0x13
|
||||
GENL_UNS_ADMIN_PERM = 0x10
|
||||
GRND_NONBLOCK = 0x1
|
||||
GRND_RANDOM = 0x2
|
||||
HUPCL = 0x400
|
||||
|
@ -1475,6 +1488,16 @@ const (
|
|||
SIOCADDMULTI = 0x8931
|
||||
SIOCADDRT = 0x890b
|
||||
SIOCATMARK = 0x8905
|
||||
SIOCBONDCHANGEACTIVE = 0x8995
|
||||
SIOCBONDENSLAVE = 0x8990
|
||||
SIOCBONDINFOQUERY = 0x8994
|
||||
SIOCBONDRELEASE = 0x8991
|
||||
SIOCBONDSETHWADDR = 0x8992
|
||||
SIOCBONDSLAVEINFOQUERY = 0x8993
|
||||
SIOCBRADDBR = 0x89a0
|
||||
SIOCBRADDIF = 0x89a2
|
||||
SIOCBRDELBR = 0x89a1
|
||||
SIOCBRDELIF = 0x89a3
|
||||
SIOCDARP = 0x8953
|
||||
SIOCDELDLCI = 0x8981
|
||||
SIOCDELMULTI = 0x8932
|
||||
|
@ -1482,7 +1505,9 @@ const (
|
|||
SIOCDEVPRIVATE = 0x89f0
|
||||
SIOCDIFADDR = 0x8936
|
||||
SIOCDRARP = 0x8960
|
||||
SIOCETHTOOL = 0x8946
|
||||
SIOCGARP = 0x8954
|
||||
SIOCGHWTSTAMP = 0x89b1
|
||||
SIOCGIFADDR = 0x8915
|
||||
SIOCGIFBR = 0x8940
|
||||
SIOCGIFBRDADDR = 0x8919
|
||||
|
@ -1502,13 +1527,21 @@ const (
|
|||
SIOCGIFPFLAGS = 0x8935
|
||||
SIOCGIFSLAVE = 0x8929
|
||||
SIOCGIFTXQLEN = 0x8942
|
||||
SIOCGIFVLAN = 0x8982
|
||||
SIOCGMIIPHY = 0x8947
|
||||
SIOCGMIIREG = 0x8948
|
||||
SIOCGPGRP = 0x8904
|
||||
SIOCGRARP = 0x8961
|
||||
SIOCGSKNS = 0x894c
|
||||
SIOCGSTAMP = 0x8906
|
||||
SIOCGSTAMPNS = 0x8907
|
||||
SIOCINQ = 0x541b
|
||||
SIOCOUTQ = 0x5411
|
||||
SIOCOUTQNSD = 0x894b
|
||||
SIOCPROTOPRIVATE = 0x89e0
|
||||
SIOCRTMSG = 0x890d
|
||||
SIOCSARP = 0x8955
|
||||
SIOCSHWTSTAMP = 0x89b0
|
||||
SIOCSIFADDR = 0x8916
|
||||
SIOCSIFBR = 0x8941
|
||||
SIOCSIFBRDADDR = 0x891a
|
||||
|
@ -1527,11 +1560,15 @@ const (
|
|||
SIOCSIFPFLAGS = 0x8934
|
||||
SIOCSIFSLAVE = 0x8930
|
||||
SIOCSIFTXQLEN = 0x8943
|
||||
SIOCSIFVLAN = 0x8983
|
||||
SIOCSMIIREG = 0x8949
|
||||
SIOCSPGRP = 0x8902
|
||||
SIOCSRARP = 0x8962
|
||||
SIOCWANDEV = 0x894a
|
||||
SOCK_CLOEXEC = 0x80000
|
||||
SOCK_DCCP = 0x6
|
||||
SOCK_DGRAM = 0x2
|
||||
SOCK_IOC_TYPE = 0x89
|
||||
SOCK_NONBLOCK = 0x800
|
||||
SOCK_PACKET = 0xa
|
||||
SOCK_RAW = 0x3
|
||||
|
@ -1664,6 +1701,12 @@ const (
|
|||
TAB2 = 0x1000
|
||||
TAB3 = 0x1800
|
||||
TABDLY = 0x1800
|
||||
TASKSTATS_CMD_ATTR_MAX = 0x4
|
||||
TASKSTATS_CMD_MAX = 0x2
|
||||
TASKSTATS_GENL_NAME = "TASKSTATS"
|
||||
TASKSTATS_GENL_VERSION = 0x1
|
||||
TASKSTATS_TYPE_MAX = 0x6
|
||||
TASKSTATS_VERSION = 0x8
|
||||
TCFLSH = 0x540b
|
||||
TCGETA = 0x5405
|
||||
TCGETS = 0x5401
|
||||
|
@ -1803,6 +1846,7 @@ const (
|
|||
TIOCSWINSZ = 0x5414
|
||||
TIOCVHANGUP = 0x5437
|
||||
TOSTOP = 0x100
|
||||
TS_COMM_LEN = 0x20
|
||||
TUNATTACHFILTER = 0x401054d5
|
||||
TUNDETACHFILTER = 0x401054d6
|
||||
TUNGETFEATURES = 0x800454cf
|
||||
|
|
|
@ -1006,6 +1006,9 @@ const (
|
|||
MSG_TRUNC = 0x10
|
||||
MSG_USERFLAGS = 0xffffff
|
||||
MSG_WAITALL = 0x40
|
||||
MS_ASYNC = 0x1
|
||||
MS_INVALIDATE = 0x2
|
||||
MS_SYNC = 0x4
|
||||
NAME_MAX = 0x1ff
|
||||
NET_RT_DUMP = 0x1
|
||||
NET_RT_FLAGS = 0x2
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
// mksyscall.pl -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build darwin,386
|
||||
|
||||
|
@ -266,6 +266,106 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Madvise(b []byte, behav int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlockall(flags int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mprotect(b []byte, prot int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Msync(b []byte, flags int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlockall() (err error) {
|
||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -298,6 +398,16 @@ func kill(pid int, signum int, posix int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Access(path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -456,6 +566,21 @@ func Exit(code int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchdir(fd int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -486,6 +611,21 @@ func Fchmod(fd int, mode uint32) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchown(fd int, uid int, gid int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
||||
if e1 != 0 {
|
||||
|
@ -496,6 +636,21 @@ func Fchown(fd int, uid int, gid int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Flock(fd int, how int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
||||
if e1 != 0 {
|
||||
|
@ -745,6 +900,26 @@ func Link(path string, link string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *byte
|
||||
_p1, err = BytePtrFromString(link)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Listen(s int, backlog int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
||||
if e1 != 0 {
|
||||
|
@ -785,6 +960,21 @@ func Mkdir(path string, mode uint32) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mkfifo(path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -815,74 +1005,6 @@ func Mknod(path string, mode uint32, dev int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlockall(flags int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mprotect(b []byte, prot int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlockall() (err error) {
|
||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -899,6 +1021,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
||||
fd = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Pathconf(path string, name int) (val int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -988,6 +1126,28 @@ func Readlink(path string, buf []byte) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 unsafe.Pointer
|
||||
if len(buf) > 0 {
|
||||
_p1 = unsafe.Pointer(&buf[0])
|
||||
} else {
|
||||
_p1 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Rename(from string, to string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(from)
|
||||
|
@ -1008,6 +1168,26 @@ func Rename(from string, to string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(from)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *byte
|
||||
_p1, err = BytePtrFromString(to)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Revoke(path string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -1245,6 +1425,26 @@ func Symlink(path string, link string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(oldpath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *byte
|
||||
_p1, err = BytePtrFromString(newpath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Sync() (err error) {
|
||||
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -1308,6 +1508,21 @@ func Unlink(path string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Unmount(path string, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// mksyscall.pl -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go
|
||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build darwin,amd64
|
||||
|
||||
|
@ -266,6 +266,106 @@ func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Madvise(b []byte, behav int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlockall(flags int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mprotect(b []byte, prot int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Msync(b []byte, flags int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlockall() (err error) {
|
||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -298,6 +398,16 @@ func kill(pid int, signum int, posix int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
||||
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Access(path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -456,6 +566,21 @@ func Exit(code int) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchdir(fd int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -486,6 +611,21 @@ func Fchmod(fd int, mode uint32) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchown(fd int, uid int, gid int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
||||
if e1 != 0 {
|
||||
|
@ -496,6 +636,21 @@ func Fchown(fd int, uid int, gid int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Flock(fd int, how int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
||||
if e1 != 0 {
|
||||
|
@ -745,6 +900,26 @@ func Link(path string, link string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *byte
|
||||
_p1, err = BytePtrFromString(link)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Listen(s int, backlog int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
||||
if e1 != 0 {
|
||||
|
@ -785,6 +960,21 @@ func Mkdir(path string, mode uint32) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mkfifo(path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -815,74 +1005,6 @@ func Mknod(path string, mode uint32, dev int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mlockall(flags int) (err error) {
|
||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Mprotect(b []byte, prot int) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlock(b []byte) (err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(b) > 0 {
|
||||
_p0 = unsafe.Pointer(&b[0])
|
||||
} else {
|
||||
_p0 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Munlockall() (err error) {
|
||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -899,6 +1021,22 @@ func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
||||
fd = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Pathconf(path string, name int) (val int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -988,6 +1126,28 @@ func Readlink(path string, buf []byte) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 unsafe.Pointer
|
||||
if len(buf) > 0 {
|
||||
_p1 = unsafe.Pointer(&buf[0])
|
||||
} else {
|
||||
_p1 = unsafe.Pointer(&_zero)
|
||||
}
|
||||
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
||||
n = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Rename(from string, to string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(from)
|
||||
|
@ -1008,6 +1168,26 @@ func Rename(from string, to string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(from)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *byte
|
||||
_p1, err = BytePtrFromString(to)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Revoke(path string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -1245,6 +1425,26 @@ func Symlink(path string, link string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(oldpath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var _p1 *byte
|
||||
_p1, err = BytePtrFromString(newpath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Sync() (err error) {
|
||||
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
||||
if e1 != 0 {
|
||||
|
@ -1308,6 +1508,21 @@ func Unlink(path string) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Unmount(path string, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -1383,21 +1598,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
|
||||
r0, r1, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
sec = int64(r0)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue