mirror of
https://github.com/bettercap/bettercap
synced 2025-07-14 09:03:39 -07:00
updated non breaking dependencies
This commit is contained in:
parent
b75694f540
commit
a164517717
212 changed files with 36545 additions and 13693 deletions
20
Gopkg.lock
generated
20
Gopkg.lock
generated
|
@ -19,7 +19,7 @@
|
||||||
"linux/util",
|
"linux/util",
|
||||||
"xpc"
|
"xpc"
|
||||||
]
|
]
|
||||||
revision = "e65eb2df9116e5ec6e2409b6142a09a93e96b900"
|
revision = "66e7446993acb3de936b3f487e5933522ed16923"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/bettercap/readline"
|
name = "github.com/bettercap/readline"
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
branch = "master"
|
branch = "master"
|
||||||
name = "github.com/dustin/go-humanize"
|
name = "github.com/dustin/go-humanize"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "bb3d318650d48840a39aa21a027c6630e198e626"
|
revision = "02af3965c54e8cacf948b97fef38925c4120652c"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
@ -84,10 +84,10 @@
|
||||||
version = "v1.1.14"
|
version = "v1.1.14"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
name = "github.com/gorilla/context"
|
name = "github.com/gorilla/context"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"
|
revision = "1ea25387ff6f684839d82767c1733ff4d4d15d0a"
|
||||||
|
version = "v1.1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/gorilla/mux"
|
name = "github.com/gorilla/mux"
|
||||||
|
@ -122,7 +122,8 @@
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/mattn/go-colorable"
|
name = "github.com/mattn/go-colorable"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "5411d3eea5978e6cdc258b30de592b60df6aba96"
|
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
|
||||||
|
version = "v0.0.9"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/mattn/go-isatty"
|
name = "github.com/mattn/go-isatty"
|
||||||
|
@ -153,10 +154,10 @@
|
||||||
version = "v1"
|
version = "v1"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
|
||||||
name = "github.com/pkg/errors"
|
name = "github.com/pkg/errors"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "816c9085562cd7ee03e7f8188a1cfd942858cded"
|
revision = "645ef00459ed84a119197bfb8d8205042c6df63d"
|
||||||
|
version = "v0.8.0"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
"registry",
|
"registry",
|
||||||
"token"
|
"token"
|
||||||
]
|
]
|
||||||
revision = "6c383dd335ef8dcccef05e651ce1eccfe4d0f011"
|
revision = "03d472dc43abece8691e609a23d295ab732abba6"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
branch = "master"
|
branch = "master"
|
||||||
|
@ -179,9 +180,10 @@
|
||||||
revision = "eaafced92e9619f03c72527efeab21e326f3bc36"
|
revision = "eaafced92e9619f03c72527efeab21e326f3bc36"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
|
branch = "master"
|
||||||
name = "golang.org/x/sys"
|
name = "golang.org/x/sys"
|
||||||
packages = ["unix"]
|
packages = ["unix"]
|
||||||
revision = "abf9c25f54453410d0c6668e519582a9e1115027"
|
revision = "d0faeb539838e250bd0a9db4182d48d4a1915181"
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "gopkg.in/sourcemap.v1"
|
name = "gopkg.in/sourcemap.v1"
|
||||||
|
|
8
vendor/github.com/dustin/go-humanize/comma.go
generated
vendored
8
vendor/github.com/dustin/go-humanize/comma.go
generated
vendored
|
@ -76,6 +76,14 @@ func Commaf(v float64) string {
|
||||||
return buf.String()
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CommafWithDigits works like the Commaf but limits the resulting
|
||||||
|
// string to the given number of decimal places.
|
||||||
|
//
|
||||||
|
// e.g. CommafWithDigits(834142.32, 1) -> 834,142.3
|
||||||
|
func CommafWithDigits(f float64, decimals int) string {
|
||||||
|
return stripTrailingDigits(Commaf(f), decimals)
|
||||||
|
}
|
||||||
|
|
||||||
// BigComma produces a string form of the given big.Int in base 10
|
// BigComma produces a string form of the given big.Int in base 10
|
||||||
// with commas after every three orders of magnitude.
|
// with commas after every three orders of magnitude.
|
||||||
func BigComma(b *big.Int) string {
|
func BigComma(b *big.Int) string {
|
||||||
|
|
25
vendor/github.com/dustin/go-humanize/ftoa.go
generated
vendored
25
vendor/github.com/dustin/go-humanize/ftoa.go
generated
vendored
|
@ -1,6 +1,9 @@
|
||||||
package humanize
|
package humanize
|
||||||
|
|
||||||
import "strconv"
|
import (
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
func stripTrailingZeros(s string) string {
|
func stripTrailingZeros(s string) string {
|
||||||
offset := len(s) - 1
|
offset := len(s) - 1
|
||||||
|
@ -17,7 +20,27 @@ func stripTrailingZeros(s string) string {
|
||||||
return s[:offset+1]
|
return s[:offset+1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func stripTrailingDigits(s string, digits int) string {
|
||||||
|
if i := strings.Index(s, "."); i >= 0 {
|
||||||
|
if digits <= 0 {
|
||||||
|
return s[:i]
|
||||||
|
}
|
||||||
|
i++
|
||||||
|
if i+digits >= len(s) {
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
return s[:i+digits]
|
||||||
|
}
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
// Ftoa converts a float to a string with no trailing zeros.
|
// Ftoa converts a float to a string with no trailing zeros.
|
||||||
func Ftoa(num float64) string {
|
func Ftoa(num float64) string {
|
||||||
return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64))
|
return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FtoaWithDigits converts a float to a string but limits the resulting string
|
||||||
|
// to the given number of decimal places, and no trailing zeros.
|
||||||
|
func FtoaWithDigits(num float64, digits int) string {
|
||||||
|
return stripTrailingZeros(stripTrailingDigits(strconv.FormatFloat(num, 'f', 6, 64), digits))
|
||||||
|
}
|
||||||
|
|
10
vendor/github.com/dustin/go-humanize/si.go
generated
vendored
10
vendor/github.com/dustin/go-humanize/si.go
generated
vendored
|
@ -93,6 +93,16 @@ func SI(input float64, unit string) string {
|
||||||
return Ftoa(value) + " " + prefix + unit
|
return Ftoa(value) + " " + prefix + unit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SIWithDigits works like SI but limits the resulting string to the
|
||||||
|
// given number of decimal places.
|
||||||
|
//
|
||||||
|
// e.g. SIWithDigits(1000000, 0, "B") -> 1 MB
|
||||||
|
// e.g. SIWithDigits(2.2345e-12, 2, "F") -> 2.23 pF
|
||||||
|
func SIWithDigits(input float64, decimals int, unit string) string {
|
||||||
|
value, prefix := ComputeSI(input)
|
||||||
|
return FtoaWithDigits(value, decimals) + " " + prefix + unit
|
||||||
|
}
|
||||||
|
|
||||||
var errInvalid = errors.New("invalid input")
|
var errInvalid = errors.New("invalid input")
|
||||||
|
|
||||||
// ParseSI parses an SI string back into the number and unit.
|
// ParseSI parses an SI string back into the number and unit.
|
||||||
|
|
8
vendor/github.com/gorilla/context/.travis.yml
generated
vendored
8
vendor/github.com/gorilla/context/.travis.yml
generated
vendored
|
@ -7,13 +7,13 @@ matrix:
|
||||||
- go: 1.4
|
- go: 1.4
|
||||||
- go: 1.5
|
- go: 1.5
|
||||||
- go: 1.6
|
- go: 1.6
|
||||||
- go: 1.7
|
|
||||||
- go: tip
|
|
||||||
allow_failures:
|
|
||||||
- go: tip
|
- go: tip
|
||||||
|
|
||||||
|
install:
|
||||||
|
- go get golang.org/x/tools/cmd/vet
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- go get -t -v ./...
|
- go get -t -v ./...
|
||||||
- diff -u <(echo -n) <(gofmt -d .)
|
- diff -u <(echo -n) <(gofmt -d .)
|
||||||
- go vet $(go list ./... | grep -v /vendor/)
|
- go tool vet .
|
||||||
- go test -v -race ./...
|
- go test -v -race ./...
|
||||||
|
|
3
vendor/github.com/gorilla/context/README.md
generated
vendored
3
vendor/github.com/gorilla/context/README.md
generated
vendored
|
@ -4,7 +4,4 @@ context
|
||||||
|
|
||||||
gorilla/context is a general purpose registry for global request variables.
|
gorilla/context is a general purpose registry for global request variables.
|
||||||
|
|
||||||
> Note: gorilla/context, having been born well before `context.Context` existed, does not play well
|
|
||||||
> with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs. You should either use *just* gorilla/context, or moving forward, the new `http.Request.Context()`.
|
|
||||||
|
|
||||||
Read the full documentation here: http://www.gorillatoolkit.org/pkg/context
|
Read the full documentation here: http://www.gorillatoolkit.org/pkg/context
|
||||||
|
|
6
vendor/github.com/gorilla/context/doc.go
generated
vendored
6
vendor/github.com/gorilla/context/doc.go
generated
vendored
|
@ -5,12 +5,6 @@
|
||||||
/*
|
/*
|
||||||
Package context stores values shared during a request lifetime.
|
Package context stores values shared during a request lifetime.
|
||||||
|
|
||||||
Note: gorilla/context, having been born well before `context.Context` existed,
|
|
||||||
does not play well > with the shallow copying of the request that
|
|
||||||
[`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext)
|
|
||||||
(added to net/http Go 1.7 onwards) performs. You should either use *just*
|
|
||||||
gorilla/context, or moving forward, the new `http.Request.Context()`.
|
|
||||||
|
|
||||||
For example, a router can set variables extracted from the URL and later
|
For example, a router can set variables extracted from the URL and later
|
||||||
application handlers can access those values, or it can be used to store
|
application handlers can access those values, or it can be used to store
|
||||||
sessions values to be saved at the end of a request. There are several
|
sessions values to be saved at the end of a request. There are several
|
||||||
|
|
7
vendor/github.com/mattn/go-colorable/.travis.yml
generated
vendored
7
vendor/github.com/mattn/go-colorable/.travis.yml
generated
vendored
|
@ -2,7 +2,8 @@ language: go
|
||||||
go:
|
go:
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
sudo: false
|
before_install:
|
||||||
|
- go get github.com/mattn/goveralls
|
||||||
|
- go get golang.org/x/tools/cmd/cover
|
||||||
script:
|
script:
|
||||||
- go test -v
|
- $HOME/gopath/bin/goveralls -repotoken xnXqRGwgW3SXIguzxf90ZSK1GPYZPaGrw
|
||||||
|
|
5
vendor/github.com/mattn/go-colorable/README.md
generated
vendored
5
vendor/github.com/mattn/go-colorable/README.md
generated
vendored
|
@ -1,5 +1,10 @@
|
||||||
# go-colorable
|
# go-colorable
|
||||||
|
|
||||||
|
[](http://godoc.org/github.com/mattn/go-colorable)
|
||||||
|
[](https://travis-ci.org/mattn/go-colorable)
|
||||||
|
[](https://coveralls.io/github/mattn/go-colorable?branch=master)
|
||||||
|
[](https://goreportcard.com/report/mattn/go-colorable)
|
||||||
|
|
||||||
Colorable writer for windows.
|
Colorable writer for windows.
|
||||||
|
|
||||||
For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.)
|
For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.)
|
||||||
|
|
29
vendor/github.com/mattn/go-colorable/colorable_appengine.go
generated
vendored
Normal file
29
vendor/github.com/mattn/go-colorable/colorable_appengine.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// +build appengine
|
||||||
|
|
||||||
|
package colorable
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
_ "github.com/mattn/go-isatty"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NewColorable return new instance of Writer which handle escape sequence.
|
||||||
|
func NewColorable(file *os.File) io.Writer {
|
||||||
|
if file == nil {
|
||||||
|
panic("nil passed instead of *os.File to NewColorable()")
|
||||||
|
}
|
||||||
|
|
||||||
|
return file
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewColorableStdout return new instance of Writer which handle escape sequence for stdout.
|
||||||
|
func NewColorableStdout() io.Writer {
|
||||||
|
return os.Stdout
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewColorableStderr return new instance of Writer which handle escape sequence for stderr.
|
||||||
|
func NewColorableStderr() io.Writer {
|
||||||
|
return os.Stderr
|
||||||
|
}
|
3
vendor/github.com/mattn/go-colorable/colorable_others.go
generated
vendored
3
vendor/github.com/mattn/go-colorable/colorable_others.go
generated
vendored
|
@ -1,10 +1,13 @@
|
||||||
// +build !windows
|
// +build !windows
|
||||||
|
// +build !appengine
|
||||||
|
|
||||||
package colorable
|
package colorable
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
_ "github.com/mattn/go-isatty"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewColorable return new instance of Writer which handle escape sequence.
|
// NewColorable return new instance of Writer which handle escape sequence.
|
||||||
|
|
168
vendor/github.com/mattn/go-colorable/colorable_windows.go
generated
vendored
168
vendor/github.com/mattn/go-colorable/colorable_windows.go
generated
vendored
|
@ -1,3 +1,6 @@
|
||||||
|
// +build windows
|
||||||
|
// +build !appengine
|
||||||
|
|
||||||
package colorable
|
package colorable
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -65,12 +68,13 @@ var (
|
||||||
procFillConsoleOutputAttribute = kernel32.NewProc("FillConsoleOutputAttribute")
|
procFillConsoleOutputAttribute = kernel32.NewProc("FillConsoleOutputAttribute")
|
||||||
procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo")
|
procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo")
|
||||||
procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo")
|
procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo")
|
||||||
|
procSetConsoleTitle = kernel32.NewProc("SetConsoleTitleW")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Writer provide colorable Writer to the console
|
||||||
type Writer struct {
|
type Writer struct {
|
||||||
out io.Writer
|
out io.Writer
|
||||||
handle syscall.Handle
|
handle syscall.Handle
|
||||||
lastbuf bytes.Buffer
|
|
||||||
oldattr word
|
oldattr word
|
||||||
oldpos coord
|
oldpos coord
|
||||||
}
|
}
|
||||||
|
@ -86,9 +90,8 @@ func NewColorable(file *os.File) io.Writer {
|
||||||
handle := syscall.Handle(file.Fd())
|
handle := syscall.Handle(file.Fd())
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
|
procGetConsoleScreenBufferInfo.Call(uintptr(handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
return &Writer{out: file, handle: handle, oldattr: csbi.attributes, oldpos: coord{0, 0}}
|
return &Writer{out: file, handle: handle, oldattr: csbi.attributes, oldpos: coord{0, 0}}
|
||||||
} else {
|
|
||||||
return file
|
|
||||||
}
|
}
|
||||||
|
return file
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewColorableStdout return new instance of Writer which handle escape sequence for stdout.
|
// NewColorableStdout return new instance of Writer which handle escape sequence for stdout.
|
||||||
|
@ -360,6 +363,45 @@ var color256 = map[int]int{
|
||||||
255: 0xeeeeee,
|
255: 0xeeeeee,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// `\033]0;TITLESTR\007`
|
||||||
|
func doTitleSequence(er *bytes.Reader) error {
|
||||||
|
var c byte
|
||||||
|
var err error
|
||||||
|
|
||||||
|
c, err = er.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if c != '0' && c != '2' {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
c, err = er.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if c != ';' {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
title := make([]byte, 0, 80)
|
||||||
|
for {
|
||||||
|
c, err = er.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if c == 0x07 || c == '\n' {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
title = append(title, c)
|
||||||
|
}
|
||||||
|
if len(title) > 0 {
|
||||||
|
title8, err := syscall.UTF16PtrFromString(string(title))
|
||||||
|
if err == nil {
|
||||||
|
procSetConsoleTitle.Call(uintptr(unsafe.Pointer(title8)))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Write write data on console
|
// Write write data on console
|
||||||
func (w *Writer) Write(data []byte) (n int, err error) {
|
func (w *Writer) Write(data []byte) (n int, err error) {
|
||||||
var csbi consoleScreenBufferInfo
|
var csbi consoleScreenBufferInfo
|
||||||
|
@ -369,11 +411,6 @@ func (w *Writer) Write(data []byte) (n int, err error) {
|
||||||
var bw [1]byte
|
var bw [1]byte
|
||||||
loop:
|
loop:
|
||||||
for {
|
for {
|
||||||
r1, _, err := procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
|
||||||
if r1 == 0 {
|
|
||||||
break loop
|
|
||||||
}
|
|
||||||
|
|
||||||
c1, err := er.ReadByte()
|
c1, err := er.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break loop
|
break loop
|
||||||
|
@ -385,12 +422,16 @@ loop:
|
||||||
}
|
}
|
||||||
c2, err := er.ReadByte()
|
c2, err := er.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.lastbuf.WriteByte(c1)
|
|
||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c2 == ']' {
|
||||||
|
if err := doTitleSequence(er); err != nil {
|
||||||
|
break loop
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
if c2 != 0x5b {
|
if c2 != 0x5b {
|
||||||
w.lastbuf.WriteByte(c1)
|
|
||||||
w.lastbuf.WriteByte(c2)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,9 +440,6 @@ loop:
|
||||||
for {
|
for {
|
||||||
c, err := er.ReadByte()
|
c, err := er.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.lastbuf.WriteByte(c1)
|
|
||||||
w.lastbuf.WriteByte(c2)
|
|
||||||
w.lastbuf.Write(buf.Bytes())
|
|
||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
|
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
|
||||||
|
@ -411,7 +449,6 @@ loop:
|
||||||
buf.Write([]byte(string(c)))
|
buf.Write([]byte(string(c)))
|
||||||
}
|
}
|
||||||
|
|
||||||
var csbi consoleScreenBufferInfo
|
|
||||||
switch m {
|
switch m {
|
||||||
case 'A':
|
case 'A':
|
||||||
n, err = strconv.Atoi(buf.String())
|
n, err = strconv.Atoi(buf.String())
|
||||||
|
@ -435,19 +472,16 @@ loop:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
csbi.cursorPosition.x -= short(n)
|
csbi.cursorPosition.x += short(n)
|
||||||
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
||||||
case 'D':
|
case 'D':
|
||||||
n, err = strconv.Atoi(buf.String())
|
n, err = strconv.Atoi(buf.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if n, err = strconv.Atoi(buf.String()); err == nil {
|
|
||||||
var csbi consoleScreenBufferInfo
|
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
csbi.cursorPosition.x += short(n)
|
csbi.cursorPosition.x -= short(n)
|
||||||
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
||||||
}
|
|
||||||
case 'E':
|
case 'E':
|
||||||
n, err = strconv.Atoi(buf.String())
|
n, err = strconv.Atoi(buf.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -474,11 +508,18 @@ loop:
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
csbi.cursorPosition.x = short(n - 1)
|
csbi.cursorPosition.x = short(n - 1)
|
||||||
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
||||||
case 'H':
|
case 'H', 'f':
|
||||||
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
|
if buf.Len() > 0 {
|
||||||
token := strings.Split(buf.String(), ";")
|
token := strings.Split(buf.String(), ";")
|
||||||
if len(token) != 2 {
|
switch len(token) {
|
||||||
|
case 1:
|
||||||
|
n1, err := strconv.Atoi(token[0])
|
||||||
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
csbi.cursorPosition.y = short(n1 - 1)
|
||||||
|
case 2:
|
||||||
n1, err := strconv.Atoi(token[0])
|
n1, err := strconv.Atoi(token[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
|
@ -489,43 +530,57 @@ loop:
|
||||||
}
|
}
|
||||||
csbi.cursorPosition.x = short(n2 - 1)
|
csbi.cursorPosition.x = short(n2 - 1)
|
||||||
csbi.cursorPosition.y = short(n1 - 1)
|
csbi.cursorPosition.y = short(n1 - 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
csbi.cursorPosition.y = 0
|
||||||
|
}
|
||||||
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&csbi.cursorPosition)))
|
||||||
case 'J':
|
case 'J':
|
||||||
n, err := strconv.Atoi(buf.String())
|
n := 0
|
||||||
|
if buf.Len() > 0 {
|
||||||
|
n, err = strconv.Atoi(buf.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
}
|
||||||
|
var count, written dword
|
||||||
var cursor coord
|
var cursor coord
|
||||||
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
switch n {
|
switch n {
|
||||||
case 0:
|
case 0:
|
||||||
cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}
|
cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}
|
||||||
|
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x)
|
||||||
case 1:
|
case 1:
|
||||||
cursor = coord{x: csbi.window.left, y: csbi.window.top}
|
cursor = coord{x: csbi.window.left, y: csbi.window.top}
|
||||||
|
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.window.top-csbi.cursorPosition.y)*csbi.size.x)
|
||||||
case 2:
|
case 2:
|
||||||
cursor = coord{x: csbi.window.left, y: csbi.window.top}
|
cursor = coord{x: csbi.window.left, y: csbi.window.top}
|
||||||
}
|
|
||||||
var count, written dword
|
|
||||||
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x)
|
count = dword(csbi.size.x - csbi.cursorPosition.x + (csbi.size.y-csbi.cursorPosition.y)*csbi.size.x)
|
||||||
|
}
|
||||||
procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
||||||
procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
||||||
case 'K':
|
case 'K':
|
||||||
n, err := strconv.Atoi(buf.String())
|
n := 0
|
||||||
|
if buf.Len() > 0 {
|
||||||
|
n, err = strconv.Atoi(buf.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
}
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
var cursor coord
|
var cursor coord
|
||||||
|
var count, written dword
|
||||||
switch n {
|
switch n {
|
||||||
case 0:
|
case 0:
|
||||||
cursor = coord{x: csbi.cursorPosition.x, y: csbi.cursorPosition.y}
|
cursor = coord{x: csbi.cursorPosition.x + 1, y: csbi.cursorPosition.y}
|
||||||
|
count = dword(csbi.size.x - csbi.cursorPosition.x - 1)
|
||||||
case 1:
|
case 1:
|
||||||
cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y}
|
cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y}
|
||||||
|
count = dword(csbi.size.x - csbi.cursorPosition.x)
|
||||||
case 2:
|
case 2:
|
||||||
cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y}
|
cursor = coord{x: csbi.window.left, y: csbi.window.top + csbi.cursorPosition.y}
|
||||||
|
count = dword(csbi.size.x)
|
||||||
}
|
}
|
||||||
var count, written dword
|
|
||||||
count = dword(csbi.size.x - csbi.cursorPosition.x)
|
|
||||||
procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
procFillConsoleOutputCharacter.Call(uintptr(w.handle), uintptr(' '), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
||||||
procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
procFillConsoleOutputAttribute.Call(uintptr(w.handle), uintptr(csbi.attributes), uintptr(count), *(*uintptr)(unsafe.Pointer(&cursor)), uintptr(unsafe.Pointer(&written)))
|
||||||
case 'm':
|
case 'm':
|
||||||
|
@ -547,7 +602,7 @@ loop:
|
||||||
attr |= foregroundIntensity
|
attr |= foregroundIntensity
|
||||||
case n == 7:
|
case n == 7:
|
||||||
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
||||||
case 22 == n || n == 25 || n == 25:
|
case n == 22 || n == 25:
|
||||||
attr |= foregroundIntensity
|
attr |= foregroundIntensity
|
||||||
case n == 27:
|
case n == 27:
|
||||||
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
||||||
|
@ -634,17 +689,25 @@ loop:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 'h':
|
case 'h':
|
||||||
cs := buf.String()
|
|
||||||
if cs == "?25" {
|
|
||||||
var ci consoleCursorInfo
|
var ci consoleCursorInfo
|
||||||
|
cs := buf.String()
|
||||||
|
if cs == "5>" {
|
||||||
|
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
|
ci.visible = 0
|
||||||
|
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
|
} else if cs == "?25" {
|
||||||
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
ci.visible = 1
|
ci.visible = 1
|
||||||
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
}
|
}
|
||||||
case 'l':
|
case 'l':
|
||||||
cs := buf.String()
|
|
||||||
if cs == "?25" {
|
|
||||||
var ci consoleCursorInfo
|
var ci consoleCursorInfo
|
||||||
|
cs := buf.String()
|
||||||
|
if cs == "5>" {
|
||||||
|
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
|
ci.visible = 1
|
||||||
|
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
|
} else if cs == "?25" {
|
||||||
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
procGetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
ci.visible = 0
|
ci.visible = 0
|
||||||
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
procSetConsoleCursorInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&ci)))
|
||||||
|
@ -656,7 +719,8 @@ loop:
|
||||||
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&w.oldpos)))
|
procSetConsoleCursorPosition.Call(uintptr(w.handle), *(*uintptr)(unsafe.Pointer(&w.oldpos)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len(data) - w.lastbuf.Len(), nil
|
|
||||||
|
return len(data), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type consoleColor struct {
|
type consoleColor struct {
|
||||||
|
@ -700,22 +764,22 @@ func (c consoleColor) backgroundAttr() (attr word) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var color16 = []consoleColor{
|
var color16 = []consoleColor{
|
||||||
consoleColor{0x000000, false, false, false, false},
|
{0x000000, false, false, false, false},
|
||||||
consoleColor{0x000080, false, false, true, false},
|
{0x000080, false, false, true, false},
|
||||||
consoleColor{0x008000, false, true, false, false},
|
{0x008000, false, true, false, false},
|
||||||
consoleColor{0x008080, false, true, true, false},
|
{0x008080, false, true, true, false},
|
||||||
consoleColor{0x800000, true, false, false, false},
|
{0x800000, true, false, false, false},
|
||||||
consoleColor{0x800080, true, false, true, false},
|
{0x800080, true, false, true, false},
|
||||||
consoleColor{0x808000, true, true, false, false},
|
{0x808000, true, true, false, false},
|
||||||
consoleColor{0xc0c0c0, true, true, true, false},
|
{0xc0c0c0, true, true, true, false},
|
||||||
consoleColor{0x808080, false, false, false, true},
|
{0x808080, false, false, false, true},
|
||||||
consoleColor{0x0000ff, false, false, true, true},
|
{0x0000ff, false, false, true, true},
|
||||||
consoleColor{0x00ff00, false, true, false, true},
|
{0x00ff00, false, true, false, true},
|
||||||
consoleColor{0x00ffff, false, true, true, true},
|
{0x00ffff, false, true, true, true},
|
||||||
consoleColor{0xff0000, true, false, false, true},
|
{0xff0000, true, false, false, true},
|
||||||
consoleColor{0xff00ff, true, false, true, true},
|
{0xff00ff, true, false, true, true},
|
||||||
consoleColor{0xffff00, true, true, false, true},
|
{0xffff00, true, true, false, true},
|
||||||
consoleColor{0xffffff, true, true, true, true},
|
{0xffffff, true, true, true, true},
|
||||||
}
|
}
|
||||||
|
|
||||||
type hsv struct {
|
type hsv struct {
|
||||||
|
|
10
vendor/github.com/mattn/go-colorable/noncolorable.go
generated
vendored
10
vendor/github.com/mattn/go-colorable/noncolorable.go
generated
vendored
|
@ -8,7 +8,6 @@ import (
|
||||||
// NonColorable hold writer but remove escape sequence.
|
// NonColorable hold writer but remove escape sequence.
|
||||||
type NonColorable struct {
|
type NonColorable struct {
|
||||||
out io.Writer
|
out io.Writer
|
||||||
lastbuf bytes.Buffer
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNonColorable return new instance of Writer which remove escape sequence from Writer.
|
// NewNonColorable return new instance of Writer which remove escape sequence from Writer.
|
||||||
|
@ -33,12 +32,9 @@ loop:
|
||||||
}
|
}
|
||||||
c2, err := er.ReadByte()
|
c2, err := er.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.lastbuf.WriteByte(c1)
|
|
||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
if c2 != 0x5b {
|
if c2 != 0x5b {
|
||||||
w.lastbuf.WriteByte(c1)
|
|
||||||
w.lastbuf.WriteByte(c2)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,9 +42,6 @@ loop:
|
||||||
for {
|
for {
|
||||||
c, err := er.ReadByte()
|
c, err := er.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.lastbuf.WriteByte(c1)
|
|
||||||
w.lastbuf.WriteByte(c2)
|
|
||||||
w.lastbuf.Write(buf.Bytes())
|
|
||||||
break loop
|
break loop
|
||||||
}
|
}
|
||||||
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
|
if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' {
|
||||||
|
@ -57,5 +50,6 @@ loop:
|
||||||
buf.Write([]byte(string(c)))
|
buf.Write([]byte(string(c)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return len(data) - w.lastbuf.Len(), nil
|
|
||||||
|
return len(data), nil
|
||||||
}
|
}
|
||||||
|
|
11
vendor/github.com/pkg/errors/.travis.yml
generated
vendored
11
vendor/github.com/pkg/errors/.travis.yml
generated
vendored
|
@ -1,13 +1,10 @@
|
||||||
language: go
|
language: go
|
||||||
go_import_path: github.com/pkg/errors
|
go_import_path: github.com/pkg/errors
|
||||||
go:
|
go:
|
||||||
- 1.4.x
|
- 1.4.3
|
||||||
- 1.5.x
|
- 1.5.4
|
||||||
- 1.6.x
|
- 1.6.2
|
||||||
- 1.7.x
|
- 1.7.1
|
||||||
- 1.8.x
|
|
||||||
- 1.9.x
|
|
||||||
- 1.10.x
|
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
script:
|
script:
|
||||||
|
|
4
vendor/github.com/pkg/errors/README.md
generated
vendored
4
vendor/github.com/pkg/errors/README.md
generated
vendored
|
@ -1,4 +1,4 @@
|
||||||
# errors [](https://travis-ci.org/pkg/errors) [](https://ci.appveyor.com/project/davecheney/errors/branch/master) [](http://godoc.org/github.com/pkg/errors) [](https://goreportcard.com/report/github.com/pkg/errors) [](https://sourcegraph.com/github.com/pkg/errors?badge)
|
# errors [](https://travis-ci.org/pkg/errors) [](https://ci.appveyor.com/project/davecheney/errors/branch/master) [](http://godoc.org/github.com/pkg/errors) [](https://goreportcard.com/report/github.com/pkg/errors)
|
||||||
|
|
||||||
Package errors provides simple error handling primitives.
|
Package errors provides simple error handling primitives.
|
||||||
|
|
||||||
|
@ -47,6 +47,6 @@ We welcome pull requests, bug fixes and issue reports. With that said, the bar f
|
||||||
|
|
||||||
Before proposing a change, please discuss your change by raising an issue.
|
Before proposing a change, please discuss your change by raising an issue.
|
||||||
|
|
||||||
## License
|
## Licence
|
||||||
|
|
||||||
BSD-2-Clause
|
BSD-2-Clause
|
||||||
|
|
51
vendor/github.com/pkg/errors/stack.go
generated
vendored
51
vendor/github.com/pkg/errors/stack.go
generated
vendored
|
@ -46,8 +46,7 @@ func (f Frame) line() int {
|
||||||
//
|
//
|
||||||
// Format accepts flags that alter the printing of some verbs, as follows:
|
// Format accepts flags that alter the printing of some verbs, as follows:
|
||||||
//
|
//
|
||||||
// %+s function name and path of source file relative to the compile time
|
// %+s path of source file relative to the compile time GOPATH
|
||||||
// GOPATH separated by \n\t (<funcname>\n\t<path>)
|
|
||||||
// %+v equivalent to %+s:%d
|
// %+v equivalent to %+s:%d
|
||||||
func (f Frame) Format(s fmt.State, verb rune) {
|
func (f Frame) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
|
@ -80,14 +79,6 @@ func (f Frame) Format(s fmt.State, verb rune) {
|
||||||
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
|
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
|
||||||
type StackTrace []Frame
|
type StackTrace []Frame
|
||||||
|
|
||||||
// Format formats the stack of Frames according to the fmt.Formatter interface.
|
|
||||||
//
|
|
||||||
// %s lists source files for each Frame in the stack
|
|
||||||
// %v lists the source file and line number for each Frame in the stack
|
|
||||||
//
|
|
||||||
// Format accepts flags that alter the printing of some verbs, as follows:
|
|
||||||
//
|
|
||||||
// %+v Prints filename, function, and line number for each Frame in the stack.
|
|
||||||
func (st StackTrace) Format(s fmt.State, verb rune) {
|
func (st StackTrace) Format(s fmt.State, verb rune) {
|
||||||
switch verb {
|
switch verb {
|
||||||
case 'v':
|
case 'v':
|
||||||
|
@ -145,3 +136,43 @@ func funcname(name string) string {
|
||||||
i = strings.Index(name, ".")
|
i = strings.Index(name, ".")
|
||||||
return name[i+1:]
|
return name[i+1:]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func trimGOPATH(name, file string) string {
|
||||||
|
// Here we want to get the source file path relative to the compile time
|
||||||
|
// GOPATH. As of Go 1.6.x there is no direct way to know the compiled
|
||||||
|
// GOPATH at runtime, but we can infer the number of path segments in the
|
||||||
|
// GOPATH. We note that fn.Name() returns the function name qualified by
|
||||||
|
// the import path, which does not include the GOPATH. Thus we can trim
|
||||||
|
// segments from the beginning of the file path until the number of path
|
||||||
|
// separators remaining is one more than the number of path separators in
|
||||||
|
// the function name. For example, given:
|
||||||
|
//
|
||||||
|
// GOPATH /home/user
|
||||||
|
// file /home/user/src/pkg/sub/file.go
|
||||||
|
// fn.Name() pkg/sub.Type.Method
|
||||||
|
//
|
||||||
|
// We want to produce:
|
||||||
|
//
|
||||||
|
// pkg/sub/file.go
|
||||||
|
//
|
||||||
|
// From this we can easily see that fn.Name() has one less path separator
|
||||||
|
// than our desired output. We count separators from the end of the file
|
||||||
|
// path until it finds two more than in the function name and then move
|
||||||
|
// one character forward to preserve the initial path segment without a
|
||||||
|
// leading separator.
|
||||||
|
const sep = "/"
|
||||||
|
goal := strings.Count(name, sep) + 2
|
||||||
|
i := len(file)
|
||||||
|
for n := 0; n < goal; n++ {
|
||||||
|
i = strings.LastIndex(file[:i], sep)
|
||||||
|
if i == -1 {
|
||||||
|
// not enough separators found, set i so that the slice expression
|
||||||
|
// below leaves file unmodified
|
||||||
|
i = -len(sep)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// get back to 0 or trim the leading separator
|
||||||
|
file = file[i+len(sep):]
|
||||||
|
return file
|
||||||
|
}
|
||||||
|
|
92
vendor/github.com/robertkrimen/otto/runtime.go
generated
vendored
92
vendor/github.com/robertkrimen/otto/runtime.go
generated
vendored
|
@ -1,6 +1,7 @@
|
||||||
package otto
|
package otto
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"math"
|
||||||
|
@ -8,6 +9,7 @@ import (
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/robertkrimen/otto/ast"
|
"github.com/robertkrimen/otto/ast"
|
||||||
|
@ -296,11 +298,27 @@ func (self *_runtime) convertCallParameter(v Value, t reflect.Type) reflect.Valu
|
||||||
if v.kind == valueObject {
|
if v.kind == valueObject {
|
||||||
if gso, ok := v._object().value.(*_goStructObject); ok {
|
if gso, ok := v._object().value.(*_goStructObject); ok {
|
||||||
if gso.value.Type().AssignableTo(t) {
|
if gso.value.Type().AssignableTo(t) {
|
||||||
|
// please see TestDynamicFunctionReturningInterface for why this exists
|
||||||
|
if t.Kind() == reflect.Interface && gso.value.Type().ConvertibleTo(t) {
|
||||||
|
return gso.value.Convert(t)
|
||||||
|
} else {
|
||||||
return gso.value
|
return gso.value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if gao, ok := v._object().value.(*_goArrayObject); ok {
|
||||||
|
if gao.value.Type().AssignableTo(t) {
|
||||||
|
// please see TestDynamicFunctionReturningInterface for why this exists
|
||||||
|
if t.Kind() == reflect.Interface && gao.value.Type().ConvertibleTo(t) {
|
||||||
|
return gao.value.Convert(t)
|
||||||
|
} else {
|
||||||
|
return gao.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if t.Kind() == reflect.Interface {
|
if t.Kind() == reflect.Interface {
|
||||||
e := v.export()
|
e := v.export()
|
||||||
if e == nil {
|
if e == nil {
|
||||||
|
@ -444,6 +462,66 @@ func (self *_runtime) convertCallParameter(v Value, t reflect.Type) reflect.Valu
|
||||||
return []reflect.Value{self.convertCallParameter(rv, t.Out(0))}
|
return []reflect.Value{self.convertCallParameter(rv, t.Out(0))}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
case reflect.Struct:
|
||||||
|
if o := v._object(); o != nil && o.class == "Object" {
|
||||||
|
s := reflect.New(t)
|
||||||
|
|
||||||
|
for _, k := range o.propertyOrder {
|
||||||
|
var f *reflect.StructField
|
||||||
|
|
||||||
|
for i := 0; i < t.NumField(); i++ {
|
||||||
|
ff := t.Field(i)
|
||||||
|
|
||||||
|
if j := ff.Tag.Get("json"); j != "" {
|
||||||
|
if j == "-" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
a := strings.Split(j, ",")
|
||||||
|
|
||||||
|
if a[0] == k {
|
||||||
|
f = &ff
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ff.Name == k {
|
||||||
|
f = &ff
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.EqualFold(ff.Name, k) {
|
||||||
|
f = &ff
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if f == nil {
|
||||||
|
panic(self.panicTypeError("can't convert object; field %q was supplied but does not exist on target %v", k, t))
|
||||||
|
}
|
||||||
|
|
||||||
|
ss := s
|
||||||
|
|
||||||
|
for _, i := range f.Index {
|
||||||
|
if ss.Kind() == reflect.Ptr {
|
||||||
|
if ss.IsNil() {
|
||||||
|
if !ss.CanSet() {
|
||||||
|
panic(self.panicTypeError("can't set embedded pointer to unexported struct: %v", ss.Type().Elem()))
|
||||||
|
}
|
||||||
|
|
||||||
|
ss.Set(reflect.New(ss.Type().Elem()))
|
||||||
|
}
|
||||||
|
|
||||||
|
ss = ss.Elem()
|
||||||
|
}
|
||||||
|
|
||||||
|
ss = ss.Field(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
ss.Set(self.convertCallParameter(o.get(k), ss.Type()))
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.Elem()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if tk == reflect.String {
|
if tk == reflect.String {
|
||||||
|
@ -464,6 +542,20 @@ func (self *_runtime) convertCallParameter(v Value, t reflect.Type) reflect.Valu
|
||||||
return reflect.ValueOf(v.String())
|
return reflect.ValueOf(v.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if v.kind == valueString {
|
||||||
|
var s encoding.TextUnmarshaler
|
||||||
|
|
||||||
|
if reflect.PtrTo(t).Implements(reflect.TypeOf(&s).Elem()) {
|
||||||
|
r := reflect.New(t)
|
||||||
|
|
||||||
|
if err := r.Interface().(encoding.TextUnmarshaler).UnmarshalText([]byte(v.string())); err != nil {
|
||||||
|
panic(self.panicSyntaxError("can't convert to %s: %s", t.String(), err.Error()))
|
||||||
|
}
|
||||||
|
|
||||||
|
return r.Elem()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s := "OTTO DOES NOT UNDERSTAND THIS TYPE"
|
s := "OTTO DOES NOT UNDERSTAND THIS TYPE"
|
||||||
switch v.kind {
|
switch v.kind {
|
||||||
case valueBoolean:
|
case valueBoolean:
|
||||||
|
|
1
vendor/golang.org/x/sys/unix/.gitignore
generated
vendored
1
vendor/golang.org/x/sys/unix/.gitignore
generated
vendored
|
@ -1 +1,2 @@
|
||||||
_obj/
|
_obj/
|
||||||
|
unix.test
|
||||||
|
|
124
vendor/golang.org/x/sys/unix/affinity_linux.go
generated
vendored
Normal file
124
vendor/golang.org/x/sys/unix/affinity_linux.go
generated
vendored
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// CPU affinity functions
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
const cpuSetSize = _CPU_SETSIZE / _NCPUBITS
|
||||||
|
|
||||||
|
// CPUSet represents a CPU affinity mask.
|
||||||
|
type CPUSet [cpuSetSize]cpuMask
|
||||||
|
|
||||||
|
func schedAffinity(trap uintptr, pid int, set *CPUSet) error {
|
||||||
|
_, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set)))
|
||||||
|
if e != 0 {
|
||||||
|
return errnoErr(e)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SchedGetaffinity gets the CPU affinity mask of the thread specified by pid.
|
||||||
|
// If pid is 0 the calling thread is used.
|
||||||
|
func SchedGetaffinity(pid int, set *CPUSet) error {
|
||||||
|
return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SchedSetaffinity sets the CPU affinity mask of the thread specified by pid.
|
||||||
|
// If pid is 0 the calling thread is used.
|
||||||
|
func SchedSetaffinity(pid int, set *CPUSet) error {
|
||||||
|
return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Zero clears the set s, so that it contains no CPUs.
|
||||||
|
func (s *CPUSet) Zero() {
|
||||||
|
for i := range s {
|
||||||
|
s[i] = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func cpuBitsIndex(cpu int) int {
|
||||||
|
return cpu / _NCPUBITS
|
||||||
|
}
|
||||||
|
|
||||||
|
func cpuBitsMask(cpu int) cpuMask {
|
||||||
|
return cpuMask(1 << (uint(cpu) % _NCPUBITS))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set adds cpu to the set s.
|
||||||
|
func (s *CPUSet) Set(cpu int) {
|
||||||
|
i := cpuBitsIndex(cpu)
|
||||||
|
if i < len(s) {
|
||||||
|
s[i] |= cpuBitsMask(cpu)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear removes cpu from the set s.
|
||||||
|
func (s *CPUSet) Clear(cpu int) {
|
||||||
|
i := cpuBitsIndex(cpu)
|
||||||
|
if i < len(s) {
|
||||||
|
s[i] &^= cpuBitsMask(cpu)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSet reports whether cpu is in the set s.
|
||||||
|
func (s *CPUSet) IsSet(cpu int) bool {
|
||||||
|
i := cpuBitsIndex(cpu)
|
||||||
|
if i < len(s) {
|
||||||
|
return s[i]&cpuBitsMask(cpu) != 0
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// Count returns the number of CPUs in the set s.
|
||||||
|
func (s *CPUSet) Count() int {
|
||||||
|
c := 0
|
||||||
|
for _, b := range s {
|
||||||
|
c += onesCount64(uint64(b))
|
||||||
|
}
|
||||||
|
return c
|
||||||
|
}
|
||||||
|
|
||||||
|
// onesCount64 is a copy of Go 1.9's math/bits.OnesCount64.
|
||||||
|
// Once this package can require Go 1.9, we can delete this
|
||||||
|
// and update the caller to use bits.OnesCount64.
|
||||||
|
func onesCount64(x uint64) int {
|
||||||
|
const m0 = 0x5555555555555555 // 01010101 ...
|
||||||
|
const m1 = 0x3333333333333333 // 00110011 ...
|
||||||
|
const m2 = 0x0f0f0f0f0f0f0f0f // 00001111 ...
|
||||||
|
const m3 = 0x00ff00ff00ff00ff // etc.
|
||||||
|
const m4 = 0x0000ffff0000ffff
|
||||||
|
|
||||||
|
// Implementation: Parallel summing of adjacent bits.
|
||||||
|
// See "Hacker's Delight", Chap. 5: Counting Bits.
|
||||||
|
// The following pattern shows the general approach:
|
||||||
|
//
|
||||||
|
// x = x>>1&(m0&m) + x&(m0&m)
|
||||||
|
// x = x>>2&(m1&m) + x&(m1&m)
|
||||||
|
// x = x>>4&(m2&m) + x&(m2&m)
|
||||||
|
// x = x>>8&(m3&m) + x&(m3&m)
|
||||||
|
// x = x>>16&(m4&m) + x&(m4&m)
|
||||||
|
// x = x>>32&(m5&m) + x&(m5&m)
|
||||||
|
// return int(x)
|
||||||
|
//
|
||||||
|
// Masking (& operations) can be left away when there's no
|
||||||
|
// danger that a field's sum will carry over into the next
|
||||||
|
// field: Since the result cannot be > 64, 8 bits is enough
|
||||||
|
// and we can ignore the masks for the shifts by 8 and up.
|
||||||
|
// Per "Hacker's Delight", the first line can be simplified
|
||||||
|
// more, but it saves at best one instruction, so we leave
|
||||||
|
// it alone for clarity.
|
||||||
|
const m = 1<<64 - 1
|
||||||
|
x = x>>1&(m0&m) + x&(m0&m)
|
||||||
|
x = x>>2&(m1&m) + x&(m1&m)
|
||||||
|
x = (x>>4 + x) & (m2 & m)
|
||||||
|
x += x >> 8
|
||||||
|
x += x >> 16
|
||||||
|
x += x >> 32
|
||||||
|
return int(x) & (1<<7 - 1)
|
||||||
|
}
|
10
vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
generated
vendored
10
vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
generated
vendored
|
@ -13,17 +13,17 @@
|
||||||
// Just jump to package syscall's implementation for all these functions.
|
// Just jump to package syscall's implementation for all these functions.
|
||||||
// The runtime may know about them.
|
// The runtime may know about them.
|
||||||
|
|
||||||
TEXT ·Syscall(SB),NOSPLIT,$0-64
|
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
JMP syscall·Syscall(SB)
|
JMP syscall·Syscall(SB)
|
||||||
|
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-88
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
JMP syscall·Syscall6(SB)
|
JMP syscall·Syscall6(SB)
|
||||||
|
|
||||||
TEXT ·Syscall9(SB),NOSPLIT,$0-112
|
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||||
JMP syscall·Syscall9(SB)
|
JMP syscall·Syscall9(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-64
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
JMP syscall·RawSyscall(SB)
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
JMP syscall·RawSyscall6(SB)
|
JMP syscall·RawSyscall6(SB)
|
||||||
|
|
30
vendor/golang.org/x/sys/unix/asm_linux_386.s
generated
vendored
30
vendor/golang.org/x/sys/unix/asm_linux_386.s
generated
vendored
|
@ -10,6 +10,10 @@
|
||||||
// System calls for 386, Linux
|
// System calls for 386, Linux
|
||||||
//
|
//
|
||||||
|
|
||||||
|
// See ../runtime/sys_linux_386.s for the reason why we always use int 0x80
|
||||||
|
// instead of the glibc-specific "CALL 0x10(GS)".
|
||||||
|
#define INVOKE_SYSCALL INT $0x80
|
||||||
|
|
||||||
// Just jump to package syscall's implementation for all these functions.
|
// Just jump to package syscall's implementation for all these functions.
|
||||||
// The runtime may know about them.
|
// The runtime may know about them.
|
||||||
|
|
||||||
|
@ -19,12 +23,38 @@ TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
JMP syscall·Syscall6(SB)
|
JMP syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
|
||||||
|
CALL runtime·entersyscall(SB)
|
||||||
|
MOVL trap+0(FP), AX // syscall entry
|
||||||
|
MOVL a1+4(FP), BX
|
||||||
|
MOVL a2+8(FP), CX
|
||||||
|
MOVL a3+12(FP), DX
|
||||||
|
MOVL $0, SI
|
||||||
|
MOVL $0, DI
|
||||||
|
INVOKE_SYSCALL
|
||||||
|
MOVL AX, r1+16(FP)
|
||||||
|
MOVL DX, r2+20(FP)
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
JMP syscall·RawSyscall(SB)
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
JMP syscall·RawSyscall6(SB)
|
JMP syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
|
||||||
|
MOVL trap+0(FP), AX // syscall entry
|
||||||
|
MOVL a1+4(FP), BX
|
||||||
|
MOVL a2+8(FP), CX
|
||||||
|
MOVL a3+12(FP), DX
|
||||||
|
MOVL $0, SI
|
||||||
|
MOVL $0, DI
|
||||||
|
INVOKE_SYSCALL
|
||||||
|
MOVL AX, r1+16(FP)
|
||||||
|
MOVL DX, r2+20(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·socketcall(SB),NOSPLIT,$0-36
|
TEXT ·socketcall(SB),NOSPLIT,$0-36
|
||||||
JMP syscall·socketcall(SB)
|
JMP syscall·socketcall(SB)
|
||||||
|
|
||||||
|
|
28
vendor/golang.org/x/sys/unix/asm_linux_amd64.s
generated
vendored
28
vendor/golang.org/x/sys/unix/asm_linux_amd64.s
generated
vendored
|
@ -19,11 +19,39 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
JMP syscall·Syscall6(SB)
|
JMP syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
CALL runtime·entersyscall(SB)
|
||||||
|
MOVQ a1+8(FP), DI
|
||||||
|
MOVQ a2+16(FP), SI
|
||||||
|
MOVQ a3+24(FP), DX
|
||||||
|
MOVQ $0, R10
|
||||||
|
MOVQ $0, R8
|
||||||
|
MOVQ $0, R9
|
||||||
|
MOVQ trap+0(FP), AX // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVQ AX, r1+32(FP)
|
||||||
|
MOVQ DX, r2+40(FP)
|
||||||
|
CALL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
JMP syscall·RawSyscall(SB)
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
JMP syscall·RawSyscall6(SB)
|
JMP syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
MOVQ a1+8(FP), DI
|
||||||
|
MOVQ a2+16(FP), SI
|
||||||
|
MOVQ a3+24(FP), DX
|
||||||
|
MOVQ $0, R10
|
||||||
|
MOVQ $0, R8
|
||||||
|
MOVQ $0, R9
|
||||||
|
MOVQ trap+0(FP), AX // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVQ AX, r1+32(FP)
|
||||||
|
MOVQ DX, r2+40(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·gettimeofday(SB),NOSPLIT,$0-16
|
TEXT ·gettimeofday(SB),NOSPLIT,$0-16
|
||||||
JMP syscall·gettimeofday(SB)
|
JMP syscall·gettimeofday(SB)
|
||||||
|
|
29
vendor/golang.org/x/sys/unix/asm_linux_arm.s
generated
vendored
29
vendor/golang.org/x/sys/unix/asm_linux_arm.s
generated
vendored
|
@ -19,11 +19,38 @@ TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
B syscall·Syscall6(SB)
|
B syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
|
||||||
|
BL runtime·entersyscall(SB)
|
||||||
|
MOVW trap+0(FP), R7
|
||||||
|
MOVW a1+4(FP), R0
|
||||||
|
MOVW a2+8(FP), R1
|
||||||
|
MOVW a3+12(FP), R2
|
||||||
|
MOVW $0, R3
|
||||||
|
MOVW $0, R4
|
||||||
|
MOVW $0, R5
|
||||||
|
SWI $0
|
||||||
|
MOVW R0, r1+16(FP)
|
||||||
|
MOVW $0, R0
|
||||||
|
MOVW R0, r2+20(FP)
|
||||||
|
BL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
B syscall·RawSyscall(SB)
|
B syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
B syscall·RawSyscall6(SB)
|
B syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
TEXT ·seek(SB),NOSPLIT,$0-32
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
|
||||||
|
MOVW trap+0(FP), R7 // syscall entry
|
||||||
|
MOVW a1+4(FP), R0
|
||||||
|
MOVW a2+8(FP), R1
|
||||||
|
MOVW a3+12(FP), R2
|
||||||
|
SWI $0
|
||||||
|
MOVW R0, r1+16(FP)
|
||||||
|
MOVW $0, R0
|
||||||
|
MOVW R0, r2+20(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·seek(SB),NOSPLIT,$0-28
|
||||||
B syscall·seek(SB)
|
B syscall·seek(SB)
|
||||||
|
|
28
vendor/golang.org/x/sys/unix/asm_linux_arm64.s
generated
vendored
28
vendor/golang.org/x/sys/unix/asm_linux_arm64.s
generated
vendored
|
@ -17,8 +17,36 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
B syscall·Syscall6(SB)
|
B syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
BL runtime·entersyscall(SB)
|
||||||
|
MOVD a1+8(FP), R0
|
||||||
|
MOVD a2+16(FP), R1
|
||||||
|
MOVD a3+24(FP), R2
|
||||||
|
MOVD $0, R3
|
||||||
|
MOVD $0, R4
|
||||||
|
MOVD $0, R5
|
||||||
|
MOVD trap+0(FP), R8 // syscall entry
|
||||||
|
SVC
|
||||||
|
MOVD R0, r1+32(FP) // r1
|
||||||
|
MOVD R1, r2+40(FP) // r2
|
||||||
|
BL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
B syscall·RawSyscall(SB)
|
B syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
B syscall·RawSyscall6(SB)
|
B syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
MOVD a1+8(FP), R0
|
||||||
|
MOVD a2+16(FP), R1
|
||||||
|
MOVD a3+24(FP), R2
|
||||||
|
MOVD $0, R3
|
||||||
|
MOVD $0, R4
|
||||||
|
MOVD $0, R5
|
||||||
|
MOVD trap+0(FP), R8 // syscall entry
|
||||||
|
SVC
|
||||||
|
MOVD R0, r1+32(FP)
|
||||||
|
MOVD R1, r2+40(FP)
|
||||||
|
RET
|
||||||
|
|
28
vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
generated
vendored
28
vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
generated
vendored
|
@ -21,8 +21,36 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
JMP syscall·Syscall6(SB)
|
JMP syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
JAL runtime·entersyscall(SB)
|
||||||
|
MOVV a1+8(FP), R4
|
||||||
|
MOVV a2+16(FP), R5
|
||||||
|
MOVV a3+24(FP), R6
|
||||||
|
MOVV R0, R7
|
||||||
|
MOVV R0, R8
|
||||||
|
MOVV R0, R9
|
||||||
|
MOVV trap+0(FP), R2 // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVV R2, r1+32(FP)
|
||||||
|
MOVV R3, r2+40(FP)
|
||||||
|
JAL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
JMP syscall·RawSyscall(SB)
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
JMP syscall·RawSyscall6(SB)
|
JMP syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
MOVV a1+8(FP), R4
|
||||||
|
MOVV a2+16(FP), R5
|
||||||
|
MOVV a3+24(FP), R6
|
||||||
|
MOVV R0, R7
|
||||||
|
MOVV R0, R8
|
||||||
|
MOVV R0, R9
|
||||||
|
MOVV trap+0(FP), R2 // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVV R2, r1+32(FP)
|
||||||
|
MOVV R3, r2+40(FP)
|
||||||
|
RET
|
||||||
|
|
23
vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
generated
vendored
23
vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
generated
vendored
|
@ -24,8 +24,31 @@ TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||||
JMP syscall·Syscall9(SB)
|
JMP syscall·Syscall9(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-24
|
||||||
|
JAL runtime·entersyscall(SB)
|
||||||
|
MOVW a1+4(FP), R4
|
||||||
|
MOVW a2+8(FP), R5
|
||||||
|
MOVW a3+12(FP), R6
|
||||||
|
MOVW R0, R7
|
||||||
|
MOVW trap+0(FP), R2 // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVW R2, r1+16(FP) // r1
|
||||||
|
MOVW R3, r2+20(FP) // r2
|
||||||
|
JAL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
JMP syscall·RawSyscall(SB)
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
JMP syscall·RawSyscall6(SB)
|
JMP syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24
|
||||||
|
MOVW a1+4(FP), R4
|
||||||
|
MOVW a2+8(FP), R5
|
||||||
|
MOVW a3+12(FP), R6
|
||||||
|
MOVW trap+0(FP), R2 // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVW R2, r1+16(FP)
|
||||||
|
MOVW R3, r2+20(FP)
|
||||||
|
RET
|
||||||
|
|
28
vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
generated
vendored
28
vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
generated
vendored
|
@ -21,8 +21,36 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
BR syscall·Syscall6(SB)
|
BR syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
BL runtime·entersyscall(SB)
|
||||||
|
MOVD a1+8(FP), R3
|
||||||
|
MOVD a2+16(FP), R4
|
||||||
|
MOVD a3+24(FP), R5
|
||||||
|
MOVD R0, R6
|
||||||
|
MOVD R0, R7
|
||||||
|
MOVD R0, R8
|
||||||
|
MOVD trap+0(FP), R9 // syscall entry
|
||||||
|
SYSCALL R9
|
||||||
|
MOVD R3, r1+32(FP)
|
||||||
|
MOVD R4, r2+40(FP)
|
||||||
|
BL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
BR syscall·RawSyscall(SB)
|
BR syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
BR syscall·RawSyscall6(SB)
|
BR syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
MOVD a1+8(FP), R3
|
||||||
|
MOVD a2+16(FP), R4
|
||||||
|
MOVD a3+24(FP), R5
|
||||||
|
MOVD R0, R6
|
||||||
|
MOVD R0, R7
|
||||||
|
MOVD R0, R8
|
||||||
|
MOVD trap+0(FP), R9 // syscall entry
|
||||||
|
SYSCALL R9
|
||||||
|
MOVD R3, r1+32(FP)
|
||||||
|
MOVD R4, r2+40(FP)
|
||||||
|
RET
|
||||||
|
|
28
vendor/golang.org/x/sys/unix/asm_linux_s390x.s
generated
vendored
28
vendor/golang.org/x/sys/unix/asm_linux_s390x.s
generated
vendored
|
@ -21,8 +21,36 @@ TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
BR syscall·Syscall6(SB)
|
BR syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
BL runtime·entersyscall(SB)
|
||||||
|
MOVD a1+8(FP), R2
|
||||||
|
MOVD a2+16(FP), R3
|
||||||
|
MOVD a3+24(FP), R4
|
||||||
|
MOVD $0, R5
|
||||||
|
MOVD $0, R6
|
||||||
|
MOVD $0, R7
|
||||||
|
MOVD trap+0(FP), R1 // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVD R2, r1+32(FP)
|
||||||
|
MOVD R3, r2+40(FP)
|
||||||
|
BL runtime·exitsyscall(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
BR syscall·RawSyscall(SB)
|
BR syscall·RawSyscall(SB)
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
BR syscall·RawSyscall6(SB)
|
BR syscall·RawSyscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
|
||||||
|
MOVD a1+8(FP), R2
|
||||||
|
MOVD a2+16(FP), R3
|
||||||
|
MOVD a3+24(FP), R4
|
||||||
|
MOVD $0, R5
|
||||||
|
MOVD $0, R6
|
||||||
|
MOVD $0, R7
|
||||||
|
MOVD trap+0(FP), R1 // syscall entry
|
||||||
|
SYSCALL
|
||||||
|
MOVD R2, r1+32(FP)
|
||||||
|
MOVD R3, r2+40(FP)
|
||||||
|
RET
|
||||||
|
|
29
vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
generated
vendored
Normal file
29
vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build !gccgo
|
||||||
|
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// System call support for ARM, OpenBSD
|
||||||
|
//
|
||||||
|
|
||||||
|
// Just jump to package syscall's implementation for all these functions.
|
||||||
|
// The runtime may know about them.
|
||||||
|
|
||||||
|
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||||
|
B syscall·Syscall(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
|
B syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||||
|
B syscall·Syscall9(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
|
B syscall·RawSyscall(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
|
B syscall·RawSyscall6(SB)
|
195
vendor/golang.org/x/sys/unix/cap_freebsd.go
generated
vendored
Normal file
195
vendor/golang.org/x/sys/unix/cap_freebsd.go
generated
vendored
Normal file
|
@ -0,0 +1,195 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build freebsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Go implementation of C mostly found in /usr/src/sys/kern/subr_capability.c
|
||||||
|
|
||||||
|
const (
|
||||||
|
// This is the version of CapRights this package understands. See C implementation for parallels.
|
||||||
|
capRightsGoVersion = CAP_RIGHTS_VERSION_00
|
||||||
|
capArSizeMin = CAP_RIGHTS_VERSION_00 + 2
|
||||||
|
capArSizeMax = capRightsGoVersion + 2
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
bit2idx = []int{
|
||||||
|
-1, 0, 1, -1, 2, -1, -1, -1, 3, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
4, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func capidxbit(right uint64) int {
|
||||||
|
return int((right >> 57) & 0x1f)
|
||||||
|
}
|
||||||
|
|
||||||
|
func rightToIndex(right uint64) (int, error) {
|
||||||
|
idx := capidxbit(right)
|
||||||
|
if idx < 0 || idx >= len(bit2idx) {
|
||||||
|
return -2, fmt.Errorf("index for right 0x%x out of range", right)
|
||||||
|
}
|
||||||
|
return bit2idx[idx], nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func caprver(right uint64) int {
|
||||||
|
return int(right >> 62)
|
||||||
|
}
|
||||||
|
|
||||||
|
func capver(rights *CapRights) int {
|
||||||
|
return caprver(rights.Rights[0])
|
||||||
|
}
|
||||||
|
|
||||||
|
func caparsize(rights *CapRights) int {
|
||||||
|
return capver(rights) + 2
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsSet sets the permissions in setrights in rights.
|
||||||
|
func CapRightsSet(rights *CapRights, setrights []uint64) error {
|
||||||
|
// This is essentially a copy of cap_rights_vset()
|
||||||
|
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return fmt.Errorf("bad rights version %d", capver(rights))
|
||||||
|
}
|
||||||
|
|
||||||
|
n := caparsize(rights)
|
||||||
|
if n < capArSizeMin || n > capArSizeMax {
|
||||||
|
return errors.New("bad rights size")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, right := range setrights {
|
||||||
|
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return errors.New("bad right version")
|
||||||
|
}
|
||||||
|
i, err := rightToIndex(right)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if i >= n {
|
||||||
|
return errors.New("index overflow")
|
||||||
|
}
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errors.New("index mismatch")
|
||||||
|
}
|
||||||
|
rights.Rights[i] |= right
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errors.New("index mismatch (after assign)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsClear clears the permissions in clearrights from rights.
|
||||||
|
func CapRightsClear(rights *CapRights, clearrights []uint64) error {
|
||||||
|
// This is essentially a copy of cap_rights_vclear()
|
||||||
|
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return fmt.Errorf("bad rights version %d", capver(rights))
|
||||||
|
}
|
||||||
|
|
||||||
|
n := caparsize(rights)
|
||||||
|
if n < capArSizeMin || n > capArSizeMax {
|
||||||
|
return errors.New("bad rights size")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, right := range clearrights {
|
||||||
|
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return errors.New("bad right version")
|
||||||
|
}
|
||||||
|
i, err := rightToIndex(right)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if i >= n {
|
||||||
|
return errors.New("index overflow")
|
||||||
|
}
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errors.New("index mismatch")
|
||||||
|
}
|
||||||
|
rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return errors.New("index mismatch (after assign)")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsIsSet checks whether all the permissions in setrights are present in rights.
|
||||||
|
func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
|
||||||
|
// This is essentially a copy of cap_rights_is_vset()
|
||||||
|
if capver(rights) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return false, fmt.Errorf("bad rights version %d", capver(rights))
|
||||||
|
}
|
||||||
|
|
||||||
|
n := caparsize(rights)
|
||||||
|
if n < capArSizeMin || n > capArSizeMax {
|
||||||
|
return false, errors.New("bad rights size")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, right := range setrights {
|
||||||
|
if caprver(right) != CAP_RIGHTS_VERSION_00 {
|
||||||
|
return false, errors.New("bad right version")
|
||||||
|
}
|
||||||
|
i, err := rightToIndex(right)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
if i >= n {
|
||||||
|
return false, errors.New("index overflow")
|
||||||
|
}
|
||||||
|
if capidxbit(rights.Rights[i]) != capidxbit(right) {
|
||||||
|
return false, errors.New("index mismatch")
|
||||||
|
}
|
||||||
|
if (rights.Rights[i] & right) != right {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func capright(idx uint64, bit uint64) uint64 {
|
||||||
|
return ((1 << (57 + idx)) | bit)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsInit returns a pointer to an initialised CapRights structure filled with rights.
|
||||||
|
// See man cap_rights_init(3) and rights(4).
|
||||||
|
func CapRightsInit(rights []uint64) (*CapRights, error) {
|
||||||
|
var r CapRights
|
||||||
|
r.Rights[0] = (capRightsGoVersion << 62) | capright(0, 0)
|
||||||
|
r.Rights[1] = capright(1, 0)
|
||||||
|
|
||||||
|
err := CapRightsSet(&r, rights)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &r, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsLimit reduces the operations permitted on fd to at most those contained in rights.
|
||||||
|
// The capability rights on fd can never be increased by CapRightsLimit.
|
||||||
|
// See man cap_rights_limit(2) and rights(4).
|
||||||
|
func CapRightsLimit(fd uintptr, rights *CapRights) error {
|
||||||
|
return capRightsLimit(int(fd), rights)
|
||||||
|
}
|
||||||
|
|
||||||
|
// CapRightsGet returns a CapRights structure containing the operations permitted on fd.
|
||||||
|
// See man cap_rights_get(3) and rights(4).
|
||||||
|
func CapRightsGet(fd uintptr) (*CapRights, error) {
|
||||||
|
r, err := CapRightsInit(nil)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
err = capRightsGet(capRightsGoVersion, int(fd), r)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return r, nil
|
||||||
|
}
|
24
vendor/golang.org/x/sys/unix/dev_darwin.go
generated
vendored
Normal file
24
vendor/golang.org/x/sys/unix/dev_darwin.go
generated
vendored
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in Darwin's sys/types.h header.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a Darwin device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev >> 24) & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a Darwin device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(dev & 0xffffff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a Darwin device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return (uint64(major) << 24) | uint64(minor)
|
||||||
|
}
|
30
vendor/golang.org/x/sys/unix/dev_dragonfly.go
generated
vendored
Normal file
30
vendor/golang.org/x/sys/unix/dev_dragonfly.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in Dragonfly's sys/types.h header.
|
||||||
|
//
|
||||||
|
// The information below is extracted and adapted from sys/types.h:
|
||||||
|
//
|
||||||
|
// Minor gives a cookie instead of an index since in order to avoid changing the
|
||||||
|
// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
|
||||||
|
// devices that don't use them.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a DragonFlyBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev >> 8) & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a DragonFlyBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(dev & 0xffff00ff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a DragonFlyBSD device number generated from the given major and
|
||||||
|
// minor components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return (uint64(major) << 8) | uint64(minor)
|
||||||
|
}
|
30
vendor/golang.org/x/sys/unix/dev_freebsd.go
generated
vendored
Normal file
30
vendor/golang.org/x/sys/unix/dev_freebsd.go
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in FreeBSD's sys/types.h header.
|
||||||
|
//
|
||||||
|
// The information below is extracted and adapted from sys/types.h:
|
||||||
|
//
|
||||||
|
// Minor gives a cookie instead of an index since in order to avoid changing the
|
||||||
|
// meanings of bits 0-15 or wasting time and space shifting bits 16-31 for
|
||||||
|
// devices that don't use them.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a FreeBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev >> 8) & 0xff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a FreeBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(dev & 0xffff00ff)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a FreeBSD device number generated from the given major and
|
||||||
|
// minor components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return (uint64(major) << 8) | uint64(minor)
|
||||||
|
}
|
42
vendor/golang.org/x/sys/unix/dev_linux.go
generated
vendored
Normal file
42
vendor/golang.org/x/sys/unix/dev_linux.go
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used by the Linux kernel and glibc.
|
||||||
|
//
|
||||||
|
// The information below is extracted and adapted from bits/sysmacros.h in the
|
||||||
|
// glibc sources:
|
||||||
|
//
|
||||||
|
// dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's
|
||||||
|
// default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major
|
||||||
|
// number and m is a hex digit of the minor number. This is backward compatible
|
||||||
|
// with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also
|
||||||
|
// backward compatible with the Linux kernel, which for some architectures uses
|
||||||
|
// 32-bit dev_t, encoded as mmmM MMmm.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a Linux device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
major := uint32((dev & 0x00000000000fff00) >> 8)
|
||||||
|
major |= uint32((dev & 0xfffff00000000000) >> 32)
|
||||||
|
return major
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a Linux device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
minor := uint32((dev & 0x00000000000000ff) >> 0)
|
||||||
|
minor |= uint32((dev & 0x00000ffffff00000) >> 12)
|
||||||
|
return minor
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a Linux device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
dev := (uint64(major) & 0x00000fff) << 8
|
||||||
|
dev |= (uint64(major) & 0xfffff000) << 32
|
||||||
|
dev |= (uint64(minor) & 0x000000ff) << 0
|
||||||
|
dev |= (uint64(minor) & 0xffffff00) << 12
|
||||||
|
return dev
|
||||||
|
}
|
29
vendor/golang.org/x/sys/unix/dev_netbsd.go
generated
vendored
Normal file
29
vendor/golang.org/x/sys/unix/dev_netbsd.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in NetBSD's sys/types.h header.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of a NetBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev & 0x000fff00) >> 8)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of a NetBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
minor := uint32((dev & 0x000000ff) >> 0)
|
||||||
|
minor |= uint32((dev & 0xfff00000) >> 12)
|
||||||
|
return minor
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns a NetBSD device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
dev := (uint64(major) << 8) & 0x000fff00
|
||||||
|
dev |= (uint64(minor) << 12) & 0xfff00000
|
||||||
|
dev |= (uint64(minor) << 0) & 0x000000ff
|
||||||
|
return dev
|
||||||
|
}
|
29
vendor/golang.org/x/sys/unix/dev_openbsd.go
generated
vendored
Normal file
29
vendor/golang.org/x/sys/unix/dev_openbsd.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Functions to access/create device major and minor numbers matching the
|
||||||
|
// encoding used in OpenBSD's sys/types.h header.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// Major returns the major component of an OpenBSD device number.
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32((dev & 0x0000ff00) >> 8)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Minor returns the minor component of an OpenBSD device number.
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
minor := uint32((dev & 0x000000ff) >> 0)
|
||||||
|
minor |= uint32((dev & 0xffff0000) >> 8)
|
||||||
|
return minor
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mkdev returns an OpenBSD device number generated from the given major and minor
|
||||||
|
// components.
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
dev := (uint64(major) << 8) & 0x0000ff00
|
||||||
|
dev |= (uint64(minor) << 8) & 0xffff0000
|
||||||
|
dev |= (uint64(minor) << 0) & 0x000000ff
|
||||||
|
return dev
|
||||||
|
}
|
89
vendor/golang.org/x/sys/unix/dirent.go
generated
vendored
89
vendor/golang.org/x/sys/unix/dirent.go
generated
vendored
|
@ -6,97 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import "unsafe"
|
import "syscall"
|
||||||
|
|
||||||
// readInt returns the size-bytes unsigned integer in native byte order at offset off.
|
|
||||||
func readInt(b []byte, off, size uintptr) (u uint64, ok bool) {
|
|
||||||
if len(b) < int(off+size) {
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
if isBigEndian {
|
|
||||||
return readIntBE(b[off:], size), true
|
|
||||||
}
|
|
||||||
return readIntLE(b[off:], size), true
|
|
||||||
}
|
|
||||||
|
|
||||||
func readIntBE(b []byte, size uintptr) uint64 {
|
|
||||||
switch size {
|
|
||||||
case 1:
|
|
||||||
return uint64(b[0])
|
|
||||||
case 2:
|
|
||||||
_ = b[1] // bounds check hint to compiler; see golang.org/issue/14808
|
|
||||||
return uint64(b[1]) | uint64(b[0])<<8
|
|
||||||
case 4:
|
|
||||||
_ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
|
|
||||||
return uint64(b[3]) | uint64(b[2])<<8 | uint64(b[1])<<16 | uint64(b[0])<<24
|
|
||||||
case 8:
|
|
||||||
_ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
|
|
||||||
return uint64(b[7]) | uint64(b[6])<<8 | uint64(b[5])<<16 | uint64(b[4])<<24 |
|
|
||||||
uint64(b[3])<<32 | uint64(b[2])<<40 | uint64(b[1])<<48 | uint64(b[0])<<56
|
|
||||||
default:
|
|
||||||
panic("syscall: readInt with unsupported size")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func readIntLE(b []byte, size uintptr) uint64 {
|
|
||||||
switch size {
|
|
||||||
case 1:
|
|
||||||
return uint64(b[0])
|
|
||||||
case 2:
|
|
||||||
_ = b[1] // bounds check hint to compiler; see golang.org/issue/14808
|
|
||||||
return uint64(b[0]) | uint64(b[1])<<8
|
|
||||||
case 4:
|
|
||||||
_ = b[3] // bounds check hint to compiler; see golang.org/issue/14808
|
|
||||||
return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24
|
|
||||||
case 8:
|
|
||||||
_ = b[7] // bounds check hint to compiler; see golang.org/issue/14808
|
|
||||||
return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 |
|
|
||||||
uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
|
|
||||||
default:
|
|
||||||
panic("syscall: readInt with unsupported size")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ParseDirent parses up to max directory entries in buf,
|
// ParseDirent parses up to max directory entries in buf,
|
||||||
// appending the names to names. It returns the number of
|
// appending the names to names. It returns the number of
|
||||||
// bytes consumed from buf, the number of entries added
|
// bytes consumed from buf, the number of entries added
|
||||||
// to names, and the new names slice.
|
// to names, and the new names slice.
|
||||||
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) {
|
||||||
origlen := len(buf)
|
return syscall.ParseDirent(buf, max, names)
|
||||||
count = 0
|
|
||||||
for max != 0 && len(buf) > 0 {
|
|
||||||
reclen, ok := direntReclen(buf)
|
|
||||||
if !ok || reclen > uint64(len(buf)) {
|
|
||||||
return origlen, count, names
|
|
||||||
}
|
|
||||||
rec := buf[:reclen]
|
|
||||||
buf = buf[reclen:]
|
|
||||||
ino, ok := direntIno(rec)
|
|
||||||
if !ok {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
if ino == 0 { // File absent in directory.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
const namoff = uint64(unsafe.Offsetof(Dirent{}.Name))
|
|
||||||
namlen, ok := direntNamlen(rec)
|
|
||||||
if !ok || namoff+namlen > uint64(len(rec)) {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
name := rec[namoff : namoff+namlen]
|
|
||||||
for i, c := range name {
|
|
||||||
if c == 0 {
|
|
||||||
name = name[:i]
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Check for useless names before allocating a string.
|
|
||||||
if string(name) == "." || string(name) == ".." {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
max--
|
|
||||||
count++
|
|
||||||
names = append(names, string(name))
|
|
||||||
}
|
|
||||||
return origlen - len(buf), count, names
|
|
||||||
}
|
}
|
||||||
|
|
4
vendor/golang.org/x/sys/unix/env_unix.go
generated
vendored
4
vendor/golang.org/x/sys/unix/env_unix.go
generated
vendored
|
@ -25,3 +25,7 @@ func Clearenv() {
|
||||||
func Environ() []string {
|
func Environ() []string {
|
||||||
return syscall.Environ()
|
return syscall.Environ()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Unsetenv(key string) error {
|
||||||
|
return syscall.Unsetenv(key)
|
||||||
|
}
|
||||||
|
|
14
vendor/golang.org/x/sys/unix/env_unset.go
generated
vendored
14
vendor/golang.org/x/sys/unix/env_unset.go
generated
vendored
|
@ -1,14 +0,0 @@
|
||||||
// Copyright 2014 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build go1.4
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import "syscall"
|
|
||||||
|
|
||||||
func Unsetenv(key string) error {
|
|
||||||
// This was added in Go 1.4.
|
|
||||||
return syscall.Unsetenv(key)
|
|
||||||
}
|
|
227
vendor/golang.org/x/sys/unix/errors_freebsd_386.go
generated
vendored
Normal file
227
vendor/golang.org/x/sys/unix/errors_freebsd_386.go
generated
vendored
Normal file
|
@ -0,0 +1,227 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
|
||||||
|
// them here for backwards compatibility.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
IFF_SMART = 0x20
|
||||||
|
IFT_1822 = 0x2
|
||||||
|
IFT_A12MPPSWITCH = 0x82
|
||||||
|
IFT_AAL2 = 0xbb
|
||||||
|
IFT_AAL5 = 0x31
|
||||||
|
IFT_ADSL = 0x5e
|
||||||
|
IFT_AFLANE8023 = 0x3b
|
||||||
|
IFT_AFLANE8025 = 0x3c
|
||||||
|
IFT_ARAP = 0x58
|
||||||
|
IFT_ARCNET = 0x23
|
||||||
|
IFT_ARCNETPLUS = 0x24
|
||||||
|
IFT_ASYNC = 0x54
|
||||||
|
IFT_ATM = 0x25
|
||||||
|
IFT_ATMDXI = 0x69
|
||||||
|
IFT_ATMFUNI = 0x6a
|
||||||
|
IFT_ATMIMA = 0x6b
|
||||||
|
IFT_ATMLOGICAL = 0x50
|
||||||
|
IFT_ATMRADIO = 0xbd
|
||||||
|
IFT_ATMSUBINTERFACE = 0x86
|
||||||
|
IFT_ATMVCIENDPT = 0xc2
|
||||||
|
IFT_ATMVIRTUAL = 0x95
|
||||||
|
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CCTEMUL = 0x3d
|
||||||
|
IFT_CEPT = 0x13
|
||||||
|
IFT_CES = 0x85
|
||||||
|
IFT_CHANNEL = 0x46
|
||||||
|
IFT_CNR = 0x55
|
||||||
|
IFT_COFFEE = 0x84
|
||||||
|
IFT_COMPOSITELINK = 0x9b
|
||||||
|
IFT_DCN = 0x8d
|
||||||
|
IFT_DIGITALPOWERLINE = 0x8a
|
||||||
|
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||||
|
IFT_DLSW = 0x4a
|
||||||
|
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||||
|
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||||
|
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAITH = 0xf2
|
||||||
|
IFT_FAST = 0x7d
|
||||||
|
IFT_FASTETHER = 0x3e
|
||||||
|
IFT_FASTETHERFX = 0x45
|
||||||
|
IFT_FDDI = 0xf
|
||||||
|
IFT_FIBRECHANNEL = 0x38
|
||||||
|
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||||
|
IFT_FRAMERELAYMPI = 0x5c
|
||||||
|
IFT_FRDLCIENDPT = 0xc1
|
||||||
|
IFT_FRELAY = 0x20
|
||||||
|
IFT_FRELAYDCE = 0x2c
|
||||||
|
IFT_FRF16MFRBUNDLE = 0xa3
|
||||||
|
IFT_FRFORWARD = 0x9e
|
||||||
|
IFT_G703AT2MB = 0x43
|
||||||
|
IFT_G703AT64K = 0x42
|
||||||
|
IFT_GIF = 0xf0
|
||||||
|
IFT_GIGABITETHERNET = 0x75
|
||||||
|
IFT_GR303IDT = 0xb2
|
||||||
|
IFT_GR303RDT = 0xb1
|
||||||
|
IFT_H323GATEKEEPER = 0xa4
|
||||||
|
IFT_H323PROXY = 0xa5
|
||||||
|
IFT_HDH1822 = 0x3
|
||||||
|
IFT_HDLC = 0x76
|
||||||
|
IFT_HDSL2 = 0xa8
|
||||||
|
IFT_HIPERLAN2 = 0xb7
|
||||||
|
IFT_HIPPI = 0x2f
|
||||||
|
IFT_HIPPIINTERFACE = 0x39
|
||||||
|
IFT_HOSTPAD = 0x5a
|
||||||
|
IFT_HSSI = 0x2e
|
||||||
|
IFT_HY = 0xe
|
||||||
|
IFT_IBM370PARCHAN = 0x48
|
||||||
|
IFT_IDSL = 0x9a
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INTERLEAVE = 0x7c
|
||||||
|
IFT_IP = 0x7e
|
||||||
|
IFT_IPFORWARD = 0x8e
|
||||||
|
IFT_IPOVERATM = 0x72
|
||||||
|
IFT_IPOVERCDLC = 0x6d
|
||||||
|
IFT_IPOVERCLAW = 0x6e
|
||||||
|
IFT_IPSWITCH = 0x4e
|
||||||
|
IFT_IPXIP = 0xf9
|
||||||
|
IFT_ISDN = 0x3f
|
||||||
|
IFT_ISDNBASIC = 0x14
|
||||||
|
IFT_ISDNPRIMARY = 0x15
|
||||||
|
IFT_ISDNS = 0x4b
|
||||||
|
IFT_ISDNU = 0x4c
|
||||||
|
IFT_ISO88022LLC = 0x29
|
||||||
|
IFT_ISO88023 = 0x7
|
||||||
|
IFT_ISO88024 = 0x8
|
||||||
|
IFT_ISO88025 = 0x9
|
||||||
|
IFT_ISO88025CRFPINT = 0x62
|
||||||
|
IFT_ISO88025DTR = 0x56
|
||||||
|
IFT_ISO88025FIBER = 0x73
|
||||||
|
IFT_ISO88026 = 0xa
|
||||||
|
IFT_ISUP = 0xb3
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MEDIAMAILOVERIP = 0x8b
|
||||||
|
IFT_MFSIGLINK = 0xa7
|
||||||
|
IFT_MIOX25 = 0x26
|
||||||
|
IFT_MODEM = 0x30
|
||||||
|
IFT_MPC = 0x71
|
||||||
|
IFT_MPLS = 0xa6
|
||||||
|
IFT_MPLSTUNNEL = 0x96
|
||||||
|
IFT_MSDSL = 0x8f
|
||||||
|
IFT_MVL = 0xbf
|
||||||
|
IFT_MYRINET = 0x63
|
||||||
|
IFT_NFAS = 0xaf
|
||||||
|
IFT_NSIP = 0x1b
|
||||||
|
IFT_OPTICALCHANNEL = 0xc3
|
||||||
|
IFT_OPTICALTRANSPORT = 0xc4
|
||||||
|
IFT_OTHER = 0x1
|
||||||
|
IFT_P10 = 0xc
|
||||||
|
IFT_P80 = 0xd
|
||||||
|
IFT_PARA = 0x22
|
||||||
|
IFT_PFLOG = 0xf6
|
||||||
|
IFT_PFSYNC = 0xf7
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf1
|
||||||
|
IFT_QLLC = 0x44
|
||||||
|
IFT_RADIOMAC = 0xbc
|
||||||
|
IFT_RADSL = 0x5f
|
||||||
|
IFT_REACHDSL = 0xc0
|
||||||
|
IFT_RFC1483 = 0x9f
|
||||||
|
IFT_RS232 = 0x21
|
||||||
|
IFT_RSRB = 0x4f
|
||||||
|
IFT_SDLC = 0x11
|
||||||
|
IFT_SDSL = 0x60
|
||||||
|
IFT_SHDSL = 0xa9
|
||||||
|
IFT_SIP = 0x1f
|
||||||
|
IFT_SLIP = 0x1c
|
||||||
|
IFT_SMDSDXI = 0x2b
|
||||||
|
IFT_SMDSICIP = 0x34
|
||||||
|
IFT_SONET = 0x27
|
||||||
|
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||||
|
IFT_SONETPATH = 0x32
|
||||||
|
IFT_SONETVT = 0x33
|
||||||
|
IFT_SRP = 0x97
|
||||||
|
IFT_SS7SIGLINK = 0x9c
|
||||||
|
IFT_STACKTOSTACK = 0x6f
|
||||||
|
IFT_STARLAN = 0xb
|
||||||
|
IFT_STF = 0xd7
|
||||||
|
IFT_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TERMPAD = 0x5b
|
||||||
|
IFT_TR008 = 0xb0
|
||||||
|
IFT_TRANSPHDLC = 0x7b
|
||||||
|
IFT_TUNNEL = 0x83
|
||||||
|
IFT_ULTRA = 0x1d
|
||||||
|
IFT_USB = 0xa0
|
||||||
|
IFT_V11 = 0x40
|
||||||
|
IFT_V35 = 0x2d
|
||||||
|
IFT_V36 = 0x41
|
||||||
|
IFT_V37 = 0x78
|
||||||
|
IFT_VDSL = 0x61
|
||||||
|
IFT_VIRTUALIPADDRESS = 0x70
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||||
|
IFT_VOICEOVERIP = 0x68
|
||||||
|
IFT_X213 = 0x5d
|
||||||
|
IFT_X25 = 0x5
|
||||||
|
IFT_X25DDN = 0x4
|
||||||
|
IFT_X25HUNTGROUP = 0x7a
|
||||||
|
IFT_X25MLP = 0x79
|
||||||
|
IFT_X25PLE = 0x28
|
||||||
|
IFT_XETHER = 0x1a
|
||||||
|
IPPROTO_MAXID = 0x34
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IP_FAITH = 0x16
|
||||||
|
MAP_NORESERVE = 0x40
|
||||||
|
MAP_RENAME = 0x20
|
||||||
|
NET_RT_MAXID = 0x6
|
||||||
|
RTF_PRCLONING = 0x10000
|
||||||
|
RTM_OLDADD = 0x9
|
||||||
|
RTM_OLDDEL = 0xa
|
||||||
|
SIOCADDRT = 0x8030720a
|
||||||
|
SIOCALIFADDR = 0x8118691b
|
||||||
|
SIOCDELRT = 0x8030720b
|
||||||
|
SIOCDLIFADDR = 0x8118691d
|
||||||
|
SIOCGLIFADDR = 0xc118691c
|
||||||
|
SIOCGLIFPHYADDR = 0xc118694b
|
||||||
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
|
)
|
227
vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
generated
vendored
Normal file
227
vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
generated
vendored
Normal file
|
@ -0,0 +1,227 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
|
||||||
|
// them here for backwards compatibility.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
IFF_SMART = 0x20
|
||||||
|
IFT_1822 = 0x2
|
||||||
|
IFT_A12MPPSWITCH = 0x82
|
||||||
|
IFT_AAL2 = 0xbb
|
||||||
|
IFT_AAL5 = 0x31
|
||||||
|
IFT_ADSL = 0x5e
|
||||||
|
IFT_AFLANE8023 = 0x3b
|
||||||
|
IFT_AFLANE8025 = 0x3c
|
||||||
|
IFT_ARAP = 0x58
|
||||||
|
IFT_ARCNET = 0x23
|
||||||
|
IFT_ARCNETPLUS = 0x24
|
||||||
|
IFT_ASYNC = 0x54
|
||||||
|
IFT_ATM = 0x25
|
||||||
|
IFT_ATMDXI = 0x69
|
||||||
|
IFT_ATMFUNI = 0x6a
|
||||||
|
IFT_ATMIMA = 0x6b
|
||||||
|
IFT_ATMLOGICAL = 0x50
|
||||||
|
IFT_ATMRADIO = 0xbd
|
||||||
|
IFT_ATMSUBINTERFACE = 0x86
|
||||||
|
IFT_ATMVCIENDPT = 0xc2
|
||||||
|
IFT_ATMVIRTUAL = 0x95
|
||||||
|
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CCTEMUL = 0x3d
|
||||||
|
IFT_CEPT = 0x13
|
||||||
|
IFT_CES = 0x85
|
||||||
|
IFT_CHANNEL = 0x46
|
||||||
|
IFT_CNR = 0x55
|
||||||
|
IFT_COFFEE = 0x84
|
||||||
|
IFT_COMPOSITELINK = 0x9b
|
||||||
|
IFT_DCN = 0x8d
|
||||||
|
IFT_DIGITALPOWERLINE = 0x8a
|
||||||
|
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||||
|
IFT_DLSW = 0x4a
|
||||||
|
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||||
|
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||||
|
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAITH = 0xf2
|
||||||
|
IFT_FAST = 0x7d
|
||||||
|
IFT_FASTETHER = 0x3e
|
||||||
|
IFT_FASTETHERFX = 0x45
|
||||||
|
IFT_FDDI = 0xf
|
||||||
|
IFT_FIBRECHANNEL = 0x38
|
||||||
|
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||||
|
IFT_FRAMERELAYMPI = 0x5c
|
||||||
|
IFT_FRDLCIENDPT = 0xc1
|
||||||
|
IFT_FRELAY = 0x20
|
||||||
|
IFT_FRELAYDCE = 0x2c
|
||||||
|
IFT_FRF16MFRBUNDLE = 0xa3
|
||||||
|
IFT_FRFORWARD = 0x9e
|
||||||
|
IFT_G703AT2MB = 0x43
|
||||||
|
IFT_G703AT64K = 0x42
|
||||||
|
IFT_GIF = 0xf0
|
||||||
|
IFT_GIGABITETHERNET = 0x75
|
||||||
|
IFT_GR303IDT = 0xb2
|
||||||
|
IFT_GR303RDT = 0xb1
|
||||||
|
IFT_H323GATEKEEPER = 0xa4
|
||||||
|
IFT_H323PROXY = 0xa5
|
||||||
|
IFT_HDH1822 = 0x3
|
||||||
|
IFT_HDLC = 0x76
|
||||||
|
IFT_HDSL2 = 0xa8
|
||||||
|
IFT_HIPERLAN2 = 0xb7
|
||||||
|
IFT_HIPPI = 0x2f
|
||||||
|
IFT_HIPPIINTERFACE = 0x39
|
||||||
|
IFT_HOSTPAD = 0x5a
|
||||||
|
IFT_HSSI = 0x2e
|
||||||
|
IFT_HY = 0xe
|
||||||
|
IFT_IBM370PARCHAN = 0x48
|
||||||
|
IFT_IDSL = 0x9a
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INTERLEAVE = 0x7c
|
||||||
|
IFT_IP = 0x7e
|
||||||
|
IFT_IPFORWARD = 0x8e
|
||||||
|
IFT_IPOVERATM = 0x72
|
||||||
|
IFT_IPOVERCDLC = 0x6d
|
||||||
|
IFT_IPOVERCLAW = 0x6e
|
||||||
|
IFT_IPSWITCH = 0x4e
|
||||||
|
IFT_IPXIP = 0xf9
|
||||||
|
IFT_ISDN = 0x3f
|
||||||
|
IFT_ISDNBASIC = 0x14
|
||||||
|
IFT_ISDNPRIMARY = 0x15
|
||||||
|
IFT_ISDNS = 0x4b
|
||||||
|
IFT_ISDNU = 0x4c
|
||||||
|
IFT_ISO88022LLC = 0x29
|
||||||
|
IFT_ISO88023 = 0x7
|
||||||
|
IFT_ISO88024 = 0x8
|
||||||
|
IFT_ISO88025 = 0x9
|
||||||
|
IFT_ISO88025CRFPINT = 0x62
|
||||||
|
IFT_ISO88025DTR = 0x56
|
||||||
|
IFT_ISO88025FIBER = 0x73
|
||||||
|
IFT_ISO88026 = 0xa
|
||||||
|
IFT_ISUP = 0xb3
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MEDIAMAILOVERIP = 0x8b
|
||||||
|
IFT_MFSIGLINK = 0xa7
|
||||||
|
IFT_MIOX25 = 0x26
|
||||||
|
IFT_MODEM = 0x30
|
||||||
|
IFT_MPC = 0x71
|
||||||
|
IFT_MPLS = 0xa6
|
||||||
|
IFT_MPLSTUNNEL = 0x96
|
||||||
|
IFT_MSDSL = 0x8f
|
||||||
|
IFT_MVL = 0xbf
|
||||||
|
IFT_MYRINET = 0x63
|
||||||
|
IFT_NFAS = 0xaf
|
||||||
|
IFT_NSIP = 0x1b
|
||||||
|
IFT_OPTICALCHANNEL = 0xc3
|
||||||
|
IFT_OPTICALTRANSPORT = 0xc4
|
||||||
|
IFT_OTHER = 0x1
|
||||||
|
IFT_P10 = 0xc
|
||||||
|
IFT_P80 = 0xd
|
||||||
|
IFT_PARA = 0x22
|
||||||
|
IFT_PFLOG = 0xf6
|
||||||
|
IFT_PFSYNC = 0xf7
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf1
|
||||||
|
IFT_QLLC = 0x44
|
||||||
|
IFT_RADIOMAC = 0xbc
|
||||||
|
IFT_RADSL = 0x5f
|
||||||
|
IFT_REACHDSL = 0xc0
|
||||||
|
IFT_RFC1483 = 0x9f
|
||||||
|
IFT_RS232 = 0x21
|
||||||
|
IFT_RSRB = 0x4f
|
||||||
|
IFT_SDLC = 0x11
|
||||||
|
IFT_SDSL = 0x60
|
||||||
|
IFT_SHDSL = 0xa9
|
||||||
|
IFT_SIP = 0x1f
|
||||||
|
IFT_SLIP = 0x1c
|
||||||
|
IFT_SMDSDXI = 0x2b
|
||||||
|
IFT_SMDSICIP = 0x34
|
||||||
|
IFT_SONET = 0x27
|
||||||
|
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||||
|
IFT_SONETPATH = 0x32
|
||||||
|
IFT_SONETVT = 0x33
|
||||||
|
IFT_SRP = 0x97
|
||||||
|
IFT_SS7SIGLINK = 0x9c
|
||||||
|
IFT_STACKTOSTACK = 0x6f
|
||||||
|
IFT_STARLAN = 0xb
|
||||||
|
IFT_STF = 0xd7
|
||||||
|
IFT_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TERMPAD = 0x5b
|
||||||
|
IFT_TR008 = 0xb0
|
||||||
|
IFT_TRANSPHDLC = 0x7b
|
||||||
|
IFT_TUNNEL = 0x83
|
||||||
|
IFT_ULTRA = 0x1d
|
||||||
|
IFT_USB = 0xa0
|
||||||
|
IFT_V11 = 0x40
|
||||||
|
IFT_V35 = 0x2d
|
||||||
|
IFT_V36 = 0x41
|
||||||
|
IFT_V37 = 0x78
|
||||||
|
IFT_VDSL = 0x61
|
||||||
|
IFT_VIRTUALIPADDRESS = 0x70
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||||
|
IFT_VOICEOVERIP = 0x68
|
||||||
|
IFT_X213 = 0x5d
|
||||||
|
IFT_X25 = 0x5
|
||||||
|
IFT_X25DDN = 0x4
|
||||||
|
IFT_X25HUNTGROUP = 0x7a
|
||||||
|
IFT_X25MLP = 0x79
|
||||||
|
IFT_X25PLE = 0x28
|
||||||
|
IFT_XETHER = 0x1a
|
||||||
|
IPPROTO_MAXID = 0x34
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IP_FAITH = 0x16
|
||||||
|
MAP_NORESERVE = 0x40
|
||||||
|
MAP_RENAME = 0x20
|
||||||
|
NET_RT_MAXID = 0x6
|
||||||
|
RTF_PRCLONING = 0x10000
|
||||||
|
RTM_OLDADD = 0x9
|
||||||
|
RTM_OLDDEL = 0xa
|
||||||
|
SIOCADDRT = 0x8040720a
|
||||||
|
SIOCALIFADDR = 0x8118691b
|
||||||
|
SIOCDELRT = 0x8040720b
|
||||||
|
SIOCDLIFADDR = 0x8118691d
|
||||||
|
SIOCGLIFADDR = 0xc118691c
|
||||||
|
SIOCGLIFPHYADDR = 0xc118694b
|
||||||
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
|
)
|
226
vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
generated
vendored
Normal file
226
vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,226 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
const (
|
||||||
|
IFT_1822 = 0x2
|
||||||
|
IFT_A12MPPSWITCH = 0x82
|
||||||
|
IFT_AAL2 = 0xbb
|
||||||
|
IFT_AAL5 = 0x31
|
||||||
|
IFT_ADSL = 0x5e
|
||||||
|
IFT_AFLANE8023 = 0x3b
|
||||||
|
IFT_AFLANE8025 = 0x3c
|
||||||
|
IFT_ARAP = 0x58
|
||||||
|
IFT_ARCNET = 0x23
|
||||||
|
IFT_ARCNETPLUS = 0x24
|
||||||
|
IFT_ASYNC = 0x54
|
||||||
|
IFT_ATM = 0x25
|
||||||
|
IFT_ATMDXI = 0x69
|
||||||
|
IFT_ATMFUNI = 0x6a
|
||||||
|
IFT_ATMIMA = 0x6b
|
||||||
|
IFT_ATMLOGICAL = 0x50
|
||||||
|
IFT_ATMRADIO = 0xbd
|
||||||
|
IFT_ATMSUBINTERFACE = 0x86
|
||||||
|
IFT_ATMVCIENDPT = 0xc2
|
||||||
|
IFT_ATMVIRTUAL = 0x95
|
||||||
|
IFT_BGPPOLICYACCOUNTING = 0xa2
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CCTEMUL = 0x3d
|
||||||
|
IFT_CEPT = 0x13
|
||||||
|
IFT_CES = 0x85
|
||||||
|
IFT_CHANNEL = 0x46
|
||||||
|
IFT_CNR = 0x55
|
||||||
|
IFT_COFFEE = 0x84
|
||||||
|
IFT_COMPOSITELINK = 0x9b
|
||||||
|
IFT_DCN = 0x8d
|
||||||
|
IFT_DIGITALPOWERLINE = 0x8a
|
||||||
|
IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
|
||||||
|
IFT_DLSW = 0x4a
|
||||||
|
IFT_DOCSCABLEDOWNSTREAM = 0x80
|
||||||
|
IFT_DOCSCABLEMACLAYER = 0x7f
|
||||||
|
IFT_DOCSCABLEUPSTREAM = 0x81
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAST = 0x7d
|
||||||
|
IFT_FASTETHER = 0x3e
|
||||||
|
IFT_FASTETHERFX = 0x45
|
||||||
|
IFT_FDDI = 0xf
|
||||||
|
IFT_FIBRECHANNEL = 0x38
|
||||||
|
IFT_FRAMERELAYINTERCONNECT = 0x3a
|
||||||
|
IFT_FRAMERELAYMPI = 0x5c
|
||||||
|
IFT_FRDLCIENDPT = 0xc1
|
||||||
|
IFT_FRELAY = 0x20
|
||||||
|
IFT_FRELAYDCE = 0x2c
|
||||||
|
IFT_FRF16MFRBUNDLE = 0xa3
|
||||||
|
IFT_FRFORWARD = 0x9e
|
||||||
|
IFT_G703AT2MB = 0x43
|
||||||
|
IFT_G703AT64K = 0x42
|
||||||
|
IFT_GIF = 0xf0
|
||||||
|
IFT_GIGABITETHERNET = 0x75
|
||||||
|
IFT_GR303IDT = 0xb2
|
||||||
|
IFT_GR303RDT = 0xb1
|
||||||
|
IFT_H323GATEKEEPER = 0xa4
|
||||||
|
IFT_H323PROXY = 0xa5
|
||||||
|
IFT_HDH1822 = 0x3
|
||||||
|
IFT_HDLC = 0x76
|
||||||
|
IFT_HDSL2 = 0xa8
|
||||||
|
IFT_HIPERLAN2 = 0xb7
|
||||||
|
IFT_HIPPI = 0x2f
|
||||||
|
IFT_HIPPIINTERFACE = 0x39
|
||||||
|
IFT_HOSTPAD = 0x5a
|
||||||
|
IFT_HSSI = 0x2e
|
||||||
|
IFT_HY = 0xe
|
||||||
|
IFT_IBM370PARCHAN = 0x48
|
||||||
|
IFT_IDSL = 0x9a
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INTERLEAVE = 0x7c
|
||||||
|
IFT_IP = 0x7e
|
||||||
|
IFT_IPFORWARD = 0x8e
|
||||||
|
IFT_IPOVERATM = 0x72
|
||||||
|
IFT_IPOVERCDLC = 0x6d
|
||||||
|
IFT_IPOVERCLAW = 0x6e
|
||||||
|
IFT_IPSWITCH = 0x4e
|
||||||
|
IFT_ISDN = 0x3f
|
||||||
|
IFT_ISDNBASIC = 0x14
|
||||||
|
IFT_ISDNPRIMARY = 0x15
|
||||||
|
IFT_ISDNS = 0x4b
|
||||||
|
IFT_ISDNU = 0x4c
|
||||||
|
IFT_ISO88022LLC = 0x29
|
||||||
|
IFT_ISO88023 = 0x7
|
||||||
|
IFT_ISO88024 = 0x8
|
||||||
|
IFT_ISO88025 = 0x9
|
||||||
|
IFT_ISO88025CRFPINT = 0x62
|
||||||
|
IFT_ISO88025DTR = 0x56
|
||||||
|
IFT_ISO88025FIBER = 0x73
|
||||||
|
IFT_ISO88026 = 0xa
|
||||||
|
IFT_ISUP = 0xb3
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MEDIAMAILOVERIP = 0x8b
|
||||||
|
IFT_MFSIGLINK = 0xa7
|
||||||
|
IFT_MIOX25 = 0x26
|
||||||
|
IFT_MODEM = 0x30
|
||||||
|
IFT_MPC = 0x71
|
||||||
|
IFT_MPLS = 0xa6
|
||||||
|
IFT_MPLSTUNNEL = 0x96
|
||||||
|
IFT_MSDSL = 0x8f
|
||||||
|
IFT_MVL = 0xbf
|
||||||
|
IFT_MYRINET = 0x63
|
||||||
|
IFT_NFAS = 0xaf
|
||||||
|
IFT_NSIP = 0x1b
|
||||||
|
IFT_OPTICALCHANNEL = 0xc3
|
||||||
|
IFT_OPTICALTRANSPORT = 0xc4
|
||||||
|
IFT_OTHER = 0x1
|
||||||
|
IFT_P10 = 0xc
|
||||||
|
IFT_P80 = 0xd
|
||||||
|
IFT_PARA = 0x22
|
||||||
|
IFT_PFLOG = 0xf6
|
||||||
|
IFT_PFSYNC = 0xf7
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf1
|
||||||
|
IFT_QLLC = 0x44
|
||||||
|
IFT_RADIOMAC = 0xbc
|
||||||
|
IFT_RADSL = 0x5f
|
||||||
|
IFT_REACHDSL = 0xc0
|
||||||
|
IFT_RFC1483 = 0x9f
|
||||||
|
IFT_RS232 = 0x21
|
||||||
|
IFT_RSRB = 0x4f
|
||||||
|
IFT_SDLC = 0x11
|
||||||
|
IFT_SDSL = 0x60
|
||||||
|
IFT_SHDSL = 0xa9
|
||||||
|
IFT_SIP = 0x1f
|
||||||
|
IFT_SLIP = 0x1c
|
||||||
|
IFT_SMDSDXI = 0x2b
|
||||||
|
IFT_SMDSICIP = 0x34
|
||||||
|
IFT_SONET = 0x27
|
||||||
|
IFT_SONETOVERHEADCHANNEL = 0xb9
|
||||||
|
IFT_SONETPATH = 0x32
|
||||||
|
IFT_SONETVT = 0x33
|
||||||
|
IFT_SRP = 0x97
|
||||||
|
IFT_SS7SIGLINK = 0x9c
|
||||||
|
IFT_STACKTOSTACK = 0x6f
|
||||||
|
IFT_STARLAN = 0xb
|
||||||
|
IFT_STF = 0xd7
|
||||||
|
IFT_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TERMPAD = 0x5b
|
||||||
|
IFT_TR008 = 0xb0
|
||||||
|
IFT_TRANSPHDLC = 0x7b
|
||||||
|
IFT_TUNNEL = 0x83
|
||||||
|
IFT_ULTRA = 0x1d
|
||||||
|
IFT_USB = 0xa0
|
||||||
|
IFT_V11 = 0x40
|
||||||
|
IFT_V35 = 0x2d
|
||||||
|
IFT_V36 = 0x41
|
||||||
|
IFT_V37 = 0x78
|
||||||
|
IFT_VDSL = 0x61
|
||||||
|
IFT_VIRTUALIPADDRESS = 0x70
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERFRAMERELAY = 0x99
|
||||||
|
IFT_VOICEOVERIP = 0x68
|
||||||
|
IFT_X213 = 0x5d
|
||||||
|
IFT_X25 = 0x5
|
||||||
|
IFT_X25DDN = 0x4
|
||||||
|
IFT_X25HUNTGROUP = 0x7a
|
||||||
|
IFT_X25MLP = 0x79
|
||||||
|
IFT_X25PLE = 0x28
|
||||||
|
IFT_XETHER = 0x1a
|
||||||
|
|
||||||
|
// missing constants on FreeBSD-11.1-RELEASE, copied from old values in ztypes_freebsd_arm.go
|
||||||
|
IFF_SMART = 0x20
|
||||||
|
IFT_FAITH = 0xf2
|
||||||
|
IFT_IPXIP = 0xf9
|
||||||
|
IPPROTO_MAXID = 0x34
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IP_FAITH = 0x16
|
||||||
|
MAP_NORESERVE = 0x40
|
||||||
|
MAP_RENAME = 0x20
|
||||||
|
NET_RT_MAXID = 0x6
|
||||||
|
RTF_PRCLONING = 0x10000
|
||||||
|
RTM_OLDADD = 0x9
|
||||||
|
RTM_OLDDEL = 0xa
|
||||||
|
SIOCADDRT = 0x8030720a
|
||||||
|
SIOCALIFADDR = 0x8118691b
|
||||||
|
SIOCDELRT = 0x8030720b
|
||||||
|
SIOCDLIFADDR = 0x8118691d
|
||||||
|
SIOCGLIFADDR = 0xc118691c
|
||||||
|
SIOCGLIFPHYADDR = 0xc118694b
|
||||||
|
SIOCSLIFPHYADDR = 0x8118694a
|
||||||
|
)
|
8
vendor/golang.org/x/sys/unix/flock.go → vendor/golang.org/x/sys/unix/fcntl.go
generated
vendored
8
vendor/golang.org/x/sys/unix/flock.go → vendor/golang.org/x/sys/unix/fcntl.go
generated
vendored
|
@ -1,5 +1,3 @@
|
||||||
// +build linux darwin freebsd openbsd netbsd dragonfly
|
|
||||||
|
|
||||||
// Copyright 2014 The Go Authors. All rights reserved.
|
// Copyright 2014 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
@ -14,6 +12,12 @@ import "unsafe"
|
||||||
// systems by flock_linux_32bit.go to be SYS_FCNTL64.
|
// systems by flock_linux_32bit.go to be SYS_FCNTL64.
|
||||||
var fcntl64Syscall uintptr = SYS_FCNTL
|
var fcntl64Syscall uintptr = SYS_FCNTL
|
||||||
|
|
||||||
|
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
||||||
|
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
||||||
|
valptr, _, err := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
|
||||||
|
return int(valptr), err
|
||||||
|
}
|
||||||
|
|
||||||
// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
|
// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
|
||||||
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
||||||
_, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
|
_, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
|
15
vendor/golang.org/x/sys/unix/gccgo.go
generated
vendored
15
vendor/golang.org/x/sys/unix/gccgo.go
generated
vendored
|
@ -11,9 +11,19 @@ import "syscall"
|
||||||
// We can't use the gc-syntax .s files for gccgo. On the plus side
|
// We can't use the gc-syntax .s files for gccgo. On the plus side
|
||||||
// much of the functionality can be written directly in Go.
|
// much of the functionality can be written directly in Go.
|
||||||
|
|
||||||
|
//extern gccgoRealSyscallNoError
|
||||||
|
func realSyscallNoError(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r uintptr)
|
||||||
|
|
||||||
//extern gccgoRealSyscall
|
//extern gccgoRealSyscall
|
||||||
func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
|
func realSyscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r, errno uintptr)
|
||||||
|
|
||||||
|
func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
|
||||||
|
syscall.Entersyscall()
|
||||||
|
r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
|
||||||
|
syscall.Exitsyscall()
|
||||||
|
return r, 0
|
||||||
|
}
|
||||||
|
|
||||||
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
|
func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
|
||||||
syscall.Entersyscall()
|
syscall.Entersyscall()
|
||||||
r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
|
r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
|
||||||
|
@ -35,6 +45,11 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||||
return r, 0, syscall.Errno(errno)
|
return r, 0, syscall.Errno(errno)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) {
|
||||||
|
r := realSyscallNoError(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
|
||||||
|
return r, 0
|
||||||
|
}
|
||||||
|
|
||||||
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
|
func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) {
|
||||||
r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
|
r, errno := realSyscall(trap, a1, a2, a3, 0, 0, 0, 0, 0, 0)
|
||||||
return r, 0, syscall.Errno(errno)
|
return r, 0, syscall.Errno(errno)
|
||||||
|
|
6
vendor/golang.org/x/sys/unix/gccgo_c.c
generated
vendored
6
vendor/golang.org/x/sys/unix/gccgo_c.c
generated
vendored
|
@ -31,6 +31,12 @@ gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintp
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uintptr_t
|
||||||
|
gccgoRealSyscallNoError(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)
|
||||||
|
{
|
||||||
|
return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
|
||||||
|
}
|
||||||
|
|
||||||
// Define the use function in C so that it is not inlined.
|
// Define the use function in C so that it is not inlined.
|
||||||
|
|
||||||
extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline));
|
extern void use(void *) __asm__ (GOSYM_PREFIX GOPKGPATH ".use") __attribute__((noinline));
|
||||||
|
|
20
vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go
generated
vendored
20
vendor/golang.org/x/sys/unix/gccgo_linux_sparc64.go
generated
vendored
|
@ -1,20 +0,0 @@
|
||||||
// Copyright 2016 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build gccgo,linux,sparc64
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import "syscall"
|
|
||||||
|
|
||||||
//extern sysconf
|
|
||||||
func realSysconf(name int) int64
|
|
||||||
|
|
||||||
func sysconf(name int) (n int64, err syscall.Errno) {
|
|
||||||
r := realSysconf(name)
|
|
||||||
if r < 0 {
|
|
||||||
return 0, syscall.GetErrno()
|
|
||||||
}
|
|
||||||
return r, 0
|
|
||||||
}
|
|
29
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
29
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
|
@ -72,7 +72,7 @@ darwin_amd64)
|
||||||
;;
|
;;
|
||||||
darwin_arm)
|
darwin_arm)
|
||||||
mkerrors="$mkerrors"
|
mkerrors="$mkerrors"
|
||||||
mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
|
mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h"
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
;;
|
;;
|
||||||
darwin_arm64)
|
darwin_arm64)
|
||||||
|
@ -80,12 +80,6 @@ darwin_arm64)
|
||||||
mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h"
|
mksysnum="./mksysnum_darwin.pl $(xcrun --show-sdk-path --sdk iphoneos)/usr/include/sys/syscall.h"
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
;;
|
;;
|
||||||
dragonfly_386)
|
|
||||||
mkerrors="$mkerrors -m32"
|
|
||||||
mksyscall="./mksyscall.pl -l32 -dragonfly"
|
|
||||||
mksysnum="curl -s 'http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/kern/syscalls.master' | ./mksysnum_dragonfly.pl"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
|
||||||
;;
|
|
||||||
dragonfly_amd64)
|
dragonfly_amd64)
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
mksyscall="./mksyscall.pl -dragonfly"
|
mksyscall="./mksyscall.pl -dragonfly"
|
||||||
|
@ -108,7 +102,7 @@ freebsd_arm)
|
||||||
mksyscall="./mksyscall.pl -l32 -arm"
|
mksyscall="./mksyscall.pl -l32 -arm"
|
||||||
mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
|
mksysnum="curl -s 'http://svn.freebsd.org/base/stable/10/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
|
||||||
# Let the type of C char be signed for making the bare syscall
|
# Let the type of C char be signed for making the bare syscall
|
||||||
# API consistent across over platforms.
|
# API consistent across platforms.
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
;;
|
;;
|
||||||
linux_sparc64)
|
linux_sparc64)
|
||||||
|
@ -130,11 +124,18 @@ netbsd_amd64)
|
||||||
mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
|
mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
;;
|
;;
|
||||||
|
netbsd_arm)
|
||||||
|
mkerrors="$mkerrors"
|
||||||
|
mksyscall="./mksyscall.pl -l32 -netbsd -arm"
|
||||||
|
mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
|
||||||
|
# Let the type of C char be signed for making the bare syscall
|
||||||
|
# API consistent across platforms.
|
||||||
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
|
;;
|
||||||
openbsd_386)
|
openbsd_386)
|
||||||
mkerrors="$mkerrors -m32"
|
mkerrors="$mkerrors -m32"
|
||||||
mksyscall="./mksyscall.pl -l32 -openbsd"
|
mksyscall="./mksyscall.pl -l32 -openbsd"
|
||||||
mksysctl="./mksysctl_openbsd.pl"
|
mksysctl="./mksysctl_openbsd.pl"
|
||||||
zsysctl="zsysctl_openbsd.go"
|
|
||||||
mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
|
mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
;;
|
;;
|
||||||
|
@ -142,10 +143,18 @@ openbsd_amd64)
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
mksyscall="./mksyscall.pl -openbsd"
|
mksyscall="./mksyscall.pl -openbsd"
|
||||||
mksysctl="./mksysctl_openbsd.pl"
|
mksysctl="./mksysctl_openbsd.pl"
|
||||||
zsysctl="zsysctl_openbsd.go"
|
|
||||||
mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
|
mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
;;
|
;;
|
||||||
|
openbsd_arm)
|
||||||
|
mkerrors="$mkerrors"
|
||||||
|
mksyscall="./mksyscall.pl -l32 -openbsd -arm"
|
||||||
|
mksysctl="./mksysctl_openbsd.pl"
|
||||||
|
mksysnum="curl -s 'http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
|
||||||
|
# Let the type of C char be signed for making the bare syscall
|
||||||
|
# API consistent across platforms.
|
||||||
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
|
;;
|
||||||
solaris_amd64)
|
solaris_amd64)
|
||||||
mksyscall="./mksyscall_solaris.pl"
|
mksyscall="./mksyscall_solaris.pl"
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
|
|
82
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
82
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
|
@ -17,8 +17,8 @@ if test -z "$GOARCH" -o -z "$GOOS"; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that we are using the new build system if we should
|
# Check that we are using the new build system if we should
|
||||||
if [[ "$GOOS" -eq "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then
|
if [[ "$GOOS" = "linux" ]] && [[ "$GOARCH" != "sparc64" ]]; then
|
||||||
if [[ "$GOLANG_SYS_BUILD" -ne "docker" ]]; then
|
if [[ "$GOLANG_SYS_BUILD" != "docker" ]]; then
|
||||||
echo 1>&2 "In the new build system, mkerrors should not be called directly."
|
echo 1>&2 "In the new build system, mkerrors should not be called directly."
|
||||||
echo 1>&2 "See README.md"
|
echo 1>&2 "See README.md"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -27,7 +27,7 @@ fi
|
||||||
|
|
||||||
CC=${CC:-cc}
|
CC=${CC:-cc}
|
||||||
|
|
||||||
if [[ "$GOOS" -eq "solaris" ]]; then
|
if [[ "$GOOS" = "solaris" ]]; then
|
||||||
# Assumes GNU versions of utilities in PATH.
|
# Assumes GNU versions of utilities in PATH.
|
||||||
export PATH=/usr/gnu/bin:$PATH
|
export PATH=/usr/gnu/bin:$PATH
|
||||||
fi
|
fi
|
||||||
|
@ -38,6 +38,8 @@ includes_Darwin='
|
||||||
#define _DARWIN_C_SOURCE
|
#define _DARWIN_C_SOURCE
|
||||||
#define KERNEL
|
#define KERNEL
|
||||||
#define _DARWIN_USE_64_BIT_INODE
|
#define _DARWIN_USE_64_BIT_INODE
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <sys/attr.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <sys/ptrace.h>
|
#include <sys/ptrace.h>
|
||||||
|
@ -45,6 +47,8 @@ includes_Darwin='
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -75,6 +79,7 @@ includes_DragonFly='
|
||||||
'
|
'
|
||||||
|
|
||||||
includes_FreeBSD='
|
includes_FreeBSD='
|
||||||
|
#include <sys/capability.h>
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
|
@ -82,6 +87,7 @@ includes_FreeBSD='
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#include <sys/mount.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
|
@ -165,6 +171,7 @@ struct ltchars {
|
||||||
#include <linux/filter.h>
|
#include <linux/filter.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/keyctl.h>
|
#include <linux/keyctl.h>
|
||||||
|
#include <linux/magic.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/perf_event.h>
|
#include <linux/perf_event.h>
|
||||||
#include <linux/random.h>
|
#include <linux/random.h>
|
||||||
|
@ -179,6 +186,11 @@ struct ltchars {
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
#include <linux/vm_sockets.h>
|
#include <linux/vm_sockets.h>
|
||||||
|
#include <linux/taskstats.h>
|
||||||
|
#include <linux/genetlink.h>
|
||||||
|
#include <linux/stat.h>
|
||||||
|
#include <linux/watchdog.h>
|
||||||
|
#include <linux/hdreg.h>
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
#include <asm/termbits.h>
|
#include <asm/termbits.h>
|
||||||
|
|
||||||
|
@ -279,6 +291,7 @@ includes_SunOS='
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/mkdev.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
|
@ -343,6 +356,7 @@ ccflags="$@"
|
||||||
$2 !~ /^EXPR_/ &&
|
$2 !~ /^EXPR_/ &&
|
||||||
$2 ~ /^E[A-Z0-9_]+$/ ||
|
$2 ~ /^E[A-Z0-9_]+$/ ||
|
||||||
$2 ~ /^B[0-9_]+$/ ||
|
$2 ~ /^B[0-9_]+$/ ||
|
||||||
|
$2 ~ /^(OLD|NEW)DEV$/ ||
|
||||||
$2 == "BOTHER" ||
|
$2 == "BOTHER" ||
|
||||||
$2 ~ /^CI?BAUD(EX)?$/ ||
|
$2 ~ /^CI?BAUD(EX)?$/ ||
|
||||||
$2 == "IBSHIFT" ||
|
$2 == "IBSHIFT" ||
|
||||||
|
@ -352,6 +366,7 @@ ccflags="$@"
|
||||||
$2 ~ /^IGN/ ||
|
$2 ~ /^IGN/ ||
|
||||||
$2 ~ /^IX(ON|ANY|OFF)$/ ||
|
$2 ~ /^IX(ON|ANY|OFF)$/ ||
|
||||||
$2 ~ /^IN(LCR|PCK)$/ ||
|
$2 ~ /^IN(LCR|PCK)$/ ||
|
||||||
|
$2 !~ "X86_CR3_PCID_NOFLUSH" &&
|
||||||
$2 ~ /(^FLU?SH)|(FLU?SH$)/ ||
|
$2 ~ /(^FLU?SH)|(FLU?SH$)/ ||
|
||||||
$2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ ||
|
$2 ~ /^C(LOCAL|READ|MSPAR|RTSCTS)$/ ||
|
||||||
$2 == "BRKINT" ||
|
$2 == "BRKINT" ||
|
||||||
|
@ -376,7 +391,9 @@ ccflags="$@"
|
||||||
$2 == "SOMAXCONN" ||
|
$2 == "SOMAXCONN" ||
|
||||||
$2 == "NAME_MAX" ||
|
$2 == "NAME_MAX" ||
|
||||||
$2 == "IFNAMSIZ" ||
|
$2 == "IFNAMSIZ" ||
|
||||||
$2 ~ /^CTL_(MAXNAME|NET|QUERY)$/ ||
|
$2 ~ /^CTL_(HW|KERN|MAXNAME|NET|QUERY)$/ ||
|
||||||
|
$2 ~ /^KERN_(HOSTNAME|OS(RELEASE|TYPE)|VERSION)$/ ||
|
||||||
|
$2 ~ /^HW_MACHINE$/ ||
|
||||||
$2 ~ /^SYSCTL_VERS/ ||
|
$2 ~ /^SYSCTL_VERS/ ||
|
||||||
$2 ~ /^(MS|MNT|UMOUNT)_/ ||
|
$2 ~ /^(MS|MNT|UMOUNT)_/ ||
|
||||||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
||||||
|
@ -401,6 +418,7 @@ ccflags="$@"
|
||||||
$2 ~ /^(BPF|DLT)_/ ||
|
$2 ~ /^(BPF|DLT)_/ ||
|
||||||
$2 ~ /^CLOCK_/ ||
|
$2 ~ /^CLOCK_/ ||
|
||||||
$2 ~ /^CAN_/ ||
|
$2 ~ /^CAN_/ ||
|
||||||
|
$2 ~ /^CAP_/ ||
|
||||||
$2 ~ /^ALG_/ ||
|
$2 ~ /^ALG_/ ||
|
||||||
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ ||
|
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ ||
|
||||||
$2 ~ /^GRND_/ ||
|
$2 ~ /^GRND_/ ||
|
||||||
|
@ -409,8 +427,19 @@ ccflags="$@"
|
||||||
$2 ~ /^PERF_EVENT_IOC_/ ||
|
$2 ~ /^PERF_EVENT_IOC_/ ||
|
||||||
$2 ~ /^SECCOMP_MODE_/ ||
|
$2 ~ /^SECCOMP_MODE_/ ||
|
||||||
$2 ~ /^SPLICE_/ ||
|
$2 ~ /^SPLICE_/ ||
|
||||||
|
$2 ~ /^[A-Z0-9_]+_MAGIC2?$/ ||
|
||||||
$2 ~ /^(VM|VMADDR)_/ ||
|
$2 ~ /^(VM|VMADDR)_/ ||
|
||||||
|
$2 ~ /^IOCTL_VM_SOCKETS_/ ||
|
||||||
|
$2 ~ /^(TASKSTATS|TS)_/ ||
|
||||||
|
$2 ~ /^CGROUPSTATS_/ ||
|
||||||
|
$2 ~ /^GENL_/ ||
|
||||||
|
$2 ~ /^STATX_/ ||
|
||||||
|
$2 ~ /^UTIME_/ ||
|
||||||
$2 ~ /^XATTR_(CREATE|REPLACE)/ ||
|
$2 ~ /^XATTR_(CREATE|REPLACE)/ ||
|
||||||
|
$2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ ||
|
||||||
|
$2 ~ /^FSOPT_/ ||
|
||||||
|
$2 ~ /^WDIOC_/ ||
|
||||||
|
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
||||||
$2 !~ "WMESGLEN" &&
|
$2 !~ "WMESGLEN" &&
|
||||||
$2 ~ /^W[A-Z0-9]+$/ ||
|
$2 ~ /^W[A-Z0-9]+$/ ||
|
||||||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
|
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
|
||||||
|
@ -480,21 +509,26 @@ echo ')'
|
||||||
|
|
||||||
enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below
|
enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below
|
||||||
|
|
||||||
int errors[] = {
|
struct tuple {
|
||||||
|
int num;
|
||||||
|
const char *name;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct tuple errors[] = {
|
||||||
"
|
"
|
||||||
for i in $errors
|
for i in $errors
|
||||||
do
|
do
|
||||||
echo -E ' '$i,
|
echo -E ' {'$i', "'$i'" },'
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -E "
|
echo -E "
|
||||||
};
|
};
|
||||||
|
|
||||||
int signals[] = {
|
struct tuple signals[] = {
|
||||||
"
|
"
|
||||||
for i in $signals
|
for i in $signals
|
||||||
do
|
do
|
||||||
echo -E ' '$i,
|
echo -E ' {'$i', "'$i'" },'
|
||||||
done
|
done
|
||||||
|
|
||||||
# Use -E because on some systems bash builtin interprets \n itself.
|
# Use -E because on some systems bash builtin interprets \n itself.
|
||||||
|
@ -502,9 +536,9 @@ int signals[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
intcmp(const void *a, const void *b)
|
tuplecmp(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
return *(int*)a - *(int*)b;
|
return ((struct tuple *)a)->num - ((struct tuple *)b)->num;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -514,26 +548,34 @@ main(void)
|
||||||
char buf[1024], *p;
|
char buf[1024], *p;
|
||||||
|
|
||||||
printf("\n\n// Error table\n");
|
printf("\n\n// Error table\n");
|
||||||
printf("var errors = [...]string {\n");
|
printf("var errorList = [...]struct {\n");
|
||||||
qsort(errors, nelem(errors), sizeof errors[0], intcmp);
|
printf("\tnum syscall.Errno\n");
|
||||||
|
printf("\tname string\n");
|
||||||
|
printf("\tdesc string\n");
|
||||||
|
printf("} {\n");
|
||||||
|
qsort(errors, nelem(errors), sizeof errors[0], tuplecmp);
|
||||||
for(i=0; i<nelem(errors); i++) {
|
for(i=0; i<nelem(errors); i++) {
|
||||||
e = errors[i];
|
e = errors[i].num;
|
||||||
if(i > 0 && errors[i-1] == e)
|
if(i > 0 && errors[i-1].num == e)
|
||||||
continue;
|
continue;
|
||||||
strcpy(buf, strerror(e));
|
strcpy(buf, strerror(e));
|
||||||
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
||||||
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
|
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
|
||||||
buf[0] += a - A;
|
buf[0] += a - A;
|
||||||
printf("\t%d: \"%s\",\n", e, buf);
|
printf("\t{ %d, \"%s\", \"%s\" },\n", e, errors[i].name, buf);
|
||||||
}
|
}
|
||||||
printf("}\n\n");
|
printf("}\n\n");
|
||||||
|
|
||||||
printf("\n\n// Signal table\n");
|
printf("\n\n// Signal table\n");
|
||||||
printf("var signals = [...]string {\n");
|
printf("var signalList = [...]struct {\n");
|
||||||
qsort(signals, nelem(signals), sizeof signals[0], intcmp);
|
printf("\tnum syscall.Signal\n");
|
||||||
|
printf("\tname string\n");
|
||||||
|
printf("\tdesc string\n");
|
||||||
|
printf("} {\n");
|
||||||
|
qsort(signals, nelem(signals), sizeof signals[0], tuplecmp);
|
||||||
for(i=0; i<nelem(signals); i++) {
|
for(i=0; i<nelem(signals); i++) {
|
||||||
e = signals[i];
|
e = signals[i].num;
|
||||||
if(i > 0 && signals[i-1] == e)
|
if(i > 0 && signals[i-1].num == e)
|
||||||
continue;
|
continue;
|
||||||
strcpy(buf, strsignal(e));
|
strcpy(buf, strsignal(e));
|
||||||
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
||||||
|
@ -543,7 +585,7 @@ main(void)
|
||||||
p = strrchr(buf, ":"[0]);
|
p = strrchr(buf, ":"[0]);
|
||||||
if(p)
|
if(p)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
printf("\t%d: \"%s\",\n", e, buf);
|
printf("\t{ %d, \"%s\", \"%s\" },\n", e, signals[i].name, buf);
|
||||||
}
|
}
|
||||||
printf("}\n\n");
|
printf("}\n\n");
|
||||||
|
|
||||||
|
|
22
vendor/golang.org/x/sys/unix/mkpost.go
generated
vendored
22
vendor/golang.org/x/sys/unix/mkpost.go
generated
vendored
|
@ -42,6 +42,10 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Intentionally export __val fields in Fsid and Sigset_t
|
||||||
|
valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`)
|
||||||
|
b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}"))
|
||||||
|
|
||||||
// If we have empty Ptrace structs, we should delete them. Only s390x emits
|
// If we have empty Ptrace structs, we should delete them. Only s390x emits
|
||||||
// nonempty Ptrace structs.
|
// nonempty Ptrace structs.
|
||||||
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
|
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
|
||||||
|
@ -56,16 +60,22 @@ func main() {
|
||||||
removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
|
removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
|
||||||
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// We refuse to export private fields on s390x
|
// Convert [65]int8 to [65]byte in Utsname members to simplify
|
||||||
if goarch == "s390x" && goos == "linux" {
|
// conversion to string; see golang.org/issue/20753
|
||||||
|
convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
|
||||||
|
b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
|
||||||
|
|
||||||
|
// Remove spare fields (e.g. in Statx_t)
|
||||||
|
spareFieldsRegex := regexp.MustCompile(`X__spare\S*`)
|
||||||
|
b = spareFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// Remove cgo padding fields
|
// Remove cgo padding fields
|
||||||
removeFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
|
removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
|
||||||
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
|
|
||||||
// Remove padding, hidden, or unused fields
|
// Remove padding, hidden, or unused fields
|
||||||
removeFieldsRegex = regexp.MustCompile(`X_\S+`)
|
removeFieldsRegex = regexp.MustCompile(`\bX_\S+`)
|
||||||
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the first line of warning from cgo
|
// Remove the first line of warning from cgo
|
||||||
b = b[bytes.IndexByte(b, '\n')+1:]
|
b = b[bytes.IndexByte(b, '\n')+1:]
|
||||||
|
|
13
vendor/golang.org/x/sys/unix/mksyscall.pl
generated
vendored
13
vendor/golang.org/x/sys/unix/mksyscall.pl
generated
vendored
|
@ -210,8 +210,16 @@ while(<>) {
|
||||||
# Determine which form to use; pad args with zeros.
|
# Determine which form to use; pad args with zeros.
|
||||||
my $asm = "Syscall";
|
my $asm = "Syscall";
|
||||||
if ($nonblock) {
|
if ($nonblock) {
|
||||||
|
if ($errvar eq "" && $ENV{'GOOS'} eq "linux") {
|
||||||
|
$asm = "RawSyscallNoError";
|
||||||
|
} else {
|
||||||
$asm = "RawSyscall";
|
$asm = "RawSyscall";
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if ($errvar eq "" && $ENV{'GOOS'} eq "linux") {
|
||||||
|
$asm = "SyscallNoError";
|
||||||
|
}
|
||||||
|
}
|
||||||
if(@args <= 3) {
|
if(@args <= 3) {
|
||||||
while(@args < 3) {
|
while(@args < 3) {
|
||||||
push @args, "0";
|
push @args, "0";
|
||||||
|
@ -283,9 +291,14 @@ while(<>) {
|
||||||
}
|
}
|
||||||
if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") {
|
if ($ret[0] eq "_" && $ret[1] eq "_" && $ret[2] eq "_") {
|
||||||
$text .= "\t$call\n";
|
$text .= "\t$call\n";
|
||||||
|
} else {
|
||||||
|
if ($errvar eq "" && $ENV{'GOOS'} eq "linux") {
|
||||||
|
# raw syscall without error on Linux, see golang.org/issue/22924
|
||||||
|
$text .= "\t$ret[0], $ret[1] := $call\n";
|
||||||
} else {
|
} else {
|
||||||
$text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
|
$text .= "\t$ret[0], $ret[1], $ret[2] := $call\n";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$text .= $body;
|
$text .= $body;
|
||||||
|
|
||||||
if ($plan9 && $ret[2] eq "e1") {
|
if ($plan9 && $ret[2] eq "e1") {
|
||||||
|
|
13
vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl
generated
vendored
13
vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl
generated
vendored
|
@ -40,21 +40,8 @@ while(<>){
|
||||||
if($name eq 'SYS_SYS_EXIT'){
|
if($name eq 'SYS_SYS_EXIT'){
|
||||||
$name = 'SYS_EXIT';
|
$name = 'SYS_EXIT';
|
||||||
}
|
}
|
||||||
if($name =~ /^SYS_CAP_+/ || $name =~ /^SYS___CAP_+/){
|
|
||||||
next
|
|
||||||
}
|
|
||||||
|
|
||||||
print " $name = $num; // $proto\n";
|
print " $name = $num; // $proto\n";
|
||||||
|
|
||||||
# We keep Capsicum syscall numbers for FreeBSD
|
|
||||||
# 9-STABLE here because we are not sure whether they
|
|
||||||
# are mature and stable.
|
|
||||||
if($num == 513){
|
|
||||||
print " SYS_CAP_NEW = 514 // { int cap_new(int fd, uint64_t rights); }\n";
|
|
||||||
print " SYS_CAP_GETRIGHTS = 515 // { int cap_getrights(int fd, \\\n";
|
|
||||||
print " SYS_CAP_ENTER = 516 // { int cap_enter(void); }\n";
|
|
||||||
print " SYS_CAP_GETMODE = 517 // { int cap_getmode(u_int *modep); }\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl
generated
vendored
2
vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl
generated
vendored
|
@ -47,7 +47,7 @@ while(<>){
|
||||||
$name = "$7_$11" if $11 ne '';
|
$name = "$7_$11" if $11 ne '';
|
||||||
$name =~ y/a-z/A-Z/;
|
$name =~ y/a-z/A-Z/;
|
||||||
|
|
||||||
if($compat eq '' || $compat eq '30' || $compat eq '50') {
|
if($compat eq '' || $compat eq '13' || $compat eq '30' || $compat eq '50') {
|
||||||
print " $name = $num; // $proto\n";
|
print " $name = $num; // $proto\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
15
vendor/golang.org/x/sys/unix/pagesize_unix.go
generated
vendored
Normal file
15
vendor/golang.org/x/sys/unix/pagesize_unix.go
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||||
|
|
||||||
|
// For Unix, get the pagesize from the runtime.
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
func Getpagesize() int {
|
||||||
|
return syscall.Getpagesize()
|
||||||
|
}
|
27
vendor/golang.org/x/sys/unix/syscall.go
generated
vendored
27
vendor/golang.org/x/sys/unix/syscall.go
generated
vendored
|
@ -11,25 +11,28 @@
|
||||||
// system, set $GOOS and $GOARCH to the desired system. For example, if
|
// system, set $GOOS and $GOARCH to the desired system. For example, if
|
||||||
// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
|
// you want to view documentation for freebsd/arm on linux/amd64, set $GOOS
|
||||||
// to freebsd and $GOARCH to arm.
|
// to freebsd and $GOARCH to arm.
|
||||||
|
//
|
||||||
// The primary use of this package is inside other packages that provide a more
|
// The primary use of this package is inside other packages that provide a more
|
||||||
// portable interface to the system, such as "os", "time" and "net". Use
|
// portable interface to the system, such as "os", "time" and "net". Use
|
||||||
// those packages rather than this one if you can.
|
// those packages rather than this one if you can.
|
||||||
|
//
|
||||||
// For details of the functions and data types in this package consult
|
// For details of the functions and data types in this package consult
|
||||||
// the manuals for the appropriate operating system.
|
// the manuals for the appropriate operating system.
|
||||||
|
//
|
||||||
// These calls return err == nil to indicate success; otherwise
|
// These calls return err == nil to indicate success; otherwise
|
||||||
// err represents an operating system error describing the failure and
|
// err represents an operating system error describing the failure and
|
||||||
// holds a value of type syscall.Errno.
|
// holds a value of type syscall.Errno.
|
||||||
package unix // import "golang.org/x/sys/unix"
|
package unix // import "golang.org/x/sys/unix"
|
||||||
|
|
||||||
|
import "strings"
|
||||||
|
|
||||||
// ByteSliceFromString returns a NUL-terminated slice of bytes
|
// ByteSliceFromString returns a NUL-terminated slice of bytes
|
||||||
// containing the text of s. If s contains a NUL byte at any
|
// containing the text of s. If s contains a NUL byte at any
|
||||||
// location, it returns (nil, EINVAL).
|
// location, it returns (nil, EINVAL).
|
||||||
func ByteSliceFromString(s string) ([]byte, error) {
|
func ByteSliceFromString(s string) ([]byte, error) {
|
||||||
for i := 0; i < len(s); i++ {
|
if strings.IndexByte(s, 0) != -1 {
|
||||||
if s[i] == 0 {
|
|
||||||
return nil, EINVAL
|
return nil, EINVAL
|
||||||
}
|
}
|
||||||
}
|
|
||||||
a := make([]byte, len(s)+1)
|
a := make([]byte, len(s)+1)
|
||||||
copy(a, s)
|
copy(a, s)
|
||||||
return a, nil
|
return a, nil
|
||||||
|
@ -49,21 +52,3 @@ func BytePtrFromString(s string) (*byte, error) {
|
||||||
// Single-word zero for use when we need a valid pointer to 0 bytes.
|
// Single-word zero for use when we need a valid pointer to 0 bytes.
|
||||||
// See mkunix.pl.
|
// See mkunix.pl.
|
||||||
var _zero uintptr
|
var _zero uintptr
|
||||||
|
|
||||||
func (ts *Timespec) Unix() (sec int64, nsec int64) {
|
|
||||||
return int64(ts.Sec), int64(ts.Nsec)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tv *Timeval) Unix() (sec int64, nsec int64) {
|
|
||||||
return int64(tv.Sec), int64(tv.Usec) * 1000
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ts *Timespec) Nano() int64 {
|
|
||||||
return int64(ts.Sec)*1e9 + int64(ts.Nsec)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tv *Timeval) Nano() int64 {
|
|
||||||
return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
|
|
||||||
}
|
|
||||||
|
|
||||||
func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
|
|
||||||
|
|
98
vendor/golang.org/x/sys/unix/syscall_bsd.go
generated
vendored
98
vendor/golang.org/x/sys/unix/syscall_bsd.go
generated
vendored
|
@ -311,45 +311,16 @@ func Getsockname(fd int) (sa Sockaddr, err error) {
|
||||||
|
|
||||||
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
|
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
|
||||||
|
|
||||||
func GetsockoptByte(fd, level, opt int) (value byte, err error) {
|
// GetsockoptString returns the string value of the socket option opt for the
|
||||||
var n byte
|
// socket associated with fd at the given socket level.
|
||||||
vallen := _Socklen(1)
|
func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)
|
buf := make([]byte, 256)
|
||||||
return n, err
|
vallen := _Socklen(len(buf))
|
||||||
}
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
if err != nil {
|
||||||
func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
|
return "", err
|
||||||
vallen := _Socklen(4)
|
}
|
||||||
err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
|
return string(buf[:vallen-1]), nil
|
||||||
return value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {
|
|
||||||
var value IPMreq
|
|
||||||
vallen := _Socklen(SizeofIPMreq)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {
|
|
||||||
var value IPv6Mreq
|
|
||||||
vallen := _Socklen(SizeofIPv6Mreq)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {
|
|
||||||
var value IPv6MTUInfo
|
|
||||||
vallen := _Socklen(SizeofIPv6MTUInfo)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {
|
|
||||||
var value ICMPv6Filter
|
|
||||||
vallen := _Socklen(SizeofICMPv6Filter)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
|
||||||
|
@ -561,13 +532,24 @@ func Utimes(path string, tv []Timeval) error {
|
||||||
|
|
||||||
func UtimesNano(path string, ts []Timespec) error {
|
func UtimesNano(path string, ts []Timespec) error {
|
||||||
if ts == nil {
|
if ts == nil {
|
||||||
|
err := utimensat(AT_FDCWD, path, nil, 0)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
return utimes(path, nil)
|
return utimes(path, nil)
|
||||||
}
|
}
|
||||||
// TODO: The BSDs can do utimensat with SYS_UTIMENSAT but it
|
|
||||||
// isn't supported by darwin so this uses utimes instead
|
|
||||||
if len(ts) != 2 {
|
if len(ts) != 2 {
|
||||||
return EINVAL
|
return EINVAL
|
||||||
}
|
}
|
||||||
|
// Darwin setattrlist can set nanosecond timestamps
|
||||||
|
err := setattrlistTimes(path, ts, 0)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
err = utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
// Not as efficient as it could be because Timespec and
|
// Not as efficient as it could be because Timespec and
|
||||||
// Timeval have different types in the different OSes
|
// Timeval have different types in the different OSes
|
||||||
tv := [2]Timeval{
|
tv := [2]Timeval{
|
||||||
|
@ -577,6 +559,20 @@ func UtimesNano(path string, ts []Timespec) error {
|
||||||
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
return utimes(path, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
|
||||||
|
if ts == nil {
|
||||||
|
return utimensat(dirfd, path, nil, flags)
|
||||||
|
}
|
||||||
|
if len(ts) != 2 {
|
||||||
|
return EINVAL
|
||||||
|
}
|
||||||
|
err := setattrlistTimes(path, ts, flags)
|
||||||
|
if err != ENOSYS {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
|
||||||
|
}
|
||||||
|
|
||||||
//sys futimes(fd int, timeval *[2]Timeval) (err error)
|
//sys futimes(fd int, timeval *[2]Timeval) (err error)
|
||||||
|
|
||||||
func Futimes(fd int, tv []Timeval) error {
|
func Futimes(fd int, tv []Timeval) error {
|
||||||
|
@ -591,12 +587,18 @@ func Futimes(fd int, tv []Timeval) error {
|
||||||
|
|
||||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||||
|
|
||||||
|
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||||
|
|
||||||
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
|
if len(fds) == 0 {
|
||||||
|
return poll(nil, 0, timeout)
|
||||||
|
}
|
||||||
|
return poll(&fds[0], len(fds), timeout)
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: wrap
|
// TODO: wrap
|
||||||
// Acct(name nil-string) (err error)
|
// Acct(name nil-string) (err error)
|
||||||
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
||||||
// Madvise(addr *byte, len int, behav int) (err error)
|
|
||||||
// Mprotect(addr *byte, len int, prot int) (err error)
|
|
||||||
// Msync(addr *byte, len int, flags int) (err error)
|
|
||||||
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
||||||
|
|
||||||
var mapper = &mmapper{
|
var mapper = &mmapper{
|
||||||
|
@ -612,3 +614,11 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
|
||||||
func Munmap(b []byte) (err error) {
|
func Munmap(b []byte) (err error) {
|
||||||
return mapper.Munmap(b)
|
return mapper.Munmap(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys Madvise(b []byte, behav int) (err error)
|
||||||
|
//sys Mlock(b []byte) (err error)
|
||||||
|
//sys Mlockall(flags int) (err error)
|
||||||
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
|
//sys Msync(b []byte, flags int) (err error)
|
||||||
|
//sys Munlock(b []byte) (err error)
|
||||||
|
//sys Munlockall() (err error)
|
||||||
|
|
165
vendor/golang.org/x/sys/unix/syscall_darwin.go
generated
vendored
165
vendor/golang.org/x/sys/unix/syscall_darwin.go
generated
vendored
|
@ -13,7 +13,7 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
errorspkg "errors"
|
"errors"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
@ -36,6 +36,7 @@ func Getwd() (string, error) {
|
||||||
return "", ENOTSUP
|
return "", ENOTSUP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||||
type SockaddrDatalink struct {
|
type SockaddrDatalink struct {
|
||||||
Len uint8
|
Len uint8
|
||||||
Family uint8
|
Family uint8
|
||||||
|
@ -76,18 +77,6 @@ func nametomib(name string) (mib []_C_int, err error) {
|
||||||
return buf[0 : n/siz], nil
|
return buf[0 : n/siz], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
|
||||||
}
|
|
||||||
|
|
||||||
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
//sys ptrace(request int, pid int, addr uintptr, data uintptr) (err error)
|
||||||
func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
|
func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
|
||||||
func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
|
func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
|
||||||
|
@ -109,7 +98,7 @@ type attrList struct {
|
||||||
|
|
||||||
func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
|
func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
|
||||||
if len(attrBuf) < 4 {
|
if len(attrBuf) < 4 {
|
||||||
return nil, errorspkg.New("attrBuf too small")
|
return nil, errors.New("attrBuf too small")
|
||||||
}
|
}
|
||||||
attrList.bitmapCount = attrBitMapCount
|
attrList.bitmapCount = attrBitMapCount
|
||||||
|
|
||||||
|
@ -145,12 +134,12 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
|
||||||
for i := uint32(0); int(i) < len(dat); {
|
for i := uint32(0); int(i) < len(dat); {
|
||||||
header := dat[i:]
|
header := dat[i:]
|
||||||
if len(header) < 8 {
|
if len(header) < 8 {
|
||||||
return attrs, errorspkg.New("truncated attribute header")
|
return attrs, errors.New("truncated attribute header")
|
||||||
}
|
}
|
||||||
datOff := *(*int32)(unsafe.Pointer(&header[0]))
|
datOff := *(*int32)(unsafe.Pointer(&header[0]))
|
||||||
attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
|
attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
|
||||||
if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
|
if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
|
||||||
return attrs, errorspkg.New("truncated results; attrBuf too small")
|
return attrs, errors.New("truncated results; attrBuf too small")
|
||||||
}
|
}
|
||||||
end := uint32(datOff) + attrLen
|
end := uint32(datOff) + attrLen
|
||||||
attrs = append(attrs, dat[datOff:end])
|
attrs = append(attrs, dat[datOff:end])
|
||||||
|
@ -187,6 +176,42 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
_p0, err := BytePtrFromString(path)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var attrList attrList
|
||||||
|
attrList.bitmapCount = ATTR_BIT_MAP_COUNT
|
||||||
|
attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME
|
||||||
|
|
||||||
|
// order is mtime, atime: the opposite of Chtimes
|
||||||
|
attributes := [2]Timespec{times[1], times[0]}
|
||||||
|
options := 0
|
||||||
|
if flags&AT_SYMLINK_NOFOLLOW != 0 {
|
||||||
|
options |= FSOPT_NOFOLLOW
|
||||||
|
}
|
||||||
|
_, _, e1 := Syscall6(
|
||||||
|
SYS_SETATTRLIST,
|
||||||
|
uintptr(unsafe.Pointer(_p0)),
|
||||||
|
uintptr(unsafe.Pointer(&attrList)),
|
||||||
|
uintptr(unsafe.Pointer(&attributes)),
|
||||||
|
uintptr(unsafe.Sizeof(attributes)),
|
||||||
|
uintptr(options),
|
||||||
|
0,
|
||||||
|
)
|
||||||
|
if e1 != 0 {
|
||||||
|
return e1
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
|
||||||
|
// Darwin doesn't support SYS_UTIMENSAT
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Wrapped
|
* Wrapped
|
||||||
*/
|
*/
|
||||||
|
@ -195,6 +220,91 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
|
|
||||||
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
|
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
|
@ -210,13 +320,17 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
//sys Dup2(from int, to int) (err error)
|
//sys Dup2(from int, to int) (err error)
|
||||||
//sys Exchangedata(path1 string, path2 string, options int) (err error)
|
//sys Exchangedata(path1 string, path2 string, options int) (err error)
|
||||||
//sys Exit(code int)
|
//sys Exit(code int)
|
||||||
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error) = SYS_FSTATFS64
|
||||||
//sys Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
|
@ -238,23 +352,23 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
//sys Kqueue() (fd int, err error)
|
//sys Kqueue() (fd int, err error)
|
||||||
//sys Lchown(path string, uid int, gid int) (err error)
|
//sys Lchown(path string, uid int, gid int) (err error)
|
||||||
//sys Link(path string, link string) (err error)
|
//sys Link(path string, link string) (err error)
|
||||||
|
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
|
||||||
//sys Listen(s int, backlog int) (err error)
|
//sys Listen(s int, backlog int) (err error)
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
|
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Readlink(path string, buf []byte) (n int, err error)
|
//sys Readlink(path string, buf []byte) (n int, err error)
|
||||||
|
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
|
||||||
//sys Rename(from string, to string) (err error)
|
//sys Rename(from string, to string) (err error)
|
||||||
|
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
|
||||||
//sys Revoke(path string) (err error)
|
//sys Revoke(path string) (err error)
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||||
|
@ -275,11 +389,13 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||||
//sys Symlink(path string, link string) (err error)
|
//sys Symlink(path string, link string) (err error)
|
||||||
|
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||||
//sys Sync() (err error)
|
//sys Sync() (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
//sys Umask(newmask int) (oldmask int)
|
//sys Umask(newmask int) (oldmask int)
|
||||||
//sys Undelete(path string) (err error)
|
//sys Undelete(path string) (err error)
|
||||||
//sys Unlink(path string) (err error)
|
//sys Unlink(path string) (err error)
|
||||||
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Unmount(path string, flags int) (err error)
|
//sys Unmount(path string, flags int) (err error)
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
|
@ -319,9 +435,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
// Add_profil
|
// Add_profil
|
||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
|
||||||
// Mlock
|
|
||||||
// Munlock
|
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
|
@ -331,7 +444,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
// Copyfile
|
// Copyfile
|
||||||
// Poll
|
|
||||||
// Watchevent
|
// Watchevent
|
||||||
// Waitevent
|
// Waitevent
|
||||||
// Modwatch
|
// Modwatch
|
||||||
|
@ -414,8 +526,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
// Lio_listio
|
// Lio_listio
|
||||||
// __pthread_cond_wait
|
// __pthread_cond_wait
|
||||||
// Iopolicysys
|
// Iopolicysys
|
||||||
// Mlockall
|
|
||||||
// Munlockall
|
|
||||||
// __pthread_kill
|
// __pthread_kill
|
||||||
// __pthread_sigmask
|
// __pthread_sigmask
|
||||||
// __sigwait
|
// __sigwait
|
||||||
|
@ -469,7 +579,6 @@ func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(sig
|
||||||
// Sendmsg_nocancel
|
// Sendmsg_nocancel
|
||||||
// Recvfrom_nocancel
|
// Recvfrom_nocancel
|
||||||
// Accept_nocancel
|
// Accept_nocancel
|
||||||
// Msync_nocancel
|
|
||||||
// Fcntl_nocancel
|
// Fcntl_nocancel
|
||||||
// Select_nocancel
|
// Select_nocancel
|
||||||
// Fsync_nocancel
|
// Fsync_nocancel
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_darwin_386.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_darwin_386.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||||
|
|
19
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
generated
vendored
19
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
generated
vendored
|
@ -11,23 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||||
|
|
21
vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
generated
vendored
21
vendor/golang.org/x/sys/unix/syscall_darwin_arm.go
generated
vendored
|
@ -9,21 +9,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||||
|
@ -69,3 +60,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
}
|
}
|
||||||
|
|
||||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
|
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic
|
||||||
|
|
||||||
|
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
||||||
|
// of darwin/arm the syscall is called sysctl instead of __sysctl.
|
||||||
|
const SYS___SYSCTL = SYS_SYSCTL
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 16384 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||||
|
|
158
vendor/golang.org/x/sys/unix/syscall_dragonfly.go
generated
vendored
158
vendor/golang.org/x/sys/unix/syscall_dragonfly.go
generated
vendored
|
@ -14,6 +14,7 @@ package unix
|
||||||
|
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||||
type SockaddrDatalink struct {
|
type SockaddrDatalink struct {
|
||||||
Len uint8
|
Len uint8
|
||||||
Family uint8
|
Family uint8
|
||||||
|
@ -56,22 +57,6 @@ func nametomib(name string) (mib []_C_int, err error) {
|
||||||
return buf[0 : n/siz], nil
|
return buf[0 : n/siz], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
namlen, ok := direntNamlen(buf)
|
|
||||||
if !ok {
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
return (16 + namlen + 1 + 7) &^ 7, true
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
|
||||||
}
|
|
||||||
|
|
||||||
//sysnb pipe() (r int, w int, err error)
|
//sysnb pipe() (r int, w int, err error)
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
|
@ -110,6 +95,23 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
var bufsize uintptr
|
var bufsize uintptr
|
||||||
|
@ -125,6 +127,113 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error {
|
||||||
|
err := sysctl(mib, old, oldlen, nil, 0)
|
||||||
|
if err != nil {
|
||||||
|
// Utsname members on Dragonfly are only 32 bytes and
|
||||||
|
// the syscall returns ENOMEM in case the actual value
|
||||||
|
// is longer.
|
||||||
|
if err == ENOMEM {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctlUname(mib, &uname.Sysname[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Sysname[unsafe.Sizeof(uname.Sysname)-1] = 0
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctlUname(mib, &uname.Nodename[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Nodename[unsafe.Sizeof(uname.Nodename)-1] = 0
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctlUname(mib, &uname.Release[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Release[unsafe.Sizeof(uname.Release)-1] = 0
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctlUname(mib, &uname.Version[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctlUname(mib, &uname.Machine[0], &n); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
uname.Machine[unsafe.Sizeof(uname.Machine)-1] = 0
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
|
@ -142,10 +251,12 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||||
//sys Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
|
@ -174,11 +285,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
|
@ -218,6 +324,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
|
@ -229,7 +336,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// Getlogin
|
// Getlogin
|
||||||
// Sigpending
|
// Sigpending
|
||||||
// Sigaltstack
|
// Sigaltstack
|
||||||
// Ioctl
|
|
||||||
// Reboot
|
// Reboot
|
||||||
// Execve
|
// Execve
|
||||||
// Vfork
|
// Vfork
|
||||||
|
@ -252,9 +358,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// Add_profil
|
// Add_profil
|
||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
|
||||||
// Mlock
|
|
||||||
// Munlock
|
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
|
@ -264,7 +367,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
// Copyfile
|
// Copyfile
|
||||||
// Poll
|
|
||||||
// Watchevent
|
// Watchevent
|
||||||
// Waitevent
|
// Waitevent
|
||||||
// Modwatch
|
// Modwatch
|
||||||
|
@ -347,8 +449,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// Lio_listio
|
// Lio_listio
|
||||||
// __pthread_cond_wait
|
// __pthread_cond_wait
|
||||||
// Iopolicysys
|
// Iopolicysys
|
||||||
// Mlockall
|
|
||||||
// Munlockall
|
|
||||||
// __pthread_kill
|
// __pthread_kill
|
||||||
// __pthread_sigmask
|
// __pthread_sigmask
|
||||||
// __sigwait
|
// __sigwait
|
||||||
|
@ -401,7 +501,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// Sendmsg_nocancel
|
// Sendmsg_nocancel
|
||||||
// Recvfrom_nocancel
|
// Recvfrom_nocancel
|
||||||
// Accept_nocancel
|
// Accept_nocancel
|
||||||
// Msync_nocancel
|
|
||||||
// Fcntl_nocancel
|
// Fcntl_nocancel
|
||||||
// Select_nocancel
|
// Select_nocancel
|
||||||
// Fsync_nocancel
|
// Fsync_nocancel
|
||||||
|
@ -413,7 +512,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// Pread_nocancel
|
// Pread_nocancel
|
||||||
// Pwrite_nocancel
|
// Pwrite_nocancel
|
||||||
// Waitid_nocancel
|
// Waitid_nocancel
|
||||||
// Poll_nocancel
|
|
||||||
// Msgsnd_nocancel
|
// Msgsnd_nocancel
|
||||||
// Msgrcv_nocancel
|
// Msgrcv_nocancel
|
||||||
// Sem_wait_nocancel
|
// Sem_wait_nocancel
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
174
vendor/golang.org/x/sys/unix/syscall_freebsd.go
generated
vendored
174
vendor/golang.org/x/sys/unix/syscall_freebsd.go
generated
vendored
|
@ -12,8 +12,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import "unsafe"
|
import (
|
||||||
|
"strings"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||||
type SockaddrDatalink struct {
|
type SockaddrDatalink struct {
|
||||||
Len uint8
|
Len uint8
|
||||||
Family uint8
|
Family uint8
|
||||||
|
@ -54,18 +58,6 @@ func nametomib(name string) (mib []_C_int, err error) {
|
||||||
return buf[0 : n/siz], nil
|
return buf[0 : n/siz], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
|
||||||
}
|
|
||||||
|
|
||||||
//sysnb pipe() (r int, w int, err error)
|
//sysnb pipe() (r int, w int, err error)
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
|
@ -105,6 +97,23 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
var _p0 unsafe.Pointer
|
var _p0 unsafe.Pointer
|
||||||
var bufsize uintptr
|
var bufsize uintptr
|
||||||
|
@ -120,17 +129,15 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
// Derive extattr namespace and attribute name
|
// Derive extattr namespace and attribute name
|
||||||
|
|
||||||
func xattrnamespace(fullattr string) (ns int, attr string, err error) {
|
func xattrnamespace(fullattr string) (ns int, attr string, err error) {
|
||||||
s := -1
|
s := strings.IndexByte(fullattr, '.')
|
||||||
for idx, val := range fullattr {
|
|
||||||
if val == '.' {
|
|
||||||
s = idx
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if s == -1 {
|
if s == -1 {
|
||||||
return -1, "", ENOATTR
|
return -1, "", ENOATTR
|
||||||
}
|
}
|
||||||
|
@ -271,7 +278,6 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
||||||
|
|
||||||
// FreeBSD won't allow you to list xattrs from multiple namespaces
|
// FreeBSD won't allow you to list xattrs from multiple namespaces
|
||||||
s := 0
|
s := 0
|
||||||
var e error
|
|
||||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||||
stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
|
stmp, e := ExtattrListFile(file, nsid, uintptr(d), destsiz)
|
||||||
|
|
||||||
|
@ -283,7 +289,6 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
||||||
* we don't have read permissions on, so don't ignore those errors
|
* we don't have read permissions on, so don't ignore those errors
|
||||||
*/
|
*/
|
||||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||||
e = nil
|
|
||||||
continue
|
continue
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return s, e
|
return s, e
|
||||||
|
@ -297,7 +302,7 @@ func Listxattr(file string, dest []byte) (sz int, err error) {
|
||||||
d = initxattrdest(dest, s)
|
d = initxattrdest(dest, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, e
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
||||||
|
@ -305,11 +310,9 @@ func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
||||||
destsiz := len(dest)
|
destsiz := len(dest)
|
||||||
|
|
||||||
s := 0
|
s := 0
|
||||||
var e error
|
|
||||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||||
stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
|
stmp, e := ExtattrListFd(fd, nsid, uintptr(d), destsiz)
|
||||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||||
e = nil
|
|
||||||
continue
|
continue
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return s, e
|
return s, e
|
||||||
|
@ -323,7 +326,7 @@ func Flistxattr(fd int, dest []byte) (sz int, err error) {
|
||||||
d = initxattrdest(dest, s)
|
d = initxattrdest(dest, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, e
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Llistxattr(link string, dest []byte) (sz int, err error) {
|
func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
|
@ -331,11 +334,9 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
destsiz := len(dest)
|
destsiz := len(dest)
|
||||||
|
|
||||||
s := 0
|
s := 0
|
||||||
var e error
|
|
||||||
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
for _, nsid := range [...]int{EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM} {
|
||||||
stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
|
stmp, e := ExtattrListLink(link, nsid, uintptr(d), destsiz)
|
||||||
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
if e != nil && e == EPERM && nsid != EXTATTR_NAMESPACE_USER {
|
||||||
e = nil
|
|
||||||
continue
|
continue
|
||||||
} else if e != nil {
|
} else if e != nil {
|
||||||
return s, e
|
return s, e
|
||||||
|
@ -349,7 +350,92 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
d = initxattrdest(dest, s)
|
d = initxattrdest(dest, s)
|
||||||
}
|
}
|
||||||
|
|
||||||
return s, e
|
return s, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -357,6 +443,9 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
*/
|
*/
|
||||||
//sys Access(path string, mode uint32) (err error)
|
//sys Access(path string, mode uint32) (err error)
|
||||||
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
|
//sys Adjtime(delta *Timeval, olddelta *Timeval) (err error)
|
||||||
|
//sys CapEnter() (err error)
|
||||||
|
//sys capRightsGet(version int, fd int, rightsp *CapRights) (err error) = SYS___CAP_RIGHTS_GET
|
||||||
|
//sys capRightsLimit(fd int, rightsp *CapRights) (err error)
|
||||||
//sys Chdir(path string) (err error)
|
//sys Chdir(path string) (err error)
|
||||||
//sys Chflags(path string, flags int) (err error)
|
//sys Chflags(path string, flags int) (err error)
|
||||||
//sys Chmod(path string, mode uint32) (err error)
|
//sys Chmod(path string, mode uint32) (err error)
|
||||||
|
@ -379,16 +468,21 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
|
//sys ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err error)
|
||||||
//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
|
//sys ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) (ret int, err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
|
||||||
|
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||||
//sys Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
|
//sys Getdents(fd int, buf []byte) (n int, err error)
|
||||||
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
|
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
|
||||||
//sys Getdtablesize() (size int)
|
//sys Getdtablesize() (size int)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -409,24 +503,24 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
//sys Kqueue() (fd int, err error)
|
//sys Kqueue() (fd int, err error)
|
||||||
//sys Lchown(path string, uid int, gid int) (err error)
|
//sys Lchown(path string, uid int, gid int) (err error)
|
||||||
//sys Link(path string, link string) (err error)
|
//sys Link(path string, link string) (err error)
|
||||||
|
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
|
||||||
//sys Listen(s int, backlog int) (err error)
|
//sys Listen(s int, backlog int) (err error)
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
|
//sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Readlink(path string, buf []byte) (n int, err error)
|
//sys Readlink(path string, buf []byte) (n int, err error)
|
||||||
|
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
|
||||||
//sys Rename(from string, to string) (err error)
|
//sys Rename(from string, to string) (err error)
|
||||||
|
//sys Renameat(fromfd int, from string, tofd int, to string) (err error)
|
||||||
//sys Revoke(path string) (err error)
|
//sys Revoke(path string) (err error)
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||||
|
@ -448,11 +542,13 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error)
|
//sys Statfs(path string, stat *Statfs_t) (err error)
|
||||||
//sys Symlink(path string, link string) (err error)
|
//sys Symlink(path string, link string) (err error)
|
||||||
|
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||||
//sys Sync() (err error)
|
//sys Sync() (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
//sys Umask(newmask int) (oldmask int)
|
//sys Umask(newmask int) (oldmask int)
|
||||||
//sys Undelete(path string) (err error)
|
//sys Undelete(path string) (err error)
|
||||||
//sys Unlink(path string) (err error)
|
//sys Unlink(path string) (err error)
|
||||||
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Unmount(path string, flags int) (err error)
|
//sys Unmount(path string, flags int) (err error)
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
|
@ -460,6 +556,7 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
|
@ -493,9 +590,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
// Add_profil
|
// Add_profil
|
||||||
// Kdebug_trace
|
// Kdebug_trace
|
||||||
// Sigreturn
|
// Sigreturn
|
||||||
// Mmap
|
|
||||||
// Mlock
|
|
||||||
// Munlock
|
|
||||||
// Atsocket
|
// Atsocket
|
||||||
// Kqueue_from_portset_np
|
// Kqueue_from_portset_np
|
||||||
// Kqueue_portset
|
// Kqueue_portset
|
||||||
|
@ -505,7 +599,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
// Searchfs
|
// Searchfs
|
||||||
// Delete
|
// Delete
|
||||||
// Copyfile
|
// Copyfile
|
||||||
// Poll
|
|
||||||
// Watchevent
|
// Watchevent
|
||||||
// Waitevent
|
// Waitevent
|
||||||
// Modwatch
|
// Modwatch
|
||||||
|
@ -588,8 +681,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
// Lio_listio
|
// Lio_listio
|
||||||
// __pthread_cond_wait
|
// __pthread_cond_wait
|
||||||
// Iopolicysys
|
// Iopolicysys
|
||||||
// Mlockall
|
|
||||||
// Munlockall
|
|
||||||
// __pthread_kill
|
// __pthread_kill
|
||||||
// __pthread_sigmask
|
// __pthread_sigmask
|
||||||
// __sigwait
|
// __sigwait
|
||||||
|
@ -642,7 +733,6 @@ func Llistxattr(link string, dest []byte) (sz int, err error) {
|
||||||
// Sendmsg_nocancel
|
// Sendmsg_nocancel
|
||||||
// Recvfrom_nocancel
|
// Recvfrom_nocancel
|
||||||
// Accept_nocancel
|
// Accept_nocancel
|
||||||
// Msync_nocancel
|
|
||||||
// Fcntl_nocancel
|
// Fcntl_nocancel
|
||||||
// Select_nocancel
|
// Select_nocancel
|
||||||
// Fsync_nocancel
|
// Fsync_nocancel
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return ts.Sec*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
161
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
161
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
|
@ -57,11 +57,15 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
|
|
||||||
// IoctlSetInt performs an ioctl operation which sets an integer value
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
// on fd, using the specified request number.
|
// on fd, using the specified request number.
|
||||||
func IoctlSetInt(fd int, req uint, value int) (err error) {
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
return ioctl(fd, req, uintptr(value))
|
return ioctl(fd, req, uintptr(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlSetTermios(fd int, req uint, value *Termios) (err error) {
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +77,12 @@ func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
return value, err
|
return value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
var value Termios
|
var value Termios
|
||||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
@ -342,10 +352,14 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
func Mkfifo(path string, mode uint32) error {
|
||||||
return Mknod(path, mode|S_IFIFO, 0)
|
return Mknod(path, mode|S_IFIFO, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Mkfifoat(dirfd int, path string, mode uint32) error {
|
||||||
|
return Mknodat(dirfd, path, mode|S_IFIFO, 0)
|
||||||
|
}
|
||||||
|
|
||||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
if sa.Port < 0 || sa.Port > 0xFFFF {
|
if sa.Port < 0 || sa.Port > 0xFFFF {
|
||||||
return nil, 0, EINVAL
|
return nil, 0, EINVAL
|
||||||
|
@ -399,6 +413,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
return unsafe.Pointer(&sa.raw), sl, nil
|
return unsafe.Pointer(&sa.raw), sl, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrLinklayer implements the Sockaddr interface for AF_PACKET type sockets.
|
||||||
type SockaddrLinklayer struct {
|
type SockaddrLinklayer struct {
|
||||||
Protocol uint16
|
Protocol uint16
|
||||||
Ifindex int
|
Ifindex int
|
||||||
|
@ -425,6 +440,7 @@ func (sa *SockaddrLinklayer) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrLinklayer, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrNetlink implements the Sockaddr interface for AF_NETLINK type sockets.
|
||||||
type SockaddrNetlink struct {
|
type SockaddrNetlink struct {
|
||||||
Family uint16
|
Family uint16
|
||||||
Pad uint16
|
Pad uint16
|
||||||
|
@ -441,6 +457,8 @@ func (sa *SockaddrNetlink) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrNetlink, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrHCI implements the Sockaddr interface for AF_BLUETOOTH type sockets
|
||||||
|
// using the HCI protocol.
|
||||||
type SockaddrHCI struct {
|
type SockaddrHCI struct {
|
||||||
Dev uint16
|
Dev uint16
|
||||||
Channel uint16
|
Channel uint16
|
||||||
|
@ -454,6 +472,31 @@ func (sa *SockaddrHCI) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrHCI, nil
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrHCI, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrL2 implements the Sockaddr interface for AF_BLUETOOTH type sockets
|
||||||
|
// using the L2CAP protocol.
|
||||||
|
type SockaddrL2 struct {
|
||||||
|
PSM uint16
|
||||||
|
CID uint16
|
||||||
|
Addr [6]uint8
|
||||||
|
AddrType uint8
|
||||||
|
raw RawSockaddrL2
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
|
sa.raw.Family = AF_BLUETOOTH
|
||||||
|
psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm))
|
||||||
|
psm[0] = byte(sa.PSM)
|
||||||
|
psm[1] = byte(sa.PSM >> 8)
|
||||||
|
for i := 0; i < len(sa.Addr); i++ {
|
||||||
|
sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i]
|
||||||
|
}
|
||||||
|
cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid))
|
||||||
|
cid[0] = byte(sa.CID)
|
||||||
|
cid[1] = byte(sa.CID >> 8)
|
||||||
|
sa.raw.Bdaddr_type = sa.AddrType
|
||||||
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrL2, nil
|
||||||
|
}
|
||||||
|
|
||||||
// SockaddrCAN implements the Sockaddr interface for AF_CAN type sockets.
|
// SockaddrCAN implements the Sockaddr interface for AF_CAN type sockets.
|
||||||
// The RxID and TxID fields are used for transport protocol addressing in
|
// The RxID and TxID fields are used for transport protocol addressing in
|
||||||
// (CAN_TP16, CAN_TP20, CAN_MCNET, and CAN_ISOTP), they can be left with
|
// (CAN_TP16, CAN_TP20, CAN_MCNET, and CAN_ISOTP), they can be left with
|
||||||
|
@ -739,19 +782,6 @@ func Getsockname(fd int) (sa Sockaddr, err error) {
|
||||||
return anyToSockaddr(&rsa)
|
return anyToSockaddr(&rsa)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
|
|
||||||
vallen := _Socklen(4)
|
|
||||||
err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
|
|
||||||
return value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {
|
|
||||||
var value IPMreq
|
|
||||||
vallen := _Socklen(SizeofIPMreq)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
|
func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
|
||||||
var value IPMreqn
|
var value IPMreqn
|
||||||
vallen := _Socklen(SizeofIPMreqn)
|
vallen := _Socklen(SizeofIPMreqn)
|
||||||
|
@ -759,27 +789,6 @@ func GetsockoptIPMreqn(fd, level, opt int) (*IPMreqn, error) {
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {
|
|
||||||
var value IPv6Mreq
|
|
||||||
vallen := _Socklen(SizeofIPv6Mreq)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {
|
|
||||||
var value IPv6MTUInfo
|
|
||||||
vallen := _Socklen(SizeofIPv6MTUInfo)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {
|
|
||||||
var value ICMPv6Filter
|
|
||||||
vallen := _Socklen(SizeofICMPv6Filter)
|
|
||||||
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
|
||||||
return &value, err
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetsockoptUcred(fd, level, opt int) (*Ucred, error) {
|
func GetsockoptUcred(fd, level, opt int) (*Ucred, error) {
|
||||||
var value Ucred
|
var value Ucred
|
||||||
vallen := _Socklen(SizeofUcred)
|
vallen := _Socklen(SizeofUcred)
|
||||||
|
@ -794,6 +803,24 @@ func GetsockoptTCPInfo(fd, level, opt int) (*TCPInfo, error) {
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetsockoptString returns the string value of the socket option opt for the
|
||||||
|
// socket associated with fd at the given socket level.
|
||||||
|
func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
|
buf := make([]byte, 256)
|
||||||
|
vallen := _Socklen(len(buf))
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
if err != nil {
|
||||||
|
if err == ERANGE {
|
||||||
|
buf = make([]byte, vallen)
|
||||||
|
err = getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
}
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return string(buf[:vallen-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
|
||||||
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
return setsockopt(fd, level, opt, unsafe.Pointer(mreq), unsafe.Sizeof(*mreq))
|
||||||
}
|
}
|
||||||
|
@ -912,17 +939,24 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
||||||
msg.Namelen = uint32(SizeofSockaddrAny)
|
msg.Namelen = uint32(SizeofSockaddrAny)
|
||||||
var iov Iovec
|
var iov Iovec
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
|
iov.Base = &p[0]
|
||||||
iov.SetLen(len(p))
|
iov.SetLen(len(p))
|
||||||
}
|
}
|
||||||
var dummy byte
|
var dummy byte
|
||||||
if len(oob) > 0 {
|
if len(oob) > 0 {
|
||||||
// receive at least one normal byte
|
|
||||||
if len(p) == 0 {
|
if len(p) == 0 {
|
||||||
|
var sockType int
|
||||||
|
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// receive at least one normal byte
|
||||||
|
if sockType != SOCK_DGRAM {
|
||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
}
|
||||||
|
msg.Control = &oob[0]
|
||||||
msg.SetControllen(len(oob))
|
msg.SetControllen(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
|
@ -955,21 +989,28 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var msg Msghdr
|
var msg Msghdr
|
||||||
msg.Name = (*byte)(unsafe.Pointer(ptr))
|
msg.Name = (*byte)(ptr)
|
||||||
msg.Namelen = uint32(salen)
|
msg.Namelen = uint32(salen)
|
||||||
var iov Iovec
|
var iov Iovec
|
||||||
if len(p) > 0 {
|
if len(p) > 0 {
|
||||||
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
|
iov.Base = &p[0]
|
||||||
iov.SetLen(len(p))
|
iov.SetLen(len(p))
|
||||||
}
|
}
|
||||||
var dummy byte
|
var dummy byte
|
||||||
if len(oob) > 0 {
|
if len(oob) > 0 {
|
||||||
// send at least one normal byte
|
|
||||||
if len(p) == 0 {
|
if len(p) == 0 {
|
||||||
|
var sockType int
|
||||||
|
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
// send at least one normal byte
|
||||||
|
if sockType != SOCK_DGRAM {
|
||||||
iov.Base = &dummy
|
iov.Base = &dummy
|
||||||
iov.SetLen(1)
|
iov.SetLen(1)
|
||||||
}
|
}
|
||||||
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
}
|
||||||
|
msg.Control = &oob[0]
|
||||||
msg.SetControllen(len(oob))
|
msg.SetControllen(len(oob))
|
||||||
}
|
}
|
||||||
msg.Iov = &iov
|
msg.Iov = &iov
|
||||||
|
@ -1101,6 +1142,10 @@ func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) {
|
||||||
return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
|
return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
|
||||||
|
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
|
||||||
|
}
|
||||||
|
|
||||||
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
||||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||||
}
|
}
|
||||||
|
@ -1144,22 +1189,6 @@ func ReadDirent(fd int, buf []byte) (n int, err error) {
|
||||||
return Getdents(fd, buf)
|
return Getdents(fd, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
reclen, ok := direntReclen(buf)
|
|
||||||
if !ok {
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
|
|
||||||
}
|
|
||||||
|
|
||||||
//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
|
//sys mount(source string, target string, fstype string, flags uintptr, data *byte) (err error)
|
||||||
|
|
||||||
func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
|
func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
|
||||||
|
@ -1235,9 +1264,11 @@ func Getpgrp() (pid int) {
|
||||||
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
|
||||||
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
|
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
|
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
|
||||||
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
||||||
//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
|
//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
|
||||||
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
||||||
|
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Removexattr(path string, attr string) (err error)
|
//sys Removexattr(path string, attr string) (err error)
|
||||||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||||
|
@ -1264,7 +1295,9 @@ func Setgid(uid int) (err error) {
|
||||||
|
|
||||||
//sys Setpriority(which int, who int, prio int) (err error)
|
//sys Setpriority(which int, who int, prio int) (err error)
|
||||||
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
|
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
|
||||||
|
//sys Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error)
|
||||||
//sys Sync()
|
//sys Sync()
|
||||||
|
//sys Syncfs(fd int) (err error)
|
||||||
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
||||||
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
|
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
|
||||||
//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
|
//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
|
||||||
|
@ -1299,8 +1332,9 @@ func Munmap(b []byte) (err error) {
|
||||||
//sys Madvise(b []byte, advice int) (err error)
|
//sys Madvise(b []byte, advice int) (err error)
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
//sys Mlockall(flags int) (err error)
|
||||||
|
//sys Msync(b []byte, flags int) (err error)
|
||||||
|
//sys Munlock(b []byte) (err error)
|
||||||
//sys Munlockall() (err error)
|
//sys Munlockall() (err error)
|
||||||
|
|
||||||
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
||||||
|
@ -1368,7 +1402,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
||||||
// ModifyLdt
|
// ModifyLdt
|
||||||
// Mount
|
// Mount
|
||||||
// MovePages
|
// MovePages
|
||||||
// Mprotect
|
|
||||||
// MqGetsetattr
|
// MqGetsetattr
|
||||||
// MqNotify
|
// MqNotify
|
||||||
// MqOpen
|
// MqOpen
|
||||||
|
@ -1380,8 +1413,6 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
||||||
// Msgget
|
// Msgget
|
||||||
// Msgrcv
|
// Msgrcv
|
||||||
// Msgsnd
|
// Msgsnd
|
||||||
// Msync
|
|
||||||
// Newfstatat
|
|
||||||
// Nfsservctl
|
// Nfsservctl
|
||||||
// Personality
|
// Personality
|
||||||
// Pselect6
|
// Pselect6
|
||||||
|
@ -1402,11 +1433,9 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
||||||
// RtSigtimedwait
|
// RtSigtimedwait
|
||||||
// SchedGetPriorityMax
|
// SchedGetPriorityMax
|
||||||
// SchedGetPriorityMin
|
// SchedGetPriorityMin
|
||||||
// SchedGetaffinity
|
|
||||||
// SchedGetparam
|
// SchedGetparam
|
||||||
// SchedGetscheduler
|
// SchedGetscheduler
|
||||||
// SchedRrGetInterval
|
// SchedRrGetInterval
|
||||||
// SchedSetaffinity
|
|
||||||
// SchedSetparam
|
// SchedSetparam
|
||||||
// SchedYield
|
// SchedYield
|
||||||
// Security
|
// Security
|
||||||
|
|
18
vendor/golang.org/x/sys/unix/syscall_linux_386.go
generated
vendored
18
vendor/golang.org/x/sys/unix/syscall_linux_386.go
generated
vendored
|
@ -14,21 +14,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (err error)
|
//sysnb pipe(p *[2]_C_int) (err error)
|
||||||
|
@ -63,6 +54,7 @@ func Pipe2(p []int, flags int) (err error) {
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
||||||
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
||||||
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
||||||
|
|
35
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
generated
vendored
35
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
generated
vendored
|
@ -11,6 +11,7 @@ package unix
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -28,7 +29,15 @@ package unix
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
|
||||||
|
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
||||||
|
var ts *Timespec
|
||||||
|
if timeout != nil {
|
||||||
|
ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
||||||
|
}
|
||||||
|
return Pselect(nfd, r, w, e, ts, nil)
|
||||||
|
}
|
||||||
|
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
|
@ -39,7 +48,12 @@ package unix
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
|
||||||
|
func Stat(path string, stat *Stat_t) (err error) {
|
||||||
|
// Use fstatat, because Android's seccomp policy blocks stat.
|
||||||
|
return Fstatat(AT_FDCWD, path, stat, 0)
|
||||||
|
}
|
||||||
|
|
||||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error)
|
//sys Truncate(path string, length int64) (err error)
|
||||||
|
@ -69,8 +83,6 @@ func Gettimeofday(tv *Timeval) (err error) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
var tv Timeval
|
var tv Timeval
|
||||||
errno := gettimeofday(&tv)
|
errno := gettimeofday(&tv)
|
||||||
|
@ -85,19 +97,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (err error)
|
//sysnb pipe(p *[2]_C_int) (err error)
|
||||||
|
|
18
vendor/golang.org/x/sys/unix/syscall_linux_arm.go
generated
vendored
18
vendor/golang.org/x/sys/unix/syscall_linux_arm.go
generated
vendored
|
@ -11,21 +11,12 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
|
@ -86,6 +77,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
//sysnb Getegid() (egid int) = SYS_GETEGID32
|
||||||
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
//sysnb Geteuid() (euid int) = SYS_GETEUID32
|
||||||
//sysnb Getgid() (gid int) = SYS_GETGID32
|
//sysnb Getgid() (gid int) = SYS_GETGID32
|
||||||
|
|
28
vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
generated
vendored
28
vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
generated
vendored
|
@ -7,6 +7,7 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
|
||||||
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||||
|
@ -21,7 +22,15 @@ package unix
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6
|
|
||||||
|
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
||||||
|
var ts *Timespec
|
||||||
|
if timeout != nil {
|
||||||
|
ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
||||||
|
}
|
||||||
|
return Pselect(nfd, r, w, e, ts, nil)
|
||||||
|
}
|
||||||
|
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
|
@ -66,23 +75,14 @@ func Lstat(path string, stat *Stat_t) (err error) {
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 65536 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Time(t *Time_t) (Time_t, error) {
|
func Time(t *Time_t) (Time_t, error) {
|
||||||
|
|
14
vendor/golang.org/x/sys/unix/syscall_linux_gc.go
generated
vendored
Normal file
14
vendor/golang.org/x/sys/unix/syscall_linux_gc.go
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build linux,!gccgo
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
// SyscallNoError may be used instead of Syscall for syscalls that don't fail.
|
||||||
|
func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
|
||||||
|
|
||||||
|
// RawSyscallNoError may be used instead of RawSyscall for syscalls that don't
|
||||||
|
// fail.
|
||||||
|
func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr)
|
21
vendor/golang.org/x/sys/unix/syscall_linux_gccgo.go
generated
vendored
Normal file
21
vendor/golang.org/x/sys/unix/syscall_linux_gccgo.go
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build linux
|
||||||
|
// +build gccgo
|
||||||
|
// +build 386 arm
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) {
|
||||||
|
offsetLow := uint32(offset & 0xffffffff)
|
||||||
|
offsetHigh := uint32((offset >> 32) & 0xffffffff)
|
||||||
|
_, _, err = Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0)
|
||||||
|
return newoffset, err
|
||||||
|
}
|
29
vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
generated
vendored
29
vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
generated
vendored
|
@ -9,7 +9,9 @@ package unix
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -23,7 +25,15 @@ package unix
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS_PSELECT6
|
|
||||||
|
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
||||||
|
var ts *Timespec
|
||||||
|
if timeout != nil {
|
||||||
|
ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
||||||
|
}
|
||||||
|
return Pselect(nfd, r, w, e, ts, nil)
|
||||||
|
}
|
||||||
|
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
|
@ -55,8 +65,6 @@ package unix
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 65536 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
|
@ -73,19 +81,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
|
|
21
vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
generated
vendored
21
vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
generated
vendored
|
@ -15,6 +15,7 @@ import (
|
||||||
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -35,7 +36,7 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||||
|
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||||
|
|
||||||
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||||
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
|
||||||
|
@ -65,6 +66,7 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||||
|
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
//sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
@ -99,19 +101,12 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: int32(sec), Nsec: int32(nsec)}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int32(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||||
tv.Sec = int32(nsec / 1e9)
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||||
|
@ -235,5 +230,3 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
}
|
}
|
||||||
return poll(&fds[0], len(fds), timeout)
|
return poll(&fds[0], len(fds), timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
21
vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
generated
vendored
21
vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
generated
vendored
|
@ -9,8 +9,10 @@ package unix
|
||||||
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -28,7 +30,7 @@ package unix
|
||||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys Setfsgid(gid int) (err error)
|
//sys Setfsgid(gid int) (err error)
|
||||||
//sys Setfsuid(uid int) (err error)
|
//sys Setfsuid(uid int) (err error)
|
||||||
|
@ -61,26 +63,17 @@ package unix
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 65536 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
//sysnb Time(t *Time_t) (tt Time_t, err error)
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Nip }
|
func (r *PtraceRegs) PC() uint64 { return r.Nip }
|
||||||
|
|
18
vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
generated
vendored
18
vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
generated
vendored
|
@ -15,6 +15,7 @@ import (
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -46,8 +47,6 @@ import (
|
||||||
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
|
//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
|
||||||
//sysnb setgroups(n int, list *_Gid_t) (err error)
|
//sysnb setgroups(n int, list *_Gid_t) (err error)
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
|
||||||
|
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
|
||||||
func Time(t *Time_t) (tt Time_t, err error) {
|
func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
|
@ -64,19 +63,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||||
|
|
37
vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
generated
vendored
37
vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
generated
vendored
|
@ -6,15 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
|
||||||
"sync/atomic"
|
|
||||||
"syscall"
|
|
||||||
)
|
|
||||||
|
|
||||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||||
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -63,21 +60,6 @@ import (
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
||||||
func sysconf(name int) (n int64, err syscall.Errno)
|
|
||||||
|
|
||||||
// pageSize caches the value of Getpagesize, since it can't change
|
|
||||||
// once the system is booted.
|
|
||||||
var pageSize int64 // accessed atomically
|
|
||||||
|
|
||||||
func Getpagesize() int {
|
|
||||||
n := atomic.LoadInt64(&pageSize)
|
|
||||||
if n == 0 {
|
|
||||||
n, _ = sysconf(_SC_PAGESIZE)
|
|
||||||
atomic.StoreInt64(&pageSize, n)
|
|
||||||
}
|
|
||||||
return int(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Ioperm(from int, num int, on int) (err error) {
|
func Ioperm(from int, num int, on int) (err error) {
|
||||||
return ENOSYS
|
return ENOSYS
|
||||||
}
|
}
|
||||||
|
@ -102,19 +84,12 @@ func Time(t *Time_t) (tt Time_t, err error) {
|
||||||
|
|
||||||
//sys Utime(path string, buf *Utimbuf) (err error)
|
//sys Utime(path string, buf *Utimbuf) (err error)
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *PtraceRegs) PC() uint64 { return r.Tpc }
|
func (r *PtraceRegs) PC() uint64 { return r.Tpc }
|
||||||
|
|
133
vendor/golang.org/x/sys/unix/syscall_netbsd.go
generated
vendored
133
vendor/golang.org/x/sys/unix/syscall_netbsd.go
generated
vendored
|
@ -17,6 +17,7 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||||
type SockaddrDatalink struct {
|
type SockaddrDatalink struct {
|
||||||
Len uint8
|
Len uint8
|
||||||
Family uint8
|
Family uint8
|
||||||
|
@ -55,7 +56,6 @@ func sysctlNodes(mib []_C_int) (nodes []Sysctlnode, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func nametomib(name string) (mib []_C_int, err error) {
|
func nametomib(name string) (mib []_C_int, err error) {
|
||||||
|
|
||||||
// Split name into components.
|
// Split name into components.
|
||||||
var parts []string
|
var parts []string
|
||||||
last := 0
|
last := 0
|
||||||
|
@ -93,18 +93,6 @@ func nametomib(name string) (mib []_C_int, err error) {
|
||||||
return mib, nil
|
return mib, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
|
||||||
}
|
|
||||||
|
|
||||||
//sysnb pipe() (fd1 int, fd2 int, err error)
|
//sysnb pipe() (fd1 int, fd2 int, err error)
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
if len(p) != 2 {
|
if len(p) != 2 {
|
||||||
|
@ -119,11 +107,118 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||||
return getdents(fd, buf)
|
return getdents(fd, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||||
return -1, ENOSYS
|
return -1, ENOSYS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
|
@ -138,13 +233,16 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sys Dup(fd int) (nfd int, err error)
|
//sys Dup(fd int) (nfd int, err error)
|
||||||
//sys Dup2(from int, to int) (err error)
|
//sys Dup2(from int, to int) (err error)
|
||||||
//sys Exit(code int)
|
//sys Exit(code int)
|
||||||
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_POSIX_FADVISE
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||||
//sys Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
//sysnb Getegid() (egid int)
|
//sysnb Getegid() (egid int)
|
||||||
|
@ -170,11 +268,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
|
@ -210,6 +303,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
|
@ -229,7 +323,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
// __msync13
|
// __msync13
|
||||||
// __ntp_gettime30
|
// __ntp_gettime30
|
||||||
// __posix_chown
|
// __posix_chown
|
||||||
// __posix_fadvise50
|
|
||||||
// __posix_fchown
|
// __posix_fchown
|
||||||
// __posix_lchown
|
// __posix_lchown
|
||||||
// __posix_rename
|
// __posix_rename
|
||||||
|
@ -388,7 +481,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
// getitimer
|
// getitimer
|
||||||
// getvfsstat
|
// getvfsstat
|
||||||
// getxattr
|
// getxattr
|
||||||
// ioctl
|
|
||||||
// ktrace
|
// ktrace
|
||||||
// lchflags
|
// lchflags
|
||||||
// lchmod
|
// lchmod
|
||||||
|
@ -426,7 +518,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
// ntp_adjtime
|
// ntp_adjtime
|
||||||
// pmc_control
|
// pmc_control
|
||||||
// pmc_get_info
|
// pmc_get_info
|
||||||
// poll
|
|
||||||
// pollts
|
// pollts
|
||||||
// preadv
|
// preadv
|
||||||
// profil
|
// profil
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_netbsd_386.go
generated
vendored
|
@ -6,21 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go
generated
vendored
|
@ -6,21 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int64(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go
generated
vendored
|
@ -6,21 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
11
vendor/golang.org/x/sys/unix/syscall_no_getwd.go
generated
vendored
11
vendor/golang.org/x/sys/unix/syscall_no_getwd.go
generated
vendored
|
@ -1,11 +0,0 @@
|
||||||
// Copyright 2013 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// +build dragonfly freebsd netbsd openbsd
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
const ImplementsGetwd = false
|
|
||||||
|
|
||||||
func Getwd() (string, error) { return "", ENOTSUP }
|
|
158
vendor/golang.org/x/sys/unix/syscall_openbsd.go
generated
vendored
158
vendor/golang.org/x/sys/unix/syscall_openbsd.go
generated
vendored
|
@ -13,10 +13,12 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sort"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||||
type SockaddrDatalink struct {
|
type SockaddrDatalink struct {
|
||||||
Len uint8
|
Len uint8
|
||||||
Family uint8
|
Family uint8
|
||||||
|
@ -32,39 +34,15 @@ type SockaddrDatalink struct {
|
||||||
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
func nametomib(name string) (mib []_C_int, err error) {
|
func nametomib(name string) (mib []_C_int, err error) {
|
||||||
|
i := sort.Search(len(sysctlMib), func(i int) bool {
|
||||||
// Perform lookup via a binary search
|
return sysctlMib[i].ctlname >= name
|
||||||
left := 0
|
})
|
||||||
right := len(sysctlMib) - 1
|
if i < len(sysctlMib) && sysctlMib[i].ctlname == name {
|
||||||
for {
|
return sysctlMib[i].ctloid, nil
|
||||||
idx := left + (right-left)/2
|
|
||||||
switch {
|
|
||||||
case name == sysctlMib[idx].ctlname:
|
|
||||||
return sysctlMib[idx].ctloid, nil
|
|
||||||
case name > sysctlMib[idx].ctlname:
|
|
||||||
left = idx + 1
|
|
||||||
default:
|
|
||||||
right = idx - 1
|
|
||||||
}
|
|
||||||
if left > right {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nil, EINVAL
|
return nil, EINVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
|
||||||
}
|
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (err error)
|
//sysnb pipe(p *[2]_C_int) (err error)
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
if len(p) != 2 {
|
if len(p) != 2 {
|
||||||
|
@ -82,6 +60,23 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||||
return getdents(fd, buf)
|
return getdents(fd, buf)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
|
//sys Getcwd(buf []byte) (n int, err error) = SYS___GETCWD
|
||||||
|
|
||||||
|
func Getwd() (string, error) {
|
||||||
|
var buf [PathMax]byte
|
||||||
|
_, err := Getcwd(buf[0:])
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
n := clen(buf[:])
|
||||||
|
if n < 1 {
|
||||||
|
return "", EINVAL
|
||||||
|
}
|
||||||
|
return string(buf[:n]), nil
|
||||||
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
||||||
return -1, ENOSYS
|
return -1, ENOSYS
|
||||||
|
@ -102,6 +97,96 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setattrlistTimes(path string, times []Timespec, flags int) error {
|
||||||
|
// used on Darwin for UtimesNano
|
||||||
|
return ENOSYS
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
|
return ioctl(fd, req, uintptr(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(value)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
func IoctlGetInt(fd int, req uint) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func Uname(uname *Utsname) error {
|
||||||
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
|
n = unsafe.Sizeof(uname.Release)
|
||||||
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
|
n = unsafe.Sizeof(uname.Version)
|
||||||
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// The version might have newlines or tabs in it, convert them to
|
||||||
|
// spaces.
|
||||||
|
for i, b := range uname.Version {
|
||||||
|
if b == '\n' || b == '\t' {
|
||||||
|
if i == len(uname.Version)-1 {
|
||||||
|
uname.Version[i] = 0
|
||||||
|
} else {
|
||||||
|
uname.Version[i] = ' '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
|
@ -119,10 +204,12 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sys Fchdir(fd int) (err error)
|
//sys Fchdir(fd int) (err error)
|
||||||
//sys Fchflags(fd int, flags int) (err error)
|
//sys Fchflags(fd int, flags int) (err error)
|
||||||
//sys Fchmod(fd int, mode uint32) (err error)
|
//sys Fchmod(fd int, mode uint32) (err error)
|
||||||
|
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Flock(fd int, how int) (err error)
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||||
//sys Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
//sys Ftruncate(fd int, length int64) (err error)
|
//sys Ftruncate(fd int, length int64) (err error)
|
||||||
|
@ -135,6 +222,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sysnb Getppid() (ppid int)
|
//sysnb Getppid() (ppid int)
|
||||||
//sys Getpriority(which int, who int) (prio int, err error)
|
//sys Getpriority(which int, who int) (prio int, err error)
|
||||||
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
|
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
|
||||||
|
//sysnb Getrtable() (rtable int, err error)
|
||||||
//sysnb Getrusage(who int, rusage *Rusage) (err error)
|
//sysnb Getrusage(who int, rusage *Rusage) (err error)
|
||||||
//sysnb Getsid(pid int) (sid int, err error)
|
//sysnb Getsid(pid int) (sid int, err error)
|
||||||
//sysnb Gettimeofday(tv *Timeval) (err error)
|
//sysnb Gettimeofday(tv *Timeval) (err error)
|
||||||
|
@ -149,11 +237,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sys Mkdir(path string, mode uint32) (err error)
|
//sys Mkdir(path string, mode uint32) (err error)
|
||||||
//sys Mkfifo(path string, mode uint32) (err error)
|
//sys Mkfifo(path string, mode uint32) (err error)
|
||||||
//sys Mknod(path string, mode uint32, dev int) (err error)
|
//sys Mknod(path string, mode uint32, dev int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
|
||||||
//sys Mlockall(flags int) (err error)
|
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
|
||||||
//sys Munlock(b []byte) (err error)
|
|
||||||
//sys Munlockall() (err error)
|
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
//sys Open(path string, mode int, perm uint32) (fd int, err error)
|
||||||
//sys Pathconf(path string, name int) (val int, err error)
|
//sys Pathconf(path string, name int) (val int, err error)
|
||||||
|
@ -177,6 +260,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
||||||
|
//sysnb Setrtable(rtable int) (err error)
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
|
@ -193,6 +277,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
||||||
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
|
@ -224,9 +309,7 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// getlogin
|
// getlogin
|
||||||
// getresgid
|
// getresgid
|
||||||
// getresuid
|
// getresuid
|
||||||
// getrtable
|
|
||||||
// getthrid
|
// getthrid
|
||||||
// ioctl
|
|
||||||
// ktrace
|
// ktrace
|
||||||
// lfs_bmapv
|
// lfs_bmapv
|
||||||
// lfs_markv
|
// lfs_markv
|
||||||
|
@ -247,7 +330,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// nfssvc
|
// nfssvc
|
||||||
// nnpfspioctl
|
// nnpfspioctl
|
||||||
// openat
|
// openat
|
||||||
// poll
|
|
||||||
// preadv
|
// preadv
|
||||||
// profil
|
// profil
|
||||||
// pwritev
|
// pwritev
|
||||||
|
@ -262,7 +344,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// semop
|
// semop
|
||||||
// setgroups
|
// setgroups
|
||||||
// setitimer
|
// setitimer
|
||||||
// setrtable
|
|
||||||
// setsockopt
|
// setsockopt
|
||||||
// shmat
|
// shmat
|
||||||
// shmctl
|
// shmctl
|
||||||
|
@ -282,6 +363,5 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
// thrsleep
|
// thrsleep
|
||||||
// thrwakeup
|
// thrwakeup
|
||||||
// unlinkat
|
// unlinkat
|
||||||
// utimensat
|
|
||||||
// vfork
|
// vfork
|
||||||
// writev
|
// writev
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_openbsd_386.go
generated
vendored
|
@ -6,21 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = int64(nsec / 1e9)
|
|
||||||
ts.Nsec = int32(nsec % 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
tv.Usec = int32(nsec % 1e9 / 1e3)
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
17
vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go
generated
vendored
|
@ -6,21 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func Getpagesize() int { return 4096 }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
|
||||||
|
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = nsec / 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
|
33
vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
generated
vendored
Normal file
33
vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build arm,openbsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: int32(nsec)}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
|
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
k.Ident = uint32(fd)
|
||||||
|
k.Filter = int16(mode)
|
||||||
|
k.Flags = uint16(flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
iov.Len = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msghdr *Msghdr) SetControllen(length int) {
|
||||||
|
msghdr.Controllen = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
cmsg.Len = uint32(length)
|
||||||
|
}
|
92
vendor/golang.org/x/sys/unix/syscall_solaris.go
generated
vendored
92
vendor/golang.org/x/sys/unix/syscall_solaris.go
generated
vendored
|
@ -13,7 +13,6 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"sync/atomic"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
@ -24,6 +23,7 @@ type syscallFunc uintptr
|
||||||
func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func rawSysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func sysvicall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
|
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
|
||||||
type SockaddrDatalink struct {
|
type SockaddrDatalink struct {
|
||||||
Family uint16
|
Family uint16
|
||||||
Index uint16
|
Index uint16
|
||||||
|
@ -35,31 +35,6 @@ type SockaddrDatalink struct {
|
||||||
raw RawSockaddrDatalink
|
raw RawSockaddrDatalink
|
||||||
}
|
}
|
||||||
|
|
||||||
func clen(n []byte) int {
|
|
||||||
for i := 0; i < len(n); i++ {
|
|
||||||
if n[i] == 0 {
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len(n)
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntIno(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntReclen(buf []byte) (uint64, bool) {
|
|
||||||
return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
|
|
||||||
}
|
|
||||||
|
|
||||||
func direntNamlen(buf []byte) (uint64, bool) {
|
|
||||||
reclen, ok := direntReclen(buf)
|
|
||||||
if !ok {
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
|
|
||||||
}
|
|
||||||
|
|
||||||
//sysnb pipe(p *[2]_C_int) (n int, err error)
|
//sysnb pipe(p *[2]_C_int) (n int, err error)
|
||||||
|
|
||||||
func Pipe(p []int) (err error) {
|
func Pipe(p []int) (err error) {
|
||||||
|
@ -140,6 +115,18 @@ func Getsockname(fd int) (sa Sockaddr, err error) {
|
||||||
return anyToSockaddr(&rsa)
|
return anyToSockaddr(&rsa)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetsockoptString returns the string value of the socket option opt for the
|
||||||
|
// socket associated with fd at the given socket level.
|
||||||
|
func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
|
buf := make([]byte, 256)
|
||||||
|
vallen := _Socklen(len(buf))
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&buf[0]), &vallen)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
return string(buf[:vallen-1]), nil
|
||||||
|
}
|
||||||
|
|
||||||
const ImplementsGetwd = true
|
const ImplementsGetwd = true
|
||||||
|
|
||||||
//sys Getcwd(buf []byte) (n int, err error)
|
//sys Getcwd(buf []byte) (n int, err error)
|
||||||
|
@ -325,6 +312,12 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
|
||||||
|
|
||||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||||
|
|
||||||
|
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
||||||
|
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
||||||
|
valptr, _, err := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(arg), 0, 0, 0)
|
||||||
|
return int(valptr), err
|
||||||
|
}
|
||||||
|
|
||||||
// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
|
// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
|
||||||
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
||||||
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0)
|
_, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procfcntl)), 3, uintptr(fd), uintptr(cmd), uintptr(unsafe.Pointer(lk)), 0, 0, 0)
|
||||||
|
@ -515,6 +508,24 @@ func Acct(path string) (err error) {
|
||||||
return acct(pathp)
|
return acct(pathp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys __makedev(version int, major uint, minor uint) (val uint64)
|
||||||
|
|
||||||
|
func Mkdev(major, minor uint32) uint64 {
|
||||||
|
return __makedev(NEWDEV, uint(major), uint(minor))
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys __major(version int, dev uint64) (val uint)
|
||||||
|
|
||||||
|
func Major(dev uint64) uint32 {
|
||||||
|
return uint32(__major(NEWDEV, dev))
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys __minor(version int, dev uint64) (val uint)
|
||||||
|
|
||||||
|
func Minor(dev uint64) uint32 {
|
||||||
|
return uint32(__minor(NEWDEV, dev))
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expose the ioctl function
|
* Expose the ioctl function
|
||||||
*/
|
*/
|
||||||
|
@ -561,6 +572,15 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
return &value, err
|
return &value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||||
|
|
||||||
|
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
|
if len(fds) == 0 {
|
||||||
|
return poll(nil, 0, timeout)
|
||||||
|
}
|
||||||
|
return poll(&fds[0], len(fds), timeout)
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exposed directly
|
* Exposed directly
|
||||||
*/
|
*/
|
||||||
|
@ -581,8 +601,10 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
//sys Fdatasync(fd int) (err error)
|
//sys Fdatasync(fd int) (err error)
|
||||||
|
//sys Flock(fd int, how int) (err error)
|
||||||
//sys Fpathconf(fd int, name int) (val int, err error)
|
//sys Fpathconf(fd int, name int) (val int, err error)
|
||||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||||
|
//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||||
//sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error)
|
//sys Fstatvfs(fd int, vfsstat *Statvfs_t) (err error)
|
||||||
//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
|
//sys Getdents(fd int, buf []byte, basep *uintptr) (n int, err error)
|
||||||
//sysnb Getgid() (gid int)
|
//sysnb Getgid() (gid int)
|
||||||
|
@ -612,6 +634,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
//sys Mlockall(flags int) (err error)
|
//sys Mlockall(flags int) (err error)
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
|
//sys Msync(b []byte, flags int) (err error)
|
||||||
//sys Munlock(b []byte) (err error)
|
//sys Munlock(b []byte) (err error)
|
||||||
//sys Munlockall() (err error)
|
//sys Munlockall() (err error)
|
||||||
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
|
||||||
|
@ -627,6 +650,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = lseek
|
||||||
|
//sys Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error)
|
||||||
//sysnb Setegid(egid int) (err error)
|
//sysnb Setegid(egid int) (err error)
|
||||||
//sysnb Seteuid(euid int) (err error)
|
//sysnb Seteuid(euid int) (err error)
|
||||||
//sysnb Setgid(gid int) (err error)
|
//sysnb Setgid(gid int) (err error)
|
||||||
|
@ -658,6 +682,7 @@ func IoctlGetTermio(fd int, req uint) (*Termio, error) {
|
||||||
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect
|
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_connect
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = libsendfile.sendfile
|
||||||
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto
|
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) = libsocket.__xnet_sendto
|
||||||
//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket
|
//sys socket(domain int, typ int, proto int) (fd int, err error) = libsocket.__xnet_socket
|
||||||
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair
|
//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) = libsocket.__xnet_socketpair
|
||||||
|
@ -698,18 +723,3 @@ func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, e
|
||||||
func Munmap(b []byte) (err error) {
|
func Munmap(b []byte) (err error) {
|
||||||
return mapper.Munmap(b)
|
return mapper.Munmap(b)
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys sysconf(name int) (n int64, err error)
|
|
||||||
|
|
||||||
// pageSize caches the value of Getpagesize, since it can't change
|
|
||||||
// once the system is booted.
|
|
||||||
var pageSize int64 // accessed atomically
|
|
||||||
|
|
||||||
func Getpagesize() int {
|
|
||||||
n := atomic.LoadInt64(&pageSize)
|
|
||||||
if n == 0 {
|
|
||||||
n, _ = sysconf(_SC_PAGESIZE)
|
|
||||||
atomic.StoreInt64(&pageSize, n)
|
|
||||||
}
|
|
||||||
return int(n)
|
|
||||||
}
|
|
||||||
|
|
20
vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
generated
vendored
20
vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go
generated
vendored
|
@ -6,19 +6,12 @@
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
func NsecToTimespec(nsec int64) (ts Timespec) {
|
|
||||||
ts.Sec = nsec / 1e9
|
|
||||||
ts.Nsec = nsec % 1e9
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NsecToTimeval(nsec int64) (tv Timeval) {
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
nsec += 999 // round up to microsecond
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
tv.Usec = nsec % 1e9 / 1e3
|
|
||||||
tv.Sec = int64(nsec / 1e9)
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (iov *Iovec) SetLen(length int) {
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
@ -28,8 +21,3 @@ func (iov *Iovec) SetLen(length int) {
|
||||||
func (cmsg *Cmsghdr) SetLen(length int) {
|
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
cmsg.Len = uint32(length)
|
cmsg.Len = uint32(length)
|
||||||
}
|
}
|
||||||
|
|
||||||
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
|
|
||||||
// TODO(aram): implement this, see issue 5847.
|
|
||||||
panic("unimplemented")
|
|
||||||
}
|
|
||||||
|
|
101
vendor/golang.org/x/sys/unix/syscall_unix.go
generated
vendored
101
vendor/golang.org/x/sys/unix/syscall_unix.go
generated
vendored
|
@ -7,7 +7,9 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"sort"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
@ -50,6 +52,37 @@ func errnoErr(e syscall.Errno) error {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ErrnoName returns the error name for error number e.
|
||||||
|
func ErrnoName(e syscall.Errno) string {
|
||||||
|
i := sort.Search(len(errorList), func(i int) bool {
|
||||||
|
return errorList[i].num >= e
|
||||||
|
})
|
||||||
|
if i < len(errorList) && errorList[i].num == e {
|
||||||
|
return errorList[i].name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// SignalName returns the signal name for signal number s.
|
||||||
|
func SignalName(s syscall.Signal) string {
|
||||||
|
i := sort.Search(len(signalList), func(i int) bool {
|
||||||
|
return signalList[i].num >= s
|
||||||
|
})
|
||||||
|
if i < len(signalList) && signalList[i].num == s {
|
||||||
|
return signalList[i].name
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
// clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte.
|
||||||
|
func clen(n []byte) int {
|
||||||
|
i := bytes.IndexByte(n, 0)
|
||||||
|
if i == -1 {
|
||||||
|
i = len(n)
|
||||||
|
}
|
||||||
|
return i
|
||||||
|
}
|
||||||
|
|
||||||
// Mmap manager, for use by operating system-specific implementations.
|
// Mmap manager, for use by operating system-specific implementations.
|
||||||
|
|
||||||
type mmapper struct {
|
type mmapper struct {
|
||||||
|
@ -138,16 +171,19 @@ func Write(fd int, p []byte) (n int, err error) {
|
||||||
// creation of IPv6 sockets to return EAFNOSUPPORT.
|
// creation of IPv6 sockets to return EAFNOSUPPORT.
|
||||||
var SocketDisableIPv6 bool
|
var SocketDisableIPv6 bool
|
||||||
|
|
||||||
|
// Sockaddr represents a socket address.
|
||||||
type Sockaddr interface {
|
type Sockaddr interface {
|
||||||
sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs
|
sockaddr() (ptr unsafe.Pointer, len _Socklen, err error) // lowercase; only we can define Sockaddrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrInet4 implements the Sockaddr interface for AF_INET type sockets.
|
||||||
type SockaddrInet4 struct {
|
type SockaddrInet4 struct {
|
||||||
Port int
|
Port int
|
||||||
Addr [4]byte
|
Addr [4]byte
|
||||||
raw RawSockaddrInet4
|
raw RawSockaddrInet4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrInet6 implements the Sockaddr interface for AF_INET6 type sockets.
|
||||||
type SockaddrInet6 struct {
|
type SockaddrInet6 struct {
|
||||||
Port int
|
Port int
|
||||||
ZoneId uint32
|
ZoneId uint32
|
||||||
|
@ -155,6 +191,7 @@ type SockaddrInet6 struct {
|
||||||
raw RawSockaddrInet6
|
raw RawSockaddrInet6
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrUnix implements the Sockaddr interface for AF_UNIX type sockets.
|
||||||
type SockaddrUnix struct {
|
type SockaddrUnix struct {
|
||||||
Name string
|
Name string
|
||||||
raw RawSockaddrUnix
|
raw RawSockaddrUnix
|
||||||
|
@ -185,6 +222,13 @@ func Getpeername(fd int) (sa Sockaddr, err error) {
|
||||||
return anyToSockaddr(&rsa)
|
return anyToSockaddr(&rsa)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetsockoptByte(fd, level, opt int) (value byte, err error) {
|
||||||
|
var n byte
|
||||||
|
vallen := _Socklen(1)
|
||||||
|
err = getsockopt(fd, level, opt, unsafe.Pointer(&n), &vallen)
|
||||||
|
return n, err
|
||||||
|
}
|
||||||
|
|
||||||
func GetsockoptInt(fd, level, opt int) (value int, err error) {
|
func GetsockoptInt(fd, level, opt int) (value int, err error) {
|
||||||
var n int32
|
var n int32
|
||||||
vallen := _Socklen(4)
|
vallen := _Socklen(4)
|
||||||
|
@ -192,6 +236,54 @@ func GetsockoptInt(fd, level, opt int) (value int, err error) {
|
||||||
return int(n), err
|
return int(n), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetsockoptInet4Addr(fd, level, opt int) (value [4]byte, err error) {
|
||||||
|
vallen := _Socklen(4)
|
||||||
|
err = getsockopt(fd, level, opt, unsafe.Pointer(&value[0]), &vallen)
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetsockoptIPMreq(fd, level, opt int) (*IPMreq, error) {
|
||||||
|
var value IPMreq
|
||||||
|
vallen := _Socklen(SizeofIPMreq)
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetsockoptIPv6Mreq(fd, level, opt int) (*IPv6Mreq, error) {
|
||||||
|
var value IPv6Mreq
|
||||||
|
vallen := _Socklen(SizeofIPv6Mreq)
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetsockoptIPv6MTUInfo(fd, level, opt int) (*IPv6MTUInfo, error) {
|
||||||
|
var value IPv6MTUInfo
|
||||||
|
vallen := _Socklen(SizeofIPv6MTUInfo)
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetsockoptICMPv6Filter(fd, level, opt int) (*ICMPv6Filter, error) {
|
||||||
|
var value ICMPv6Filter
|
||||||
|
vallen := _Socklen(SizeofICMPv6Filter)
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetsockoptLinger(fd, level, opt int) (*Linger, error) {
|
||||||
|
var linger Linger
|
||||||
|
vallen := _Socklen(SizeofLinger)
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&linger), &vallen)
|
||||||
|
return &linger, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func GetsockoptTimeval(fd, level, opt int) (*Timeval, error) {
|
||||||
|
var tv Timeval
|
||||||
|
vallen := _Socklen(unsafe.Sizeof(tv))
|
||||||
|
err := getsockopt(fd, level, opt, unsafe.Pointer(&tv), &vallen)
|
||||||
|
return &tv, err
|
||||||
|
}
|
||||||
|
|
||||||
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
|
func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
|
||||||
var rsa RawSockaddrAny
|
var rsa RawSockaddrAny
|
||||||
var len _Socklen = SizeofSockaddrAny
|
var len _Socklen = SizeofSockaddrAny
|
||||||
|
@ -291,3 +383,12 @@ func SetNonblock(fd int, nonblocking bool) (err error) {
|
||||||
_, err = fcntl(fd, F_SETFL, flag)
|
_, err = fcntl(fd, F_SETFL, flag)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Exec calls execve(2), which replaces the calling executable in the process
|
||||||
|
// tree. argv0 should be the full path to an executable ("/bin/ls") and the
|
||||||
|
// executable name should also be the first argument in argv (["ls", "-l"]).
|
||||||
|
// envv are the environment variables that should be passed to the new
|
||||||
|
// process (["USER=go", "PWD=/tmp"]).
|
||||||
|
func Exec(argv0 string, argv []string, envv []string) error {
|
||||||
|
return syscall.Exec(argv0, argv, envv)
|
||||||
|
}
|
||||||
|
|
82
vendor/golang.org/x/sys/unix/timestruct.go
generated
vendored
Normal file
82
vendor/golang.org/x/sys/unix/timestruct.go
generated
vendored
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
// Copyright 2017 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// TimespecToNsec converts a Timespec value into a number of
|
||||||
|
// nanoseconds since the Unix epoch.
|
||||||
|
func TimespecToNsec(ts Timespec) int64 { return int64(ts.Sec)*1e9 + int64(ts.Nsec) }
|
||||||
|
|
||||||
|
// NsecToTimespec takes a number of nanoseconds since the Unix epoch
|
||||||
|
// and returns the corresponding Timespec value.
|
||||||
|
func NsecToTimespec(nsec int64) Timespec {
|
||||||
|
sec := nsec / 1e9
|
||||||
|
nsec = nsec % 1e9
|
||||||
|
if nsec < 0 {
|
||||||
|
nsec += 1e9
|
||||||
|
sec--
|
||||||
|
}
|
||||||
|
return setTimespec(sec, nsec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TimeToTimespec converts t into a Timespec.
|
||||||
|
// On some 32-bit systems the range of valid Timespec values are smaller
|
||||||
|
// than that of time.Time values. So if t is out of the valid range of
|
||||||
|
// Timespec, it returns a zero Timespec and ERANGE.
|
||||||
|
func TimeToTimespec(t time.Time) (Timespec, error) {
|
||||||
|
sec := t.Unix()
|
||||||
|
nsec := int64(t.Nanosecond())
|
||||||
|
ts := setTimespec(sec, nsec)
|
||||||
|
|
||||||
|
// Currently all targets have either int32 or int64 for Timespec.Sec.
|
||||||
|
// If there were a new target with floating point type for it, we have
|
||||||
|
// to consider the rounding error.
|
||||||
|
if int64(ts.Sec) != sec {
|
||||||
|
return Timespec{}, ERANGE
|
||||||
|
}
|
||||||
|
return ts, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// TimevalToNsec converts a Timeval value into a number of nanoseconds
|
||||||
|
// since the Unix epoch.
|
||||||
|
func TimevalToNsec(tv Timeval) int64 { return int64(tv.Sec)*1e9 + int64(tv.Usec)*1e3 }
|
||||||
|
|
||||||
|
// NsecToTimeval takes a number of nanoseconds since the Unix epoch
|
||||||
|
// and returns the corresponding Timeval value.
|
||||||
|
func NsecToTimeval(nsec int64) Timeval {
|
||||||
|
nsec += 999 // round up to microsecond
|
||||||
|
usec := nsec % 1e9 / 1e3
|
||||||
|
sec := nsec / 1e9
|
||||||
|
if usec < 0 {
|
||||||
|
usec += 1e6
|
||||||
|
sec--
|
||||||
|
}
|
||||||
|
return setTimeval(sec, usec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unix returns ts as the number of seconds and nanoseconds elapsed since the
|
||||||
|
// Unix epoch.
|
||||||
|
func (ts *Timespec) Unix() (sec int64, nsec int64) {
|
||||||
|
return int64(ts.Sec), int64(ts.Nsec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unix returns tv as the number of seconds and nanoseconds elapsed since the
|
||||||
|
// Unix epoch.
|
||||||
|
func (tv *Timeval) Unix() (sec int64, nsec int64) {
|
||||||
|
return int64(tv.Sec), int64(tv.Usec) * 1000
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nano returns ts as the number of nanoseconds elapsed since the Unix epoch.
|
||||||
|
func (ts *Timespec) Nano() int64 {
|
||||||
|
return int64(ts.Sec)*1e9 + int64(ts.Nsec)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Nano returns tv as the number of nanoseconds elapsed since the Unix epoch.
|
||||||
|
func (tv *Timeval) Nano() int64 {
|
||||||
|
return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
|
||||||
|
}
|
27
vendor/golang.org/x/sys/unix/types_darwin.go
generated
vendored
27
vendor/golang.org/x/sys/unix/types_darwin.go
generated
vendored
|
@ -19,6 +19,7 @@ package unix
|
||||||
#define _DARWIN_USE_64_BIT_INODE
|
#define _DARWIN_USE_64_BIT_INODE
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -38,6 +39,7 @@ package unix
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -242,9 +244,34 @@ type BpfHdr C.struct_bpf_hdr
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
// fchmodat-like syscalls.
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AT_FDCWD = C.AT_FDCWD
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||||
|
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||||
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|
38
vendor/golang.org/x/sys/unix/types_dragonfly.go
generated
vendored
38
vendor/golang.org/x/sys/unix/types_dragonfly.go
generated
vendored
|
@ -17,6 +17,7 @@ package unix
|
||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -34,6 +35,7 @@ package unix
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -125,6 +127,12 @@ type Dirent C.struct_dirent
|
||||||
|
|
||||||
type Fsid C.struct_fsid
|
type Fsid C.struct_fsid
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
|
@ -240,3 +248,33 @@ type BpfHdr C.struct_bpf_hdr
|
||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|
49
vendor/golang.org/x/sys/unix/types_freebsd.go
generated
vendored
49
vendor/golang.org/x/sys/unix/types_freebsd.go
generated
vendored
|
@ -17,10 +17,12 @@ package unix
|
||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/capability.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
|
@ -34,6 +36,7 @@ package unix
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -130,7 +133,10 @@ struct if_data8 {
|
||||||
u_long ifi_iqdrops;
|
u_long ifi_iqdrops;
|
||||||
u_long ifi_noproto;
|
u_long ifi_noproto;
|
||||||
u_long ifi_hwassist;
|
u_long ifi_hwassist;
|
||||||
|
// FIXME: these are now unions, so maybe need to change definitions?
|
||||||
|
#undef ifi_epoch
|
||||||
time_t ifi_epoch;
|
time_t ifi_epoch;
|
||||||
|
#undef ifi_lastchange
|
||||||
struct timeval ifi_lastchange;
|
struct timeval ifi_lastchange;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -210,6 +216,12 @@ type Dirent C.struct_dirent
|
||||||
|
|
||||||
type Fsid C.struct_fsid
|
type Fsid C.struct_fsid
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Advice to Fadvise
|
// Advice to Fadvise
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -351,3 +363,40 @@ type BpfZbufHeader C.struct_bpf_zbuf_header
|
||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_REMOVEDIR = C.AT_REMOVEDIR
|
||||||
|
AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLINIGNEOF = C.POLLINIGNEOF
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// Capabilities
|
||||||
|
|
||||||
|
type CapRights C.struct_cap_rights
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|
49
vendor/golang.org/x/sys/unix/types_netbsd.go
generated
vendored
49
vendor/golang.org/x/sys/unix/types_netbsd.go
generated
vendored
|
@ -17,6 +17,7 @@ package unix
|
||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -36,6 +37,7 @@ package unix
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -110,6 +112,23 @@ type Dirent C.struct_dirent
|
||||||
|
|
||||||
type Fsid C.fsid_t
|
type Fsid C.fsid_t
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
|
// Advice to Fadvise
|
||||||
|
|
||||||
|
const (
|
||||||
|
FADV_NORMAL = C.POSIX_FADV_NORMAL
|
||||||
|
FADV_RANDOM = C.POSIX_FADV_RANDOM
|
||||||
|
FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
|
||||||
|
FADV_WILLNEED = C.POSIX_FADV_WILLNEED
|
||||||
|
FADV_DONTNEED = C.POSIX_FADV_DONTNEED
|
||||||
|
FADV_NOREUSE = C.POSIX_FADV_NOREUSE
|
||||||
|
)
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
|
@ -227,6 +246,36 @@ type BpfTimeval C.struct_bpf_timeval
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
// Sysctl
|
// Sysctl
|
||||||
|
|
||||||
type Sysctlnode C.struct_sysctlnode
|
type Sysctlnode C.struct_sysctlnode
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|
38
vendor/golang.org/x/sys/unix/types_openbsd.go
generated
vendored
38
vendor/golang.org/x/sys/unix/types_openbsd.go
generated
vendored
|
@ -17,6 +17,7 @@ package unix
|
||||||
#define KERNEL
|
#define KERNEL
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -35,6 +36,7 @@ package unix
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <sys/utsname.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <net/bpf.h>
|
#include <net/bpf.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
@ -126,6 +128,12 @@ type Dirent C.struct_dirent
|
||||||
|
|
||||||
type Fsid C.fsid_t
|
type Fsid C.fsid_t
|
||||||
|
|
||||||
|
// File system limits
|
||||||
|
|
||||||
|
const (
|
||||||
|
PathMax = C.PATH_MAX
|
||||||
|
)
|
||||||
|
|
||||||
// Sockets
|
// Sockets
|
||||||
|
|
||||||
type RawSockaddrInet4 C.struct_sockaddr_in
|
type RawSockaddrInet4 C.struct_sockaddr_in
|
||||||
|
@ -242,3 +250,33 @@ type BpfTimeval C.struct_bpf_timeval
|
||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
|
||||||
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// fchmodat-like syscalls.
|
||||||
|
|
||||||
|
const (
|
||||||
|
AT_FDCWD = C.AT_FDCWD
|
||||||
|
AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
|
||||||
|
)
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
||||||
|
// Uname
|
||||||
|
|
||||||
|
type Utsname C.struct_utsname
|
||||||
|
|
22
vendor/golang.org/x/sys/unix/types_solaris.go
generated
vendored
22
vendor/golang.org/x/sys/unix/types_solaris.go
generated
vendored
|
@ -24,6 +24,7 @@ package unix
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <poll.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <termio.h>
|
#include <termio.h>
|
||||||
|
@ -256,10 +257,6 @@ type BpfTimeval C.struct_bpf_timeval
|
||||||
|
|
||||||
type BpfHdr C.struct_bpf_hdr
|
type BpfHdr C.struct_bpf_hdr
|
||||||
|
|
||||||
// sysconf information
|
|
||||||
|
|
||||||
const _SC_PAGESIZE = C._SC_PAGESIZE
|
|
||||||
|
|
||||||
// Terminal handling
|
// Terminal handling
|
||||||
|
|
||||||
type Termios C.struct_termios
|
type Termios C.struct_termios
|
||||||
|
@ -267,3 +264,20 @@ type Termios C.struct_termios
|
||||||
type Termio C.struct_termio
|
type Termio C.struct_termio
|
||||||
|
|
||||||
type Winsize C.struct_winsize
|
type Winsize C.struct_winsize
|
||||||
|
|
||||||
|
// poll
|
||||||
|
|
||||||
|
type PollFd C.struct_pollfd
|
||||||
|
|
||||||
|
const (
|
||||||
|
POLLERR = C.POLLERR
|
||||||
|
POLLHUP = C.POLLHUP
|
||||||
|
POLLIN = C.POLLIN
|
||||||
|
POLLNVAL = C.POLLNVAL
|
||||||
|
POLLOUT = C.POLLOUT
|
||||||
|
POLLPRI = C.POLLPRI
|
||||||
|
POLLRDBAND = C.POLLRDBAND
|
||||||
|
POLLRDNORM = C.POLLRDNORM
|
||||||
|
POLLWRBAND = C.POLLWRBAND
|
||||||
|
POLLWRNORM = C.POLLWRNORM
|
||||||
|
)
|
||||||
|
|
485
vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
generated
vendored
485
vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
generated
vendored
|
@ -1,5 +1,5 @@
|
||||||
// mkerrors.sh -m32
|
// mkerrors.sh -m32
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build 386,darwin
|
// +build 386,darwin
|
||||||
|
|
||||||
|
@ -48,6 +48,87 @@ const (
|
||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
AF_UTUN = 0x26
|
AF_UTUN = 0x26
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ATTR_BIT_MAP_COUNT = 0x5
|
||||||
|
ATTR_CMN_ACCESSMASK = 0x20000
|
||||||
|
ATTR_CMN_ACCTIME = 0x1000
|
||||||
|
ATTR_CMN_ADDEDTIME = 0x10000000
|
||||||
|
ATTR_CMN_BKUPTIME = 0x2000
|
||||||
|
ATTR_CMN_CHGTIME = 0x800
|
||||||
|
ATTR_CMN_CRTIME = 0x200
|
||||||
|
ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
|
||||||
|
ATTR_CMN_DEVID = 0x2
|
||||||
|
ATTR_CMN_DOCUMENT_ID = 0x100000
|
||||||
|
ATTR_CMN_ERROR = 0x20000000
|
||||||
|
ATTR_CMN_EXTENDED_SECURITY = 0x400000
|
||||||
|
ATTR_CMN_FILEID = 0x2000000
|
||||||
|
ATTR_CMN_FLAGS = 0x40000
|
||||||
|
ATTR_CMN_FNDRINFO = 0x4000
|
||||||
|
ATTR_CMN_FSID = 0x4
|
||||||
|
ATTR_CMN_FULLPATH = 0x8000000
|
||||||
|
ATTR_CMN_GEN_COUNT = 0x80000
|
||||||
|
ATTR_CMN_GRPID = 0x10000
|
||||||
|
ATTR_CMN_GRPUUID = 0x1000000
|
||||||
|
ATTR_CMN_MODTIME = 0x400
|
||||||
|
ATTR_CMN_NAME = 0x1
|
||||||
|
ATTR_CMN_NAMEDATTRCOUNT = 0x80000
|
||||||
|
ATTR_CMN_NAMEDATTRLIST = 0x100000
|
||||||
|
ATTR_CMN_OBJID = 0x20
|
||||||
|
ATTR_CMN_OBJPERMANENTID = 0x40
|
||||||
|
ATTR_CMN_OBJTAG = 0x10
|
||||||
|
ATTR_CMN_OBJTYPE = 0x8
|
||||||
|
ATTR_CMN_OWNERID = 0x8000
|
||||||
|
ATTR_CMN_PARENTID = 0x4000000
|
||||||
|
ATTR_CMN_PAROBJID = 0x80
|
||||||
|
ATTR_CMN_RETURNED_ATTRS = 0x80000000
|
||||||
|
ATTR_CMN_SCRIPT = 0x100
|
||||||
|
ATTR_CMN_SETMASK = 0x41c7ff00
|
||||||
|
ATTR_CMN_USERACCESS = 0x200000
|
||||||
|
ATTR_CMN_UUID = 0x800000
|
||||||
|
ATTR_CMN_VALIDMASK = 0xffffffff
|
||||||
|
ATTR_CMN_VOLSETMASK = 0x6700
|
||||||
|
ATTR_FILE_ALLOCSIZE = 0x4
|
||||||
|
ATTR_FILE_CLUMPSIZE = 0x10
|
||||||
|
ATTR_FILE_DATAALLOCSIZE = 0x400
|
||||||
|
ATTR_FILE_DATAEXTENTS = 0x800
|
||||||
|
ATTR_FILE_DATALENGTH = 0x200
|
||||||
|
ATTR_FILE_DEVTYPE = 0x20
|
||||||
|
ATTR_FILE_FILETYPE = 0x40
|
||||||
|
ATTR_FILE_FORKCOUNT = 0x80
|
||||||
|
ATTR_FILE_FORKLIST = 0x100
|
||||||
|
ATTR_FILE_IOBLOCKSIZE = 0x8
|
||||||
|
ATTR_FILE_LINKCOUNT = 0x1
|
||||||
|
ATTR_FILE_RSRCALLOCSIZE = 0x2000
|
||||||
|
ATTR_FILE_RSRCEXTENTS = 0x4000
|
||||||
|
ATTR_FILE_RSRCLENGTH = 0x1000
|
||||||
|
ATTR_FILE_SETMASK = 0x20
|
||||||
|
ATTR_FILE_TOTALSIZE = 0x2
|
||||||
|
ATTR_FILE_VALIDMASK = 0x37ff
|
||||||
|
ATTR_VOL_ALLOCATIONCLUMP = 0x40
|
||||||
|
ATTR_VOL_ATTRIBUTES = 0x40000000
|
||||||
|
ATTR_VOL_CAPABILITIES = 0x20000
|
||||||
|
ATTR_VOL_DIRCOUNT = 0x400
|
||||||
|
ATTR_VOL_ENCODINGSUSED = 0x10000
|
||||||
|
ATTR_VOL_FILECOUNT = 0x200
|
||||||
|
ATTR_VOL_FSTYPE = 0x1
|
||||||
|
ATTR_VOL_INFO = 0x80000000
|
||||||
|
ATTR_VOL_IOBLOCKSIZE = 0x80
|
||||||
|
ATTR_VOL_MAXOBJCOUNT = 0x800
|
||||||
|
ATTR_VOL_MINALLOCATION = 0x20
|
||||||
|
ATTR_VOL_MOUNTEDDEVICE = 0x8000
|
||||||
|
ATTR_VOL_MOUNTFLAGS = 0x4000
|
||||||
|
ATTR_VOL_MOUNTPOINT = 0x1000
|
||||||
|
ATTR_VOL_NAME = 0x2000
|
||||||
|
ATTR_VOL_OBJCOUNT = 0x100
|
||||||
|
ATTR_VOL_QUOTA_SIZE = 0x10000000
|
||||||
|
ATTR_VOL_RESERVED_SIZE = 0x20000000
|
||||||
|
ATTR_VOL_SETMASK = 0x80002000
|
||||||
|
ATTR_VOL_SIGNATURE = 0x2
|
||||||
|
ATTR_VOL_SIZE = 0x4
|
||||||
|
ATTR_VOL_SPACEAVAIL = 0x10
|
||||||
|
ATTR_VOL_SPACEFREE = 0x8
|
||||||
|
ATTR_VOL_UUID = 0x40000
|
||||||
|
ATTR_VOL_VALIDMASK = 0xf007ffff
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
|
@ -138,9 +219,26 @@ const (
|
||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x8000
|
||||||
|
BSDLY = 0x8000
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x6
|
||||||
|
CLOCK_MONOTONIC_RAW = 0x4
|
||||||
|
CLOCK_MONOTONIC_RAW_APPROX = 0x5
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xc
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x1000
|
||||||
|
CR2 = 0x2000
|
||||||
|
CR3 = 0x3000
|
||||||
|
CRDLY = 0x3000
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
|
@ -151,6 +249,8 @@ const (
|
||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DLT_A429 = 0xb8
|
DLT_A429 = 0xb8
|
||||||
|
@ -332,13 +432,14 @@ const (
|
||||||
ECHONL = 0x10
|
ECHONL = 0x10
|
||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_EXCEPT = -0xf
|
||||||
EVFILT_FS = -0x9
|
EVFILT_FS = -0x9
|
||||||
EVFILT_MACHPORT = -0x8
|
EVFILT_MACHPORT = -0x8
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0xe
|
EVFILT_SYSCOUNT = 0xf
|
||||||
EVFILT_THREADMARKER = 0xe
|
EVFILT_THREADMARKER = 0xf
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
EVFILT_USER = -0xa
|
EVFILT_USER = -0xa
|
||||||
EVFILT_VM = -0xc
|
EVFILT_VM = -0xc
|
||||||
|
@ -349,6 +450,7 @@ const (
|
||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
EV_DISPATCH = 0x80
|
EV_DISPATCH = 0x80
|
||||||
|
EV_DISPATCH2 = 0x180
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
|
@ -359,16 +461,30 @@ const (
|
||||||
EV_POLL = 0x1000
|
EV_POLL = 0x1000
|
||||||
EV_RECEIPT = 0x40
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EV_UDATA_SPECIFIC = 0x100
|
||||||
|
EV_VANISHED = 0x200
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
EXTPROC = 0x800
|
EXTPROC = 0x800
|
||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_SETSIZE = 0x400
|
FD_SETSIZE = 0x400
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x4000
|
||||||
|
FFDLY = 0x4000
|
||||||
FLUSHO = 0x800000
|
FLUSHO = 0x800000
|
||||||
|
FSOPT_ATTR_CMN_EXTENDED = 0x20
|
||||||
|
FSOPT_NOFOLLOW = 0x1
|
||||||
|
FSOPT_NOINMEMUPDATE = 0x2
|
||||||
|
FSOPT_PACK_INVAL_ATTRS = 0x8
|
||||||
|
FSOPT_REPORT_FULLSIZE = 0x4
|
||||||
F_ADDFILESIGS = 0x3d
|
F_ADDFILESIGS = 0x3d
|
||||||
|
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||||
|
F_ADDFILESIGS_RETURN = 0x61
|
||||||
F_ADDSIGS = 0x3b
|
F_ADDSIGS = 0x3b
|
||||||
F_ALLOCATEALL = 0x4
|
F_ALLOCATEALL = 0x4
|
||||||
F_ALLOCATECONTIG = 0x2
|
F_ALLOCATECONTIG = 0x2
|
||||||
|
F_BARRIERFSYNC = 0x55
|
||||||
|
F_CHECK_LV = 0x62
|
||||||
F_CHKCLEAN = 0x29
|
F_CHKCLEAN = 0x29
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x43
|
F_DUPFD_CLOEXEC = 0x43
|
||||||
|
@ -396,6 +512,7 @@ const (
|
||||||
F_PATHPKG_CHECK = 0x34
|
F_PATHPKG_CHECK = 0x34
|
||||||
F_PEOFPOSMODE = 0x3
|
F_PEOFPOSMODE = 0x3
|
||||||
F_PREALLOCATE = 0x2a
|
F_PREALLOCATE = 0x2a
|
||||||
|
F_PUNCHHOLE = 0x63
|
||||||
F_RDADVISE = 0x2c
|
F_RDADVISE = 0x2c
|
||||||
F_RDAHEAD = 0x2d
|
F_RDAHEAD = 0x2d
|
||||||
F_RDLCK = 0x1
|
F_RDLCK = 0x1
|
||||||
|
@ -412,10 +529,12 @@ const (
|
||||||
F_SINGLE_WRITER = 0x4c
|
F_SINGLE_WRITER = 0x4c
|
||||||
F_THAW_FS = 0x36
|
F_THAW_FS = 0x36
|
||||||
F_TRANSCODEKEY = 0x4b
|
F_TRANSCODEKEY = 0x4b
|
||||||
|
F_TRIM_ACTIVE_FILE = 0x64
|
||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_VOLPOSMODE = 0x4
|
F_VOLPOSMODE = 0x4
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
|
@ -652,6 +771,7 @@ const (
|
||||||
IPV6_FAITH = 0x1d
|
IPV6_FAITH = 0x1d
|
||||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||||
|
IPV6_FLOW_ECN_MASK = 0x300
|
||||||
IPV6_FRAGTTL = 0x3c
|
IPV6_FRAGTTL = 0x3c
|
||||||
IPV6_FW_ADD = 0x1e
|
IPV6_FW_ADD = 0x1e
|
||||||
IPV6_FW_DEL = 0x1f
|
IPV6_FW_DEL = 0x1f
|
||||||
|
@ -742,6 +862,7 @@ const (
|
||||||
IP_RECVOPTS = 0x5
|
IP_RECVOPTS = 0x5
|
||||||
IP_RECVPKTINFO = 0x1a
|
IP_RECVPKTINFO = 0x1a
|
||||||
IP_RECVRETOPTS = 0x6
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVTOS = 0x1b
|
||||||
IP_RECVTTL = 0x18
|
IP_RECVTTL = 0x18
|
||||||
IP_RETOPTS = 0x8
|
IP_RETOPTS = 0x8
|
||||||
IP_RF = 0x8000
|
IP_RF = 0x8000
|
||||||
|
@ -760,6 +881,10 @@ const (
|
||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
|
@ -770,11 +895,13 @@ const (
|
||||||
MADV_FREE_REUSABLE = 0x7
|
MADV_FREE_REUSABLE = 0x7
|
||||||
MADV_FREE_REUSE = 0x8
|
MADV_FREE_REUSE = 0x8
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PAGEOUT = 0xa
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MADV_ZERO_WIRED_PAGES = 0x6
|
MADV_ZERO_WIRED_PAGES = 0x6
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
|
@ -786,9 +913,43 @@ const (
|
||||||
MAP_PRIVATE = 0x2
|
MAP_PRIVATE = 0x2
|
||||||
MAP_RENAME = 0x20
|
MAP_RENAME = 0x20
|
||||||
MAP_RESERVED0080 = 0x80
|
MAP_RESERVED0080 = 0x80
|
||||||
|
MAP_RESILIENT_CODESIGN = 0x2000
|
||||||
|
MAP_RESILIENT_MEDIA = 0x4000
|
||||||
MAP_SHARED = 0x1
|
MAP_SHARED = 0x1
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_AUTOMOUNTED = 0x400000
|
||||||
|
MNT_CMDFLAGS = 0xf0000
|
||||||
|
MNT_CPROTECT = 0x80
|
||||||
|
MNT_DEFWRITE = 0x2000000
|
||||||
|
MNT_DONTBROWSE = 0x100000
|
||||||
|
MNT_DOVOLFS = 0x8000
|
||||||
|
MNT_DWAIT = 0x4
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_IGNORE_OWNERSHIP = 0x200000
|
||||||
|
MNT_JOURNALED = 0x800000
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_MULTILABEL = 0x4000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOBLOCK = 0x20000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOUSERXATTR = 0x1000000
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUARANTINE = 0x400
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UNION = 0x20
|
||||||
|
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
|
@ -819,7 +980,13 @@ const (
|
||||||
NET_RT_MAXID = 0xa
|
NET_RT_MAXID = 0xa
|
||||||
NET_RT_STAT = 0x4
|
NET_RT_STAT = 0x4
|
||||||
NET_RT_TRASH = 0x5
|
NET_RT_TRASH = 0x5
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NL2 = 0x200
|
||||||
|
NL3 = 0x300
|
||||||
|
NLDLY = 0x300
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ABSOLUTE = 0x8
|
NOTE_ABSOLUTE = 0x8
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_BACKGROUND = 0x40
|
NOTE_BACKGROUND = 0x40
|
||||||
|
@ -843,11 +1010,14 @@ const (
|
||||||
NOTE_FFNOP = 0x0
|
NOTE_FFNOP = 0x0
|
||||||
NOTE_FFOR = 0x80000000
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_FUNLOCK = 0x100
|
||||||
NOTE_LEEWAY = 0x10
|
NOTE_LEEWAY = 0x10
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||||
NOTE_NONE = 0x80
|
NOTE_NONE = 0x80
|
||||||
NOTE_NSECONDS = 0x4
|
NOTE_NSECONDS = 0x4
|
||||||
|
NOTE_OOB = 0x2
|
||||||
NOTE_PCTRLMASK = -0x100000
|
NOTE_PCTRLMASK = -0x100000
|
||||||
NOTE_PDATAMASK = 0xfffff
|
NOTE_PDATAMASK = 0xfffff
|
||||||
NOTE_REAP = 0x10000000
|
NOTE_REAP = 0x10000000
|
||||||
|
@ -872,6 +1042,7 @@ const (
|
||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_ALERT = 0x20000000
|
O_ALERT = 0x20000000
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
|
@ -880,6 +1051,7 @@ const (
|
||||||
O_CREAT = 0x200
|
O_CREAT = 0x200
|
||||||
O_DIRECTORY = 0x100000
|
O_DIRECTORY = 0x100000
|
||||||
O_DP_GETRAWENCRYPTED = 0x1
|
O_DP_GETRAWENCRYPTED = 0x1
|
||||||
|
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||||
O_DSYNC = 0x400000
|
O_DSYNC = 0x400000
|
||||||
O_EVTONLY = 0x8000
|
O_EVTONLY = 0x8000
|
||||||
O_EXCL = 0x800
|
O_EXCL = 0x800
|
||||||
|
@ -932,7 +1104,10 @@ const (
|
||||||
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
||||||
RLIMIT_DATA = 0x2
|
RLIMIT_DATA = 0x2
|
||||||
RLIMIT_FSIZE = 0x1
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
RLIMIT_NOFILE = 0x8
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
RLIMIT_STACK = 0x3
|
RLIMIT_STACK = 0x3
|
||||||
RLIM_INFINITY = 0x7fffffffffffffff
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
RTAX_AUTHOR = 0x6
|
RTAX_AUTHOR = 0x6
|
||||||
|
@ -1102,6 +1277,8 @@ const (
|
||||||
SO_LABEL = 0x1010
|
SO_LABEL = 0x1010
|
||||||
SO_LINGER = 0x80
|
SO_LINGER = 0x80
|
||||||
SO_LINGER_SEC = 0x1080
|
SO_LINGER_SEC = 0x1080
|
||||||
|
SO_NETSVC_MARKING_LEVEL = 0x1119
|
||||||
|
SO_NET_SERVICE_TYPE = 0x1116
|
||||||
SO_NKE = 0x1021
|
SO_NKE = 0x1021
|
||||||
SO_NOADDRERR = 0x1023
|
SO_NOADDRERR = 0x1023
|
||||||
SO_NOSIGPIPE = 0x1022
|
SO_NOSIGPIPE = 0x1022
|
||||||
|
@ -1157,11 +1334,22 @@ const (
|
||||||
S_IXGRP = 0x8
|
S_IXGRP = 0x8
|
||||||
S_IXOTH = 0x1
|
S_IXOTH = 0x1
|
||||||
S_IXUSR = 0x40
|
S_IXUSR = 0x40
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x400
|
||||||
|
TAB2 = 0x800
|
||||||
|
TAB3 = 0x4
|
||||||
|
TABDLY = 0xc04
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_CONNECTIONTIMEOUT = 0x20
|
TCP_CONNECTIONTIMEOUT = 0x20
|
||||||
|
TCP_CONNECTION_INFO = 0x106
|
||||||
TCP_ENABLE_ECN = 0x104
|
TCP_ENABLE_ECN = 0x104
|
||||||
|
TCP_FASTOPEN = 0x105
|
||||||
TCP_KEEPALIVE = 0x10
|
TCP_KEEPALIVE = 0x10
|
||||||
TCP_KEEPCNT = 0x102
|
TCP_KEEPCNT = 0x102
|
||||||
TCP_KEEPINTVL = 0x101
|
TCP_KEEPINTVL = 0x101
|
||||||
|
@ -1261,6 +1449,11 @@ const (
|
||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MACHFACTOR = 0x4
|
||||||
|
VM_MAXID = 0x6
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_SWAPUSAGE = 0x5
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
@ -1431,146 +1624,154 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errorList = [...]struct {
|
||||||
1: "operation not permitted",
|
num syscall.Errno
|
||||||
2: "no such file or directory",
|
name string
|
||||||
3: "no such process",
|
desc string
|
||||||
4: "interrupted system call",
|
}{
|
||||||
5: "input/output error",
|
{1, "EPERM", "operation not permitted"},
|
||||||
6: "device not configured",
|
{2, "ENOENT", "no such file or directory"},
|
||||||
7: "argument list too long",
|
{3, "ESRCH", "no such process"},
|
||||||
8: "exec format error",
|
{4, "EINTR", "interrupted system call"},
|
||||||
9: "bad file descriptor",
|
{5, "EIO", "input/output error"},
|
||||||
10: "no child processes",
|
{6, "ENXIO", "device not configured"},
|
||||||
11: "resource deadlock avoided",
|
{7, "E2BIG", "argument list too long"},
|
||||||
12: "cannot allocate memory",
|
{8, "ENOEXEC", "exec format error"},
|
||||||
13: "permission denied",
|
{9, "EBADF", "bad file descriptor"},
|
||||||
14: "bad address",
|
{10, "ECHILD", "no child processes"},
|
||||||
15: "block device required",
|
{11, "EDEADLK", "resource deadlock avoided"},
|
||||||
16: "resource busy",
|
{12, "ENOMEM", "cannot allocate memory"},
|
||||||
17: "file exists",
|
{13, "EACCES", "permission denied"},
|
||||||
18: "cross-device link",
|
{14, "EFAULT", "bad address"},
|
||||||
19: "operation not supported by device",
|
{15, "ENOTBLK", "block device required"},
|
||||||
20: "not a directory",
|
{16, "EBUSY", "resource busy"},
|
||||||
21: "is a directory",
|
{17, "EEXIST", "file exists"},
|
||||||
22: "invalid argument",
|
{18, "EXDEV", "cross-device link"},
|
||||||
23: "too many open files in system",
|
{19, "ENODEV", "operation not supported by device"},
|
||||||
24: "too many open files",
|
{20, "ENOTDIR", "not a directory"},
|
||||||
25: "inappropriate ioctl for device",
|
{21, "EISDIR", "is a directory"},
|
||||||
26: "text file busy",
|
{22, "EINVAL", "invalid argument"},
|
||||||
27: "file too large",
|
{23, "ENFILE", "too many open files in system"},
|
||||||
28: "no space left on device",
|
{24, "EMFILE", "too many open files"},
|
||||||
29: "illegal seek",
|
{25, "ENOTTY", "inappropriate ioctl for device"},
|
||||||
30: "read-only file system",
|
{26, "ETXTBSY", "text file busy"},
|
||||||
31: "too many links",
|
{27, "EFBIG", "file too large"},
|
||||||
32: "broken pipe",
|
{28, "ENOSPC", "no space left on device"},
|
||||||
33: "numerical argument out of domain",
|
{29, "ESPIPE", "illegal seek"},
|
||||||
34: "result too large",
|
{30, "EROFS", "read-only file system"},
|
||||||
35: "resource temporarily unavailable",
|
{31, "EMLINK", "too many links"},
|
||||||
36: "operation now in progress",
|
{32, "EPIPE", "broken pipe"},
|
||||||
37: "operation already in progress",
|
{33, "EDOM", "numerical argument out of domain"},
|
||||||
38: "socket operation on non-socket",
|
{34, "ERANGE", "result too large"},
|
||||||
39: "destination address required",
|
{35, "EAGAIN", "resource temporarily unavailable"},
|
||||||
40: "message too long",
|
{36, "EINPROGRESS", "operation now in progress"},
|
||||||
41: "protocol wrong type for socket",
|
{37, "EALREADY", "operation already in progress"},
|
||||||
42: "protocol not available",
|
{38, "ENOTSOCK", "socket operation on non-socket"},
|
||||||
43: "protocol not supported",
|
{39, "EDESTADDRREQ", "destination address required"},
|
||||||
44: "socket type not supported",
|
{40, "EMSGSIZE", "message too long"},
|
||||||
45: "operation not supported",
|
{41, "EPROTOTYPE", "protocol wrong type for socket"},
|
||||||
46: "protocol family not supported",
|
{42, "ENOPROTOOPT", "protocol not available"},
|
||||||
47: "address family not supported by protocol family",
|
{43, "EPROTONOSUPPORT", "protocol not supported"},
|
||||||
48: "address already in use",
|
{44, "ESOCKTNOSUPPORT", "socket type not supported"},
|
||||||
49: "can't assign requested address",
|
{45, "ENOTSUP", "operation not supported"},
|
||||||
50: "network is down",
|
{46, "EPFNOSUPPORT", "protocol family not supported"},
|
||||||
51: "network is unreachable",
|
{47, "EAFNOSUPPORT", "address family not supported by protocol family"},
|
||||||
52: "network dropped connection on reset",
|
{48, "EADDRINUSE", "address already in use"},
|
||||||
53: "software caused connection abort",
|
{49, "EADDRNOTAVAIL", "can't assign requested address"},
|
||||||
54: "connection reset by peer",
|
{50, "ENETDOWN", "network is down"},
|
||||||
55: "no buffer space available",
|
{51, "ENETUNREACH", "network is unreachable"},
|
||||||
56: "socket is already connected",
|
{52, "ENETRESET", "network dropped connection on reset"},
|
||||||
57: "socket is not connected",
|
{53, "ECONNABORTED", "software caused connection abort"},
|
||||||
58: "can't send after socket shutdown",
|
{54, "ECONNRESET", "connection reset by peer"},
|
||||||
59: "too many references: can't splice",
|
{55, "ENOBUFS", "no buffer space available"},
|
||||||
60: "operation timed out",
|
{56, "EISCONN", "socket is already connected"},
|
||||||
61: "connection refused",
|
{57, "ENOTCONN", "socket is not connected"},
|
||||||
62: "too many levels of symbolic links",
|
{58, "ESHUTDOWN", "can't send after socket shutdown"},
|
||||||
63: "file name too long",
|
{59, "ETOOMANYREFS", "too many references: can't splice"},
|
||||||
64: "host is down",
|
{60, "ETIMEDOUT", "operation timed out"},
|
||||||
65: "no route to host",
|
{61, "ECONNREFUSED", "connection refused"},
|
||||||
66: "directory not empty",
|
{62, "ELOOP", "too many levels of symbolic links"},
|
||||||
67: "too many processes",
|
{63, "ENAMETOOLONG", "file name too long"},
|
||||||
68: "too many users",
|
{64, "EHOSTDOWN", "host is down"},
|
||||||
69: "disc quota exceeded",
|
{65, "EHOSTUNREACH", "no route to host"},
|
||||||
70: "stale NFS file handle",
|
{66, "ENOTEMPTY", "directory not empty"},
|
||||||
71: "too many levels of remote in path",
|
{67, "EPROCLIM", "too many processes"},
|
||||||
72: "RPC struct is bad",
|
{68, "EUSERS", "too many users"},
|
||||||
73: "RPC version wrong",
|
{69, "EDQUOT", "disc quota exceeded"},
|
||||||
74: "RPC prog. not avail",
|
{70, "ESTALE", "stale NFS file handle"},
|
||||||
75: "program version wrong",
|
{71, "EREMOTE", "too many levels of remote in path"},
|
||||||
76: "bad procedure for program",
|
{72, "EBADRPC", "RPC struct is bad"},
|
||||||
77: "no locks available",
|
{73, "ERPCMISMATCH", "RPC version wrong"},
|
||||||
78: "function not implemented",
|
{74, "EPROGUNAVAIL", "RPC prog. not avail"},
|
||||||
79: "inappropriate file type or format",
|
{75, "EPROGMISMATCH", "program version wrong"},
|
||||||
80: "authentication error",
|
{76, "EPROCUNAVAIL", "bad procedure for program"},
|
||||||
81: "need authenticator",
|
{77, "ENOLCK", "no locks available"},
|
||||||
82: "device power is off",
|
{78, "ENOSYS", "function not implemented"},
|
||||||
83: "device error",
|
{79, "EFTYPE", "inappropriate file type or format"},
|
||||||
84: "value too large to be stored in data type",
|
{80, "EAUTH", "authentication error"},
|
||||||
85: "bad executable (or shared library)",
|
{81, "ENEEDAUTH", "need authenticator"},
|
||||||
86: "bad CPU type in executable",
|
{82, "EPWROFF", "device power is off"},
|
||||||
87: "shared library version mismatch",
|
{83, "EDEVERR", "device error"},
|
||||||
88: "malformed Mach-o file",
|
{84, "EOVERFLOW", "value too large to be stored in data type"},
|
||||||
89: "operation canceled",
|
{85, "EBADEXEC", "bad executable (or shared library)"},
|
||||||
90: "identifier removed",
|
{86, "EBADARCH", "bad CPU type in executable"},
|
||||||
91: "no message of desired type",
|
{87, "ESHLIBVERS", "shared library version mismatch"},
|
||||||
92: "illegal byte sequence",
|
{88, "EBADMACHO", "malformed Mach-o file"},
|
||||||
93: "attribute not found",
|
{89, "ECANCELED", "operation canceled"},
|
||||||
94: "bad message",
|
{90, "EIDRM", "identifier removed"},
|
||||||
95: "EMULTIHOP (Reserved)",
|
{91, "ENOMSG", "no message of desired type"},
|
||||||
96: "no message available on STREAM",
|
{92, "EILSEQ", "illegal byte sequence"},
|
||||||
97: "ENOLINK (Reserved)",
|
{93, "ENOATTR", "attribute not found"},
|
||||||
98: "no STREAM resources",
|
{94, "EBADMSG", "bad message"},
|
||||||
99: "not a STREAM",
|
{95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
|
||||||
100: "protocol error",
|
{96, "ENODATA", "no message available on STREAM"},
|
||||||
101: "STREAM ioctl timeout",
|
{97, "ENOLINK", "ENOLINK (Reserved)"},
|
||||||
102: "operation not supported on socket",
|
{98, "ENOSR", "no STREAM resources"},
|
||||||
103: "policy not found",
|
{99, "ENOSTR", "not a STREAM"},
|
||||||
104: "state not recoverable",
|
{100, "EPROTO", "protocol error"},
|
||||||
105: "previous owner died",
|
{101, "ETIME", "STREAM ioctl timeout"},
|
||||||
106: "interface output queue is full",
|
{102, "EOPNOTSUPP", "operation not supported on socket"},
|
||||||
|
{103, "ENOPOLICY", "policy not found"},
|
||||||
|
{104, "ENOTRECOVERABLE", "state not recoverable"},
|
||||||
|
{105, "EOWNERDEAD", "previous owner died"},
|
||||||
|
{106, "EQFULL", "interface output queue is full"},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signal table
|
// Signal table
|
||||||
var signals = [...]string{
|
var signalList = [...]struct {
|
||||||
1: "hangup",
|
num syscall.Signal
|
||||||
2: "interrupt",
|
name string
|
||||||
3: "quit",
|
desc string
|
||||||
4: "illegal instruction",
|
}{
|
||||||
5: "trace/BPT trap",
|
{1, "SIGHUP", "hangup"},
|
||||||
6: "abort trap",
|
{2, "SIGINT", "interrupt"},
|
||||||
7: "EMT trap",
|
{3, "SIGQUIT", "quit"},
|
||||||
8: "floating point exception",
|
{4, "SIGILL", "illegal instruction"},
|
||||||
9: "killed",
|
{5, "SIGTRAP", "trace/BPT trap"},
|
||||||
10: "bus error",
|
{6, "SIGABRT", "abort trap"},
|
||||||
11: "segmentation fault",
|
{7, "SIGEMT", "EMT trap"},
|
||||||
12: "bad system call",
|
{8, "SIGFPE", "floating point exception"},
|
||||||
13: "broken pipe",
|
{9, "SIGKILL", "killed"},
|
||||||
14: "alarm clock",
|
{10, "SIGBUS", "bus error"},
|
||||||
15: "terminated",
|
{11, "SIGSEGV", "segmentation fault"},
|
||||||
16: "urgent I/O condition",
|
{12, "SIGSYS", "bad system call"},
|
||||||
17: "suspended (signal)",
|
{13, "SIGPIPE", "broken pipe"},
|
||||||
18: "suspended",
|
{14, "SIGALRM", "alarm clock"},
|
||||||
19: "continued",
|
{15, "SIGTERM", "terminated"},
|
||||||
20: "child exited",
|
{16, "SIGURG", "urgent I/O condition"},
|
||||||
21: "stopped (tty input)",
|
{17, "SIGSTOP", "suspended (signal)"},
|
||||||
22: "stopped (tty output)",
|
{18, "SIGTSTP", "suspended"},
|
||||||
23: "I/O possible",
|
{19, "SIGCONT", "continued"},
|
||||||
24: "cputime limit exceeded",
|
{20, "SIGCHLD", "child exited"},
|
||||||
25: "filesize limit exceeded",
|
{21, "SIGTTIN", "stopped (tty input)"},
|
||||||
26: "virtual timer expired",
|
{22, "SIGTTOU", "stopped (tty output)"},
|
||||||
27: "profiling timer expired",
|
{23, "SIGIO", "I/O possible"},
|
||||||
28: "window size changes",
|
{24, "SIGXCPU", "cputime limit exceeded"},
|
||||||
29: "information request",
|
{25, "SIGXFSZ", "filesize limit exceeded"},
|
||||||
30: "user defined signal 1",
|
{26, "SIGVTALRM", "virtual timer expired"},
|
||||||
31: "user defined signal 2",
|
{27, "SIGPROF", "profiling timer expired"},
|
||||||
|
{28, "SIGWINCH", "window size changes"},
|
||||||
|
{29, "SIGINFO", "information request"},
|
||||||
|
{30, "SIGUSR1", "user defined signal 1"},
|
||||||
|
{31, "SIGUSR2", "user defined signal 2"},
|
||||||
}
|
}
|
||||||
|
|
485
vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
generated
vendored
485
vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
generated
vendored
|
@ -1,5 +1,5 @@
|
||||||
// mkerrors.sh -m64
|
// mkerrors.sh -m64
|
||||||
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
// +build amd64,darwin
|
// +build amd64,darwin
|
||||||
|
|
||||||
|
@ -48,6 +48,87 @@ const (
|
||||||
AF_UNIX = 0x1
|
AF_UNIX = 0x1
|
||||||
AF_UNSPEC = 0x0
|
AF_UNSPEC = 0x0
|
||||||
AF_UTUN = 0x26
|
AF_UTUN = 0x26
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ATTR_BIT_MAP_COUNT = 0x5
|
||||||
|
ATTR_CMN_ACCESSMASK = 0x20000
|
||||||
|
ATTR_CMN_ACCTIME = 0x1000
|
||||||
|
ATTR_CMN_ADDEDTIME = 0x10000000
|
||||||
|
ATTR_CMN_BKUPTIME = 0x2000
|
||||||
|
ATTR_CMN_CHGTIME = 0x800
|
||||||
|
ATTR_CMN_CRTIME = 0x200
|
||||||
|
ATTR_CMN_DATA_PROTECT_FLAGS = 0x40000000
|
||||||
|
ATTR_CMN_DEVID = 0x2
|
||||||
|
ATTR_CMN_DOCUMENT_ID = 0x100000
|
||||||
|
ATTR_CMN_ERROR = 0x20000000
|
||||||
|
ATTR_CMN_EXTENDED_SECURITY = 0x400000
|
||||||
|
ATTR_CMN_FILEID = 0x2000000
|
||||||
|
ATTR_CMN_FLAGS = 0x40000
|
||||||
|
ATTR_CMN_FNDRINFO = 0x4000
|
||||||
|
ATTR_CMN_FSID = 0x4
|
||||||
|
ATTR_CMN_FULLPATH = 0x8000000
|
||||||
|
ATTR_CMN_GEN_COUNT = 0x80000
|
||||||
|
ATTR_CMN_GRPID = 0x10000
|
||||||
|
ATTR_CMN_GRPUUID = 0x1000000
|
||||||
|
ATTR_CMN_MODTIME = 0x400
|
||||||
|
ATTR_CMN_NAME = 0x1
|
||||||
|
ATTR_CMN_NAMEDATTRCOUNT = 0x80000
|
||||||
|
ATTR_CMN_NAMEDATTRLIST = 0x100000
|
||||||
|
ATTR_CMN_OBJID = 0x20
|
||||||
|
ATTR_CMN_OBJPERMANENTID = 0x40
|
||||||
|
ATTR_CMN_OBJTAG = 0x10
|
||||||
|
ATTR_CMN_OBJTYPE = 0x8
|
||||||
|
ATTR_CMN_OWNERID = 0x8000
|
||||||
|
ATTR_CMN_PARENTID = 0x4000000
|
||||||
|
ATTR_CMN_PAROBJID = 0x80
|
||||||
|
ATTR_CMN_RETURNED_ATTRS = 0x80000000
|
||||||
|
ATTR_CMN_SCRIPT = 0x100
|
||||||
|
ATTR_CMN_SETMASK = 0x41c7ff00
|
||||||
|
ATTR_CMN_USERACCESS = 0x200000
|
||||||
|
ATTR_CMN_UUID = 0x800000
|
||||||
|
ATTR_CMN_VALIDMASK = 0xffffffff
|
||||||
|
ATTR_CMN_VOLSETMASK = 0x6700
|
||||||
|
ATTR_FILE_ALLOCSIZE = 0x4
|
||||||
|
ATTR_FILE_CLUMPSIZE = 0x10
|
||||||
|
ATTR_FILE_DATAALLOCSIZE = 0x400
|
||||||
|
ATTR_FILE_DATAEXTENTS = 0x800
|
||||||
|
ATTR_FILE_DATALENGTH = 0x200
|
||||||
|
ATTR_FILE_DEVTYPE = 0x20
|
||||||
|
ATTR_FILE_FILETYPE = 0x40
|
||||||
|
ATTR_FILE_FORKCOUNT = 0x80
|
||||||
|
ATTR_FILE_FORKLIST = 0x100
|
||||||
|
ATTR_FILE_IOBLOCKSIZE = 0x8
|
||||||
|
ATTR_FILE_LINKCOUNT = 0x1
|
||||||
|
ATTR_FILE_RSRCALLOCSIZE = 0x2000
|
||||||
|
ATTR_FILE_RSRCEXTENTS = 0x4000
|
||||||
|
ATTR_FILE_RSRCLENGTH = 0x1000
|
||||||
|
ATTR_FILE_SETMASK = 0x20
|
||||||
|
ATTR_FILE_TOTALSIZE = 0x2
|
||||||
|
ATTR_FILE_VALIDMASK = 0x37ff
|
||||||
|
ATTR_VOL_ALLOCATIONCLUMP = 0x40
|
||||||
|
ATTR_VOL_ATTRIBUTES = 0x40000000
|
||||||
|
ATTR_VOL_CAPABILITIES = 0x20000
|
||||||
|
ATTR_VOL_DIRCOUNT = 0x400
|
||||||
|
ATTR_VOL_ENCODINGSUSED = 0x10000
|
||||||
|
ATTR_VOL_FILECOUNT = 0x200
|
||||||
|
ATTR_VOL_FSTYPE = 0x1
|
||||||
|
ATTR_VOL_INFO = 0x80000000
|
||||||
|
ATTR_VOL_IOBLOCKSIZE = 0x80
|
||||||
|
ATTR_VOL_MAXOBJCOUNT = 0x800
|
||||||
|
ATTR_VOL_MINALLOCATION = 0x20
|
||||||
|
ATTR_VOL_MOUNTEDDEVICE = 0x8000
|
||||||
|
ATTR_VOL_MOUNTFLAGS = 0x4000
|
||||||
|
ATTR_VOL_MOUNTPOINT = 0x1000
|
||||||
|
ATTR_VOL_NAME = 0x2000
|
||||||
|
ATTR_VOL_OBJCOUNT = 0x100
|
||||||
|
ATTR_VOL_QUOTA_SIZE = 0x10000000
|
||||||
|
ATTR_VOL_RESERVED_SIZE = 0x20000000
|
||||||
|
ATTR_VOL_SETMASK = 0x80002000
|
||||||
|
ATTR_VOL_SIGNATURE = 0x2
|
||||||
|
ATTR_VOL_SIZE = 0x4
|
||||||
|
ATTR_VOL_SPACEAVAIL = 0x10
|
||||||
|
ATTR_VOL_SPACEFREE = 0x8
|
||||||
|
ATTR_VOL_UUID = 0x40000
|
||||||
|
ATTR_VOL_VALIDMASK = 0xf007ffff
|
||||||
B0 = 0x0
|
B0 = 0x0
|
||||||
B110 = 0x6e
|
B110 = 0x6e
|
||||||
B115200 = 0x1c200
|
B115200 = 0x1c200
|
||||||
|
@ -138,9 +219,26 @@ const (
|
||||||
BPF_W = 0x0
|
BPF_W = 0x0
|
||||||
BPF_X = 0x8
|
BPF_X = 0x8
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
|
BS0 = 0x0
|
||||||
|
BS1 = 0x8000
|
||||||
|
BSDLY = 0x8000
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_MONOTONIC = 0x6
|
||||||
|
CLOCK_MONOTONIC_RAW = 0x4
|
||||||
|
CLOCK_MONOTONIC_RAW_APPROX = 0x5
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0xc
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CR0 = 0x0
|
||||||
|
CR1 = 0x1000
|
||||||
|
CR2 = 0x2000
|
||||||
|
CR3 = 0x3000
|
||||||
|
CRDLY = 0x3000
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
CS6 = 0x100
|
CS6 = 0x100
|
||||||
CS7 = 0x200
|
CS7 = 0x200
|
||||||
|
@ -151,6 +249,8 @@ const (
|
||||||
CSTOP = 0x13
|
CSTOP = 0x13
|
||||||
CSTOPB = 0x400
|
CSTOPB = 0x400
|
||||||
CSUSP = 0x1a
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
CTL_MAXNAME = 0xc
|
CTL_MAXNAME = 0xc
|
||||||
CTL_NET = 0x4
|
CTL_NET = 0x4
|
||||||
DLT_A429 = 0xb8
|
DLT_A429 = 0xb8
|
||||||
|
@ -332,13 +432,14 @@ const (
|
||||||
ECHONL = 0x10
|
ECHONL = 0x10
|
||||||
ECHOPRT = 0x20
|
ECHOPRT = 0x20
|
||||||
EVFILT_AIO = -0x3
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_EXCEPT = -0xf
|
||||||
EVFILT_FS = -0x9
|
EVFILT_FS = -0x9
|
||||||
EVFILT_MACHPORT = -0x8
|
EVFILT_MACHPORT = -0x8
|
||||||
EVFILT_PROC = -0x5
|
EVFILT_PROC = -0x5
|
||||||
EVFILT_READ = -0x1
|
EVFILT_READ = -0x1
|
||||||
EVFILT_SIGNAL = -0x6
|
EVFILT_SIGNAL = -0x6
|
||||||
EVFILT_SYSCOUNT = 0xe
|
EVFILT_SYSCOUNT = 0xf
|
||||||
EVFILT_THREADMARKER = 0xe
|
EVFILT_THREADMARKER = 0xf
|
||||||
EVFILT_TIMER = -0x7
|
EVFILT_TIMER = -0x7
|
||||||
EVFILT_USER = -0xa
|
EVFILT_USER = -0xa
|
||||||
EVFILT_VM = -0xc
|
EVFILT_VM = -0xc
|
||||||
|
@ -349,6 +450,7 @@ const (
|
||||||
EV_DELETE = 0x2
|
EV_DELETE = 0x2
|
||||||
EV_DISABLE = 0x8
|
EV_DISABLE = 0x8
|
||||||
EV_DISPATCH = 0x80
|
EV_DISPATCH = 0x80
|
||||||
|
EV_DISPATCH2 = 0x180
|
||||||
EV_ENABLE = 0x4
|
EV_ENABLE = 0x4
|
||||||
EV_EOF = 0x8000
|
EV_EOF = 0x8000
|
||||||
EV_ERROR = 0x4000
|
EV_ERROR = 0x4000
|
||||||
|
@ -359,16 +461,30 @@ const (
|
||||||
EV_POLL = 0x1000
|
EV_POLL = 0x1000
|
||||||
EV_RECEIPT = 0x40
|
EV_RECEIPT = 0x40
|
||||||
EV_SYSFLAGS = 0xf000
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EV_UDATA_SPECIFIC = 0x100
|
||||||
|
EV_VANISHED = 0x200
|
||||||
EXTA = 0x4b00
|
EXTA = 0x4b00
|
||||||
EXTB = 0x9600
|
EXTB = 0x9600
|
||||||
EXTPROC = 0x800
|
EXTPROC = 0x800
|
||||||
FD_CLOEXEC = 0x1
|
FD_CLOEXEC = 0x1
|
||||||
FD_SETSIZE = 0x400
|
FD_SETSIZE = 0x400
|
||||||
|
FF0 = 0x0
|
||||||
|
FF1 = 0x4000
|
||||||
|
FFDLY = 0x4000
|
||||||
FLUSHO = 0x800000
|
FLUSHO = 0x800000
|
||||||
|
FSOPT_ATTR_CMN_EXTENDED = 0x20
|
||||||
|
FSOPT_NOFOLLOW = 0x1
|
||||||
|
FSOPT_NOINMEMUPDATE = 0x2
|
||||||
|
FSOPT_PACK_INVAL_ATTRS = 0x8
|
||||||
|
FSOPT_REPORT_FULLSIZE = 0x4
|
||||||
F_ADDFILESIGS = 0x3d
|
F_ADDFILESIGS = 0x3d
|
||||||
|
F_ADDFILESIGS_FOR_DYLD_SIM = 0x53
|
||||||
|
F_ADDFILESIGS_RETURN = 0x61
|
||||||
F_ADDSIGS = 0x3b
|
F_ADDSIGS = 0x3b
|
||||||
F_ALLOCATEALL = 0x4
|
F_ALLOCATEALL = 0x4
|
||||||
F_ALLOCATECONTIG = 0x2
|
F_ALLOCATECONTIG = 0x2
|
||||||
|
F_BARRIERFSYNC = 0x55
|
||||||
|
F_CHECK_LV = 0x62
|
||||||
F_CHKCLEAN = 0x29
|
F_CHKCLEAN = 0x29
|
||||||
F_DUPFD = 0x0
|
F_DUPFD = 0x0
|
||||||
F_DUPFD_CLOEXEC = 0x43
|
F_DUPFD_CLOEXEC = 0x43
|
||||||
|
@ -396,6 +512,7 @@ const (
|
||||||
F_PATHPKG_CHECK = 0x34
|
F_PATHPKG_CHECK = 0x34
|
||||||
F_PEOFPOSMODE = 0x3
|
F_PEOFPOSMODE = 0x3
|
||||||
F_PREALLOCATE = 0x2a
|
F_PREALLOCATE = 0x2a
|
||||||
|
F_PUNCHHOLE = 0x63
|
||||||
F_RDADVISE = 0x2c
|
F_RDADVISE = 0x2c
|
||||||
F_RDAHEAD = 0x2d
|
F_RDAHEAD = 0x2d
|
||||||
F_RDLCK = 0x1
|
F_RDLCK = 0x1
|
||||||
|
@ -412,10 +529,12 @@ const (
|
||||||
F_SINGLE_WRITER = 0x4c
|
F_SINGLE_WRITER = 0x4c
|
||||||
F_THAW_FS = 0x36
|
F_THAW_FS = 0x36
|
||||||
F_TRANSCODEKEY = 0x4b
|
F_TRANSCODEKEY = 0x4b
|
||||||
|
F_TRIM_ACTIVE_FILE = 0x64
|
||||||
F_UNLCK = 0x2
|
F_UNLCK = 0x2
|
||||||
F_VOLPOSMODE = 0x4
|
F_VOLPOSMODE = 0x4
|
||||||
F_WRLCK = 0x3
|
F_WRLCK = 0x3
|
||||||
HUPCL = 0x4000
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
ICANON = 0x100
|
ICANON = 0x100
|
||||||
ICMP6_FILTER = 0x12
|
ICMP6_FILTER = 0x12
|
||||||
ICRNL = 0x100
|
ICRNL = 0x100
|
||||||
|
@ -652,6 +771,7 @@ const (
|
||||||
IPV6_FAITH = 0x1d
|
IPV6_FAITH = 0x1d
|
||||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||||
|
IPV6_FLOW_ECN_MASK = 0x300
|
||||||
IPV6_FRAGTTL = 0x3c
|
IPV6_FRAGTTL = 0x3c
|
||||||
IPV6_FW_ADD = 0x1e
|
IPV6_FW_ADD = 0x1e
|
||||||
IPV6_FW_DEL = 0x1f
|
IPV6_FW_DEL = 0x1f
|
||||||
|
@ -742,6 +862,7 @@ const (
|
||||||
IP_RECVOPTS = 0x5
|
IP_RECVOPTS = 0x5
|
||||||
IP_RECVPKTINFO = 0x1a
|
IP_RECVPKTINFO = 0x1a
|
||||||
IP_RECVRETOPTS = 0x6
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVTOS = 0x1b
|
||||||
IP_RECVTTL = 0x18
|
IP_RECVTTL = 0x18
|
||||||
IP_RETOPTS = 0x8
|
IP_RETOPTS = 0x8
|
||||||
IP_RF = 0x8000
|
IP_RF = 0x8000
|
||||||
|
@ -760,6 +881,10 @@ const (
|
||||||
IXANY = 0x800
|
IXANY = 0x800
|
||||||
IXOFF = 0x400
|
IXOFF = 0x400
|
||||||
IXON = 0x200
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
LOCK_EX = 0x2
|
LOCK_EX = 0x2
|
||||||
LOCK_NB = 0x4
|
LOCK_NB = 0x4
|
||||||
LOCK_SH = 0x1
|
LOCK_SH = 0x1
|
||||||
|
@ -770,11 +895,13 @@ const (
|
||||||
MADV_FREE_REUSABLE = 0x7
|
MADV_FREE_REUSABLE = 0x7
|
||||||
MADV_FREE_REUSE = 0x8
|
MADV_FREE_REUSE = 0x8
|
||||||
MADV_NORMAL = 0x0
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_PAGEOUT = 0xa
|
||||||
MADV_RANDOM = 0x1
|
MADV_RANDOM = 0x1
|
||||||
MADV_SEQUENTIAL = 0x2
|
MADV_SEQUENTIAL = 0x2
|
||||||
MADV_WILLNEED = 0x3
|
MADV_WILLNEED = 0x3
|
||||||
MADV_ZERO_WIRED_PAGES = 0x6
|
MADV_ZERO_WIRED_PAGES = 0x6
|
||||||
MAP_ANON = 0x1000
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
MAP_COPY = 0x2
|
MAP_COPY = 0x2
|
||||||
MAP_FILE = 0x0
|
MAP_FILE = 0x0
|
||||||
MAP_FIXED = 0x10
|
MAP_FIXED = 0x10
|
||||||
|
@ -786,9 +913,43 @@ const (
|
||||||
MAP_PRIVATE = 0x2
|
MAP_PRIVATE = 0x2
|
||||||
MAP_RENAME = 0x20
|
MAP_RENAME = 0x20
|
||||||
MAP_RESERVED0080 = 0x80
|
MAP_RESERVED0080 = 0x80
|
||||||
|
MAP_RESILIENT_CODESIGN = 0x2000
|
||||||
|
MAP_RESILIENT_MEDIA = 0x4000
|
||||||
MAP_SHARED = 0x1
|
MAP_SHARED = 0x1
|
||||||
MCL_CURRENT = 0x1
|
MCL_CURRENT = 0x1
|
||||||
MCL_FUTURE = 0x2
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_AUTOMOUNTED = 0x400000
|
||||||
|
MNT_CMDFLAGS = 0xf0000
|
||||||
|
MNT_CPROTECT = 0x80
|
||||||
|
MNT_DEFWRITE = 0x2000000
|
||||||
|
MNT_DONTBROWSE = 0x100000
|
||||||
|
MNT_DOVOLFS = 0x8000
|
||||||
|
MNT_DWAIT = 0x4
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_IGNORE_OWNERSHIP = 0x200000
|
||||||
|
MNT_JOURNALED = 0x800000
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_MULTILABEL = 0x4000000
|
||||||
|
MNT_NOATIME = 0x10000000
|
||||||
|
MNT_NOBLOCK = 0x20000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOUSERXATTR = 0x1000000
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUARANTINE = 0x400
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UNION = 0x20
|
||||||
|
MNT_UNKNOWNPERMISSIONS = 0x200000
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x17f0f5ff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
MSG_CTRUNC = 0x20
|
MSG_CTRUNC = 0x20
|
||||||
MSG_DONTROUTE = 0x4
|
MSG_DONTROUTE = 0x4
|
||||||
MSG_DONTWAIT = 0x80
|
MSG_DONTWAIT = 0x80
|
||||||
|
@ -819,7 +980,13 @@ const (
|
||||||
NET_RT_MAXID = 0xa
|
NET_RT_MAXID = 0xa
|
||||||
NET_RT_STAT = 0x4
|
NET_RT_STAT = 0x4
|
||||||
NET_RT_TRASH = 0x5
|
NET_RT_TRASH = 0x5
|
||||||
|
NL0 = 0x0
|
||||||
|
NL1 = 0x100
|
||||||
|
NL2 = 0x200
|
||||||
|
NL3 = 0x300
|
||||||
|
NLDLY = 0x300
|
||||||
NOFLSH = 0x80000000
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
NOTE_ABSOLUTE = 0x8
|
NOTE_ABSOLUTE = 0x8
|
||||||
NOTE_ATTRIB = 0x8
|
NOTE_ATTRIB = 0x8
|
||||||
NOTE_BACKGROUND = 0x40
|
NOTE_BACKGROUND = 0x40
|
||||||
|
@ -843,11 +1010,14 @@ const (
|
||||||
NOTE_FFNOP = 0x0
|
NOTE_FFNOP = 0x0
|
||||||
NOTE_FFOR = 0x80000000
|
NOTE_FFOR = 0x80000000
|
||||||
NOTE_FORK = 0x40000000
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_FUNLOCK = 0x100
|
||||||
NOTE_LEEWAY = 0x10
|
NOTE_LEEWAY = 0x10
|
||||||
NOTE_LINK = 0x10
|
NOTE_LINK = 0x10
|
||||||
NOTE_LOWAT = 0x1
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_MACH_CONTINUOUS_TIME = 0x80
|
||||||
NOTE_NONE = 0x80
|
NOTE_NONE = 0x80
|
||||||
NOTE_NSECONDS = 0x4
|
NOTE_NSECONDS = 0x4
|
||||||
|
NOTE_OOB = 0x2
|
||||||
NOTE_PCTRLMASK = -0x100000
|
NOTE_PCTRLMASK = -0x100000
|
||||||
NOTE_PDATAMASK = 0xfffff
|
NOTE_PDATAMASK = 0xfffff
|
||||||
NOTE_REAP = 0x10000000
|
NOTE_REAP = 0x10000000
|
||||||
|
@ -872,6 +1042,7 @@ const (
|
||||||
ONOCR = 0x20
|
ONOCR = 0x20
|
||||||
ONOEOT = 0x8
|
ONOEOT = 0x8
|
||||||
OPOST = 0x1
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
O_ACCMODE = 0x3
|
O_ACCMODE = 0x3
|
||||||
O_ALERT = 0x20000000
|
O_ALERT = 0x20000000
|
||||||
O_APPEND = 0x8
|
O_APPEND = 0x8
|
||||||
|
@ -880,6 +1051,7 @@ const (
|
||||||
O_CREAT = 0x200
|
O_CREAT = 0x200
|
||||||
O_DIRECTORY = 0x100000
|
O_DIRECTORY = 0x100000
|
||||||
O_DP_GETRAWENCRYPTED = 0x1
|
O_DP_GETRAWENCRYPTED = 0x1
|
||||||
|
O_DP_GETRAWUNENCRYPTED = 0x2
|
||||||
O_DSYNC = 0x400000
|
O_DSYNC = 0x400000
|
||||||
O_EVTONLY = 0x8000
|
O_EVTONLY = 0x8000
|
||||||
O_EXCL = 0x800
|
O_EXCL = 0x800
|
||||||
|
@ -932,7 +1104,10 @@ const (
|
||||||
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
RLIMIT_CPU_USAGE_MONITOR = 0x2
|
||||||
RLIMIT_DATA = 0x2
|
RLIMIT_DATA = 0x2
|
||||||
RLIMIT_FSIZE = 0x1
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
RLIMIT_NOFILE = 0x8
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
RLIMIT_STACK = 0x3
|
RLIMIT_STACK = 0x3
|
||||||
RLIM_INFINITY = 0x7fffffffffffffff
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
RTAX_AUTHOR = 0x6
|
RTAX_AUTHOR = 0x6
|
||||||
|
@ -1102,6 +1277,8 @@ const (
|
||||||
SO_LABEL = 0x1010
|
SO_LABEL = 0x1010
|
||||||
SO_LINGER = 0x80
|
SO_LINGER = 0x80
|
||||||
SO_LINGER_SEC = 0x1080
|
SO_LINGER_SEC = 0x1080
|
||||||
|
SO_NETSVC_MARKING_LEVEL = 0x1119
|
||||||
|
SO_NET_SERVICE_TYPE = 0x1116
|
||||||
SO_NKE = 0x1021
|
SO_NKE = 0x1021
|
||||||
SO_NOADDRERR = 0x1023
|
SO_NOADDRERR = 0x1023
|
||||||
SO_NOSIGPIPE = 0x1022
|
SO_NOSIGPIPE = 0x1022
|
||||||
|
@ -1157,11 +1334,22 @@ const (
|
||||||
S_IXGRP = 0x8
|
S_IXGRP = 0x8
|
||||||
S_IXOTH = 0x1
|
S_IXOTH = 0x1
|
||||||
S_IXUSR = 0x40
|
S_IXUSR = 0x40
|
||||||
|
TAB0 = 0x0
|
||||||
|
TAB1 = 0x400
|
||||||
|
TAB2 = 0x800
|
||||||
|
TAB3 = 0x4
|
||||||
|
TABDLY = 0xc04
|
||||||
TCIFLUSH = 0x1
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
TCIOFLUSH = 0x3
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
TCOFLUSH = 0x2
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
TCP_CONNECTIONTIMEOUT = 0x20
|
TCP_CONNECTIONTIMEOUT = 0x20
|
||||||
|
TCP_CONNECTION_INFO = 0x106
|
||||||
TCP_ENABLE_ECN = 0x104
|
TCP_ENABLE_ECN = 0x104
|
||||||
|
TCP_FASTOPEN = 0x105
|
||||||
TCP_KEEPALIVE = 0x10
|
TCP_KEEPALIVE = 0x10
|
||||||
TCP_KEEPCNT = 0x102
|
TCP_KEEPCNT = 0x102
|
||||||
TCP_KEEPINTVL = 0x101
|
TCP_KEEPINTVL = 0x101
|
||||||
|
@ -1261,6 +1449,11 @@ const (
|
||||||
VKILL = 0x5
|
VKILL = 0x5
|
||||||
VLNEXT = 0xe
|
VLNEXT = 0xe
|
||||||
VMIN = 0x10
|
VMIN = 0x10
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MACHFACTOR = 0x4
|
||||||
|
VM_MAXID = 0x6
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_SWAPUSAGE = 0x5
|
||||||
VQUIT = 0x9
|
VQUIT = 0x9
|
||||||
VREPRINT = 0x6
|
VREPRINT = 0x6
|
||||||
VSTART = 0xc
|
VSTART = 0xc
|
||||||
|
@ -1431,146 +1624,154 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errorList = [...]struct {
|
||||||
1: "operation not permitted",
|
num syscall.Errno
|
||||||
2: "no such file or directory",
|
name string
|
||||||
3: "no such process",
|
desc string
|
||||||
4: "interrupted system call",
|
}{
|
||||||
5: "input/output error",
|
{1, "EPERM", "operation not permitted"},
|
||||||
6: "device not configured",
|
{2, "ENOENT", "no such file or directory"},
|
||||||
7: "argument list too long",
|
{3, "ESRCH", "no such process"},
|
||||||
8: "exec format error",
|
{4, "EINTR", "interrupted system call"},
|
||||||
9: "bad file descriptor",
|
{5, "EIO", "input/output error"},
|
||||||
10: "no child processes",
|
{6, "ENXIO", "device not configured"},
|
||||||
11: "resource deadlock avoided",
|
{7, "E2BIG", "argument list too long"},
|
||||||
12: "cannot allocate memory",
|
{8, "ENOEXEC", "exec format error"},
|
||||||
13: "permission denied",
|
{9, "EBADF", "bad file descriptor"},
|
||||||
14: "bad address",
|
{10, "ECHILD", "no child processes"},
|
||||||
15: "block device required",
|
{11, "EDEADLK", "resource deadlock avoided"},
|
||||||
16: "resource busy",
|
{12, "ENOMEM", "cannot allocate memory"},
|
||||||
17: "file exists",
|
{13, "EACCES", "permission denied"},
|
||||||
18: "cross-device link",
|
{14, "EFAULT", "bad address"},
|
||||||
19: "operation not supported by device",
|
{15, "ENOTBLK", "block device required"},
|
||||||
20: "not a directory",
|
{16, "EBUSY", "resource busy"},
|
||||||
21: "is a directory",
|
{17, "EEXIST", "file exists"},
|
||||||
22: "invalid argument",
|
{18, "EXDEV", "cross-device link"},
|
||||||
23: "too many open files in system",
|
{19, "ENODEV", "operation not supported by device"},
|
||||||
24: "too many open files",
|
{20, "ENOTDIR", "not a directory"},
|
||||||
25: "inappropriate ioctl for device",
|
{21, "EISDIR", "is a directory"},
|
||||||
26: "text file busy",
|
{22, "EINVAL", "invalid argument"},
|
||||||
27: "file too large",
|
{23, "ENFILE", "too many open files in system"},
|
||||||
28: "no space left on device",
|
{24, "EMFILE", "too many open files"},
|
||||||
29: "illegal seek",
|
{25, "ENOTTY", "inappropriate ioctl for device"},
|
||||||
30: "read-only file system",
|
{26, "ETXTBSY", "text file busy"},
|
||||||
31: "too many links",
|
{27, "EFBIG", "file too large"},
|
||||||
32: "broken pipe",
|
{28, "ENOSPC", "no space left on device"},
|
||||||
33: "numerical argument out of domain",
|
{29, "ESPIPE", "illegal seek"},
|
||||||
34: "result too large",
|
{30, "EROFS", "read-only file system"},
|
||||||
35: "resource temporarily unavailable",
|
{31, "EMLINK", "too many links"},
|
||||||
36: "operation now in progress",
|
{32, "EPIPE", "broken pipe"},
|
||||||
37: "operation already in progress",
|
{33, "EDOM", "numerical argument out of domain"},
|
||||||
38: "socket operation on non-socket",
|
{34, "ERANGE", "result too large"},
|
||||||
39: "destination address required",
|
{35, "EAGAIN", "resource temporarily unavailable"},
|
||||||
40: "message too long",
|
{36, "EINPROGRESS", "operation now in progress"},
|
||||||
41: "protocol wrong type for socket",
|
{37, "EALREADY", "operation already in progress"},
|
||||||
42: "protocol not available",
|
{38, "ENOTSOCK", "socket operation on non-socket"},
|
||||||
43: "protocol not supported",
|
{39, "EDESTADDRREQ", "destination address required"},
|
||||||
44: "socket type not supported",
|
{40, "EMSGSIZE", "message too long"},
|
||||||
45: "operation not supported",
|
{41, "EPROTOTYPE", "protocol wrong type for socket"},
|
||||||
46: "protocol family not supported",
|
{42, "ENOPROTOOPT", "protocol not available"},
|
||||||
47: "address family not supported by protocol family",
|
{43, "EPROTONOSUPPORT", "protocol not supported"},
|
||||||
48: "address already in use",
|
{44, "ESOCKTNOSUPPORT", "socket type not supported"},
|
||||||
49: "can't assign requested address",
|
{45, "ENOTSUP", "operation not supported"},
|
||||||
50: "network is down",
|
{46, "EPFNOSUPPORT", "protocol family not supported"},
|
||||||
51: "network is unreachable",
|
{47, "EAFNOSUPPORT", "address family not supported by protocol family"},
|
||||||
52: "network dropped connection on reset",
|
{48, "EADDRINUSE", "address already in use"},
|
||||||
53: "software caused connection abort",
|
{49, "EADDRNOTAVAIL", "can't assign requested address"},
|
||||||
54: "connection reset by peer",
|
{50, "ENETDOWN", "network is down"},
|
||||||
55: "no buffer space available",
|
{51, "ENETUNREACH", "network is unreachable"},
|
||||||
56: "socket is already connected",
|
{52, "ENETRESET", "network dropped connection on reset"},
|
||||||
57: "socket is not connected",
|
{53, "ECONNABORTED", "software caused connection abort"},
|
||||||
58: "can't send after socket shutdown",
|
{54, "ECONNRESET", "connection reset by peer"},
|
||||||
59: "too many references: can't splice",
|
{55, "ENOBUFS", "no buffer space available"},
|
||||||
60: "operation timed out",
|
{56, "EISCONN", "socket is already connected"},
|
||||||
61: "connection refused",
|
{57, "ENOTCONN", "socket is not connected"},
|
||||||
62: "too many levels of symbolic links",
|
{58, "ESHUTDOWN", "can't send after socket shutdown"},
|
||||||
63: "file name too long",
|
{59, "ETOOMANYREFS", "too many references: can't splice"},
|
||||||
64: "host is down",
|
{60, "ETIMEDOUT", "operation timed out"},
|
||||||
65: "no route to host",
|
{61, "ECONNREFUSED", "connection refused"},
|
||||||
66: "directory not empty",
|
{62, "ELOOP", "too many levels of symbolic links"},
|
||||||
67: "too many processes",
|
{63, "ENAMETOOLONG", "file name too long"},
|
||||||
68: "too many users",
|
{64, "EHOSTDOWN", "host is down"},
|
||||||
69: "disc quota exceeded",
|
{65, "EHOSTUNREACH", "no route to host"},
|
||||||
70: "stale NFS file handle",
|
{66, "ENOTEMPTY", "directory not empty"},
|
||||||
71: "too many levels of remote in path",
|
{67, "EPROCLIM", "too many processes"},
|
||||||
72: "RPC struct is bad",
|
{68, "EUSERS", "too many users"},
|
||||||
73: "RPC version wrong",
|
{69, "EDQUOT", "disc quota exceeded"},
|
||||||
74: "RPC prog. not avail",
|
{70, "ESTALE", "stale NFS file handle"},
|
||||||
75: "program version wrong",
|
{71, "EREMOTE", "too many levels of remote in path"},
|
||||||
76: "bad procedure for program",
|
{72, "EBADRPC", "RPC struct is bad"},
|
||||||
77: "no locks available",
|
{73, "ERPCMISMATCH", "RPC version wrong"},
|
||||||
78: "function not implemented",
|
{74, "EPROGUNAVAIL", "RPC prog. not avail"},
|
||||||
79: "inappropriate file type or format",
|
{75, "EPROGMISMATCH", "program version wrong"},
|
||||||
80: "authentication error",
|
{76, "EPROCUNAVAIL", "bad procedure for program"},
|
||||||
81: "need authenticator",
|
{77, "ENOLCK", "no locks available"},
|
||||||
82: "device power is off",
|
{78, "ENOSYS", "function not implemented"},
|
||||||
83: "device error",
|
{79, "EFTYPE", "inappropriate file type or format"},
|
||||||
84: "value too large to be stored in data type",
|
{80, "EAUTH", "authentication error"},
|
||||||
85: "bad executable (or shared library)",
|
{81, "ENEEDAUTH", "need authenticator"},
|
||||||
86: "bad CPU type in executable",
|
{82, "EPWROFF", "device power is off"},
|
||||||
87: "shared library version mismatch",
|
{83, "EDEVERR", "device error"},
|
||||||
88: "malformed Mach-o file",
|
{84, "EOVERFLOW", "value too large to be stored in data type"},
|
||||||
89: "operation canceled",
|
{85, "EBADEXEC", "bad executable (or shared library)"},
|
||||||
90: "identifier removed",
|
{86, "EBADARCH", "bad CPU type in executable"},
|
||||||
91: "no message of desired type",
|
{87, "ESHLIBVERS", "shared library version mismatch"},
|
||||||
92: "illegal byte sequence",
|
{88, "EBADMACHO", "malformed Mach-o file"},
|
||||||
93: "attribute not found",
|
{89, "ECANCELED", "operation canceled"},
|
||||||
94: "bad message",
|
{90, "EIDRM", "identifier removed"},
|
||||||
95: "EMULTIHOP (Reserved)",
|
{91, "ENOMSG", "no message of desired type"},
|
||||||
96: "no message available on STREAM",
|
{92, "EILSEQ", "illegal byte sequence"},
|
||||||
97: "ENOLINK (Reserved)",
|
{93, "ENOATTR", "attribute not found"},
|
||||||
98: "no STREAM resources",
|
{94, "EBADMSG", "bad message"},
|
||||||
99: "not a STREAM",
|
{95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
|
||||||
100: "protocol error",
|
{96, "ENODATA", "no message available on STREAM"},
|
||||||
101: "STREAM ioctl timeout",
|
{97, "ENOLINK", "ENOLINK (Reserved)"},
|
||||||
102: "operation not supported on socket",
|
{98, "ENOSR", "no STREAM resources"},
|
||||||
103: "policy not found",
|
{99, "ENOSTR", "not a STREAM"},
|
||||||
104: "state not recoverable",
|
{100, "EPROTO", "protocol error"},
|
||||||
105: "previous owner died",
|
{101, "ETIME", "STREAM ioctl timeout"},
|
||||||
106: "interface output queue is full",
|
{102, "EOPNOTSUPP", "operation not supported on socket"},
|
||||||
|
{103, "ENOPOLICY", "policy not found"},
|
||||||
|
{104, "ENOTRECOVERABLE", "state not recoverable"},
|
||||||
|
{105, "EOWNERDEAD", "previous owner died"},
|
||||||
|
{106, "EQFULL", "interface output queue is full"},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Signal table
|
// Signal table
|
||||||
var signals = [...]string{
|
var signalList = [...]struct {
|
||||||
1: "hangup",
|
num syscall.Signal
|
||||||
2: "interrupt",
|
name string
|
||||||
3: "quit",
|
desc string
|
||||||
4: "illegal instruction",
|
}{
|
||||||
5: "trace/BPT trap",
|
{1, "SIGHUP", "hangup"},
|
||||||
6: "abort trap",
|
{2, "SIGINT", "interrupt"},
|
||||||
7: "EMT trap",
|
{3, "SIGQUIT", "quit"},
|
||||||
8: "floating point exception",
|
{4, "SIGILL", "illegal instruction"},
|
||||||
9: "killed",
|
{5, "SIGTRAP", "trace/BPT trap"},
|
||||||
10: "bus error",
|
{6, "SIGABRT", "abort trap"},
|
||||||
11: "segmentation fault",
|
{7, "SIGEMT", "EMT trap"},
|
||||||
12: "bad system call",
|
{8, "SIGFPE", "floating point exception"},
|
||||||
13: "broken pipe",
|
{9, "SIGKILL", "killed"},
|
||||||
14: "alarm clock",
|
{10, "SIGBUS", "bus error"},
|
||||||
15: "terminated",
|
{11, "SIGSEGV", "segmentation fault"},
|
||||||
16: "urgent I/O condition",
|
{12, "SIGSYS", "bad system call"},
|
||||||
17: "suspended (signal)",
|
{13, "SIGPIPE", "broken pipe"},
|
||||||
18: "suspended",
|
{14, "SIGALRM", "alarm clock"},
|
||||||
19: "continued",
|
{15, "SIGTERM", "terminated"},
|
||||||
20: "child exited",
|
{16, "SIGURG", "urgent I/O condition"},
|
||||||
21: "stopped (tty input)",
|
{17, "SIGSTOP", "suspended (signal)"},
|
||||||
22: "stopped (tty output)",
|
{18, "SIGTSTP", "suspended"},
|
||||||
23: "I/O possible",
|
{19, "SIGCONT", "continued"},
|
||||||
24: "cputime limit exceeded",
|
{20, "SIGCHLD", "child exited"},
|
||||||
25: "filesize limit exceeded",
|
{21, "SIGTTIN", "stopped (tty input)"},
|
||||||
26: "virtual timer expired",
|
{22, "SIGTTOU", "stopped (tty output)"},
|
||||||
27: "profiling timer expired",
|
{23, "SIGIO", "I/O possible"},
|
||||||
28: "window size changes",
|
{24, "SIGXCPU", "cputime limit exceeded"},
|
||||||
29: "information request",
|
{25, "SIGXFSZ", "filesize limit exceeded"},
|
||||||
30: "user defined signal 1",
|
{26, "SIGVTALRM", "virtual timer expired"},
|
||||||
31: "user defined signal 2",
|
{27, "SIGPROF", "profiling timer expired"},
|
||||||
|
{28, "SIGWINCH", "window size changes"},
|
||||||
|
{29, "SIGINFO", "information request"},
|
||||||
|
{30, "SIGUSR1", "user defined signal 1"},
|
||||||
|
{31, "SIGUSR2", "user defined signal 2"},
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue