├── vendor ├── golang.org │ └── x │ │ └── sys │ │ ├── unix │ │ ├── .gitignore │ │ ├── asm.s │ │ ├── constants.go │ │ ├── syscall_no_getwd.go │ │ ├── zsysnum_solaris_amd64.go │ │ ├── env_unset.go │ │ ├── flock_linux_32bit.go │ │ ├── asm_solaris_amd64.s │ │ ├── gccgo_linux_amd64.go │ │ ├── race0.go │ │ ├── env_unix.go │ │ ├── asm_linux_arm64.s │ │ ├── str.go │ │ ├── race.go │ │ ├── asm_linux_s390x.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_freebsd_arm.s │ │ ├── asm_netbsd_arm.s │ │ ├── asm_darwin_386.s │ │ ├── asm_freebsd_386.s │ │ ├── asm_netbsd_386.s │ │ ├── asm_openbsd_386.s │ │ ├── asm_darwin_amd64.s │ │ ├── asm_freebsd_amd64.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_netbsd_amd64.s │ │ ├── asm_openbsd_amd64.s │ │ ├── asm_dragonfly_amd64.s │ │ ├── asm_darwin_arm.s │ │ ├── bluetooth_linux.go │ │ ├── asm_darwin_arm64.s │ │ ├── flock.go │ │ ├── mksysnum_darwin.pl │ │ ├── asm_linux_386.s │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_openbsd_386.go │ │ ├── gccgo_c.c │ │ ├── sockcmsg_linux.go │ │ ├── mksysnum_dragonfly.pl │ │ ├── mksysnum_openbsd.pl │ │ ├── mksysnum_netbsd.pl │ │ ├── mksysnum_linux.pl │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_386.go │ │ ├── gccgo.go │ │ ├── mksysnum_freebsd.pl │ │ ├── mkpost.go │ │ ├── syscall_darwin_arm.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_386.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall.go │ │ ├── sockcmsg_unix.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── types_netbsd.go │ │ ├── syscall_linux_amd64.go │ │ ├── types_dragonfly.go │ │ ├── types_openbsd.go │ │ ├── types_darwin.go │ │ ├── mksysctl_openbsd.pl │ │ ├── types_solaris.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── ztypes_netbsd_386.go │ │ └── ztypes_netbsd_arm.go │ │ ├── PATENTS │ │ └── LICENSE ├── github.com │ ├── google │ │ └── shlex │ │ │ └── README │ ├── codeskyblue │ │ ├── kexec │ │ │ ├── kexec.go │ │ │ ├── .gitignore │ │ │ ├── kexec_windows.go │ │ │ ├── README.md │ │ │ └── kexec_posix.go │ │ └── dockerignore │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ └── ignore.go │ ├── go-fsnotify │ │ └── fsnotify │ │ │ ├── .gitignore │ │ │ ├── open_mode_bsd.go │ │ │ ├── open_mode_darwin.go │ │ │ ├── .travis.yml │ │ │ ├── fen.go │ │ │ ├── LICENSE │ │ │ ├── AUTHORS │ │ │ ├── fsnotify.go │ │ │ ├── README.md │ │ │ ├── CONTRIBUTING.md │ │ │ └── inotify_poller.go │ └── gobuild │ │ └── log │ │ ├── README.md │ │ └── .gitignore └── gopkg.in │ └── yaml.v2 │ ├── LICENSE.libyaml │ ├── writerc.go │ ├── sorter.go │ ├── README.md │ ├── yamlprivateh.go │ └── resolve.go ├── .gopmfile ├── .travis.yml ├── .gobuild.yml ├── Godeps ├── Readme └── Godeps.json ├── .fsw.yml ├── appveyor.yml ├── .gitignore ├── go.mod └── README.md /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | -------------------------------------------------------------------------------- /.gopmfile: -------------------------------------------------------------------------------- 1 | [target] 2 | path=github.com/codeskyblue/fswatch 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | go: 4 | - 1.4 5 | - 1.5 6 | script: go test -v . 7 | -------------------------------------------------------------------------------- /.gobuild.yml: -------------------------------------------------------------------------------- 1 | filesets: 2 | includes: 3 | - README.md 4 | - LICENSE 5 | excludes: 6 | - .*.go 7 | -------------------------------------------------------------------------------- /vendor/github.com/google/shlex/README: -------------------------------------------------------------------------------- 1 | go-shlex is a simple lexer for go that supports shell-style quoting, 2 | commenting, and escaping. 3 | -------------------------------------------------------------------------------- /vendor/github.com/codeskyblue/kexec/kexec.go: -------------------------------------------------------------------------------- 1 | package kexec 2 | 3 | import "os/exec" 4 | 5 | type KCommand struct { 6 | *exec.Cmd 7 | } 8 | -------------------------------------------------------------------------------- /Godeps/Readme: -------------------------------------------------------------------------------- 1 | This directory tree is generated automatically by godep. 2 | 3 | Please do not edit. 4 | 5 | See https://github.com/tools/godep for more information. 6 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/.gitignore: -------------------------------------------------------------------------------- 1 | # Setup a Global .gitignore for OS and editor generated files: 2 | # https://help.github.com/articles/ignoring-files 3 | # git config --global core.excludesfile ~/.gitignore_global 4 | 5 | .vagrant 6 | *.sublime-project 7 | -------------------------------------------------------------------------------- /vendor/github.com/gobuild/log/README.md: -------------------------------------------------------------------------------- 1 | ## log 2 | [![GoDoc](https://godoc.org/github.com/gobuild/log?status.png)](https://godoc.org/github.com/gobuild/log) 3 | 4 | Extension module of golang logging, 5 | Most code came from [qiniu/log](https://github.com/qiniu/log) 6 | 7 | Improment: Add color support 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | TEXT ·use(SB),NOSPLIT,$0 10 | RET 11 | -------------------------------------------------------------------------------- /.fsw.yml: -------------------------------------------------------------------------------- 1 | desc: Auto generated by fswatch [fswatch] 2 | triggers: 3 | - pattens: 4 | - '*.go' 5 | - '!testdata/*' 6 | cmd: go test -v 7 | name: test 8 | 9 | - pattens: 10 | - 'testdata/*' 11 | cmd: echo Haha, detect testdata changed && sleep 2 12 | name: echo 13 | watch_paths: 14 | - . 15 | #watch_skips: 16 | #- '!vendor' 17 | watch_depth: 0 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/gobuild/log/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_no_getwd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build dragonfly freebsd netbsd openbsd 6 | 7 | package unix 8 | 9 | const ImplementsGetwd = false 10 | 11 | func Getwd() (string, error) { return "", ENOTSUP } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsysnum_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | // TODO(aram): remove these before Go 1.3. 10 | const ( 11 | SYS_EXECVE = 59 12 | SYS_FCNTL = 62 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/codeskyblue/kexec/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/open_mode_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build freebsd openbsd netbsd dragonfly 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | const openMode = unix.O_NONBLOCK | unix.O_RDONLY 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build go1.4 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Unsetenv(key string) error { 12 | // This was added in Go 1.4. 13 | return syscall.Unsetenv(key) 14 | } 15 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | 2 | version: "{build}" 3 | 4 | os: Windows Server 2012 R2 5 | 6 | clone_folder: c:\gopath\src\github.com\codeskyblue\fswatch 7 | 8 | environment: 9 | GOPATH: c:\gopath 10 | 11 | install: 12 | - echo %PATH% 13 | - echo %GOPATH% 14 | - git submodule update --init --recursive 15 | - go version 16 | - go env 17 | - go get -v -t ./... 18 | 19 | build_script: 20 | - go test -v ./... 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/open_mode_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | 7 | package fsnotify 8 | 9 | import "golang.org/x/sys/unix" 10 | 11 | // note: this constant is not defined on BSD 12 | const openMode = unix.O_EVTONLY 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | *.swp 6 | *.swx 7 | *[~] 8 | 9 | # Folders 10 | _obj 11 | _test 12 | 13 | # Architecture specific extensions/prefixes 14 | *.[568vq] 15 | [568vq].out 16 | 17 | 18 | .idea 19 | 20 | 21 | *.cgo1.go 22 | *.cgo2.c 23 | _cgo_defun.c 24 | _cgo_gotypes.go 25 | _cgo_export.* 26 | 27 | _testmain.go 28 | 29 | *.exe 30 | fswatch 31 | -------------------------------------------------------------------------------- /vendor/github.com/codeskyblue/dockerignore/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | !ok.* 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-64 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-64 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | 4 | go: 5 | - 1.5.4 6 | - 1.6.1 7 | - tip 8 | 9 | matrix: 10 | allow_failures: 11 | - go: tip 12 | 13 | before_script: 14 | - go get -u github.com/golang/lint/golint 15 | 16 | script: 17 | - go test -v --race ./... 18 | 19 | after_script: 20 | - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" 21 | - test -z "$(golint ./... | tee /dev/stderr)" 22 | - go vet ./... 23 | 24 | os: 25 | - linux 26 | - osx 27 | 28 | notifications: 29 | email: false 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/codeskyblue/fswatch 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/codeskyblue/dockerignore v0.0.0-20151214070507-de82dee623d9 7 | github.com/codeskyblue/kexec v0.0.0-20151121150732-b7e1983cb326 8 | github.com/frioux/leatherman v0.0.0-20200731205643-6bcd2a6717c2 9 | github.com/fsnotify/fsnotify v1.4.9 10 | github.com/gobuild/log v1.0.0 11 | github.com/google/shlex v0.0.0-20150127133951-6f45313302b9 12 | github.com/smartystreets/goconvey v1.6.4 // indirect 13 | gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect 14 | gopkg.in/yaml.v2 v2.2.2 15 | ) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | B syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | B syscall·RawSyscall6(SB) 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | BR syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | BR syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 23 | B syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 26 | B syscall·RawSyscall6(SB) 27 | 28 | TEXT ·seek(SB),NOSPLIT,$0-32 29 | B syscall·seek(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 25 | JMP syscall·RawSyscall(SB) 26 | 27 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 28 | JMP syscall·RawSyscall6(SB) 29 | -------------------------------------------------------------------------------- /vendor/github.com/codeskyblue/kexec/kexec_windows.go: -------------------------------------------------------------------------------- 1 | package kexec 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "strconv" 7 | ) 8 | 9 | func Command(name string, arg ...string) *KCommand { 10 | return &KCommand{ 11 | Cmd: exec.Command(name, arg...), 12 | } 13 | } 14 | 15 | func CommandString(command string) *KCommand { 16 | cmd := exec.Command("cmd", "/c", command) 17 | cmd.Stdout = os.Stdout 18 | cmd.Stderr = os.Stderr 19 | return &KCommand{ 20 | Cmd: cmd, 21 | } 22 | } 23 | 24 | func (p *KCommand) Terminate(sig os.Signal) (err error) { 25 | if p.Process == nil { 26 | return nil 27 | } 28 | pid := p.Process.Pid 29 | c := exec.Command("taskkill", "/t", "/f", "/pid", strconv.Itoa(pid)) 30 | c.Stdout = os.Stdout 31 | c.Stderr = os.Stderr 32 | return c.Run() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 23 | JMP syscall·RawSyscall(SB) 24 | 25 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 26 | JMP syscall·RawSyscall6(SB) 27 | 28 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 29 | JMP syscall·gettimeofday(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-64 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-112 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-64 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-88 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/flock.go: -------------------------------------------------------------------------------- 1 | // +build linux darwin freebsd openbsd netbsd dragonfly 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build darwin dragonfly freebsd linux netbsd openbsd 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 14 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 15 | var fcntl64Syscall uintptr = SYS_FCNTL 16 | 17 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 18 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 19 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 20 | if errno == 0 { 21 | return nil 22 | } 23 | return errno 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_darwin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for Darwin from sys/syscall.h 7 | 8 | use strict; 9 | 10 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 11 | print STDERR "GOARCH or GOOS not defined in environment\n"; 12 | exit 1; 13 | } 14 | 15 | my $command = "mksysnum_darwin.pl " . join(' ', @ARGV); 16 | 17 | print <){ 29 | if(/^#define\s+SYS_(\w+)\s+([0-9]+)/){ 30 | my $name = $1; 31 | my $num = $2; 32 | $name =~ y/a-z/A-Z/; 33 | print " SYS_$name = $num;" 34 | } 35 | } 36 | 37 | print < 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 24 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 25 | { 26 | struct ret r; 27 | 28 | errno = 0; 29 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 30 | r.err = errno; 31 | return r; 32 | } 33 | 34 | // Define the use function in C so that it is not inlined. 35 | 36 | extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline)); 37 | 38 | void 39 | use(void *p __attribute__ ((unused))) 40 | { 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for DragonFly from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_dragonfly.pl " . join(' ', @ARGV); 17 | 18 | print <){ 30 | if(/^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 30 | if(/^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $3; 33 | my $name = $4; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | 44 | print " $name = $num; // $proto\n"; 45 | } 46 | } 47 | 48 | print <){ 31 | if($line =~ /^(.*)\\$/) { 32 | # Handle continuation 33 | $line = $1; 34 | $_ =~ s/^\s+//; 35 | $line .= $_; 36 | } else { 37 | # New line 38 | $line = $_; 39 | } 40 | next if $line =~ /\\$/; 41 | if($line =~ /^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$/) { 42 | my $num = $1; 43 | my $proto = $6; 44 | my $compat = $8; 45 | my $name = "$7_$9"; 46 | 47 | $name = "$7_$11" if $11 ne ''; 48 | $name =~ y/a-z/A-Z/; 49 | 50 | if($compat eq '' || $compat eq '30' || $compat eq '50') { 51 | print " $name = $num; // $proto\n"; 52 | } 53 | } 54 | } 55 | 56 | print < 999){ 29 | # ignore deprecated syscalls that are no longer implemented 30 | # https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/include/uapi/asm-generic/unistd.h?id=refs/heads/master#n716 31 | return; 32 | } 33 | $name =~ y/a-z/A-Z/; 34 | print " SYS_$name = $num;\n"; 35 | } 36 | 37 | my $prev; 38 | open(GCC, "gcc -E -dD $ARGV[0] |") || die "can't run gcc"; 39 | while(){ 40 | if(/^#define __NR_syscalls\s+/) { 41 | # ignore redefinitions of __NR_syscalls 42 | } 43 | elsif(/^#define __NR_(\w+)\s+([0-9]+)/){ 44 | $prev = $2; 45 | fmt($1, $2); 46 | } 47 | elsif(/^#define __NR3264_(\w+)\s+([0-9]+)/){ 48 | $prev = $2; 49 | fmt($1, $2); 50 | } 51 | elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){ 52 | fmt($1, $prev+$2) 53 | } 54 | } 55 | 56 | print <>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file as 2 | # Name or Organization 3 | # The email address is not required for organizations. 4 | 5 | # You can update this list using the following command: 6 | # 7 | # $ git shortlog -se | awk '{print $2 " " $3 " " $4}' 8 | 9 | # Please keep the list sorted. 10 | 11 | Adrien Bustany 12 | Amit Krishnan 13 | Bjørn Erik Pedersen 14 | Bruno Bigras 15 | Caleb Spare 16 | Case Nelson 17 | Chris Howey 18 | Christoffer Buchholz 19 | Daniel Wagner-Hall 20 | Dave Cheney 21 | Evan Phoenix 22 | Francisco Souza 23 | Hari haran 24 | John C Barstow 25 | Kelvin Fo 26 | Ken-ichirou MATSUZAWA 27 | Matt Layher 28 | Nathan Youngman 29 | Paul Hammond 30 | Pawel Knap 31 | Pieter Droogendijk 32 | Pursuit92 33 | Riku Voipio 34 | Rob Figueiredo 35 | Soge Zhang 36 | Tiffany Jernigan 37 | Tilak Sharma 38 | Travis Cline 39 | Tudor Golubenco 40 | Yukang 41 | bronze1man 42 | debrando 43 | henrikedwards 44 | 铁哥 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 32 | k.Ident = uint32(fd) 33 | k.Filter = int16(mode) 34 | k.Flags = uint16(flags) 35 | } 36 | 37 | func (iov *Iovec) SetLen(length int) { 38 | iov.Len = uint32(length) 39 | } 40 | 41 | func (msghdr *Msghdr) SetControllen(length int) { 42 | msghdr.Controllen = uint32(length) 43 | } 44 | 45 | func (cmsg *Cmsghdr) SetLen(length int) { 46 | cmsg.Len = uint32(length) 47 | } 48 | 49 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 50 | var writtenOut uint64 = 0 51 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 52 | 53 | written = int(writtenOut) 54 | 55 | if e1 != 0 { 56 | err = e1 57 | } 58 | return 59 | } 60 | 61 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 62 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build gccgo 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // We can't use the gc-syntax .s files for gccgo. On the plus side 12 | // much of the functionality can be written directly in Go. 13 | 14 | //extern gccgoRealSyscall 15 | func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr) 16 | 17 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | syscall.Entersyscall() 19 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 20 | syscall.Exitsyscall() 21 | return r, 0, syscall.Errno(errno) 22 | } 23 | 24 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 25 | syscall.Entersyscall() 26 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 27 | syscall.Exitsyscall() 28 | return r, 0, syscall.Errno(errno) 29 | } 30 | 31 | func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) { 32 | syscall.Entersyscall() 33 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9) 34 | syscall.Exitsyscall() 35 | return r, 0, syscall.Errno(errno) 36 | } 37 | 38 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 39 | r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0) 40 | return r, 0, syscall.Errno(errno) 41 | } 42 | 43 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 44 | r, errno := realSyscall(trap, a1, a2, a3, a4, a5, a6, 0, 0, 0) 45 | return r, 0, syscall.Errno(errno) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/fsnotify.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !plan9 6 | 7 | // Package fsnotify provides a platform-independent interface for file system notifications. 8 | package fsnotify 9 | 10 | import ( 11 | "bytes" 12 | "fmt" 13 | ) 14 | 15 | // Event represents a single file system notification. 16 | type Event struct { 17 | Name string // Relative path to the file or directory. 18 | Op Op // File operation that triggered the event. 19 | } 20 | 21 | // Op describes a set of file operations. 22 | type Op uint32 23 | 24 | // These are the generalized file operations that can trigger a notification. 25 | const ( 26 | Create Op = 1 << iota 27 | Write 28 | Remove 29 | Rename 30 | Chmod 31 | ) 32 | 33 | // String returns a string representation of the event in the form 34 | // "file: REMOVE|WRITE|..." 35 | func (e Event) String() string { 36 | // Use a buffer for efficient string concatenation 37 | var buffer bytes.Buffer 38 | 39 | if e.Op&Create == Create { 40 | buffer.WriteString("|CREATE") 41 | } 42 | if e.Op&Remove == Remove { 43 | buffer.WriteString("|REMOVE") 44 | } 45 | if e.Op&Write == Write { 46 | buffer.WriteString("|WRITE") 47 | } 48 | if e.Op&Rename == Rename { 49 | buffer.WriteString("|RENAME") 50 | } 51 | if e.Op&Chmod == Chmod { 52 | buffer.WriteString("|CHMOD") 53 | } 54 | 55 | // If buffer remains empty, return no event names 56 | if buffer.Len() == 0 { 57 | return fmt.Sprintf("%q: ", e.Name) 58 | } 59 | 60 | // Return a list of event names, with leading pipe character stripped 61 | return fmt.Sprintf("%q: %s", e.Name, buffer.String()[1:]) 62 | } 63 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | # 6 | # Generate system call table for FreeBSD from master list 7 | # (for example, /usr/src/sys/kern/syscalls.master). 8 | 9 | use strict; 10 | 11 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 12 | print STDERR "GOARCH or GOOS not defined in environment\n"; 13 | exit 1; 14 | } 15 | 16 | my $command = "mksysnum_freebsd.pl " . join(' ', @ARGV); 17 | 18 | print <){ 30 | if(/^([0-9]+)\s+\S+\s+STD\s+({ \S+\s+(\w+).*)$/){ 31 | my $num = $1; 32 | my $proto = $2; 33 | my $name = "SYS_$3"; 34 | $name =~ y/a-z/A-Z/; 35 | 36 | # There are multiple entries for enosys and nosys, so comment them out. 37 | if($name =~ /^SYS_E?NOSYS$/){ 38 | $name = "// $name"; 39 | } 40 | if($name eq 'SYS_SYS_EXIT'){ 41 | $name = 'SYS_EXIT'; 42 | } 43 | if($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){ 44 | next 45 | } 46 | 47 | print " $name = $num; // $proto\n"; 48 | 49 | # We keep Capsicum syscall numbers for FreeBSD 50 | # 9-STABLE here because we are not sure whether they 51 | # are mature and stable. 52 | if($num == 513){ 53 | print " SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\n"; 54 | print " SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\n"; 55 | print " SYS_CAP_ENTER = 516 // { int cap_enter(void); }\n"; 56 | print " SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\n"; 57 | } 58 | } 59 | } 60 | 61 | print <>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 62 | 63 | written = int(length) 64 | 65 | if e1 != 0 { 66 | err = e1 67 | } 68 | return 69 | } 70 | 71 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 72 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 16384 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = nsec / 1e9 20 | ts.Nsec = nsec % 1e9 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int64(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = sec 38 | tv.Usec = usec 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint64(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint64(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 74 | 75 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 76 | // of darwin/arm64 the syscall is called sysctl instead of __sysctl. 77 | const SYS___SYSCTL = SYS_SYSCTL 78 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build 386,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getpagesize() int { return 4096 } 15 | 16 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 17 | 18 | func NsecToTimespec(nsec int64) (ts Timespec) { 19 | ts.Sec = int32(nsec / 1e9) 20 | ts.Nsec = int32(nsec % 1e9) 21 | return 22 | } 23 | 24 | func NsecToTimeval(nsec int64) (tv Timeval) { 25 | nsec += 999 // round up to microsecond 26 | tv.Usec = int32(nsec % 1e9 / 1e3) 27 | tv.Sec = int32(nsec / 1e9) 28 | return 29 | } 30 | 31 | //sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error) 32 | func Gettimeofday(tv *Timeval) (err error) { 33 | // The tv passed to gettimeofday must be non-nil 34 | // but is otherwise unused. The answers come back 35 | // in the two registers. 36 | sec, usec, err := gettimeofday(tv) 37 | tv.Sec = int32(sec) 38 | tv.Usec = int32(usec) 39 | return err 40 | } 41 | 42 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 43 | k.Ident = uint32(fd) 44 | k.Filter = int16(mode) 45 | k.Flags = uint16(flags) 46 | } 47 | 48 | func (iov *Iovec) SetLen(length int) { 49 | iov.Len = uint32(length) 50 | } 51 | 52 | func (msghdr *Msghdr) SetControllen(length int) { 53 | msghdr.Controllen = uint32(length) 54 | } 55 | 56 | func (cmsg *Cmsghdr) SetLen(length int) { 57 | cmsg.Len = uint32(length) 58 | } 59 | 60 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 61 | var length = uint64(count) 62 | 63 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(*offset>>32), uintptr(unsafe.Pointer(&length)), 0, 0, 0, 0) 64 | 65 | written = int(length) 66 | 67 | if e1 != 0 { 68 | err = e1 69 | } 70 | return 71 | } 72 | 73 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 74 | 75 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 76 | // of darwin/386 the syscall is called sysctl instead of __sysctl. 77 | const SYS___SYSCTL = SYS_SYSCTL 78 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,darwin 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) 15 | 16 | func Getpagesize() int { return 4096 } 17 | 18 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 19 | 20 | func NsecToTimespec(nsec int64) (ts Timespec) { 21 | ts.Sec = nsec / 1e9 22 | ts.Nsec = nsec % 1e9 23 | return 24 | } 25 | 26 | func NsecToTimeval(nsec int64) (tv Timeval) { 27 | nsec += 999 // round up to microsecond 28 | tv.Usec = int32(nsec % 1e9 / 1e3) 29 | tv.Sec = int64(nsec / 1e9) 30 | return 31 | } 32 | 33 | //sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error) 34 | func Gettimeofday(tv *Timeval) (err error) { 35 | // The tv passed to gettimeofday must be non-nil 36 | // but is otherwise unused. The answers come back 37 | // in the two registers. 38 | sec, usec, err := gettimeofday(tv) 39 | tv.Sec = sec 40 | tv.Usec = usec 41 | return err 42 | } 43 | 44 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 45 | k.Ident = uint64(fd) 46 | k.Filter = int16(mode) 47 | k.Flags = uint16(flags) 48 | } 49 | 50 | func (iov *Iovec) SetLen(length int) { 51 | iov.Len = uint64(length) 52 | } 53 | 54 | func (msghdr *Msghdr) SetControllen(length int) { 55 | msghdr.Controllen = uint32(length) 56 | } 57 | 58 | func (cmsg *Cmsghdr) SetLen(length int) { 59 | cmsg.Len = uint32(length) 60 | } 61 | 62 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 63 | var length = uint64(count) 64 | 65 | _, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(unsafe.Pointer(&length)), 0, 0) 66 | 67 | written = int(length) 68 | 69 | if e1 != 0 { 70 | err = e1 71 | } 72 | return 73 | } 74 | 75 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 76 | 77 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 78 | // of darwin/amd64 the syscall is called sysctl instead of __sysctl. 79 | const SYS___SYSCTL = SYS_SYSCTL 80 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | // If the output encoding is UTF-8, we don't need to recode the buffer. 22 | if emitter.encoding == yaml_UTF8_ENCODING { 23 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 24 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 25 | } 26 | emitter.buffer_pos = 0 27 | return true 28 | } 29 | 30 | // Recode the buffer into the raw buffer. 31 | var low, high int 32 | if emitter.encoding == yaml_UTF16LE_ENCODING { 33 | low, high = 0, 1 34 | } else { 35 | high, low = 1, 0 36 | } 37 | 38 | pos := 0 39 | for pos < emitter.buffer_pos { 40 | // See the "reader.c" code for more details on UTF-8 encoding. Note 41 | // that we assume that the buffer contains a valid UTF-8 sequence. 42 | 43 | // Read the next UTF-8 character. 44 | octet := emitter.buffer[pos] 45 | 46 | var w int 47 | var value rune 48 | switch { 49 | case octet&0x80 == 0x00: 50 | w, value = 1, rune(octet&0x7F) 51 | case octet&0xE0 == 0xC0: 52 | w, value = 2, rune(octet&0x1F) 53 | case octet&0xF0 == 0xE0: 54 | w, value = 3, rune(octet&0x0F) 55 | case octet&0xF8 == 0xF0: 56 | w, value = 4, rune(octet&0x07) 57 | } 58 | for k := 1; k < w; k++ { 59 | octet = emitter.buffer[pos+k] 60 | value = (value << 6) + (rune(octet) & 0x3F) 61 | } 62 | pos += w 63 | 64 | // Write the character. 65 | if value < 0x10000 { 66 | var b [2]byte 67 | b[high] = byte(value >> 8) 68 | b[low] = byte(value & 0xFF) 69 | emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1]) 70 | } else { 71 | // Write the character using a surrogate pair (check "reader.c"). 72 | var b [4]byte 73 | value -= 0x10000 74 | b[high] = byte(0xD8 + (value >> 18)) 75 | b[low] = byte((value >> 10) & 0xFF) 76 | b[high+2] = byte(0xDC + ((value >> 8) & 0xFF)) 77 | b[low+2] = byte(value & 0xFF) 78 | emitter.raw_buffer = append(emitter.raw_buffer, b[0], b[1], b[2], b[3]) 79 | } 80 | } 81 | 82 | // Write the raw buffer. 83 | if err := emitter.write_handler(emitter, emitter.raw_buffer); err != nil { 84 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 85 | } 86 | emitter.buffer_pos = 0 87 | emitter.raw_buffer = emitter.raw_buffer[:0] 88 | return true 89 | } 90 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Package unix contains an interface to the low-level operating system 8 | // primitives. OS details vary depending on the underlying system, and 9 | // by default, godoc will display OS-specific documentation for the current 10 | // system. If you want godoc to display OS documentation for another 11 | // system, set $GOOS and $GOARCH to the desired system. For example, if 12 | // you want to view documentation for freebsd/arm on linux/amd64, set $GOOS 13 | // to freebsd and $GOARCH to arm. 14 | // The primary use of this package is inside other packages that provide a more 15 | // portable interface to the system, such as "os", "time" and "net". Use 16 | // those packages rather than this one if you can. 17 | // For details of the functions and data types in this package consult 18 | // the manuals for the appropriate operating system. 19 | // These calls return err == nil to indicate success; otherwise 20 | // err represents an operating system error describing the failure and 21 | // holds a value of type syscall.Errno. 22 | package unix 23 | 24 | import "unsafe" 25 | 26 | // ByteSliceFromString returns a NUL-terminated slice of bytes 27 | // containing the text of s. If s contains a NUL byte at any 28 | // location, it returns (nil, EINVAL). 29 | func ByteSliceFromString(s string) ([]byte, error) { 30 | for i := 0; i < len(s); i++ { 31 | if s[i] == 0 { 32 | return nil, EINVAL 33 | } 34 | } 35 | a := make([]byte, len(s)+1) 36 | copy(a, s) 37 | return a, nil 38 | } 39 | 40 | // BytePtrFromString returns a pointer to a NUL-terminated array of 41 | // bytes containing the text of s. If s contains a NUL byte at any 42 | // location, it returns (nil, EINVAL). 43 | func BytePtrFromString(s string) (*byte, error) { 44 | a, err := ByteSliceFromString(s) 45 | if err != nil { 46 | return nil, err 47 | } 48 | return &a[0], nil 49 | } 50 | 51 | // Single-word zero for use when we need a valid pointer to 0 bytes. 52 | // See mkunix.pl. 53 | var _zero uintptr 54 | 55 | func (ts *Timespec) Unix() (sec int64, nsec int64) { 56 | return int64(ts.Sec), int64(ts.Nsec) 57 | } 58 | 59 | func (tv *Timeval) Unix() (sec int64, nsec int64) { 60 | return int64(tv.Sec), int64(tv.Usec) * 1000 61 | } 62 | 63 | func (ts *Timespec) Nano() int64 { 64 | return int64(ts.Sec)*1e9 + int64(ts.Nsec) 65 | } 66 | 67 | func (tv *Timeval) Nano() int64 { 68 | return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000 69 | } 70 | 71 | func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 } 72 | 73 | // use is a no-op, but the compiler cannot see that it is. 74 | // Calling use(p) ensures that p is kept live until that point. 75 | //go:noescape 76 | func use(p unsafe.Pointer) 77 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/sorter.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | import ( 4 | "reflect" 5 | "unicode" 6 | ) 7 | 8 | type keyList []reflect.Value 9 | 10 | func (l keyList) Len() int { return len(l) } 11 | func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } 12 | func (l keyList) Less(i, j int) bool { 13 | a := l[i] 14 | b := l[j] 15 | ak := a.Kind() 16 | bk := b.Kind() 17 | for (ak == reflect.Interface || ak == reflect.Ptr) && !a.IsNil() { 18 | a = a.Elem() 19 | ak = a.Kind() 20 | } 21 | for (bk == reflect.Interface || bk == reflect.Ptr) && !b.IsNil() { 22 | b = b.Elem() 23 | bk = b.Kind() 24 | } 25 | af, aok := keyFloat(a) 26 | bf, bok := keyFloat(b) 27 | if aok && bok { 28 | if af != bf { 29 | return af < bf 30 | } 31 | if ak != bk { 32 | return ak < bk 33 | } 34 | return numLess(a, b) 35 | } 36 | if ak != reflect.String || bk != reflect.String { 37 | return ak < bk 38 | } 39 | ar, br := []rune(a.String()), []rune(b.String()) 40 | for i := 0; i < len(ar) && i < len(br); i++ { 41 | if ar[i] == br[i] { 42 | continue 43 | } 44 | al := unicode.IsLetter(ar[i]) 45 | bl := unicode.IsLetter(br[i]) 46 | if al && bl { 47 | return ar[i] < br[i] 48 | } 49 | if al || bl { 50 | return bl 51 | } 52 | var ai, bi int 53 | var an, bn int64 54 | for ai = i; ai < len(ar) && unicode.IsDigit(ar[ai]); ai++ { 55 | an = an*10 + int64(ar[ai]-'0') 56 | } 57 | for bi = i; bi < len(br) && unicode.IsDigit(br[bi]); bi++ { 58 | bn = bn*10 + int64(br[bi]-'0') 59 | } 60 | if an != bn { 61 | return an < bn 62 | } 63 | if ai != bi { 64 | return ai < bi 65 | } 66 | return ar[i] < br[i] 67 | } 68 | return len(ar) < len(br) 69 | } 70 | 71 | // keyFloat returns a float value for v if it is a number/bool 72 | // and whether it is a number/bool or not. 73 | func keyFloat(v reflect.Value) (f float64, ok bool) { 74 | switch v.Kind() { 75 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 76 | return float64(v.Int()), true 77 | case reflect.Float32, reflect.Float64: 78 | return v.Float(), true 79 | case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 80 | return float64(v.Uint()), true 81 | case reflect.Bool: 82 | if v.Bool() { 83 | return 1, true 84 | } 85 | return 0, true 86 | } 87 | return 0, false 88 | } 89 | 90 | // numLess returns whether a < b. 91 | // a and b must necessarily have the same kind. 92 | func numLess(a, b reflect.Value) bool { 93 | switch a.Kind() { 94 | case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: 95 | return a.Int() < b.Int() 96 | case reflect.Float32, reflect.Float64: 97 | return a.Float() < b.Float() 98 | case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: 99 | return a.Uint() < b.Uint() 100 | case reflect.Bool: 101 | return !a.Bool() && b.Bool() 102 | } 103 | panic("not a number") 104 | } 105 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/README.md: -------------------------------------------------------------------------------- 1 | # File system notifications for Go 2 | 3 | [![GoDoc](https://godoc.org/github.com/fsnotify/fsnotify?status.svg)](https://godoc.org/github.com/fsnotify/fsnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/fsnotify/fsnotify)](https://goreportcard.com/report/github.com/fsnotify/fsnotify) [![Coverage](http://gocover.io/_badge/github.com/fsnotify/fsnotify)](http://gocover.io/github.com/fsnotify/fsnotify) 4 | 5 | fsnotify utilizes [golang.org/x/sys](https://godoc.org/golang.org/x/sys) rather than `syscall` from the standard library. Ensure you have the latest version installed by running: 6 | 7 | ```console 8 | go get -u golang.org/x/sys/... 9 | ``` 10 | 11 | Cross platform: Windows, Linux, BSD and OS X. 12 | 13 | |Adapter |OS |Status | 14 | |----------|----------|----------| 15 | |inotify |Linux 2.6.27 or later, Android\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| 16 | |kqueue |BSD, OS X, iOS\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| 17 | |ReadDirectoryChangesW|Windows|Supported [![Build status](https://ci.appveyor.com/api/projects/status/ivwjubaih4r0udeh/branch/master?svg=true)](https://ci.appveyor.com/project/NathanYoungman/fsnotify/branch/master)| 18 | |FSEvents |OS X |[Planned](https://github.com/fsnotify/fsnotify/issues/11)| 19 | |FEN |Solaris 11 |[In Progress](https://github.com/fsnotify/fsnotify/issues/12)| 20 | |fanotify |Linux 2.6.37+ | | 21 | |USN Journals |Windows |[Maybe](https://github.com/fsnotify/fsnotify/issues/53)| 22 | |Polling |*All* |[Maybe](https://github.com/fsnotify/fsnotify/issues/9)| 23 | 24 | \* Android and iOS are untested. 25 | 26 | Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) for usage. Consult the [Wiki](https://github.com/fsnotify/fsnotify/wiki) for the FAQ and further information. 27 | 28 | ## API stability 29 | 30 | fsnotify is a fork of [howeyc/fsnotify](https://godoc.org/github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA). 31 | 32 | All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). Further API changes are [planned](https://github.com/fsnotify/fsnotify/milestones), and will be tagged with a new major revision number. 33 | 34 | Go 1.6 supports dependencies located in the `vendor/` folder. Unless you are creating a library, it is recommended that you copy fsnotify into `vendor/github.com/fsnotify/fsnotify` within your project, and likewise for `golang.org/x/sys`. 35 | 36 | ## Contributing 37 | 38 | Please refer to [CONTRIBUTING][] before opening an issue or pull request. 39 | 40 | ## Example 41 | 42 | See [example_test.go](https://github.com/fsnotify/fsnotify/blob/master/example_test.go). 43 | 44 | [contributing]: https://github.com/fsnotify/fsnotify/blob/master/CONTRIBUTING.md 45 | 46 | ## Related Projects 47 | 48 | * [notify](https://github.com/rjeczalik/notify) 49 | * [fsevents](https://github.com/fsnotify/fsevents) 50 | 51 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/README.md: -------------------------------------------------------------------------------- 1 | # YAML support for the Go language 2 | 3 | Introduction 4 | ------------ 5 | 6 | The yaml package enables Go programs to comfortably encode and decode YAML 7 | values. It was developed within [Canonical](https://www.canonical.com) as 8 | part of the [juju](https://juju.ubuntu.com) project, and is based on a 9 | pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) 10 | C library to parse and generate YAML data quickly and reliably. 11 | 12 | Compatibility 13 | ------------- 14 | 15 | The yaml package supports most of YAML 1.1 and 1.2, including support for 16 | anchors, tags, map merging, etc. Multi-document unmarshalling is not yet 17 | implemented, and base-60 floats from YAML 1.1 are purposefully not 18 | supported since they're a poor design and are gone in YAML 1.2. 19 | 20 | Installation and usage 21 | ---------------------- 22 | 23 | The import path for the package is *gopkg.in/yaml.v2*. 24 | 25 | To install it, run: 26 | 27 | go get gopkg.in/yaml.v2 28 | 29 | API documentation 30 | ----------------- 31 | 32 | If opened in a browser, the import path itself leads to the API documentation: 33 | 34 | * [https://gopkg.in/yaml.v2](https://gopkg.in/yaml.v2) 35 | 36 | API stability 37 | ------------- 38 | 39 | The package API for yaml v2 will remain stable as described in [gopkg.in](https://gopkg.in). 40 | 41 | 42 | License 43 | ------- 44 | 45 | The yaml package is licensed under the LGPL with an exception that allows it to be linked statically. Please see the LICENSE file for details. 46 | 47 | 48 | Example 49 | ------- 50 | 51 | ```Go 52 | package main 53 | 54 | import ( 55 | "fmt" 56 | "log" 57 | 58 | "gopkg.in/yaml.v2" 59 | ) 60 | 61 | var data = ` 62 | a: Easy! 63 | b: 64 | c: 2 65 | d: [3, 4] 66 | ` 67 | 68 | type T struct { 69 | A string 70 | B struct { 71 | RenamedC int `yaml:"c"` 72 | D []int `yaml:",flow"` 73 | } 74 | } 75 | 76 | func main() { 77 | t := T{} 78 | 79 | err := yaml.Unmarshal([]byte(data), &t) 80 | if err != nil { 81 | log.Fatalf("error: %v", err) 82 | } 83 | fmt.Printf("--- t:\n%v\n\n", t) 84 | 85 | d, err := yaml.Marshal(&t) 86 | if err != nil { 87 | log.Fatalf("error: %v", err) 88 | } 89 | fmt.Printf("--- t dump:\n%s\n\n", string(d)) 90 | 91 | m := make(map[interface{}]interface{}) 92 | 93 | err = yaml.Unmarshal([]byte(data), &m) 94 | if err != nil { 95 | log.Fatalf("error: %v", err) 96 | } 97 | fmt.Printf("--- m:\n%v\n\n", m) 98 | 99 | d, err = yaml.Marshal(&m) 100 | if err != nil { 101 | log.Fatalf("error: %v", err) 102 | } 103 | fmt.Printf("--- m dump:\n%s\n\n", string(d)) 104 | } 105 | ``` 106 | 107 | This example will generate the following output: 108 | 109 | ``` 110 | --- t: 111 | {Easy! {2 [3 4]}} 112 | 113 | --- t dump: 114 | a: Easy! 115 | b: 116 | c: 2 117 | d: [3, 4] 118 | 119 | 120 | --- m: 121 | map[a:Easy! b:map[c:2 d:[3 4]]] 122 | 123 | --- m dump: 124 | a: Easy! 125 | b: 126 | c: 2 127 | d: 128 | - 3 129 | - 4 130 | ``` 131 | 132 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Socket control messages 8 | 9 | package unix 10 | 11 | import "unsafe" 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := sizeofPtr 16 | // NOTE: It seems like 64-bit Darwin and DragonFly BSD kernels 17 | // still require 32-bit aligned access to network subsystem. 18 | if darwin64Bit || dragonfly64Bit { 19 | salign = 4 20 | } 21 | return (salen + salign - 1) & ^(salign - 1) 22 | } 23 | 24 | // CmsgLen returns the value to store in the Len field of the Cmsghdr 25 | // structure, taking into account any necessary alignment. 26 | func CmsgLen(datalen int) int { 27 | return cmsgAlignOf(SizeofCmsghdr) + datalen 28 | } 29 | 30 | // CmsgSpace returns the number of bytes an ancillary element with 31 | // payload of the passed data length occupies. 32 | func CmsgSpace(datalen int) int { 33 | return cmsgAlignOf(SizeofCmsghdr) + cmsgAlignOf(datalen) 34 | } 35 | 36 | func cmsgData(h *Cmsghdr) unsafe.Pointer { 37 | return unsafe.Pointer(uintptr(unsafe.Pointer(h)) + uintptr(cmsgAlignOf(SizeofCmsghdr))) 38 | } 39 | 40 | // SocketControlMessage represents a socket control message. 41 | type SocketControlMessage struct { 42 | Header Cmsghdr 43 | Data []byte 44 | } 45 | 46 | // ParseSocketControlMessage parses b as an array of socket control 47 | // messages. 48 | func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) { 49 | var msgs []SocketControlMessage 50 | i := 0 51 | for i+CmsgLen(0) <= len(b) { 52 | h, dbuf, err := socketControlMessageHeaderAndData(b[i:]) 53 | if err != nil { 54 | return nil, err 55 | } 56 | m := SocketControlMessage{Header: *h, Data: dbuf} 57 | msgs = append(msgs, m) 58 | i += cmsgAlignOf(int(h.Len)) 59 | } 60 | return msgs, nil 61 | } 62 | 63 | func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) { 64 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 65 | if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) { 66 | return nil, nil, EINVAL 67 | } 68 | return h, b[cmsgAlignOf(SizeofCmsghdr):h.Len], nil 69 | } 70 | 71 | // UnixRights encodes a set of open file descriptors into a socket 72 | // control message for sending to another process. 73 | func UnixRights(fds ...int) []byte { 74 | datalen := len(fds) * 4 75 | b := make([]byte, CmsgSpace(datalen)) 76 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 77 | h.Level = SOL_SOCKET 78 | h.Type = SCM_RIGHTS 79 | h.SetLen(CmsgLen(datalen)) 80 | data := cmsgData(h) 81 | for _, fd := range fds { 82 | *(*int32)(data) = int32(fd) 83 | data = unsafe.Pointer(uintptr(data) + 4) 84 | } 85 | return b 86 | } 87 | 88 | // ParseUnixRights decodes a socket control message that contains an 89 | // integer array of open file descriptors from another process. 90 | func ParseUnixRights(m *SocketControlMessage) ([]int, error) { 91 | if m.Header.Level != SOL_SOCKET { 92 | return nil, EINVAL 93 | } 94 | if m.Header.Type != SCM_RIGHTS { 95 | return nil, EINVAL 96 | } 97 | fds := make([]int, len(m.Data)>>2) 98 | for i, j := 0, 0; i < len(m.Data); i += 4 { 99 | fds[j] = int(*(*int32)(unsafe.Pointer(&m.Data[i]))) 100 | j++ 101 | } 102 | return fds, nil 103 | } 104 | -------------------------------------------------------------------------------- /vendor/github.com/codeskyblue/dockerignore/README.md: -------------------------------------------------------------------------------- 1 | # dockerignore 2 | [![GoDoc](https://godoc.org/github.com/codeskyblue/dockerignore?status.svg)](https://godoc.org/github.com/codeskyblue/dockerignore) 3 | 4 | go library parse gitignore file, source code most from [docker](https://github.com/docker/docker) 5 | 6 | ## Usage 7 | ```go 8 | package main 9 | 10 | import ( 11 | "bytes" 12 | "io/ioutil" 13 | "log" 14 | 15 | ignore "github.com/codeskyblue/dockerignore" 16 | ) 17 | 18 | func main() { 19 | // patterns, err := ignore.ReadIgnoreFile(".gitignore") 20 | rd := ioutil.NopCloser(bytes.NewBufferString("*.exe")) 21 | patterns, err := ignore.ReadIgnore(rd) 22 | if err != nil { 23 | log.Fatal(err) 24 | } 25 | isSkip, err := ignore.Matches("hello.exe", patterns) 26 | if err != nil { 27 | log.Fatal(err) 28 | } 29 | log.Printf("Should skipped true, got %v", isSkip) 30 | } 31 | ``` 32 | 33 | ## Rules 34 | The Go lib interprets a `.dockerignore` like file as a newline-separated list of patterns similar to the file globs of Unix shells. 35 | For the purposes of matching, the root of the context is considered to be both the working and the root directory. 36 | For example, the patterns /foo/bar and foo/bar both exclude a file or directory named bar in the foo subdirectory of PATH or in the root of the git repository located at URL. 37 | Neither excludes anything else. 38 | 39 | Here is an example .dockerignore file: 40 | 41 | */temp* 42 | */*/temp* 43 | temp? 44 | 45 | This file causes the following build behavior: 46 | 47 | Rule | Behavior 48 | ------------|---------- 49 | `*/temp*` | Exclude files and directories whose names start with temp in any immediate subdirectory of the root. For example, the plain file `/somedir/temporary.txt` is excluded, as is the directory `/somedir/temp`. 50 | `*/*/temp*` | Exclude files and directories starting with temp from any subdirectory that is two levels below the root. For example, `/somedir/subdir/temporary.txt` is excluded. 51 | `temp?` | Exclude files and directories in the root directory whose names are a one-character extension of temp. For example, `/tempa` and `/tempb` are excluded. 52 | 53 | Matching is done using Go’s filepath.Match rules. 54 | A preprocessing step removes leading and trailing whitespace and eliminates `.` and `..` elements using Go’s filepath.Clean. 55 | Lines that are blank after preprocessing are ignored. 56 | 57 | Lines starting with `!` (exclamation mark) can be used to make exceptions to exclusions. 58 | The following is an example `.dockerignore` file that uses this mechanism: 59 | 60 | *.md 61 | !README.md 62 | 63 | All markdown files except `README.md` are excluded from the context. 64 | 65 | The placement of `!` exception rules influences the behavior: the last line of the `.dockerignore` that matches a particular file determines whether it is included or excluded. 66 | Consider the following example: 67 | 68 | *.md 69 | !README*.md 70 | README-secret.md 71 | 72 | No markdown files are included in the context except README files other than `README-secret.md` 73 | 74 | Now consider this example: 75 | 76 | *.md 77 | README-secret.md 78 | !README*.md 79 | 80 | All of the README files are included. 81 | The middle line has no effect because `!README*.md` matches `README-secret.md` and comes last. 82 | 83 | You can even use the `.dockerignore` file to exclude the Dockerfile and `.dockerignore` files. 84 | These files are still sent to the daemon because it needs them to do its job. 85 | But the ADD and COPY commands do not copy them to the the image. 86 | 87 | Finally, you may want to specify which files to include in the context, rather than which to exclude. 88 | To achieve this, specify `*` as the first pattern, followed by one or more `!` exception patterns. 89 | 90 | Note: For historical reasons, the pattern `.` is ignored. 91 | 92 | ## LICENCE 93 | Folow the docker license, this lib use [APACHE V2 LICENSE](LICENSE) 94 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fswatch 2 | 3 | [![Build status](https://ci.appveyor.com/api/projects/status/hble6an55u4a04e5/branch/master?svg=true)](https://ci.appveyor.com/project/codeskyblue/fswatch/branch/master) 4 | 5 | **fswatch** is a developer tool that triggers commands in response to filesystem changes. 6 | Works well on Mac, Linux, and should also works on Windows(not well tested). 7 | 8 | ## Install 9 | ``` 10 | go install github.com/codeskyblue/fswatch@latest 11 | ``` 12 | 13 | ## Simple way to use fswatch 14 | 15 | Usage example 16 | 17 | ``` 18 | $ fswatch -v 19 | 3.0 20 | $ fswtach --help 21 | show help message ... 22 | ``` 23 | 24 | Watch file change event and trigger command 25 | 26 | TODO: now only watch `*.go, *.c, *.py` files, watch depth = 0 (current directory) 27 | 28 | ```bash 29 | $ fswatch sh -c "ls -l | wc -l" 30 | fswatch >>> [] exec start: sh -c 'ls -l | wc -l' 31 | 8 32 | fswatch >>> [] finish in 11.822873ms 33 | fswatch >>> changed: fswatch.go 34 | fswatch >>> delay: 100ms 35 | fswatch >>> [] exec start: [sh -c ls -l | wc -l] 36 | 8 37 | fswatch >>> [] finish in 13.606428ms 38 | ^Cfswatch >>> Catch signal interrupt! 39 | fswatch >>> Kill all running ... Done 40 | ``` 41 | 42 | ## Hard way to use fswatch (not recommend) 43 | ### Step 1 44 | Create a config file `fsw.yml` 45 | 46 | config file example though command `fswatch` with no arguments 47 | 48 | ```yaml 49 | desc: Auto generated by fswatch [fswatch] 50 | triggers: 51 | - pattens: 52 | - '**/*.go' 53 | - '**/*.c' 54 | # also support '!**/test_*.go' 55 | env: 56 | DEBUG: "1" 57 | # if shell is true, $cmd will be wrapped with `bash -c` 58 | shell: true 59 | cmd: go test -v 60 | delay: 100ms 61 | stop_timeout: 1s 62 | signal: "KILL" 63 | kill_signal: "SIGTERM" 64 | watch_paths: 65 | - . 66 | watch_depth: 5 67 | ``` 68 | 69 | ### Step 2 70 | Run `fswatch` directly. 71 | Every time you edit a file. Command `go test -v` will be called. 72 | 73 | ``` 74 | $ fswatch 75 | fswatch >>> exec start: go test -v 76 | # github.com/codeskyblue/fswatch 77 | ./fswatch.go:281: main redeclared in this block 78 | previous declaration at ./config.go:354 79 | fswatch >>> program exited: exit status 2 80 | fswatch >>> finish in 145.499911ms 81 | ``` 82 | 83 | > support specify config file through `fswatch --config myfsw.yml` 84 | 85 | ## You should know 86 | ### How fswatch kill process 87 | fswatch send signal to all process when restart. (mac and linux killed by pgid, windows by taskkill) 88 | `Ctrl+C` will trigger fswatch quit and kill all process it started. 89 | 90 | ### Pattens 91 | More about the pattens. The patten has the same rule like `.gitignore`. 92 | So you can write like this. 93 | 94 | ``` 95 | - pattens: 96 | - '*.go' 97 | - '!*_test.go' 98 | - '!**/bindata.go' 99 | ``` 100 | 101 | `main.go` changed will trigger command, but `a_test.go` and `libs/bindata.go` will be ignored. 102 | 103 | ## FAQs 104 | `too many open files` 105 | 106 | For mac, run the following command 107 | 108 | sysctl -w kern.maxfiles=20480 109 | sysctl -w kern.maxfilesperproc=18000 110 | ulimit -S -n 2048 111 | 112 | [reference](http://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1) 113 | 114 | ## Other 115 | 116 | 117 | Chinese Blog: 118 | 119 | ## Friendly link: 120 | * [bee](https://github.com/astaxie/bee) 121 | * [fsnotify](github.com/go-fsnotify/fsnotify) 122 | * 123 | * 124 | 125 | ## Code History 126 | I reviewed the first version of fswatch(which was taged 0.1). The code I look now is shit. So I deleted almost 80% code, And left some very useful functions. 127 | 128 | ## Alternative 129 | * 130 | * write with cpp 131 | * Funny name. 132 | 133 | ## LICENSE 134 | Under [MIT](LICENSE) 135 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Issues 4 | 5 | * Request features and report bugs using the [GitHub Issue Tracker](https://github.com/fsnotify/fsnotify/issues). 6 | * Please indicate the platform you are using fsnotify on. 7 | * A code example to reproduce the problem is appreciated. 8 | 9 | ## Pull Requests 10 | 11 | ### Contributor License Agreement 12 | 13 | fsnotify is derived from code in the [golang.org/x/exp](https://godoc.org/golang.org/x/exp) package and it may be included [in the standard library](https://github.com/fsnotify/fsnotify/issues/1) in the future. Therefore fsnotify carries the same [LICENSE](https://github.com/fsnotify/fsnotify/blob/master/LICENSE) as Go. Contributors retain their copyright, so you need to fill out a short form before we can accept your contribution: [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual). 14 | 15 | Please indicate that you have signed the CLA in your pull request. 16 | 17 | ### How fsnotify is Developed 18 | 19 | * Development is done on feature branches. 20 | * Tests are run on BSD, Linux, OS X and Windows. 21 | * Pull requests are reviewed and [applied to master][am] using [hub][]. 22 | * Maintainers may modify or squash commits rather than asking contributors to. 23 | * To issue a new release, the maintainers will: 24 | * Update the CHANGELOG 25 | * Tag a version, which will become available through gopkg.in. 26 | 27 | ### How to Fork 28 | 29 | For smooth sailing, always use the original import path. Installing with `go get` makes this easy. 30 | 31 | 1. Install from GitHub (`go get -u github.com/fsnotify/fsnotify`) 32 | 2. Create your feature branch (`git checkout -b my-new-feature`) 33 | 3. Ensure everything works and the tests pass (see below) 34 | 4. Commit your changes (`git commit -am 'Add some feature'`) 35 | 36 | Contribute upstream: 37 | 38 | 1. Fork fsnotify on GitHub 39 | 2. Add your remote (`git remote add fork git@github.com:mycompany/repo.git`) 40 | 3. Push to the branch (`git push fork my-new-feature`) 41 | 4. Create a new Pull Request on GitHub 42 | 43 | This workflow is [thoroughly explained by Katrina Owen](https://blog.splice.com/contributing-open-source-git-repositories-go/). 44 | 45 | ### Testing 46 | 47 | fsnotify uses build tags to compile different code on Linux, BSD, OS X, and Windows. 48 | 49 | Before doing a pull request, please do your best to test your changes on multiple platforms, and list which platforms you were able/unable to test on. 50 | 51 | To aid in cross-platform testing there is a Vagrantfile for Linux and BSD. 52 | 53 | * Install [Vagrant](http://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) 54 | * Setup [Vagrant Gopher](https://github.com/nathany/vagrant-gopher) in your `src` folder. 55 | * Run `vagrant up` from the project folder. You can also setup just one box with `vagrant up linux` or `vagrant up bsd` (note: the BSD box doesn't support Windows hosts at this time, and NFS may prompt for your host OS password) 56 | * Once setup, you can run the test suite on a given OS with a single command `vagrant ssh linux -c 'cd fsnotify/fsnotify; go test'`. 57 | * When you're done, you will want to halt or destroy the Vagrant boxes. 58 | 59 | Notice: fsnotify file system events won't trigger in shared folders. The tests get around this limitation by using the /tmp directory. 60 | 61 | Right now there is no equivalent solution for Windows and OS X, but there are Windows VMs [freely available from Microsoft](http://www.modern.ie/en-us/virtualization-tools#downloads). 62 | 63 | ### Maintainers 64 | 65 | Help maintaining fsnotify is welcome. To be a maintainer: 66 | 67 | * Submit a pull request and sign the CLA as above. 68 | * You must be able to run the test suite on Mac, Windows, Linux and BSD. 69 | 70 | To keep master clean, the fsnotify project uses the "apply mail" workflow outlined in Nathaniel Talbott's post ["Merge pull request" Considered Harmful][am]. This requires installing [hub][]. 71 | 72 | All code changes should be internal pull requests. 73 | 74 | Releases are tagged using [Semantic Versioning](http://semver.org/). 75 | 76 | [hub]: https://github.com/github/hub 77 | [am]: http://blog.spreedly.com/2014/06/24/merge-pull-request-considered-harmful/#.VGa5yZPF_Zs 78 | -------------------------------------------------------------------------------- /vendor/github.com/go-fsnotify/fsnotify/inotify_poller.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | 7 | package fsnotify 8 | 9 | import ( 10 | "errors" 11 | 12 | "golang.org/x/sys/unix" 13 | ) 14 | 15 | type fdPoller struct { 16 | fd int // File descriptor (as returned by the inotify_init() syscall) 17 | epfd int // Epoll file descriptor 18 | pipe [2]int // Pipe for waking up 19 | } 20 | 21 | func emptyPoller(fd int) *fdPoller { 22 | poller := new(fdPoller) 23 | poller.fd = fd 24 | poller.epfd = -1 25 | poller.pipe[0] = -1 26 | poller.pipe[1] = -1 27 | return poller 28 | } 29 | 30 | // Create a new inotify poller. 31 | // This creates an inotify handler, and an epoll handler. 32 | func newFdPoller(fd int) (*fdPoller, error) { 33 | var errno error 34 | poller := emptyPoller(fd) 35 | defer func() { 36 | if errno != nil { 37 | poller.close() 38 | } 39 | }() 40 | poller.fd = fd 41 | 42 | // Create epoll fd 43 | poller.epfd, errno = unix.EpollCreate1(0) 44 | if poller.epfd == -1 { 45 | return nil, errno 46 | } 47 | // Create pipe; pipe[0] is the read end, pipe[1] the write end. 48 | errno = unix.Pipe2(poller.pipe[:], unix.O_NONBLOCK) 49 | if errno != nil { 50 | return nil, errno 51 | } 52 | 53 | // Register inotify fd with epoll 54 | event := unix.EpollEvent{ 55 | Fd: int32(poller.fd), 56 | Events: unix.EPOLLIN, 57 | } 58 | errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.fd, &event) 59 | if errno != nil { 60 | return nil, errno 61 | } 62 | 63 | // Register pipe fd with epoll 64 | event = unix.EpollEvent{ 65 | Fd: int32(poller.pipe[0]), 66 | Events: unix.EPOLLIN, 67 | } 68 | errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.pipe[0], &event) 69 | if errno != nil { 70 | return nil, errno 71 | } 72 | 73 | return poller, nil 74 | } 75 | 76 | // Wait using epoll. 77 | // Returns true if something is ready to be read, 78 | // false if there is not. 79 | func (poller *fdPoller) wait() (bool, error) { 80 | // 3 possible events per fd, and 2 fds, makes a maximum of 6 events. 81 | // I don't know whether epoll_wait returns the number of events returned, 82 | // or the total number of events ready. 83 | // I decided to catch both by making the buffer one larger than the maximum. 84 | events := make([]unix.EpollEvent, 7) 85 | for { 86 | n, errno := unix.EpollWait(poller.epfd, events, -1) 87 | if n == -1 { 88 | if errno == unix.EINTR { 89 | continue 90 | } 91 | return false, errno 92 | } 93 | if n == 0 { 94 | // If there are no events, try again. 95 | continue 96 | } 97 | if n > 6 { 98 | // This should never happen. More events were returned than should be possible. 99 | return false, errors.New("epoll_wait returned more events than I know what to do with") 100 | } 101 | ready := events[:n] 102 | epollhup := false 103 | epollerr := false 104 | epollin := false 105 | for _, event := range ready { 106 | if event.Fd == int32(poller.fd) { 107 | if event.Events&unix.EPOLLHUP != 0 { 108 | // This should not happen, but if it does, treat it as a wakeup. 109 | epollhup = true 110 | } 111 | if event.Events&unix.EPOLLERR != 0 { 112 | // If an error is waiting on the file descriptor, we should pretend 113 | // something is ready to read, and let unix.Read pick up the error. 114 | epollerr = true 115 | } 116 | if event.Events&unix.EPOLLIN != 0 { 117 | // There is data to read. 118 | epollin = true 119 | } 120 | } 121 | if event.Fd == int32(poller.pipe[0]) { 122 | if event.Events&unix.EPOLLHUP != 0 { 123 | // Write pipe descriptor was closed, by us. This means we're closing down the 124 | // watcher, and we should wake up. 125 | } 126 | if event.Events&unix.EPOLLERR != 0 { 127 | // If an error is waiting on the pipe file descriptor. 128 | // This is an absolute mystery, and should never ever happen. 129 | return false, errors.New("Error on the pipe descriptor.") 130 | } 131 | if event.Events&unix.EPOLLIN != 0 { 132 | // This is a regular wakeup, so we have to clear the buffer. 133 | err := poller.clearWake() 134 | if err != nil { 135 | return false, err 136 | } 137 | } 138 | } 139 | } 140 | 141 | if epollhup || epollerr || epollin { 142 | return true, nil 143 | } 144 | return false, nil 145 | } 146 | } 147 | 148 | // Close the write end of the poller. 149 | func (poller *fdPoller) wake() error { 150 | buf := make([]byte, 1) 151 | n, errno := unix.Write(poller.pipe[1], buf) 152 | if n == -1 { 153 | if errno == unix.EAGAIN { 154 | // Buffer is full, poller will wake. 155 | return nil 156 | } 157 | return errno 158 | } 159 | return nil 160 | } 161 | 162 | func (poller *fdPoller) clearWake() error { 163 | // You have to be woken up a LOT in order to get to 100! 164 | buf := make([]byte, 100) 165 | n, errno := unix.Read(poller.pipe[0], buf) 166 | if n == -1 { 167 | if errno == unix.EAGAIN { 168 | // Buffer is empty, someone else cleared our wake. 169 | return nil 170 | } 171 | return errno 172 | } 173 | return nil 174 | } 175 | 176 | // Close all poller file descriptors, but not the one passed to it. 177 | func (poller *fdPoller) close() { 178 | if poller.pipe[1] != -1 { 179 | unix.Close(poller.pipe[1]) 180 | } 181 | if poller.pipe[0] != -1 { 182 | unix.Close(poller.pipe[0]) 183 | } 184 | if poller.epfd != -1 { 185 | unix.Close(poller.epfd) 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build ppc64 ppc64le 7 | 8 | package unix 9 | 10 | //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) 11 | //sys Dup2(oldfd int, newfd int) (err error) 12 | //sys Fchown(fd int, uid int, gid int) (err error) 13 | //sys Fstat(fd int, stat *Stat_t) (err error) 14 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 15 | //sys Ftruncate(fd int, length int64) (err error) 16 | //sysnb Getegid() (egid int) 17 | //sysnb Geteuid() (euid int) 18 | //sysnb Getgid() (gid int) 19 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = SYS_UGETRLIMIT 20 | //sysnb Getuid() (uid int) 21 | //sysnb InotifyInit() (fd int, err error) 22 | //sys Ioperm(from int, num int, on int) (err error) 23 | //sys Iopl(level int) (err error) 24 | //sys Lchown(path string, uid int, gid int) (err error) 25 | //sys Listen(s int, n int) (err error) 26 | //sys Lstat(path string, stat *Stat_t) (err error) 27 | //sys Pause() (err error) 28 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 29 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 30 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 31 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) 32 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 33 | //sys Setfsgid(gid int) (err error) 34 | //sys Setfsuid(uid int) (err error) 35 | //sysnb Setregid(rgid int, egid int) (err error) 36 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 37 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 38 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 39 | //sysnb Setreuid(ruid int, euid int) (err error) 40 | //sys Shutdown(fd int, how int) (err error) 41 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 42 | //sys Stat(path string, stat *Stat_t) (err error) 43 | //sys Statfs(path string, buf *Statfs_t) (err error) 44 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) = SYS_SYNC_FILE_RANGE2 45 | //sys Truncate(path string, length int64) (err error) 46 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 47 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 48 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 49 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 50 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 51 | //sysnb setgroups(n int, list *_Gid_t) (err error) 52 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 53 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 54 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 55 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 56 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 57 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 58 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 59 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 60 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 61 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 62 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 63 | 64 | func Getpagesize() int { return 65536 } 65 | 66 | //sysnb Gettimeofday(tv *Timeval) (err error) 67 | //sysnb Time(t *Time_t) (tt Time_t, err error) 68 | 69 | //sys Utime(path string, buf *Utimbuf) (err error) 70 | 71 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 72 | 73 | func NsecToTimespec(nsec int64) (ts Timespec) { 74 | ts.Sec = nsec / 1e9 75 | ts.Nsec = nsec % 1e9 76 | return 77 | } 78 | 79 | func NsecToTimeval(nsec int64) (tv Timeval) { 80 | nsec += 999 // round up to microsecond 81 | tv.Sec = nsec / 1e9 82 | tv.Usec = nsec % 1e9 / 1e3 83 | return 84 | } 85 | 86 | func (r *PtraceRegs) PC() uint64 { return r.Nip } 87 | 88 | func (r *PtraceRegs) SetPC(pc uint64) { r.Nip = pc } 89 | 90 | func (iov *Iovec) SetLen(length int) { 91 | iov.Len = uint64(length) 92 | } 93 | 94 | func (msghdr *Msghdr) SetControllen(length int) { 95 | msghdr.Controllen = uint64(length) 96 | } 97 | 98 | func (cmsg *Cmsghdr) SetLen(length int) { 99 | cmsg.Len = uint64(length) 100 | } 101 | 102 | //sysnb pipe(p *[2]_C_int) (err error) 103 | 104 | func Pipe(p []int) (err error) { 105 | if len(p) != 2 { 106 | return EINVAL 107 | } 108 | var pp [2]_C_int 109 | err = pipe(&pp) 110 | p[0] = int(pp[0]) 111 | p[1] = int(pp[1]) 112 | return 113 | } 114 | 115 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) 116 | 117 | func Pipe2(p []int, flags int) (err error) { 118 | if len(p) != 2 { 119 | return EINVAL 120 | } 121 | var pp [2]_C_int 122 | err = pipe2(&pp, flags) 123 | p[0] = int(pp[0]) 124 | p[1] = int(pp[1]) 125 | return 126 | } 127 | 128 | //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) 129 | 130 | func Poll(fds []PollFd, timeout int) (n int, err error) { 131 | if len(fds) == 0 { 132 | return poll(nil, 0, timeout) 133 | } 134 | return poll(&fds[0], len(fds), timeout) 135 | } 136 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/yamlprivateh.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | const ( 4 | // The size of the input raw buffer. 5 | input_raw_buffer_size = 512 6 | 7 | // The size of the input buffer. 8 | // It should be possible to decode the whole raw buffer. 9 | input_buffer_size = input_raw_buffer_size * 3 10 | 11 | // The size of the output buffer. 12 | output_buffer_size = 128 13 | 14 | // The size of the output raw buffer. 15 | // It should be possible to encode the whole output buffer. 16 | output_raw_buffer_size = (output_buffer_size*2 + 2) 17 | 18 | // The size of other stacks and queues. 19 | initial_stack_size = 16 20 | initial_queue_size = 16 21 | initial_string_size = 16 22 | ) 23 | 24 | // Check if the character at the specified position is an alphabetical 25 | // character, a digit, '_', or '-'. 26 | func is_alpha(b []byte, i int) bool { 27 | return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-' 28 | } 29 | 30 | // Check if the character at the specified position is a digit. 31 | func is_digit(b []byte, i int) bool { 32 | return b[i] >= '0' && b[i] <= '9' 33 | } 34 | 35 | // Get the value of a digit. 36 | func as_digit(b []byte, i int) int { 37 | return int(b[i]) - '0' 38 | } 39 | 40 | // Check if the character at the specified position is a hex-digit. 41 | func is_hex(b []byte, i int) bool { 42 | return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || b[i] >= 'a' && b[i] <= 'f' 43 | } 44 | 45 | // Get the value of a hex-digit. 46 | func as_hex(b []byte, i int) int { 47 | bi := b[i] 48 | if bi >= 'A' && bi <= 'F' { 49 | return int(bi) - 'A' + 10 50 | } 51 | if bi >= 'a' && bi <= 'f' { 52 | return int(bi) - 'a' + 10 53 | } 54 | return int(bi) - '0' 55 | } 56 | 57 | // Check if the character is ASCII. 58 | func is_ascii(b []byte, i int) bool { 59 | return b[i] <= 0x7F 60 | } 61 | 62 | // Check if the character at the start of the buffer can be printed unescaped. 63 | func is_printable(b []byte, i int) bool { 64 | return ((b[i] == 0x0A) || // . == #x0A 65 | (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E 66 | (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF 67 | (b[i] > 0xC2 && b[i] < 0xED) || 68 | (b[i] == 0xED && b[i+1] < 0xA0) || 69 | (b[i] == 0xEE) || 70 | (b[i] == 0xEF && // #xE000 <= . <= #xFFFD 71 | !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF 72 | !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) 73 | } 74 | 75 | // Check if the character at the specified position is NUL. 76 | func is_z(b []byte, i int) bool { 77 | return b[i] == 0x00 78 | } 79 | 80 | // Check if the beginning of the buffer is a BOM. 81 | func is_bom(b []byte, i int) bool { 82 | return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF 83 | } 84 | 85 | // Check if the character at the specified position is space. 86 | func is_space(b []byte, i int) bool { 87 | return b[i] == ' ' 88 | } 89 | 90 | // Check if the character at the specified position is tab. 91 | func is_tab(b []byte, i int) bool { 92 | return b[i] == '\t' 93 | } 94 | 95 | // Check if the character at the specified position is blank (space or tab). 96 | func is_blank(b []byte, i int) bool { 97 | //return is_space(b, i) || is_tab(b, i) 98 | return b[i] == ' ' || b[i] == '\t' 99 | } 100 | 101 | // Check if the character at the specified position is a line break. 102 | func is_break(b []byte, i int) bool { 103 | return (b[i] == '\r' || // CR (#xD) 104 | b[i] == '\n' || // LF (#xA) 105 | b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) 106 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) 107 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029) 108 | } 109 | 110 | func is_crlf(b []byte, i int) bool { 111 | return b[i] == '\r' && b[i+1] == '\n' 112 | } 113 | 114 | // Check if the character is a line break or NUL. 115 | func is_breakz(b []byte, i int) bool { 116 | //return is_break(b, i) || is_z(b, i) 117 | return ( // is_break: 118 | b[i] == '\r' || // CR (#xD) 119 | b[i] == '\n' || // LF (#xA) 120 | b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) 121 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) 122 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) 123 | // is_z: 124 | b[i] == 0) 125 | } 126 | 127 | // Check if the character is a line break, space, or NUL. 128 | func is_spacez(b []byte, i int) bool { 129 | //return is_space(b, i) || is_breakz(b, i) 130 | return ( // is_space: 131 | b[i] == ' ' || 132 | // is_breakz: 133 | b[i] == '\r' || // CR (#xD) 134 | b[i] == '\n' || // LF (#xA) 135 | b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) 136 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) 137 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) 138 | b[i] == 0) 139 | } 140 | 141 | // Check if the character is a line break, space, tab, or NUL. 142 | func is_blankz(b []byte, i int) bool { 143 | //return is_blank(b, i) || is_breakz(b, i) 144 | return ( // is_blank: 145 | b[i] == ' ' || b[i] == '\t' || 146 | // is_breakz: 147 | b[i] == '\r' || // CR (#xD) 148 | b[i] == '\n' || // LF (#xA) 149 | b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) 150 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) 151 | b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) 152 | b[i] == 0) 153 | } 154 | 155 | // Determine the width of the character. 156 | func width(b byte) int { 157 | // Don't replace these by a switch without first 158 | // confirming that it is being inlined. 159 | if b&0x80 == 0x00 { 160 | return 1 161 | } 162 | if b&0xE0 == 0xC0 { 163 | return 2 164 | } 165 | if b&0xF0 == 0xE0 { 166 | return 3 167 | } 168 | if b&0xF8 == 0xF0 { 169 | return 4 170 | } 171 | return 0 172 | 173 | } 174 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | enum { 49 | sizeofPtr = sizeof(void*), 50 | }; 51 | 52 | union sockaddr_all { 53 | struct sockaddr s1; // this one gets used for fields 54 | struct sockaddr_in s2; // these pad it out 55 | struct sockaddr_in6 s3; 56 | struct sockaddr_un s4; 57 | struct sockaddr_dl s5; 58 | }; 59 | 60 | struct sockaddr_any { 61 | struct sockaddr addr; 62 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 63 | }; 64 | 65 | */ 66 | import "C" 67 | 68 | // Machine characteristics; for internal use. 69 | 70 | const ( 71 | sizeofPtr = C.sizeofPtr 72 | sizeofShort = C.sizeof_short 73 | sizeofInt = C.sizeof_int 74 | sizeofLong = C.sizeof_long 75 | sizeofLongLong = C.sizeof_longlong 76 | ) 77 | 78 | // Basic types 79 | 80 | type ( 81 | _C_short C.short 82 | _C_int C.int 83 | _C_long C.long 84 | _C_long_long C.longlong 85 | ) 86 | 87 | // Time 88 | 89 | type Timespec C.struct_timespec 90 | 91 | type Timeval C.struct_timeval 92 | 93 | // Processes 94 | 95 | type Rusage C.struct_rusage 96 | 97 | type Rlimit C.struct_rlimit 98 | 99 | type _Gid_t C.gid_t 100 | 101 | // Files 102 | 103 | type Stat_t C.struct_stat 104 | 105 | type Statfs_t C.struct_statfs 106 | 107 | type Flock_t C.struct_flock 108 | 109 | type Dirent C.struct_dirent 110 | 111 | type Fsid C.fsid_t 112 | 113 | // Sockets 114 | 115 | type RawSockaddrInet4 C.struct_sockaddr_in 116 | 117 | type RawSockaddrInet6 C.struct_sockaddr_in6 118 | 119 | type RawSockaddrUnix C.struct_sockaddr_un 120 | 121 | type RawSockaddrDatalink C.struct_sockaddr_dl 122 | 123 | type RawSockaddr C.struct_sockaddr 124 | 125 | type RawSockaddrAny C.struct_sockaddr_any 126 | 127 | type _Socklen C.socklen_t 128 | 129 | type Linger C.struct_linger 130 | 131 | type Iovec C.struct_iovec 132 | 133 | type IPMreq C.struct_ip_mreq 134 | 135 | type IPv6Mreq C.struct_ipv6_mreq 136 | 137 | type Msghdr C.struct_msghdr 138 | 139 | type Cmsghdr C.struct_cmsghdr 140 | 141 | type Inet6Pktinfo C.struct_in6_pktinfo 142 | 143 | type IPv6MTUInfo C.struct_ip6_mtuinfo 144 | 145 | type ICMPv6Filter C.struct_icmp6_filter 146 | 147 | const ( 148 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 149 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 150 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 151 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 152 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 153 | SizeofLinger = C.sizeof_struct_linger 154 | SizeofIPMreq = C.sizeof_struct_ip_mreq 155 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 156 | SizeofMsghdr = C.sizeof_struct_msghdr 157 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 158 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 159 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 160 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 161 | ) 162 | 163 | // Ptrace requests 164 | 165 | const ( 166 | PTRACE_TRACEME = C.PT_TRACE_ME 167 | PTRACE_CONT = C.PT_CONTINUE 168 | PTRACE_KILL = C.PT_KILL 169 | ) 170 | 171 | // Events (kqueue, kevent) 172 | 173 | type Kevent_t C.struct_kevent 174 | 175 | // Select 176 | 177 | type FdSet C.fd_set 178 | 179 | // Routing and interface messages 180 | 181 | const ( 182 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 183 | SizeofIfData = C.sizeof_struct_if_data 184 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 185 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 186 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 187 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 188 | ) 189 | 190 | type IfMsghdr C.struct_if_msghdr 191 | 192 | type IfData C.struct_if_data 193 | 194 | type IfaMsghdr C.struct_ifa_msghdr 195 | 196 | type IfAnnounceMsghdr C.struct_if_announcemsghdr 197 | 198 | type RtMsghdr C.struct_rt_msghdr 199 | 200 | type RtMetrics C.struct_rt_metrics 201 | 202 | type Mclpool C.struct_mclpool 203 | 204 | // Berkeley packet filter 205 | 206 | const ( 207 | SizeofBpfVersion = C.sizeof_struct_bpf_version 208 | SizeofBpfStat = C.sizeof_struct_bpf_stat 209 | SizeofBpfProgram = C.sizeof_struct_bpf_program 210 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 211 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 212 | ) 213 | 214 | type BpfVersion C.struct_bpf_version 215 | 216 | type BpfStat C.struct_bpf_stat 217 | 218 | type BpfProgram C.struct_bpf_program 219 | 220 | type BpfInsn C.struct_bpf_insn 221 | 222 | type BpfHdr C.struct_bpf_hdr 223 | 224 | type BpfTimeval C.struct_bpf_timeval 225 | 226 | // Terminal handling 227 | 228 | type Termios C.struct_termios 229 | 230 | // Sysctl 231 | 232 | type Sysctlnode C.struct_sysctlnode 233 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/resolve.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | import ( 4 | "encoding/base64" 5 | "math" 6 | "strconv" 7 | "strings" 8 | "unicode/utf8" 9 | ) 10 | 11 | type resolveMapItem struct { 12 | value interface{} 13 | tag string 14 | } 15 | 16 | var resolveTable = make([]byte, 256) 17 | var resolveMap = make(map[string]resolveMapItem) 18 | 19 | func init() { 20 | t := resolveTable 21 | t[int('+')] = 'S' // Sign 22 | t[int('-')] = 'S' 23 | for _, c := range "0123456789" { 24 | t[int(c)] = 'D' // Digit 25 | } 26 | for _, c := range "yYnNtTfFoO~" { 27 | t[int(c)] = 'M' // In map 28 | } 29 | t[int('.')] = '.' // Float (potentially in map) 30 | 31 | var resolveMapList = []struct { 32 | v interface{} 33 | tag string 34 | l []string 35 | }{ 36 | {true, yaml_BOOL_TAG, []string{"y", "Y", "yes", "Yes", "YES"}}, 37 | {true, yaml_BOOL_TAG, []string{"true", "True", "TRUE"}}, 38 | {true, yaml_BOOL_TAG, []string{"on", "On", "ON"}}, 39 | {false, yaml_BOOL_TAG, []string{"n", "N", "no", "No", "NO"}}, 40 | {false, yaml_BOOL_TAG, []string{"false", "False", "FALSE"}}, 41 | {false, yaml_BOOL_TAG, []string{"off", "Off", "OFF"}}, 42 | {nil, yaml_NULL_TAG, []string{"", "~", "null", "Null", "NULL"}}, 43 | {math.NaN(), yaml_FLOAT_TAG, []string{".nan", ".NaN", ".NAN"}}, 44 | {math.Inf(+1), yaml_FLOAT_TAG, []string{".inf", ".Inf", ".INF"}}, 45 | {math.Inf(+1), yaml_FLOAT_TAG, []string{"+.inf", "+.Inf", "+.INF"}}, 46 | {math.Inf(-1), yaml_FLOAT_TAG, []string{"-.inf", "-.Inf", "-.INF"}}, 47 | {"<<", yaml_MERGE_TAG, []string{"<<"}}, 48 | } 49 | 50 | m := resolveMap 51 | for _, item := range resolveMapList { 52 | for _, s := range item.l { 53 | m[s] = resolveMapItem{item.v, item.tag} 54 | } 55 | } 56 | } 57 | 58 | const longTagPrefix = "tag:yaml.org,2002:" 59 | 60 | func shortTag(tag string) string { 61 | // TODO This can easily be made faster and produce less garbage. 62 | if strings.HasPrefix(tag, longTagPrefix) { 63 | return "!!" + tag[len(longTagPrefix):] 64 | } 65 | return tag 66 | } 67 | 68 | func longTag(tag string) string { 69 | if strings.HasPrefix(tag, "!!") { 70 | return longTagPrefix + tag[2:] 71 | } 72 | return tag 73 | } 74 | 75 | func resolvableTag(tag string) bool { 76 | switch tag { 77 | case "", yaml_STR_TAG, yaml_BOOL_TAG, yaml_INT_TAG, yaml_FLOAT_TAG, yaml_NULL_TAG: 78 | return true 79 | } 80 | return false 81 | } 82 | 83 | func resolve(tag string, in string) (rtag string, out interface{}) { 84 | if !resolvableTag(tag) { 85 | return tag, in 86 | } 87 | 88 | defer func() { 89 | switch tag { 90 | case "", rtag, yaml_STR_TAG, yaml_BINARY_TAG: 91 | return 92 | } 93 | failf("cannot decode %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)) 94 | }() 95 | 96 | // Any data is accepted as a !!str or !!binary. 97 | // Otherwise, the prefix is enough of a hint about what it might be. 98 | hint := byte('N') 99 | if in != "" { 100 | hint = resolveTable[in[0]] 101 | } 102 | if hint != 0 && tag != yaml_STR_TAG && tag != yaml_BINARY_TAG { 103 | // Handle things we can lookup in a map. 104 | if item, ok := resolveMap[in]; ok { 105 | return item.tag, item.value 106 | } 107 | 108 | // Base 60 floats are a bad idea, were dropped in YAML 1.2, and 109 | // are purposefully unsupported here. They're still quoted on 110 | // the way out for compatibility with other parser, though. 111 | 112 | switch hint { 113 | case 'M': 114 | // We've already checked the map above. 115 | 116 | case '.': 117 | // Not in the map, so maybe a normal float. 118 | floatv, err := strconv.ParseFloat(in, 64) 119 | if err == nil { 120 | return yaml_FLOAT_TAG, floatv 121 | } 122 | 123 | case 'D', 'S': 124 | // Int, float, or timestamp. 125 | plain := strings.Replace(in, "_", "", -1) 126 | intv, err := strconv.ParseInt(plain, 0, 64) 127 | if err == nil { 128 | if intv == int64(int(intv)) { 129 | return yaml_INT_TAG, int(intv) 130 | } else { 131 | return yaml_INT_TAG, intv 132 | } 133 | } 134 | uintv, err := strconv.ParseUint(plain, 0, 64) 135 | if err == nil { 136 | return yaml_INT_TAG, uintv 137 | } 138 | floatv, err := strconv.ParseFloat(plain, 64) 139 | if err == nil { 140 | return yaml_FLOAT_TAG, floatv 141 | } 142 | if strings.HasPrefix(plain, "0b") { 143 | intv, err := strconv.ParseInt(plain[2:], 2, 64) 144 | if err == nil { 145 | if intv == int64(int(intv)) { 146 | return yaml_INT_TAG, int(intv) 147 | } else { 148 | return yaml_INT_TAG, intv 149 | } 150 | } 151 | uintv, err := strconv.ParseUint(plain[2:], 2, 64) 152 | if err == nil { 153 | return yaml_INT_TAG, uintv 154 | } 155 | } else if strings.HasPrefix(plain, "-0b") { 156 | intv, err := strconv.ParseInt(plain[3:], 2, 64) 157 | if err == nil { 158 | if intv == int64(int(intv)) { 159 | return yaml_INT_TAG, -int(intv) 160 | } else { 161 | return yaml_INT_TAG, -intv 162 | } 163 | } 164 | } 165 | // XXX Handle timestamps here. 166 | 167 | default: 168 | panic("resolveTable item not yet handled: " + string(rune(hint)) + " (with " + in + ")") 169 | } 170 | } 171 | if tag == yaml_BINARY_TAG { 172 | return yaml_BINARY_TAG, in 173 | } 174 | if utf8.ValidString(in) { 175 | return yaml_STR_TAG, in 176 | } 177 | return yaml_BINARY_TAG, encodeBase64(in) 178 | } 179 | 180 | // encodeBase64 encodes s as base64 that is broken up into multiple lines 181 | // as appropriate for the resulting length. 182 | func encodeBase64(s string) string { 183 | const lineLen = 70 184 | encLen := base64.StdEncoding.EncodedLen(len(s)) 185 | lines := encLen/lineLen + 1 186 | buf := make([]byte, encLen*2+lines) 187 | in := buf[0:encLen] 188 | out := buf[encLen:] 189 | base64.StdEncoding.Encode(in, []byte(s)) 190 | k := 0 191 | for i := 0; i < len(in); i += lineLen { 192 | j := i + lineLen 193 | if j > len(in) { 194 | j = len(in) 195 | } 196 | k += copy(out[k:], in[i:j]) 197 | if lines > 1 { 198 | out[k] = '\n' 199 | k++ 200 | } 201 | } 202 | return string(out[:k]) 203 | } 204 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build amd64,linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //sys Dup2(oldfd int, newfd int) (err error) 12 | //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) 13 | //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64 14 | //sys Fchown(fd int, uid int, gid int) (err error) 15 | //sys Fstat(fd int, stat *Stat_t) (err error) 16 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 17 | //sys Ftruncate(fd int, length int64) (err error) 18 | //sysnb Getegid() (egid int) 19 | //sysnb Geteuid() (euid int) 20 | //sysnb Getgid() (gid int) 21 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 22 | //sysnb Getuid() (uid int) 23 | //sysnb InotifyInit() (fd int, err error) 24 | //sys Ioperm(from int, num int, on int) (err error) 25 | //sys Iopl(level int) (err error) 26 | //sys Lchown(path string, uid int, gid int) (err error) 27 | //sys Listen(s int, n int) (err error) 28 | //sys Lstat(path string, stat *Stat_t) (err error) 29 | //sys Pause() (err error) 30 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 31 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 32 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 33 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) 34 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 35 | //sys Setfsgid(gid int) (err error) 36 | //sys Setfsuid(uid int) (err error) 37 | //sysnb Setregid(rgid int, egid int) (err error) 38 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 39 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 40 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 41 | //sysnb Setreuid(ruid int, euid int) (err error) 42 | //sys Shutdown(fd int, how int) (err error) 43 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 44 | //sys Stat(path string, stat *Stat_t) (err error) 45 | //sys Statfs(path string, buf *Statfs_t) (err error) 46 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) 47 | //sys Truncate(path string, length int64) (err error) 48 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 49 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 50 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 51 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 52 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 53 | //sysnb setgroups(n int, list *_Gid_t) (err error) 54 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 55 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 56 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 57 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 58 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 59 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 60 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 61 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 62 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 63 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 64 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 65 | 66 | //go:noescape 67 | func gettimeofday(tv *Timeval) (err syscall.Errno) 68 | 69 | func Gettimeofday(tv *Timeval) (err error) { 70 | errno := gettimeofday(tv) 71 | if errno != 0 { 72 | return errno 73 | } 74 | return nil 75 | } 76 | 77 | func Getpagesize() int { return 4096 } 78 | 79 | func Time(t *Time_t) (tt Time_t, err error) { 80 | var tv Timeval 81 | errno := gettimeofday(&tv) 82 | if errno != 0 { 83 | return 0, errno 84 | } 85 | if t != nil { 86 | *t = Time_t(tv.Sec) 87 | } 88 | return Time_t(tv.Sec), nil 89 | } 90 | 91 | //sys Utime(path string, buf *Utimbuf) (err error) 92 | 93 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 94 | 95 | func NsecToTimespec(nsec int64) (ts Timespec) { 96 | ts.Sec = nsec / 1e9 97 | ts.Nsec = nsec % 1e9 98 | return 99 | } 100 | 101 | func NsecToTimeval(nsec int64) (tv Timeval) { 102 | nsec += 999 // round up to microsecond 103 | tv.Sec = nsec / 1e9 104 | tv.Usec = nsec % 1e9 / 1e3 105 | return 106 | } 107 | 108 | //sysnb pipe(p *[2]_C_int) (err error) 109 | 110 | func Pipe(p []int) (err error) { 111 | if len(p) != 2 { 112 | return EINVAL 113 | } 114 | var pp [2]_C_int 115 | err = pipe(&pp) 116 | p[0] = int(pp[0]) 117 | p[1] = int(pp[1]) 118 | return 119 | } 120 | 121 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) 122 | 123 | func Pipe2(p []int, flags int) (err error) { 124 | if len(p) != 2 { 125 | return EINVAL 126 | } 127 | var pp [2]_C_int 128 | err = pipe2(&pp, flags) 129 | p[0] = int(pp[0]) 130 | p[1] = int(pp[1]) 131 | return 132 | } 133 | 134 | func (r *PtraceRegs) PC() uint64 { return r.Rip } 135 | 136 | func (r *PtraceRegs) SetPC(pc uint64) { r.Rip = pc } 137 | 138 | func (iov *Iovec) SetLen(length int) { 139 | iov.Len = uint64(length) 140 | } 141 | 142 | func (msghdr *Msghdr) SetControllen(length int) { 143 | msghdr.Controllen = uint64(length) 144 | } 145 | 146 | func (cmsg *Cmsghdr) SetLen(length int) { 147 | cmsg.Len = uint64(length) 148 | } 149 | 150 | //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) 151 | 152 | func Poll(fds []PollFd, timeout int) (n int, err error) { 153 | if len(fds) == 0 { 154 | return poll(nil, 0, timeout) 155 | } 156 | return poll(&fds[0], len(fds), timeout) 157 | } 158 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | enum { 47 | sizeofPtr = sizeof(void*), 48 | }; 49 | 50 | union sockaddr_all { 51 | struct sockaddr s1; // this one gets used for fields 52 | struct sockaddr_in s2; // these pad it out 53 | struct sockaddr_in6 s3; 54 | struct sockaddr_un s4; 55 | struct sockaddr_dl s5; 56 | }; 57 | 58 | struct sockaddr_any { 59 | struct sockaddr addr; 60 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 61 | }; 62 | 63 | */ 64 | import "C" 65 | 66 | // Machine characteristics; for internal use. 67 | 68 | const ( 69 | sizeofPtr = C.sizeofPtr 70 | sizeofShort = C.sizeof_short 71 | sizeofInt = C.sizeof_int 72 | sizeofLong = C.sizeof_long 73 | sizeofLongLong = C.sizeof_longlong 74 | ) 75 | 76 | // Basic types 77 | 78 | type ( 79 | _C_short C.short 80 | _C_int C.int 81 | _C_long C.long 82 | _C_long_long C.longlong 83 | ) 84 | 85 | // Time 86 | 87 | type Timespec C.struct_timespec 88 | 89 | type Timeval C.struct_timeval 90 | 91 | // Processes 92 | 93 | type Rusage C.struct_rusage 94 | 95 | type Rlimit C.struct_rlimit 96 | 97 | type _Gid_t C.gid_t 98 | 99 | // Files 100 | 101 | const ( // Directory mode bits 102 | S_IFMT = C.S_IFMT 103 | S_IFIFO = C.S_IFIFO 104 | S_IFCHR = C.S_IFCHR 105 | S_IFDIR = C.S_IFDIR 106 | S_IFBLK = C.S_IFBLK 107 | S_IFREG = C.S_IFREG 108 | S_IFLNK = C.S_IFLNK 109 | S_IFSOCK = C.S_IFSOCK 110 | S_ISUID = C.S_ISUID 111 | S_ISGID = C.S_ISGID 112 | S_ISVTX = C.S_ISVTX 113 | S_IRUSR = C.S_IRUSR 114 | S_IWUSR = C.S_IWUSR 115 | S_IXUSR = C.S_IXUSR 116 | ) 117 | 118 | type Stat_t C.struct_stat 119 | 120 | type Statfs_t C.struct_statfs 121 | 122 | type Flock_t C.struct_flock 123 | 124 | type Dirent C.struct_dirent 125 | 126 | type Fsid C.struct_fsid 127 | 128 | // Sockets 129 | 130 | type RawSockaddrInet4 C.struct_sockaddr_in 131 | 132 | type RawSockaddrInet6 C.struct_sockaddr_in6 133 | 134 | type RawSockaddrUnix C.struct_sockaddr_un 135 | 136 | type RawSockaddrDatalink C.struct_sockaddr_dl 137 | 138 | type RawSockaddr C.struct_sockaddr 139 | 140 | type RawSockaddrAny C.struct_sockaddr_any 141 | 142 | type _Socklen C.socklen_t 143 | 144 | type Linger C.struct_linger 145 | 146 | type Iovec C.struct_iovec 147 | 148 | type IPMreq C.struct_ip_mreq 149 | 150 | type IPv6Mreq C.struct_ipv6_mreq 151 | 152 | type Msghdr C.struct_msghdr 153 | 154 | type Cmsghdr C.struct_cmsghdr 155 | 156 | type Inet6Pktinfo C.struct_in6_pktinfo 157 | 158 | type IPv6MTUInfo C.struct_ip6_mtuinfo 159 | 160 | type ICMPv6Filter C.struct_icmp6_filter 161 | 162 | const ( 163 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 164 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 165 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 166 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 167 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 168 | SizeofLinger = C.sizeof_struct_linger 169 | SizeofIPMreq = C.sizeof_struct_ip_mreq 170 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 171 | SizeofMsghdr = C.sizeof_struct_msghdr 172 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 173 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 174 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 175 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 176 | ) 177 | 178 | // Ptrace requests 179 | 180 | const ( 181 | PTRACE_TRACEME = C.PT_TRACE_ME 182 | PTRACE_CONT = C.PT_CONTINUE 183 | PTRACE_KILL = C.PT_KILL 184 | ) 185 | 186 | // Events (kqueue, kevent) 187 | 188 | type Kevent_t C.struct_kevent 189 | 190 | // Select 191 | 192 | type FdSet C.fd_set 193 | 194 | // Routing and interface messages 195 | 196 | const ( 197 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 198 | SizeofIfData = C.sizeof_struct_if_data 199 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 200 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr 201 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 202 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 203 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 204 | ) 205 | 206 | type IfMsghdr C.struct_if_msghdr 207 | 208 | type IfData C.struct_if_data 209 | 210 | type IfaMsghdr C.struct_ifa_msghdr 211 | 212 | type IfmaMsghdr C.struct_ifma_msghdr 213 | 214 | type IfAnnounceMsghdr C.struct_if_announcemsghdr 215 | 216 | type RtMsghdr C.struct_rt_msghdr 217 | 218 | type RtMetrics C.struct_rt_metrics 219 | 220 | // Berkeley packet filter 221 | 222 | const ( 223 | SizeofBpfVersion = C.sizeof_struct_bpf_version 224 | SizeofBpfStat = C.sizeof_struct_bpf_stat 225 | SizeofBpfProgram = C.sizeof_struct_bpf_program 226 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 227 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 228 | ) 229 | 230 | type BpfVersion C.struct_bpf_version 231 | 232 | type BpfStat C.struct_bpf_stat 233 | 234 | type BpfProgram C.struct_bpf_program 235 | 236 | type BpfInsn C.struct_bpf_insn 237 | 238 | type BpfHdr C.struct_bpf_hdr 239 | 240 | // Terminal handling 241 | 242 | type Termios C.struct_termios 243 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define KERNEL 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | 47 | enum { 48 | sizeofPtr = sizeof(void*), 49 | }; 50 | 51 | union sockaddr_all { 52 | struct sockaddr s1; // this one gets used for fields 53 | struct sockaddr_in s2; // these pad it out 54 | struct sockaddr_in6 s3; 55 | struct sockaddr_un s4; 56 | struct sockaddr_dl s5; 57 | }; 58 | 59 | struct sockaddr_any { 60 | struct sockaddr addr; 61 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 62 | }; 63 | 64 | */ 65 | import "C" 66 | 67 | // Machine characteristics; for internal use. 68 | 69 | const ( 70 | sizeofPtr = C.sizeofPtr 71 | sizeofShort = C.sizeof_short 72 | sizeofInt = C.sizeof_int 73 | sizeofLong = C.sizeof_long 74 | sizeofLongLong = C.sizeof_longlong 75 | ) 76 | 77 | // Basic types 78 | 79 | type ( 80 | _C_short C.short 81 | _C_int C.int 82 | _C_long C.long 83 | _C_long_long C.longlong 84 | ) 85 | 86 | // Time 87 | 88 | type Timespec C.struct_timespec 89 | 90 | type Timeval C.struct_timeval 91 | 92 | // Processes 93 | 94 | type Rusage C.struct_rusage 95 | 96 | type Rlimit C.struct_rlimit 97 | 98 | type _Gid_t C.gid_t 99 | 100 | // Files 101 | 102 | const ( // Directory mode bits 103 | S_IFMT = C.S_IFMT 104 | S_IFIFO = C.S_IFIFO 105 | S_IFCHR = C.S_IFCHR 106 | S_IFDIR = C.S_IFDIR 107 | S_IFBLK = C.S_IFBLK 108 | S_IFREG = C.S_IFREG 109 | S_IFLNK = C.S_IFLNK 110 | S_IFSOCK = C.S_IFSOCK 111 | S_ISUID = C.S_ISUID 112 | S_ISGID = C.S_ISGID 113 | S_ISVTX = C.S_ISVTX 114 | S_IRUSR = C.S_IRUSR 115 | S_IWUSR = C.S_IWUSR 116 | S_IXUSR = C.S_IXUSR 117 | ) 118 | 119 | type Stat_t C.struct_stat 120 | 121 | type Statfs_t C.struct_statfs 122 | 123 | type Flock_t C.struct_flock 124 | 125 | type Dirent C.struct_dirent 126 | 127 | type Fsid C.fsid_t 128 | 129 | // Sockets 130 | 131 | type RawSockaddrInet4 C.struct_sockaddr_in 132 | 133 | type RawSockaddrInet6 C.struct_sockaddr_in6 134 | 135 | type RawSockaddrUnix C.struct_sockaddr_un 136 | 137 | type RawSockaddrDatalink C.struct_sockaddr_dl 138 | 139 | type RawSockaddr C.struct_sockaddr 140 | 141 | type RawSockaddrAny C.struct_sockaddr_any 142 | 143 | type _Socklen C.socklen_t 144 | 145 | type Linger C.struct_linger 146 | 147 | type Iovec C.struct_iovec 148 | 149 | type IPMreq C.struct_ip_mreq 150 | 151 | type IPv6Mreq C.struct_ipv6_mreq 152 | 153 | type Msghdr C.struct_msghdr 154 | 155 | type Cmsghdr C.struct_cmsghdr 156 | 157 | type Inet6Pktinfo C.struct_in6_pktinfo 158 | 159 | type IPv6MTUInfo C.struct_ip6_mtuinfo 160 | 161 | type ICMPv6Filter C.struct_icmp6_filter 162 | 163 | const ( 164 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 165 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 166 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 167 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 168 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 169 | SizeofLinger = C.sizeof_struct_linger 170 | SizeofIPMreq = C.sizeof_struct_ip_mreq 171 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 172 | SizeofMsghdr = C.sizeof_struct_msghdr 173 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 174 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 175 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 176 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 177 | ) 178 | 179 | // Ptrace requests 180 | 181 | const ( 182 | PTRACE_TRACEME = C.PT_TRACE_ME 183 | PTRACE_CONT = C.PT_CONTINUE 184 | PTRACE_KILL = C.PT_KILL 185 | ) 186 | 187 | // Events (kqueue, kevent) 188 | 189 | type Kevent_t C.struct_kevent 190 | 191 | // Select 192 | 193 | type FdSet C.fd_set 194 | 195 | // Routing and interface messages 196 | 197 | const ( 198 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 199 | SizeofIfData = C.sizeof_struct_if_data 200 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 201 | SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr 202 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 203 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 204 | ) 205 | 206 | type IfMsghdr C.struct_if_msghdr 207 | 208 | type IfData C.struct_if_data 209 | 210 | type IfaMsghdr C.struct_ifa_msghdr 211 | 212 | type IfAnnounceMsghdr C.struct_if_announcemsghdr 213 | 214 | type RtMsghdr C.struct_rt_msghdr 215 | 216 | type RtMetrics C.struct_rt_metrics 217 | 218 | type Mclpool C.struct_mclpool 219 | 220 | // Berkeley packet filter 221 | 222 | const ( 223 | SizeofBpfVersion = C.sizeof_struct_bpf_version 224 | SizeofBpfStat = C.sizeof_struct_bpf_stat 225 | SizeofBpfProgram = C.sizeof_struct_bpf_program 226 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 227 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 228 | ) 229 | 230 | type BpfVersion C.struct_bpf_version 231 | 232 | type BpfStat C.struct_bpf_stat 233 | 234 | type BpfProgram C.struct_bpf_program 235 | 236 | type BpfInsn C.struct_bpf_insn 237 | 238 | type BpfHdr C.struct_bpf_hdr 239 | 240 | type BpfTimeval C.struct_bpf_timeval 241 | 242 | // Terminal handling 243 | 244 | type Termios C.struct_termios 245 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/types_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build ignore 6 | 7 | /* 8 | Input to cgo -godefs. See also mkerrors.sh and mkall.sh 9 | */ 10 | 11 | // +godefs map struct_in_addr [4]byte /* in_addr */ 12 | // +godefs map struct_in6_addr [16]byte /* in6_addr */ 13 | 14 | package unix 15 | 16 | /* 17 | #define __DARWIN_UNIX03 0 18 | #define KERNEL 19 | #define _DARWIN_USE_64_BIT_INODE 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | 51 | enum { 52 | sizeofPtr = sizeof(void*), 53 | }; 54 | 55 | union sockaddr_all { 56 | struct sockaddr s1; // this one gets used for fields 57 | struct sockaddr_in s2; // these pad it out 58 | struct sockaddr_in6 s3; 59 | struct sockaddr_un s4; 60 | struct sockaddr_dl s5; 61 | }; 62 | 63 | struct sockaddr_any { 64 | struct sockaddr addr; 65 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 66 | }; 67 | 68 | */ 69 | import "C" 70 | 71 | // Machine characteristics; for internal use. 72 | 73 | const ( 74 | sizeofPtr = C.sizeofPtr 75 | sizeofShort = C.sizeof_short 76 | sizeofInt = C.sizeof_int 77 | sizeofLong = C.sizeof_long 78 | sizeofLongLong = C.sizeof_longlong 79 | ) 80 | 81 | // Basic types 82 | 83 | type ( 84 | _C_short C.short 85 | _C_int C.int 86 | _C_long C.long 87 | _C_long_long C.longlong 88 | ) 89 | 90 | // Time 91 | 92 | type Timespec C.struct_timespec 93 | 94 | type Timeval C.struct_timeval 95 | 96 | type Timeval32 C.struct_timeval32 97 | 98 | // Processes 99 | 100 | type Rusage C.struct_rusage 101 | 102 | type Rlimit C.struct_rlimit 103 | 104 | type _Gid_t C.gid_t 105 | 106 | // Files 107 | 108 | type Stat_t C.struct_stat64 109 | 110 | type Statfs_t C.struct_statfs64 111 | 112 | type Flock_t C.struct_flock 113 | 114 | type Fstore_t C.struct_fstore 115 | 116 | type Radvisory_t C.struct_radvisory 117 | 118 | type Fbootstraptransfer_t C.struct_fbootstraptransfer 119 | 120 | type Log2phys_t C.struct_log2phys 121 | 122 | type Fsid C.struct_fsid 123 | 124 | type Dirent C.struct_dirent 125 | 126 | // Sockets 127 | 128 | type RawSockaddrInet4 C.struct_sockaddr_in 129 | 130 | type RawSockaddrInet6 C.struct_sockaddr_in6 131 | 132 | type RawSockaddrUnix C.struct_sockaddr_un 133 | 134 | type RawSockaddrDatalink C.struct_sockaddr_dl 135 | 136 | type RawSockaddr C.struct_sockaddr 137 | 138 | type RawSockaddrAny C.struct_sockaddr_any 139 | 140 | type _Socklen C.socklen_t 141 | 142 | type Linger C.struct_linger 143 | 144 | type Iovec C.struct_iovec 145 | 146 | type IPMreq C.struct_ip_mreq 147 | 148 | type IPv6Mreq C.struct_ipv6_mreq 149 | 150 | type Msghdr C.struct_msghdr 151 | 152 | type Cmsghdr C.struct_cmsghdr 153 | 154 | type Inet4Pktinfo C.struct_in_pktinfo 155 | 156 | type Inet6Pktinfo C.struct_in6_pktinfo 157 | 158 | type IPv6MTUInfo C.struct_ip6_mtuinfo 159 | 160 | type ICMPv6Filter C.struct_icmp6_filter 161 | 162 | const ( 163 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 164 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 165 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 166 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 167 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 168 | SizeofLinger = C.sizeof_struct_linger 169 | SizeofIPMreq = C.sizeof_struct_ip_mreq 170 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 171 | SizeofMsghdr = C.sizeof_struct_msghdr 172 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 173 | SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo 174 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 175 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 176 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 177 | ) 178 | 179 | // Ptrace requests 180 | 181 | const ( 182 | PTRACE_TRACEME = C.PT_TRACE_ME 183 | PTRACE_CONT = C.PT_CONTINUE 184 | PTRACE_KILL = C.PT_KILL 185 | ) 186 | 187 | // Events (kqueue, kevent) 188 | 189 | type Kevent_t C.struct_kevent 190 | 191 | // Select 192 | 193 | type FdSet C.fd_set 194 | 195 | // Routing and interface messages 196 | 197 | const ( 198 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 199 | SizeofIfData = C.sizeof_struct_if_data 200 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 201 | SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr 202 | SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2 203 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 204 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 205 | ) 206 | 207 | type IfMsghdr C.struct_if_msghdr 208 | 209 | type IfData C.struct_if_data 210 | 211 | type IfaMsghdr C.struct_ifa_msghdr 212 | 213 | type IfmaMsghdr C.struct_ifma_msghdr 214 | 215 | type IfmaMsghdr2 C.struct_ifma_msghdr2 216 | 217 | type RtMsghdr C.struct_rt_msghdr 218 | 219 | type RtMetrics C.struct_rt_metrics 220 | 221 | // Berkeley packet filter 222 | 223 | const ( 224 | SizeofBpfVersion = C.sizeof_struct_bpf_version 225 | SizeofBpfStat = C.sizeof_struct_bpf_stat 226 | SizeofBpfProgram = C.sizeof_struct_bpf_program 227 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 228 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 229 | ) 230 | 231 | type BpfVersion C.struct_bpf_version 232 | 233 | type BpfStat C.struct_bpf_stat 234 | 235 | type BpfProgram C.struct_bpf_program 236 | 237 | type BpfInsn C.struct_bpf_insn 238 | 239 | type BpfHdr C.struct_bpf_hdr 240 | 241 | // Terminal handling 242 | 243 | type Termios C.struct_termios 244 | 245 | // fchmodat-like syscalls. 246 | 247 | const ( 248 | AT_FDCWD = C.AT_FDCWD 249 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 250 | ) 251 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | # Copyright 2011 The Go Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style 5 | # license that can be found in the LICENSE file. 6 | 7 | # 8 | # Parse the header files for OpenBSD and generate a Go usable sysctl MIB. 9 | # 10 | # Build a MIB with each entry being an array containing the level, type and 11 | # a hash that will contain additional entries if the current entry is a node. 12 | # We then walk this MIB and create a flattened sysctl name to OID hash. 13 | # 14 | 15 | use strict; 16 | 17 | if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { 18 | print STDERR "GOARCH or GOOS not defined in environment\n"; 19 | exit 1; 20 | } 21 | 22 | my $debug = 0; 23 | my %ctls = (); 24 | 25 | my @headers = qw ( 26 | sys/sysctl.h 27 | sys/socket.h 28 | sys/tty.h 29 | sys/malloc.h 30 | sys/mount.h 31 | sys/namei.h 32 | sys/sem.h 33 | sys/shm.h 34 | sys/vmmeter.h 35 | uvm/uvm_param.h 36 | uvm/uvm_swap_encrypt.h 37 | ddb/db_var.h 38 | net/if.h 39 | net/if_pfsync.h 40 | net/pipex.h 41 | netinet/in.h 42 | netinet/icmp_var.h 43 | netinet/igmp_var.h 44 | netinet/ip_ah.h 45 | netinet/ip_carp.h 46 | netinet/ip_divert.h 47 | netinet/ip_esp.h 48 | netinet/ip_ether.h 49 | netinet/ip_gre.h 50 | netinet/ip_ipcomp.h 51 | netinet/ip_ipip.h 52 | netinet/pim_var.h 53 | netinet/tcp_var.h 54 | netinet/udp_var.h 55 | netinet6/in6.h 56 | netinet6/ip6_divert.h 57 | netinet6/pim6_var.h 58 | netinet/icmp6.h 59 | netmpls/mpls.h 60 | ); 61 | 62 | my @ctls = qw ( 63 | kern 64 | vm 65 | fs 66 | net 67 | #debug # Special handling required 68 | hw 69 | #machdep # Arch specific 70 | user 71 | ddb 72 | #vfs # Special handling required 73 | fs.posix 74 | kern.forkstat 75 | kern.intrcnt 76 | kern.malloc 77 | kern.nchstats 78 | kern.seminfo 79 | kern.shminfo 80 | kern.timecounter 81 | kern.tty 82 | kern.watchdog 83 | net.bpf 84 | net.ifq 85 | net.inet 86 | net.inet.ah 87 | net.inet.carp 88 | net.inet.divert 89 | net.inet.esp 90 | net.inet.etherip 91 | net.inet.gre 92 | net.inet.icmp 93 | net.inet.igmp 94 | net.inet.ip 95 | net.inet.ip.ifq 96 | net.inet.ipcomp 97 | net.inet.ipip 98 | net.inet.mobileip 99 | net.inet.pfsync 100 | net.inet.pim 101 | net.inet.tcp 102 | net.inet.udp 103 | net.inet6 104 | net.inet6.divert 105 | net.inet6.ip6 106 | net.inet6.icmp6 107 | net.inet6.pim6 108 | net.inet6.tcp6 109 | net.inet6.udp6 110 | net.mpls 111 | net.mpls.ifq 112 | net.key 113 | net.pflow 114 | net.pfsync 115 | net.pipex 116 | net.rt 117 | vm.swapencrypt 118 | #vfsgenctl # Special handling required 119 | ); 120 | 121 | # Node name "fixups" 122 | my %ctl_map = ( 123 | "ipproto" => "net.inet", 124 | "net.inet.ipproto" => "net.inet", 125 | "net.inet6.ipv6proto" => "net.inet6", 126 | "net.inet6.ipv6" => "net.inet6.ip6", 127 | "net.inet.icmpv6" => "net.inet6.icmp6", 128 | "net.inet6.divert6" => "net.inet6.divert", 129 | "net.inet6.tcp6" => "net.inet.tcp", 130 | "net.inet6.udp6" => "net.inet.udp", 131 | "mpls" => "net.mpls", 132 | "swpenc" => "vm.swapencrypt" 133 | ); 134 | 135 | # Node mappings 136 | my %node_map = ( 137 | "net.inet.ip.ifq" => "net.ifq", 138 | "net.inet.pfsync" => "net.pfsync", 139 | "net.mpls.ifq" => "net.ifq" 140 | ); 141 | 142 | my $ctlname; 143 | my %mib = (); 144 | my %sysctl = (); 145 | my $node; 146 | 147 | sub debug() { 148 | print STDERR "$_[0]\n" if $debug; 149 | } 150 | 151 | # Walk the MIB and build a sysctl name to OID mapping. 152 | sub build_sysctl() { 153 | my ($node, $name, $oid) = @_; 154 | my %node = %{$node}; 155 | my @oid = @{$oid}; 156 | 157 | foreach my $key (sort keys %node) { 158 | my @node = @{$node{$key}}; 159 | my $nodename = $name.($name ne '' ? '.' : '').$key; 160 | my @nodeoid = (@oid, $node[0]); 161 | if ($node[1] eq 'CTLTYPE_NODE') { 162 | if (exists $node_map{$nodename}) { 163 | $node = \%mib; 164 | $ctlname = $node_map{$nodename}; 165 | foreach my $part (split /\./, $ctlname) { 166 | $node = \%{@{$$node{$part}}[2]}; 167 | } 168 | } else { 169 | $node = $node[2]; 170 | } 171 | &build_sysctl($node, $nodename, \@nodeoid); 172 | } elsif ($node[1] ne '') { 173 | $sysctl{$nodename} = \@nodeoid; 174 | } 175 | } 176 | } 177 | 178 | foreach my $ctl (@ctls) { 179 | $ctls{$ctl} = $ctl; 180 | } 181 | 182 | # Build MIB 183 | foreach my $header (@headers) { 184 | &debug("Processing $header..."); 185 | open HEADER, "/usr/include/$header" || 186 | print STDERR "Failed to open $header\n"; 187 | while (
) { 188 | if ($_ =~ /^#define\s+(CTL_NAMES)\s+{/ || 189 | $_ =~ /^#define\s+(CTL_(.*)_NAMES)\s+{/ || 190 | $_ =~ /^#define\s+((.*)CTL_NAMES)\s+{/) { 191 | if ($1 eq 'CTL_NAMES') { 192 | # Top level. 193 | $node = \%mib; 194 | } else { 195 | # Node. 196 | my $nodename = lc($2); 197 | if ($header =~ /^netinet\//) { 198 | $ctlname = "net.inet.$nodename"; 199 | } elsif ($header =~ /^netinet6\//) { 200 | $ctlname = "net.inet6.$nodename"; 201 | } elsif ($header =~ /^net\//) { 202 | $ctlname = "net.$nodename"; 203 | } else { 204 | $ctlname = "$nodename"; 205 | $ctlname =~ s/^(fs|net|kern)_/$1\./; 206 | } 207 | if (exists $ctl_map{$ctlname}) { 208 | $ctlname = $ctl_map{$ctlname}; 209 | } 210 | if (not exists $ctls{$ctlname}) { 211 | &debug("Ignoring $ctlname..."); 212 | next; 213 | } 214 | 215 | # Walk down from the top of the MIB. 216 | $node = \%mib; 217 | foreach my $part (split /\./, $ctlname) { 218 | if (not exists $$node{$part}) { 219 | &debug("Missing node $part"); 220 | $$node{$part} = [ 0, '', {} ]; 221 | } 222 | $node = \%{@{$$node{$part}}[2]}; 223 | } 224 | } 225 | 226 | # Populate current node with entries. 227 | my $i = -1; 228 | while (defined($_) && $_ !~ /^}/) { 229 | $_ =
; 230 | $i++ if $_ =~ /{.*}/; 231 | next if $_ !~ /{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}/; 232 | $$node{$1} = [ $i, $2, {} ]; 233 | } 234 | } 235 | } 236 | close HEADER; 237 | } 238 | 239 | &build_sysctl(\%mib, "", []); 240 | 241 | print < 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | enum { 56 | sizeofPtr = sizeof(void*), 57 | }; 58 | 59 | union sockaddr_all { 60 | struct sockaddr s1; // this one gets used for fields 61 | struct sockaddr_in s2; // these pad it out 62 | struct sockaddr_in6 s3; 63 | struct sockaddr_un s4; 64 | struct sockaddr_dl s5; 65 | }; 66 | 67 | struct sockaddr_any { 68 | struct sockaddr addr; 69 | char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)]; 70 | }; 71 | 72 | */ 73 | import "C" 74 | 75 | // Machine characteristics; for internal use. 76 | 77 | const ( 78 | sizeofPtr = C.sizeofPtr 79 | sizeofShort = C.sizeof_short 80 | sizeofInt = C.sizeof_int 81 | sizeofLong = C.sizeof_long 82 | sizeofLongLong = C.sizeof_longlong 83 | PathMax = C.PATH_MAX 84 | ) 85 | 86 | // Basic types 87 | 88 | type ( 89 | _C_short C.short 90 | _C_int C.int 91 | _C_long C.long 92 | _C_long_long C.longlong 93 | ) 94 | 95 | // Time 96 | 97 | type Timespec C.struct_timespec 98 | 99 | type Timeval C.struct_timeval 100 | 101 | type Timeval32 C.struct_timeval32 102 | 103 | type Tms C.struct_tms 104 | 105 | type Utimbuf C.struct_utimbuf 106 | 107 | // Processes 108 | 109 | type Rusage C.struct_rusage 110 | 111 | type Rlimit C.struct_rlimit 112 | 113 | type _Gid_t C.gid_t 114 | 115 | // Files 116 | 117 | const ( // Directory mode bits 118 | S_IFMT = C.S_IFMT 119 | S_IFIFO = C.S_IFIFO 120 | S_IFCHR = C.S_IFCHR 121 | S_IFDIR = C.S_IFDIR 122 | S_IFBLK = C.S_IFBLK 123 | S_IFREG = C.S_IFREG 124 | S_IFLNK = C.S_IFLNK 125 | S_IFSOCK = C.S_IFSOCK 126 | S_ISUID = C.S_ISUID 127 | S_ISGID = C.S_ISGID 128 | S_ISVTX = C.S_ISVTX 129 | S_IRUSR = C.S_IRUSR 130 | S_IWUSR = C.S_IWUSR 131 | S_IXUSR = C.S_IXUSR 132 | ) 133 | 134 | type Stat_t C.struct_stat 135 | 136 | type Flock_t C.struct_flock 137 | 138 | type Dirent C.struct_dirent 139 | 140 | // Sockets 141 | 142 | type RawSockaddrInet4 C.struct_sockaddr_in 143 | 144 | type RawSockaddrInet6 C.struct_sockaddr_in6 145 | 146 | type RawSockaddrUnix C.struct_sockaddr_un 147 | 148 | type RawSockaddrDatalink C.struct_sockaddr_dl 149 | 150 | type RawSockaddr C.struct_sockaddr 151 | 152 | type RawSockaddrAny C.struct_sockaddr_any 153 | 154 | type _Socklen C.socklen_t 155 | 156 | type Linger C.struct_linger 157 | 158 | type Iovec C.struct_iovec 159 | 160 | type IPMreq C.struct_ip_mreq 161 | 162 | type IPv6Mreq C.struct_ipv6_mreq 163 | 164 | type Msghdr C.struct_msghdr 165 | 166 | type Cmsghdr C.struct_cmsghdr 167 | 168 | type Inet6Pktinfo C.struct_in6_pktinfo 169 | 170 | type IPv6MTUInfo C.struct_ip6_mtuinfo 171 | 172 | type ICMPv6Filter C.struct_icmp6_filter 173 | 174 | const ( 175 | SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in 176 | SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6 177 | SizeofSockaddrAny = C.sizeof_struct_sockaddr_any 178 | SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un 179 | SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl 180 | SizeofLinger = C.sizeof_struct_linger 181 | SizeofIPMreq = C.sizeof_struct_ip_mreq 182 | SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq 183 | SizeofMsghdr = C.sizeof_struct_msghdr 184 | SizeofCmsghdr = C.sizeof_struct_cmsghdr 185 | SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo 186 | SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo 187 | SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter 188 | ) 189 | 190 | // Select 191 | 192 | type FdSet C.fd_set 193 | 194 | // Misc 195 | 196 | type Utsname C.struct_utsname 197 | 198 | type Ustat_t C.struct_ustat 199 | 200 | const ( 201 | AT_FDCWD = C.AT_FDCWD 202 | AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW 203 | AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW 204 | AT_REMOVEDIR = C.AT_REMOVEDIR 205 | AT_EACCESS = C.AT_EACCESS 206 | ) 207 | 208 | // Routing and interface messages 209 | 210 | const ( 211 | SizeofIfMsghdr = C.sizeof_struct_if_msghdr 212 | SizeofIfData = C.sizeof_struct_if_data 213 | SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr 214 | SizeofRtMsghdr = C.sizeof_struct_rt_msghdr 215 | SizeofRtMetrics = C.sizeof_struct_rt_metrics 216 | ) 217 | 218 | type IfMsghdr C.struct_if_msghdr 219 | 220 | type IfData C.struct_if_data 221 | 222 | type IfaMsghdr C.struct_ifa_msghdr 223 | 224 | type RtMsghdr C.struct_rt_msghdr 225 | 226 | type RtMetrics C.struct_rt_metrics 227 | 228 | // Berkeley packet filter 229 | 230 | const ( 231 | SizeofBpfVersion = C.sizeof_struct_bpf_version 232 | SizeofBpfStat = C.sizeof_struct_bpf_stat 233 | SizeofBpfProgram = C.sizeof_struct_bpf_program 234 | SizeofBpfInsn = C.sizeof_struct_bpf_insn 235 | SizeofBpfHdr = C.sizeof_struct_bpf_hdr 236 | ) 237 | 238 | type BpfVersion C.struct_bpf_version 239 | 240 | type BpfStat C.struct_bpf_stat 241 | 242 | type BpfProgram C.struct_bpf_program 243 | 244 | type BpfInsn C.struct_bpf_insn 245 | 246 | type BpfTimeval C.struct_bpf_timeval 247 | 248 | type BpfHdr C.struct_bpf_hdr 249 | 250 | // sysconf information 251 | 252 | const _SC_PAGESIZE = C._SC_PAGESIZE 253 | 254 | // Terminal handling 255 | 256 | type Termios C.struct_termios 257 | 258 | type Termio C.struct_termio 259 | 260 | type Winsize C.struct_winsize 261 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build arm64,linux 6 | 7 | package unix 8 | 9 | const _SYS_dup = SYS_DUP3 10 | 11 | //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT 12 | //sys Fchown(fd int, uid int, gid int) (err error) 13 | //sys Fstat(fd int, stat *Stat_t) (err error) 14 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 15 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 16 | //sys Ftruncate(fd int, length int64) (err error) 17 | //sysnb Getegid() (egid int) 18 | //sysnb Geteuid() (euid int) 19 | //sysnb Getgid() (gid int) 20 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 21 | //sysnb Getuid() (uid int) 22 | //sys Listen(s int, n int) (err error) 23 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 24 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 25 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 26 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6 27 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 28 | //sys Setfsgid(gid int) (err error) 29 | //sys Setfsuid(uid int) (err error) 30 | //sysnb Setregid(rgid int, egid int) (err error) 31 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 32 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 33 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 34 | //sysnb Setreuid(ruid int, euid int) (err error) 35 | //sys Shutdown(fd int, how int) (err error) 36 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 37 | 38 | func Stat(path string, stat *Stat_t) (err error) { 39 | return Fstatat(AT_FDCWD, path, stat, 0) 40 | } 41 | 42 | func Lchown(path string, uid int, gid int) (err error) { 43 | return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW) 44 | } 45 | 46 | func Lstat(path string, stat *Stat_t) (err error) { 47 | return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW) 48 | } 49 | 50 | //sys Statfs(path string, buf *Statfs_t) (err error) 51 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) 52 | //sys Truncate(path string, length int64) (err error) 53 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 54 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 55 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 56 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 57 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 58 | //sysnb setgroups(n int, list *_Gid_t) (err error) 59 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 60 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 61 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 62 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 63 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 64 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 65 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 66 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 67 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 68 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 69 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 70 | 71 | func Getpagesize() int { return 65536 } 72 | 73 | //sysnb Gettimeofday(tv *Timeval) (err error) 74 | 75 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 76 | 77 | func NsecToTimespec(nsec int64) (ts Timespec) { 78 | ts.Sec = nsec / 1e9 79 | ts.Nsec = nsec % 1e9 80 | return 81 | } 82 | 83 | func NsecToTimeval(nsec int64) (tv Timeval) { 84 | nsec += 999 // round up to microsecond 85 | tv.Sec = nsec / 1e9 86 | tv.Usec = nsec % 1e9 / 1e3 87 | return 88 | } 89 | 90 | func Time(t *Time_t) (Time_t, error) { 91 | var tv Timeval 92 | err := Gettimeofday(&tv) 93 | if err != nil { 94 | return 0, err 95 | } 96 | if t != nil { 97 | *t = Time_t(tv.Sec) 98 | } 99 | return Time_t(tv.Sec), nil 100 | } 101 | 102 | func Utime(path string, buf *Utimbuf) error { 103 | tv := []Timeval{ 104 | {Sec: buf.Actime}, 105 | {Sec: buf.Modtime}, 106 | } 107 | return Utimes(path, tv) 108 | } 109 | 110 | func Pipe(p []int) (err error) { 111 | if len(p) != 2 { 112 | return EINVAL 113 | } 114 | var pp [2]_C_int 115 | err = pipe2(&pp, 0) 116 | p[0] = int(pp[0]) 117 | p[1] = int(pp[1]) 118 | return 119 | } 120 | 121 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) 122 | 123 | func Pipe2(p []int, flags int) (err error) { 124 | if len(p) != 2 { 125 | return EINVAL 126 | } 127 | var pp [2]_C_int 128 | err = pipe2(&pp, flags) 129 | p[0] = int(pp[0]) 130 | p[1] = int(pp[1]) 131 | return 132 | } 133 | 134 | func (r *PtraceRegs) PC() uint64 { return r.Pc } 135 | 136 | func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc } 137 | 138 | func (iov *Iovec) SetLen(length int) { 139 | iov.Len = uint64(length) 140 | } 141 | 142 | func (msghdr *Msghdr) SetControllen(length int) { 143 | msghdr.Controllen = uint64(length) 144 | } 145 | 146 | func (cmsg *Cmsghdr) SetLen(length int) { 147 | cmsg.Len = uint64(length) 148 | } 149 | 150 | func InotifyInit() (fd int, err error) { 151 | return InotifyInit1(0) 152 | } 153 | 154 | func Dup2(oldfd int, newfd int) (err error) { 155 | return Dup3(oldfd, newfd, 0) 156 | } 157 | 158 | func Pause() (err error) { 159 | _, _, e1 := Syscall6(SYS_PPOLL, 0, 0, 0, 0, 0, 0) 160 | if e1 != 0 { 161 | err = errnoErr(e1) 162 | } 163 | return 164 | } 165 | 166 | // TODO(dfc): constants that should be in zsysnum_linux_arm64.go, remove 167 | // these when the deprecated syscalls that the syscall package relies on 168 | // are removed. 169 | const ( 170 | SYS_GETPGRP = 1060 171 | SYS_UTIMES = 1037 172 | SYS_FUTIMESAT = 1066 173 | SYS_PAUSE = 1061 174 | SYS_USTAT = 1070 175 | SYS_UTIME = 1063 176 | SYS_LCHOWN = 1032 177 | SYS_TIME = 1062 178 | SYS_EPOLL_CREATE = 1042 179 | SYS_EPOLL_WAIT = 1069 180 | ) 181 | 182 | func Poll(fds []PollFd, timeout int) (n int, err error) { 183 | var ts *Timespec 184 | if timeout >= 0 { 185 | ts = new(Timespec) 186 | *ts = NsecToTimespec(int64(timeout) * 1e6) 187 | } 188 | if len(fds) == 0 { 189 | return ppoll(nil, 0, ts, nil) 190 | } 191 | return ppoll(&fds[0], len(fds), ts, nil) 192 | } 193 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build linux 6 | // +build mips64 mips64le 7 | 8 | package unix 9 | 10 | // Linux introduced getdents64 syscall for N64 ABI only in 3.10 11 | // (May 21 2013, rev dec33abaafc89bcbd78f85fad0513170415a26d5), 12 | // to support older kernels, we have to use getdents for mips64. 13 | // Also note that struct dirent is different for these two. 14 | // Lookup linux_dirent{,64} in kernel source code for details. 15 | const _SYS_getdents = SYS_GETDENTS 16 | 17 | //sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) 18 | //sys Fchown(fd int, uid int, gid int) (err error) 19 | //sys Fstatfs(fd int, buf *Statfs_t) (err error) 20 | //sys Ftruncate(fd int, length int64) (err error) 21 | //sysnb Getegid() (egid int) 22 | //sysnb Geteuid() (euid int) 23 | //sysnb Getgid() (gid int) 24 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 25 | //sysnb Getuid() (uid int) 26 | //sys Lchown(path string, uid int, gid int) (err error) 27 | //sys Listen(s int, n int) (err error) 28 | //sys Pause() (err error) 29 | //sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64 30 | //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 31 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK 32 | //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6 33 | //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) 34 | //sys Setfsgid(gid int) (err error) 35 | //sys Setfsuid(uid int) (err error) 36 | //sysnb Setregid(rgid int, egid int) (err error) 37 | //sysnb Setresgid(rgid int, egid int, sgid int) (err error) 38 | //sysnb Setresuid(ruid int, euid int, suid int) (err error) 39 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 40 | //sysnb Setreuid(ruid int, euid int) (err error) 41 | //sys Shutdown(fd int, how int) (err error) 42 | //sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) 43 | //sys Statfs(path string, buf *Statfs_t) (err error) 44 | //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error) 45 | //sys Truncate(path string, length int64) (err error) 46 | //sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) 47 | //sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) 48 | //sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 49 | //sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) 50 | //sysnb getgroups(n int, list *_Gid_t) (nn int, err error) 51 | //sysnb setgroups(n int, list *_Gid_t) (err error) 52 | //sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) 53 | //sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) 54 | //sysnb socket(domain int, typ int, proto int) (fd int, err error) 55 | //sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) 56 | //sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 57 | //sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) 58 | //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) 59 | //sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) 60 | //sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) 61 | //sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) 62 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 63 | 64 | func Getpagesize() int { return 65536 } 65 | 66 | //sysnb Gettimeofday(tv *Timeval) (err error) 67 | 68 | func Time(t *Time_t) (tt Time_t, err error) { 69 | var tv Timeval 70 | err = Gettimeofday(&tv) 71 | if err != nil { 72 | return 0, err 73 | } 74 | if t != nil { 75 | *t = Time_t(tv.Sec) 76 | } 77 | return Time_t(tv.Sec), nil 78 | } 79 | 80 | //sys Utime(path string, buf *Utimbuf) (err error) 81 | 82 | func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) } 83 | 84 | func NsecToTimespec(nsec int64) (ts Timespec) { 85 | ts.Sec = nsec / 1e9 86 | ts.Nsec = nsec % 1e9 87 | return 88 | } 89 | 90 | func NsecToTimeval(nsec int64) (tv Timeval) { 91 | nsec += 999 // round up to microsecond 92 | tv.Sec = nsec / 1e9 93 | tv.Usec = nsec % 1e9 / 1e3 94 | return 95 | } 96 | 97 | func Pipe(p []int) (err error) { 98 | if len(p) != 2 { 99 | return EINVAL 100 | } 101 | var pp [2]_C_int 102 | err = pipe2(&pp, 0) 103 | p[0] = int(pp[0]) 104 | p[1] = int(pp[1]) 105 | return 106 | } 107 | 108 | //sysnb pipe2(p *[2]_C_int, flags int) (err error) 109 | 110 | func Pipe2(p []int, flags int) (err error) { 111 | if len(p) != 2 { 112 | return EINVAL 113 | } 114 | var pp [2]_C_int 115 | err = pipe2(&pp, flags) 116 | p[0] = int(pp[0]) 117 | p[1] = int(pp[1]) 118 | return 119 | } 120 | 121 | func Ioperm(from int, num int, on int) (err error) { 122 | return ENOSYS 123 | } 124 | 125 | func Iopl(level int) (err error) { 126 | return ENOSYS 127 | } 128 | 129 | type stat_t struct { 130 | Dev uint32 131 | Pad0 [3]int32 132 | Ino uint64 133 | Mode uint32 134 | Nlink uint32 135 | Uid uint32 136 | Gid uint32 137 | Rdev uint32 138 | Pad1 [3]uint32 139 | Size int64 140 | Atime uint32 141 | Atime_nsec uint32 142 | Mtime uint32 143 | Mtime_nsec uint32 144 | Ctime uint32 145 | Ctime_nsec uint32 146 | Blksize uint32 147 | Pad2 uint32 148 | Blocks int64 149 | } 150 | 151 | //sys fstat(fd int, st *stat_t) (err error) 152 | //sys lstat(path string, st *stat_t) (err error) 153 | //sys stat(path string, st *stat_t) (err error) 154 | 155 | func Fstat(fd int, s *Stat_t) (err error) { 156 | st := &stat_t{} 157 | err = fstat(fd, st) 158 | fillStat_t(s, st) 159 | return 160 | } 161 | 162 | func Lstat(path string, s *Stat_t) (err error) { 163 | st := &stat_t{} 164 | err = lstat(path, st) 165 | fillStat_t(s, st) 166 | return 167 | } 168 | 169 | func Stat(path string, s *Stat_t) (err error) { 170 | st := &stat_t{} 171 | err = stat(path, st) 172 | fillStat_t(s, st) 173 | return 174 | } 175 | 176 | func fillStat_t(s *Stat_t, st *stat_t) { 177 | s.Dev = st.Dev 178 | s.Ino = st.Ino 179 | s.Mode = st.Mode 180 | s.Nlink = st.Nlink 181 | s.Uid = st.Uid 182 | s.Gid = st.Gid 183 | s.Rdev = st.Rdev 184 | s.Size = st.Size 185 | s.Atim = Timespec{int64(st.Atime), int64(st.Atime_nsec)} 186 | s.Mtim = Timespec{int64(st.Mtime), int64(st.Mtime_nsec)} 187 | s.Ctim = Timespec{int64(st.Ctime), int64(st.Ctime_nsec)} 188 | s.Blksize = st.Blksize 189 | s.Blocks = st.Blocks 190 | } 191 | 192 | func (r *PtraceRegs) PC() uint64 { return r.Regs[64] } 193 | 194 | func (r *PtraceRegs) SetPC(pc uint64) { r.Regs[64] = pc } 195 | 196 | func (iov *Iovec) SetLen(length int) { 197 | iov.Len = uint64(length) 198 | } 199 | 200 | func (msghdr *Msghdr) SetControllen(length int) { 201 | msghdr.Controllen = uint64(length) 202 | } 203 | 204 | func (cmsg *Cmsghdr) SetLen(length int) { 205 | cmsg.Len = uint64(length) 206 | } 207 | 208 | //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) 209 | 210 | func Poll(fds []PollFd, timeout int) (n int, err error) { 211 | if len(fds) == 0 { 212 | return poll(nil, 0, timeout) 213 | } 214 | return poll(&fds[0], len(fds), timeout) 215 | } 216 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_netbsd.go 3 | 4 | // +build 386,netbsd 5 | 6 | package unix 7 | 8 | const ( 9 | sizeofPtr = 0x4 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x4 13 | sizeofLongLong = 0x8 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type Timespec struct { 24 | Sec int64 25 | Nsec int32 26 | } 27 | 28 | type Timeval struct { 29 | Sec int64 30 | Usec int32 31 | } 32 | 33 | type Rusage struct { 34 | Utime Timeval 35 | Stime Timeval 36 | Maxrss int32 37 | Ixrss int32 38 | Idrss int32 39 | Isrss int32 40 | Minflt int32 41 | Majflt int32 42 | Nswap int32 43 | Inblock int32 44 | Oublock int32 45 | Msgsnd int32 46 | Msgrcv int32 47 | Nsignals int32 48 | Nvcsw int32 49 | Nivcsw int32 50 | } 51 | 52 | type Rlimit struct { 53 | Cur uint64 54 | Max uint64 55 | } 56 | 57 | type _Gid_t uint32 58 | 59 | type Stat_t struct { 60 | Dev uint64 61 | Mode uint32 62 | Ino uint64 63 | Nlink uint32 64 | Uid uint32 65 | Gid uint32 66 | Rdev uint64 67 | Atimespec Timespec 68 | Mtimespec Timespec 69 | Ctimespec Timespec 70 | Birthtimespec Timespec 71 | Size int64 72 | Blocks int64 73 | Blksize uint32 74 | Flags uint32 75 | Gen uint32 76 | Spare [2]uint32 77 | } 78 | 79 | type Statfs_t [0]byte 80 | 81 | type Flock_t struct { 82 | Start int64 83 | Len int64 84 | Pid int32 85 | Type int16 86 | Whence int16 87 | } 88 | 89 | type Dirent struct { 90 | Fileno uint64 91 | Reclen uint16 92 | Namlen uint16 93 | Type uint8 94 | Name [512]int8 95 | Pad_cgo_0 [3]byte 96 | } 97 | 98 | type Fsid struct { 99 | X__fsid_val [2]int32 100 | } 101 | 102 | type RawSockaddrInet4 struct { 103 | Len uint8 104 | Family uint8 105 | Port uint16 106 | Addr [4]byte /* in_addr */ 107 | Zero [8]int8 108 | } 109 | 110 | type RawSockaddrInet6 struct { 111 | Len uint8 112 | Family uint8 113 | Port uint16 114 | Flowinfo uint32 115 | Addr [16]byte /* in6_addr */ 116 | Scope_id uint32 117 | } 118 | 119 | type RawSockaddrUnix struct { 120 | Len uint8 121 | Family uint8 122 | Path [104]int8 123 | } 124 | 125 | type RawSockaddrDatalink struct { 126 | Len uint8 127 | Family uint8 128 | Index uint16 129 | Type uint8 130 | Nlen uint8 131 | Alen uint8 132 | Slen uint8 133 | Data [12]int8 134 | } 135 | 136 | type RawSockaddr struct { 137 | Len uint8 138 | Family uint8 139 | Data [14]int8 140 | } 141 | 142 | type RawSockaddrAny struct { 143 | Addr RawSockaddr 144 | Pad [92]int8 145 | } 146 | 147 | type _Socklen uint32 148 | 149 | type Linger struct { 150 | Onoff int32 151 | Linger int32 152 | } 153 | 154 | type Iovec struct { 155 | Base *byte 156 | Len uint32 157 | } 158 | 159 | type IPMreq struct { 160 | Multiaddr [4]byte /* in_addr */ 161 | Interface [4]byte /* in_addr */ 162 | } 163 | 164 | type IPv6Mreq struct { 165 | Multiaddr [16]byte /* in6_addr */ 166 | Interface uint32 167 | } 168 | 169 | type Msghdr struct { 170 | Name *byte 171 | Namelen uint32 172 | Iov *Iovec 173 | Iovlen int32 174 | Control *byte 175 | Controllen uint32 176 | Flags int32 177 | } 178 | 179 | type Cmsghdr struct { 180 | Len uint32 181 | Level int32 182 | Type int32 183 | } 184 | 185 | type Inet6Pktinfo struct { 186 | Addr [16]byte /* in6_addr */ 187 | Ifindex uint32 188 | } 189 | 190 | type IPv6MTUInfo struct { 191 | Addr RawSockaddrInet6 192 | Mtu uint32 193 | } 194 | 195 | type ICMPv6Filter struct { 196 | Filt [8]uint32 197 | } 198 | 199 | const ( 200 | SizeofSockaddrInet4 = 0x10 201 | SizeofSockaddrInet6 = 0x1c 202 | SizeofSockaddrAny = 0x6c 203 | SizeofSockaddrUnix = 0x6a 204 | SizeofSockaddrDatalink = 0x14 205 | SizeofLinger = 0x8 206 | SizeofIPMreq = 0x8 207 | SizeofIPv6Mreq = 0x14 208 | SizeofMsghdr = 0x1c 209 | SizeofCmsghdr = 0xc 210 | SizeofInet6Pktinfo = 0x14 211 | SizeofIPv6MTUInfo = 0x20 212 | SizeofICMPv6Filter = 0x20 213 | ) 214 | 215 | const ( 216 | PTRACE_TRACEME = 0x0 217 | PTRACE_CONT = 0x7 218 | PTRACE_KILL = 0x8 219 | ) 220 | 221 | type Kevent_t struct { 222 | Ident uint32 223 | Filter uint32 224 | Flags uint32 225 | Fflags uint32 226 | Data int64 227 | Udata int32 228 | } 229 | 230 | type FdSet struct { 231 | Bits [8]uint32 232 | } 233 | 234 | const ( 235 | SizeofIfMsghdr = 0x98 236 | SizeofIfData = 0x84 237 | SizeofIfaMsghdr = 0x18 238 | SizeofIfAnnounceMsghdr = 0x18 239 | SizeofRtMsghdr = 0x78 240 | SizeofRtMetrics = 0x50 241 | ) 242 | 243 | type IfMsghdr struct { 244 | Msglen uint16 245 | Version uint8 246 | Type uint8 247 | Addrs int32 248 | Flags int32 249 | Index uint16 250 | Pad_cgo_0 [2]byte 251 | Data IfData 252 | Pad_cgo_1 [4]byte 253 | } 254 | 255 | type IfData struct { 256 | Type uint8 257 | Addrlen uint8 258 | Hdrlen uint8 259 | Pad_cgo_0 [1]byte 260 | Link_state int32 261 | Mtu uint64 262 | Metric uint64 263 | Baudrate uint64 264 | Ipackets uint64 265 | Ierrors uint64 266 | Opackets uint64 267 | Oerrors uint64 268 | Collisions uint64 269 | Ibytes uint64 270 | Obytes uint64 271 | Imcasts uint64 272 | Omcasts uint64 273 | Iqdrops uint64 274 | Noproto uint64 275 | Lastchange Timespec 276 | } 277 | 278 | type IfaMsghdr struct { 279 | Msglen uint16 280 | Version uint8 281 | Type uint8 282 | Addrs int32 283 | Flags int32 284 | Metric int32 285 | Index uint16 286 | Pad_cgo_0 [6]byte 287 | } 288 | 289 | type IfAnnounceMsghdr struct { 290 | Msglen uint16 291 | Version uint8 292 | Type uint8 293 | Index uint16 294 | Name [16]int8 295 | What uint16 296 | } 297 | 298 | type RtMsghdr struct { 299 | Msglen uint16 300 | Version uint8 301 | Type uint8 302 | Index uint16 303 | Pad_cgo_0 [2]byte 304 | Flags int32 305 | Addrs int32 306 | Pid int32 307 | Seq int32 308 | Errno int32 309 | Use int32 310 | Inits int32 311 | Pad_cgo_1 [4]byte 312 | Rmx RtMetrics 313 | } 314 | 315 | type RtMetrics struct { 316 | Locks uint64 317 | Mtu uint64 318 | Hopcount uint64 319 | Recvpipe uint64 320 | Sendpipe uint64 321 | Ssthresh uint64 322 | Rtt uint64 323 | Rttvar uint64 324 | Expire int64 325 | Pksent int64 326 | } 327 | 328 | type Mclpool [0]byte 329 | 330 | const ( 331 | SizeofBpfVersion = 0x4 332 | SizeofBpfStat = 0x80 333 | SizeofBpfProgram = 0x8 334 | SizeofBpfInsn = 0x8 335 | SizeofBpfHdr = 0x14 336 | ) 337 | 338 | type BpfVersion struct { 339 | Major uint16 340 | Minor uint16 341 | } 342 | 343 | type BpfStat struct { 344 | Recv uint64 345 | Drop uint64 346 | Capt uint64 347 | Padding [13]uint64 348 | } 349 | 350 | type BpfProgram struct { 351 | Len uint32 352 | Insns *BpfInsn 353 | } 354 | 355 | type BpfInsn struct { 356 | Code uint16 357 | Jt uint8 358 | Jf uint8 359 | K uint32 360 | } 361 | 362 | type BpfHdr struct { 363 | Tstamp BpfTimeval 364 | Caplen uint32 365 | Datalen uint32 366 | Hdrlen uint16 367 | Pad_cgo_0 [2]byte 368 | } 369 | 370 | type BpfTimeval struct { 371 | Sec int32 372 | Usec int32 373 | } 374 | 375 | type Termios struct { 376 | Iflag uint32 377 | Oflag uint32 378 | Cflag uint32 379 | Lflag uint32 380 | Cc [20]uint8 381 | Ispeed int32 382 | Ospeed int32 383 | } 384 | 385 | type Sysctlnode struct { 386 | Flags uint32 387 | Num int32 388 | Name [32]int8 389 | Ver uint32 390 | X__rsvd uint32 391 | Un [16]byte 392 | X_sysctl_size [8]byte 393 | X_sysctl_func [8]byte 394 | X_sysctl_parent [8]byte 395 | X_sysctl_desc [8]byte 396 | } 397 | -------------------------------------------------------------------------------- /vendor/github.com/codeskyblue/dockerignore/ignore.go: -------------------------------------------------------------------------------- 1 | package dockerignore 2 | 3 | import ( 4 | "bufio" 5 | "errors" 6 | "fmt" 7 | "io" 8 | "os" 9 | "path/filepath" 10 | "regexp" 11 | "strings" 12 | "text/scanner" 13 | ) 14 | 15 | // exclusion return true if the specified pattern is an exclusion 16 | func exclusion(pattern string) bool { 17 | return pattern[0] == '!' 18 | } 19 | 20 | // empty return true if the specified pattern is empty 21 | func empty(pattern string) bool { 22 | return pattern == "" || strings.HasPrefix(pattern, "#") 23 | } 24 | 25 | // Read ignore from file 26 | func ReadIgnoreFile(filename string) ([]string, error) { 27 | igrd, err := os.Open(filename) 28 | if err != nil { 29 | //if os.IsNotExist(err){ 30 | // return []string{}, nil 31 | //} 32 | return nil, err 33 | } 34 | return ReadIgnore(igrd) 35 | } 36 | 37 | // ReadIgnore reads a .dockerignore file and returns the list of file patterns 38 | // to ignore. Note this will trim whitespace from each line as well 39 | // as use GO's "clean" func to get the shortest/cleanest path for each. 40 | func ReadIgnore(reader io.ReadCloser) ([]string, error) { 41 | if reader == nil { 42 | return nil, nil 43 | } 44 | defer reader.Close() 45 | scanner := bufio.NewScanner(reader) 46 | var excludes []string 47 | 48 | for scanner.Scan() { 49 | pattern := strings.TrimSpace(scanner.Text()) 50 | if empty(pattern) { 51 | continue 52 | } 53 | pattern = filepath.Clean(pattern) 54 | excludes = append(excludes, pattern) 55 | } 56 | if err := scanner.Err(); err != nil { 57 | return nil, fmt.Errorf("Error reading .dockerignore: %v", err) 58 | } 59 | return excludes, nil 60 | } 61 | 62 | // CleanPatterns takes a slice of patterns returns a new 63 | // slice of patterns cleaned with filepath.Clean, stripped 64 | // of any empty patterns and lets the caller know whether the 65 | // slice contains any exception patterns (prefixed with !). 66 | func cleanPatterns(patterns []string) ([]string, [][]string, bool, error) { 67 | // Loop over exclusion patterns and: 68 | // 1. Clean them up. 69 | // 2. Indicate whether we are dealing with any exception rules. 70 | // 3. Error if we see a single exclusion marker on it's own (!). 71 | cleanedPatterns := []string{} 72 | patternDirs := [][]string{} 73 | exceptions := false 74 | for _, pattern := range patterns { 75 | // Eliminate leading and trailing whitespace. 76 | pattern = strings.TrimSpace(pattern) 77 | if empty(pattern) { 78 | continue 79 | } 80 | if exclusion(pattern) { 81 | if len(pattern) == 1 { 82 | return nil, nil, false, errors.New("Illegal exclusion pattern: !") 83 | } 84 | exceptions = true 85 | } 86 | pattern = filepath.Clean(pattern) 87 | cleanedPatterns = append(cleanedPatterns, pattern) 88 | if exclusion(pattern) { 89 | pattern = pattern[1:] 90 | } 91 | patternDirs = append(patternDirs, strings.Split(pattern, "/")) 92 | } 93 | 94 | return cleanedPatterns, patternDirs, exceptions, nil 95 | } 96 | 97 | // Matches returns true if file matches any of the patterns 98 | // and isn't excluded by any of the subsequent patterns. 99 | func Matches(file string, patterns []string) (bool, error) { 100 | file = filepath.Clean(file) 101 | 102 | if file == "." { 103 | // Don't let them exclude everything, kind of silly. 104 | return false, nil 105 | } 106 | 107 | patterns, patDirs, _, err := cleanPatterns(patterns) 108 | if err != nil { 109 | return false, err 110 | } 111 | 112 | return optimizedMatches(file, patterns, patDirs) 113 | } 114 | 115 | // OptimizedMatches is basically the same as fileutils.Matches() but optimized for archive.go. 116 | // It will assume that the inputs have been preprocessed and therefore the function 117 | // doesn't need to do as much error checking and clean-up. This was done to avoid 118 | // repeating these steps on each file being checked during the archive process. 119 | // The more generic fileutils.Matches() can't make these assumptions. 120 | func optimizedMatches(file string, patterns []string, patDirs [][]string) (bool, error) { 121 | matched := false 122 | parentPath := filepath.Dir(file) 123 | parentPathDirs := strings.Split(parentPath, "/") 124 | 125 | for i, pattern := range patterns { 126 | negative := false 127 | 128 | if exclusion(pattern) { 129 | negative = true 130 | pattern = pattern[1:] 131 | } 132 | 133 | match, err := regexpMatch(pattern, file) 134 | if err != nil { 135 | return false, fmt.Errorf("Error in pattern (%s): %s", pattern, err) 136 | } 137 | 138 | if !match && parentPath != "." { 139 | // Check to see if the pattern matches one of our parent dirs. 140 | if len(patDirs[i]) <= len(parentPathDirs) { 141 | match, _ = regexpMatch(strings.Join(patDirs[i], "/"), 142 | strings.Join(parentPathDirs[:len(patDirs[i])], "/")) 143 | } 144 | } 145 | 146 | if match { 147 | matched = !negative 148 | } 149 | } 150 | 151 | //if matched { 152 | //log.Debugf("Skipping excluded path: %s", file) 153 | //} 154 | 155 | return matched, nil 156 | } 157 | 158 | // regexpMatch tries to match the logic of filepath.Match but 159 | // does so using regexp logic. We do this so that we can expand the 160 | // wildcard set to include other things, like "**" to mean any number 161 | // of directories. This means that we should be backwards compatible 162 | // with filepath.Match(). We'll end up supporting more stuff, due to 163 | // the fact that we're using regexp, but that's ok - it does no harm. 164 | func regexpMatch(pattern, path string) (bool, error) { 165 | regStr := "^" 166 | 167 | // Do some syntax checking on the pattern. 168 | // filepath's Match() has some really weird rules that are inconsistent 169 | // so instead of trying to dup their logic, just call Match() for its 170 | // error state and if there is an error in the pattern return it. 171 | // If this becomes an issue we can remove this since its really only 172 | // needed in the error (syntax) case - which isn't really critical. 173 | if _, err := filepath.Match(pattern, path); err != nil { 174 | return false, err 175 | } 176 | 177 | // Go through the pattern and convert it to a regexp. 178 | // We use a scanner so we can support utf-8 chars. 179 | var scan scanner.Scanner 180 | scan.Init(strings.NewReader(pattern)) 181 | 182 | sl := string(os.PathSeparator) 183 | escSL := sl 184 | if sl == `\` { 185 | escSL += `\` 186 | } 187 | 188 | for scan.Peek() != scanner.EOF { 189 | ch := scan.Next() 190 | 191 | if ch == '*' { 192 | if scan.Peek() == '*' { 193 | // is some flavor of "**" 194 | scan.Next() 195 | 196 | if scan.Peek() == scanner.EOF { 197 | // is "**EOF" - to align with .gitignore just accept all 198 | regStr += ".*" 199 | } else { 200 | // is "**" 201 | regStr += "((.*" + escSL + ")|([^" + escSL + "]*))" 202 | } 203 | 204 | // Treat **/ as ** so eat the "/" 205 | if string(scan.Peek()) == sl { 206 | scan.Next() 207 | } 208 | } else { 209 | // is "*" so map it to anything but "/" 210 | regStr += "[^" + escSL + "]*" 211 | } 212 | } else if ch == '?' { 213 | // "?" is any char except "/" 214 | regStr += "[^" + escSL + "]" 215 | } else if strings.Index(".$", string(ch)) != -1 { 216 | // Escape some regexp special chars that have no meaning 217 | // in golang's filepath.Match 218 | regStr += `\` + string(ch) 219 | } else if ch == '\\' { 220 | // escape next char. Note that a trailing \ in the pattern 221 | // will be left alone (but need to escape it) 222 | if sl == `\` { 223 | // On windows map "\" to "\\", meaning an escaped backslash, 224 | // and then just continue because filepath.Match on 225 | // Windows doesn't allow escaping at all 226 | regStr += escSL 227 | continue 228 | } 229 | if scan.Peek() != scanner.EOF { 230 | regStr += `\` + string(scan.Next()) 231 | } else { 232 | regStr += `\` 233 | } 234 | } else { 235 | regStr += string(ch) 236 | } 237 | } 238 | 239 | regStr += "$" 240 | 241 | res, err := regexp.MatchString(regStr, path) 242 | 243 | // Map regexp's error to filepath's so no one knows we're not using filepath 244 | if err != nil { 245 | err = filepath.ErrBadPattern 246 | } 247 | 248 | return res, err 249 | } 250 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_netbsd.go 3 | 4 | // +build arm,netbsd 5 | 6 | package unix 7 | 8 | const ( 9 | sizeofPtr = 0x4 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x4 13 | sizeofLongLong = 0x8 14 | ) 15 | 16 | type ( 17 | _C_short int16 18 | _C_int int32 19 | _C_long int32 20 | _C_long_long int64 21 | ) 22 | 23 | type Timespec struct { 24 | Sec int64 25 | Nsec int32 26 | Pad_cgo_0 [4]byte 27 | } 28 | 29 | type Timeval struct { 30 | Sec int64 31 | Usec int32 32 | Pad_cgo_0 [4]byte 33 | } 34 | 35 | type Rusage struct { 36 | Utime Timeval 37 | Stime Timeval 38 | Maxrss int32 39 | Ixrss int32 40 | Idrss int32 41 | Isrss int32 42 | Minflt int32 43 | Majflt int32 44 | Nswap int32 45 | Inblock int32 46 | Oublock int32 47 | Msgsnd int32 48 | Msgrcv int32 49 | Nsignals int32 50 | Nvcsw int32 51 | Nivcsw int32 52 | } 53 | 54 | type Rlimit struct { 55 | Cur uint64 56 | Max uint64 57 | } 58 | 59 | type _Gid_t uint32 60 | 61 | type Stat_t struct { 62 | Dev uint64 63 | Mode uint32 64 | Pad_cgo_0 [4]byte 65 | Ino uint64 66 | Nlink uint32 67 | Uid uint32 68 | Gid uint32 69 | Pad_cgo_1 [4]byte 70 | Rdev uint64 71 | Atimespec Timespec 72 | Mtimespec Timespec 73 | Ctimespec Timespec 74 | Birthtimespec Timespec 75 | Size int64 76 | Blocks int64 77 | Blksize uint32 78 | Flags uint32 79 | Gen uint32 80 | Spare [2]uint32 81 | Pad_cgo_2 [4]byte 82 | } 83 | 84 | type Statfs_t [0]byte 85 | 86 | type Flock_t struct { 87 | Start int64 88 | Len int64 89 | Pid int32 90 | Type int16 91 | Whence int16 92 | } 93 | 94 | type Dirent struct { 95 | Fileno uint64 96 | Reclen uint16 97 | Namlen uint16 98 | Type uint8 99 | Name [512]int8 100 | Pad_cgo_0 [3]byte 101 | } 102 | 103 | type Fsid struct { 104 | X__fsid_val [2]int32 105 | } 106 | 107 | type RawSockaddrInet4 struct { 108 | Len uint8 109 | Family uint8 110 | Port uint16 111 | Addr [4]byte /* in_addr */ 112 | Zero [8]int8 113 | } 114 | 115 | type RawSockaddrInet6 struct { 116 | Len uint8 117 | Family uint8 118 | Port uint16 119 | Flowinfo uint32 120 | Addr [16]byte /* in6_addr */ 121 | Scope_id uint32 122 | } 123 | 124 | type RawSockaddrUnix struct { 125 | Len uint8 126 | Family uint8 127 | Path [104]int8 128 | } 129 | 130 | type RawSockaddrDatalink struct { 131 | Len uint8 132 | Family uint8 133 | Index uint16 134 | Type uint8 135 | Nlen uint8 136 | Alen uint8 137 | Slen uint8 138 | Data [12]int8 139 | } 140 | 141 | type RawSockaddr struct { 142 | Len uint8 143 | Family uint8 144 | Data [14]int8 145 | } 146 | 147 | type RawSockaddrAny struct { 148 | Addr RawSockaddr 149 | Pad [92]int8 150 | } 151 | 152 | type _Socklen uint32 153 | 154 | type Linger struct { 155 | Onoff int32 156 | Linger int32 157 | } 158 | 159 | type Iovec struct { 160 | Base *byte 161 | Len uint32 162 | } 163 | 164 | type IPMreq struct { 165 | Multiaddr [4]byte /* in_addr */ 166 | Interface [4]byte /* in_addr */ 167 | } 168 | 169 | type IPv6Mreq struct { 170 | Multiaddr [16]byte /* in6_addr */ 171 | Interface uint32 172 | } 173 | 174 | type Msghdr struct { 175 | Name *byte 176 | Namelen uint32 177 | Iov *Iovec 178 | Iovlen int32 179 | Control *byte 180 | Controllen uint32 181 | Flags int32 182 | } 183 | 184 | type Cmsghdr struct { 185 | Len uint32 186 | Level int32 187 | Type int32 188 | } 189 | 190 | type Inet6Pktinfo struct { 191 | Addr [16]byte /* in6_addr */ 192 | Ifindex uint32 193 | } 194 | 195 | type IPv6MTUInfo struct { 196 | Addr RawSockaddrInet6 197 | Mtu uint32 198 | } 199 | 200 | type ICMPv6Filter struct { 201 | Filt [8]uint32 202 | } 203 | 204 | const ( 205 | SizeofSockaddrInet4 = 0x10 206 | SizeofSockaddrInet6 = 0x1c 207 | SizeofSockaddrAny = 0x6c 208 | SizeofSockaddrUnix = 0x6a 209 | SizeofSockaddrDatalink = 0x14 210 | SizeofLinger = 0x8 211 | SizeofIPMreq = 0x8 212 | SizeofIPv6Mreq = 0x14 213 | SizeofMsghdr = 0x1c 214 | SizeofCmsghdr = 0xc 215 | SizeofInet6Pktinfo = 0x14 216 | SizeofIPv6MTUInfo = 0x20 217 | SizeofICMPv6Filter = 0x20 218 | ) 219 | 220 | const ( 221 | PTRACE_TRACEME = 0x0 222 | PTRACE_CONT = 0x7 223 | PTRACE_KILL = 0x8 224 | ) 225 | 226 | type Kevent_t struct { 227 | Ident uint32 228 | Filter uint32 229 | Flags uint32 230 | Fflags uint32 231 | Data int64 232 | Udata int32 233 | Pad_cgo_0 [4]byte 234 | } 235 | 236 | type FdSet struct { 237 | Bits [8]uint32 238 | } 239 | 240 | const ( 241 | SizeofIfMsghdr = 0x98 242 | SizeofIfData = 0x88 243 | SizeofIfaMsghdr = 0x18 244 | SizeofIfAnnounceMsghdr = 0x18 245 | SizeofRtMsghdr = 0x78 246 | SizeofRtMetrics = 0x50 247 | ) 248 | 249 | type IfMsghdr struct { 250 | Msglen uint16 251 | Version uint8 252 | Type uint8 253 | Addrs int32 254 | Flags int32 255 | Index uint16 256 | Pad_cgo_0 [2]byte 257 | Data IfData 258 | } 259 | 260 | type IfData struct { 261 | Type uint8 262 | Addrlen uint8 263 | Hdrlen uint8 264 | Pad_cgo_0 [1]byte 265 | Link_state int32 266 | Mtu uint64 267 | Metric uint64 268 | Baudrate uint64 269 | Ipackets uint64 270 | Ierrors uint64 271 | Opackets uint64 272 | Oerrors uint64 273 | Collisions uint64 274 | Ibytes uint64 275 | Obytes uint64 276 | Imcasts uint64 277 | Omcasts uint64 278 | Iqdrops uint64 279 | Noproto uint64 280 | Lastchange Timespec 281 | } 282 | 283 | type IfaMsghdr struct { 284 | Msglen uint16 285 | Version uint8 286 | Type uint8 287 | Addrs int32 288 | Flags int32 289 | Metric int32 290 | Index uint16 291 | Pad_cgo_0 [6]byte 292 | } 293 | 294 | type IfAnnounceMsghdr struct { 295 | Msglen uint16 296 | Version uint8 297 | Type uint8 298 | Index uint16 299 | Name [16]int8 300 | What uint16 301 | } 302 | 303 | type RtMsghdr struct { 304 | Msglen uint16 305 | Version uint8 306 | Type uint8 307 | Index uint16 308 | Pad_cgo_0 [2]byte 309 | Flags int32 310 | Addrs int32 311 | Pid int32 312 | Seq int32 313 | Errno int32 314 | Use int32 315 | Inits int32 316 | Pad_cgo_1 [4]byte 317 | Rmx RtMetrics 318 | } 319 | 320 | type RtMetrics struct { 321 | Locks uint64 322 | Mtu uint64 323 | Hopcount uint64 324 | Recvpipe uint64 325 | Sendpipe uint64 326 | Ssthresh uint64 327 | Rtt uint64 328 | Rttvar uint64 329 | Expire int64 330 | Pksent int64 331 | } 332 | 333 | type Mclpool [0]byte 334 | 335 | const ( 336 | SizeofBpfVersion = 0x4 337 | SizeofBpfStat = 0x80 338 | SizeofBpfProgram = 0x8 339 | SizeofBpfInsn = 0x8 340 | SizeofBpfHdr = 0x14 341 | ) 342 | 343 | type BpfVersion struct { 344 | Major uint16 345 | Minor uint16 346 | } 347 | 348 | type BpfStat struct { 349 | Recv uint64 350 | Drop uint64 351 | Capt uint64 352 | Padding [13]uint64 353 | } 354 | 355 | type BpfProgram struct { 356 | Len uint32 357 | Insns *BpfInsn 358 | } 359 | 360 | type BpfInsn struct { 361 | Code uint16 362 | Jt uint8 363 | Jf uint8 364 | K uint32 365 | } 366 | 367 | type BpfHdr struct { 368 | Tstamp BpfTimeval 369 | Caplen uint32 370 | Datalen uint32 371 | Hdrlen uint16 372 | Pad_cgo_0 [2]byte 373 | } 374 | 375 | type BpfTimeval struct { 376 | Sec int32 377 | Usec int32 378 | } 379 | 380 | type Termios struct { 381 | Iflag uint32 382 | Oflag uint32 383 | Cflag uint32 384 | Lflag uint32 385 | Cc [20]uint8 386 | Ispeed int32 387 | Ospeed int32 388 | } 389 | 390 | type Sysctlnode struct { 391 | Flags uint32 392 | Num int32 393 | Name [32]int8 394 | Ver uint32 395 | X__rsvd uint32 396 | Un [16]byte 397 | X_sysctl_size [8]byte 398 | X_sysctl_func [8]byte 399 | X_sysctl_parent [8]byte 400 | X_sysctl_desc [8]byte 401 | } 402 | --------------------------------------------------------------------------------