mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-21 20:26:12 +02:00
update revive lint to latest commit (#12921)
* update revive lint to latest commit * make fmt * change import
This commit is contained in:
parent
63e8bdaf73
commit
1c3278c2fa
2
build.go
2
build.go
|
@ -11,12 +11,12 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
// for lint
|
// for lint
|
||||||
_ "github.com/BurntSushi/toml"
|
|
||||||
_ "github.com/mgechev/dots"
|
_ "github.com/mgechev/dots"
|
||||||
_ "github.com/mgechev/revive/formatter"
|
_ "github.com/mgechev/revive/formatter"
|
||||||
_ "github.com/mgechev/revive/lint"
|
_ "github.com/mgechev/revive/lint"
|
||||||
_ "github.com/mgechev/revive/rule"
|
_ "github.com/mgechev/revive/rule"
|
||||||
_ "github.com/mitchellh/go-homedir"
|
_ "github.com/mitchellh/go-homedir"
|
||||||
|
_ "github.com/pelletier/go-toml"
|
||||||
|
|
||||||
// for embed
|
// for embed
|
||||||
_ "github.com/shurcooL/vfsgen"
|
_ "github.com/shurcooL/vfsgen"
|
||||||
|
|
|
@ -15,12 +15,12 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
|
||||||
"github.com/mgechev/dots"
|
"github.com/mgechev/dots"
|
||||||
"github.com/mgechev/revive/formatter"
|
"github.com/mgechev/revive/formatter"
|
||||||
"github.com/mgechev/revive/lint"
|
"github.com/mgechev/revive/lint"
|
||||||
"github.com/mgechev/revive/rule"
|
"github.com/mgechev/revive/rule"
|
||||||
"github.com/mitchellh/go-homedir"
|
"github.com/mitchellh/go-homedir"
|
||||||
|
"github.com/pelletier/go-toml"
|
||||||
)
|
)
|
||||||
|
|
||||||
func fail(err string) {
|
func fail(err string) {
|
||||||
|
@ -133,7 +133,7 @@ func parseConfig(path string) *lint.Config {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fail("cannot read the config file")
|
fail("cannot read the config file")
|
||||||
}
|
}
|
||||||
_, err = toml.Decode(string(file), config)
|
err = toml.Unmarshal(file, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fail("cannot parse the config file: " + err.Error())
|
fail("cannot parse the config file: " + err.Error())
|
||||||
}
|
}
|
||||||
|
|
10
go.mod
10
go.mod
|
@ -16,7 +16,6 @@ require (
|
||||||
gitea.com/macaron/macaron v1.5.0
|
gitea.com/macaron/macaron v1.5.0
|
||||||
gitea.com/macaron/session v0.0.0-20200902202411-e3a87877db6e
|
gitea.com/macaron/session v0.0.0-20200902202411-e3a87877db6e
|
||||||
gitea.com/macaron/toolbox v0.0.0-20190822013122-05ff0fc766b7
|
gitea.com/macaron/toolbox v0.0.0-20190822013122-05ff0fc766b7
|
||||||
github.com/BurntSushi/toml v0.3.1
|
|
||||||
github.com/PuerkitoBio/goquery v1.5.1
|
github.com/PuerkitoBio/goquery v1.5.1
|
||||||
github.com/alecthomas/chroma v0.8.0
|
github.com/alecthomas/chroma v0.8.0
|
||||||
github.com/blevesearch/bleve v1.0.10
|
github.com/blevesearch/bleve v1.0.10
|
||||||
|
@ -63,10 +62,12 @@ require (
|
||||||
github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc
|
github.com/lib/pq v1.8.1-0.20200908161135-083382b7e6fc
|
||||||
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
|
github.com/lunny/dingtalk_webhook v0.0.0-20171025031554-e3534c89ef96
|
||||||
github.com/markbates/goth v1.61.2
|
github.com/markbates/goth v1.61.2
|
||||||
|
github.com/mattn/go-colorable v0.1.7 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.12
|
github.com/mattn/go-isatty v0.0.12
|
||||||
|
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||||
github.com/mattn/go-sqlite3 v1.14.0
|
github.com/mattn/go-sqlite3 v1.14.0
|
||||||
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81
|
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81
|
||||||
github.com/mgechev/revive v1.0.2
|
github.com/mgechev/revive v1.0.3-0.20200921231451-246eac737dc7
|
||||||
github.com/mholt/archiver/v3 v3.3.0
|
github.com/mholt/archiver/v3 v3.3.0
|
||||||
github.com/microcosm-cc/bluemonday v1.0.3-0.20191119130333-0a75d7616912
|
github.com/microcosm-cc/bluemonday v1.0.3-0.20191119130333-0a75d7616912
|
||||||
github.com/minio/minio-go/v7 v7.0.4
|
github.com/minio/minio-go/v7 v7.0.4
|
||||||
|
@ -76,6 +77,7 @@ require (
|
||||||
github.com/niklasfasching/go-org v1.3.2
|
github.com/niklasfasching/go-org v1.3.2
|
||||||
github.com/oliamb/cutter v0.2.2
|
github.com/oliamb/cutter v0.2.2
|
||||||
github.com/olivere/elastic/v7 v7.0.9
|
github.com/olivere/elastic/v7 v7.0.9
|
||||||
|
github.com/pelletier/go-toml v1.8.1
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/pquerna/otp v1.2.0
|
github.com/pquerna/otp v1.2.0
|
||||||
github.com/prometheus/client_golang v1.1.0
|
github.com/prometheus/client_golang v1.1.0
|
||||||
|
@ -102,10 +104,10 @@ require (
|
||||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
|
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a
|
||||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73
|
golang.org/x/net v0.0.0-20200904194848-62affa334b73
|
||||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
|
||||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae
|
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff
|
||||||
golang.org/x/text v0.3.3
|
golang.org/x/text v0.3.3
|
||||||
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
|
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
|
||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d
|
golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||||
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
|
gopkg.in/asn1-ber.v1 v1.0.0-20150924051756-4e86f4367175 // indirect
|
||||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
|
||||||
|
|
23
go.sum
23
go.sum
|
@ -265,7 +265,6 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
|
||||||
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
|
||||||
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
|
||||||
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
|
||||||
github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas=
|
|
||||||
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
|
github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI=
|
||||||
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
||||||
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik=
|
||||||
|
@ -647,6 +646,8 @@ github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaa
|
||||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||||
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
|
||||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
|
github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw=
|
||||||
|
github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||||
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||||
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
@ -659,6 +660,8 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
|
||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||||
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
|
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
|
||||||
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||||
|
github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
|
||||||
|
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||||
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||||
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||||
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
|
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
|
||||||
|
@ -667,8 +670,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 h1:QASJXOGm2RZ5Ardbc86qNFvby9AqkLDibfChMtAg5QM=
|
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81 h1:QASJXOGm2RZ5Ardbc86qNFvby9AqkLDibfChMtAg5QM=
|
||||||
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg=
|
github.com/mgechev/dots v0.0.0-20190921121421-c36f7dcfbb81/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg=
|
||||||
github.com/mgechev/revive v1.0.2 h1:v0NxxQ7fSFz/u1NQydPo6EGdq7va0J1BtsZmae6kzUg=
|
github.com/mgechev/revive v1.0.3-0.20200921231451-246eac737dc7 h1:ydVkpU/M4/c45yT3e5lzMeguKJm9GxGgsawx4/XlwK0=
|
||||||
github.com/mgechev/revive v1.0.2/go.mod h1:rb0dQy1LVAxW9SWy5R3LPUjevzUbUS316U5MFySA2lo=
|
github.com/mgechev/revive v1.0.3-0.20200921231451-246eac737dc7/go.mod h1:no/hfevHbndpXR5CaJahkYCfM/FFpmM/dSOwFGU7Z1o=
|
||||||
github.com/mholt/archiver/v3 v3.3.0 h1:vWjhY8SQp5yzM9P6OJ/eZEkmi3UAbRrxCq48MxjAzig=
|
github.com/mholt/archiver/v3 v3.3.0 h1:vWjhY8SQp5yzM9P6OJ/eZEkmi3UAbRrxCq48MxjAzig=
|
||||||
github.com/mholt/archiver/v3 v3.3.0/go.mod h1:YnQtqsp+94Rwd0D/rk5cnLrxusUBUXg+08Ebtr1Mqao=
|
github.com/mholt/archiver/v3 v3.3.0/go.mod h1:YnQtqsp+94Rwd0D/rk5cnLrxusUBUXg+08Ebtr1Mqao=
|
||||||
github.com/microcosm-cc/bluemonday v1.0.3-0.20191119130333-0a75d7616912 h1:hJde9rA24hlTcAYSwJoXpDUyGtfKQ/jsofw+WaDqGrI=
|
github.com/microcosm-cc/bluemonday v1.0.3-0.20191119130333-0a75d7616912 h1:hJde9rA24hlTcAYSwJoXpDUyGtfKQ/jsofw+WaDqGrI=
|
||||||
|
@ -739,6 +742,8 @@ github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfS
|
||||||
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
|
github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo=
|
||||||
github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw=
|
github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw=
|
||||||
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
|
github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs=
|
||||||
|
github.com/pelletier/go-toml v1.8.1 h1:1Nf83orprkJyknT6h7zbuEGUEjcyVlCxSUGTENmNCRM=
|
||||||
|
github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc=
|
||||||
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
github.com/philhofer/fwd v1.0.0 h1:UbZqGr5Y38ApvM/V/jEljVxwocdweyH+vmYvRPBnbqQ=
|
||||||
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
|
||||||
github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=
|
github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I=
|
||||||
|
@ -981,7 +986,6 @@ golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU
|
||||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
|
||||||
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
@ -1017,6 +1021,7 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/
|
||||||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
|
golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA=
|
||||||
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180620175406-ef147856a6dd/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
@ -1075,6 +1080,8 @@ golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||||
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200413165638-669c56c373c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
|
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
|
||||||
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8=
|
||||||
|
golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||||
|
@ -1114,17 +1121,18 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn
|
||||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20200225230052-807dcd883420/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
|
|
||||||
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
|
||||||
golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d h1:W07d4xkoAUSNOkOzdzXCdFGxT7o2rW4q8M34tB2i//k=
|
golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4 h1:v8Jgq9X6Es9K9otVr9jxENEJigepKMZgA9OmrIZDtFA=
|
||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200921210052-fa0125251cc4/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
|
||||||
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||||
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
|
||||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
|
@ -1219,7 +1227,6 @@ honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWh
|
||||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
|
|
||||||
mvdan.cc/xurls/v2 v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=
|
mvdan.cc/xurls/v2 v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=
|
||||||
mvdan.cc/xurls/v2 v2.1.0/go.mod h1:5GrSd9rOnKOpZaji1OZLYL/yeAAtGDlo/cFe+8K5n8E=
|
mvdan.cc/xurls/v2 v2.1.0/go.mod h1:5GrSd9rOnKOpZaji1OZLYL/yeAAtGDlo/cFe+8K5n8E=
|
||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
@ -27,6 +28,7 @@ const (
|
||||||
backgroundRed = 0x40
|
backgroundRed = 0x40
|
||||||
backgroundIntensity = 0x80
|
backgroundIntensity = 0x80
|
||||||
backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity)
|
backgroundMask = (backgroundRed | backgroundBlue | backgroundGreen | backgroundIntensity)
|
||||||
|
commonLvbUnderscore = 0x8000
|
||||||
|
|
||||||
cENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4
|
cENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4
|
||||||
)
|
)
|
||||||
|
@ -93,6 +95,7 @@ type Writer struct {
|
||||||
oldattr word
|
oldattr word
|
||||||
oldpos coord
|
oldpos coord
|
||||||
rest bytes.Buffer
|
rest bytes.Buffer
|
||||||
|
mutex sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewColorable returns new instance of Writer which handles escape sequence from File.
|
// NewColorable returns new instance of Writer which handles escape sequence from File.
|
||||||
|
@ -432,6 +435,8 @@ func atoiWithDefault(s string, def int) (int, error) {
|
||||||
|
|
||||||
// Write writes data on console
|
// Write writes data on console
|
||||||
func (w *Writer) Write(data []byte) (n int, err error) {
|
func (w *Writer) Write(data []byte) (n int, err error) {
|
||||||
|
w.mutex.Lock()
|
||||||
|
defer w.mutex.Unlock()
|
||||||
var csbi consoleScreenBufferInfo
|
var csbi consoleScreenBufferInfo
|
||||||
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
procGetConsoleScreenBufferInfo.Call(uintptr(w.handle), uintptr(unsafe.Pointer(&csbi)))
|
||||||
|
|
||||||
|
@ -683,14 +688,19 @@ loop:
|
||||||
switch {
|
switch {
|
||||||
case n == 0 || n == 100:
|
case n == 0 || n == 100:
|
||||||
attr = w.oldattr
|
attr = w.oldattr
|
||||||
case 1 <= n && n <= 5:
|
case n == 4:
|
||||||
|
attr |= commonLvbUnderscore
|
||||||
|
case (1 <= n && n <= 3) || n == 5:
|
||||||
attr |= foregroundIntensity
|
attr |= foregroundIntensity
|
||||||
case n == 7:
|
case n == 7 || n == 27:
|
||||||
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
attr =
|
||||||
case n == 22 || n == 25:
|
(attr &^ (foregroundMask | backgroundMask)) |
|
||||||
attr |= foregroundIntensity
|
((attr & foregroundMask) << 4) |
|
||||||
case n == 27:
|
((attr & backgroundMask) >> 4)
|
||||||
attr = ((attr & foregroundMask) << 4) | ((attr & backgroundMask) >> 4)
|
case n == 22:
|
||||||
|
attr &^= foregroundIntensity
|
||||||
|
case n == 24:
|
||||||
|
attr &^= commonLvbUnderscore
|
||||||
case 30 <= n && n <= 37:
|
case 30 <= n && n <= 37:
|
||||||
attr &= backgroundMask
|
attr &= backgroundMask
|
||||||
if (n-30)&1 != 0 {
|
if (n-30)&1 != 0 {
|
||||||
|
|
|
@ -1,8 +1,16 @@
|
||||||
language: go
|
language: go
|
||||||
|
sudo: false
|
||||||
go:
|
go:
|
||||||
|
- 1.13.x
|
||||||
- tip
|
- tip
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- go get github.com/mattn/goveralls
|
- go get -t -v ./...
|
||||||
- go get golang.org/x/tools/cmd/cover
|
|
||||||
script:
|
script:
|
||||||
- $HOME/gopath/bin/goveralls -repotoken lAKAWPzcGsD3A8yBX3BGGtRUdJ6CaGERL
|
- go generate
|
||||||
|
- git diff --cached --exit-code
|
||||||
|
- ./go.test.sh
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- bash <(curl -s https://codecov.io/bash)
|
||||||
|
|
|
@ -2,7 +2,7 @@ go-runewidth
|
||||||
============
|
============
|
||||||
|
|
||||||
[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth)
|
[![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth)
|
||||||
[![Coverage Status](https://coveralls.io/repos/mattn/go-runewidth/badge.png?branch=HEAD)](https://coveralls.io/r/mattn/go-runewidth?branch=HEAD)
|
[![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth)
|
||||||
[![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth)
|
[![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth)
|
||||||
[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth)
|
[![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth)
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
echo "" > coverage.txt
|
||||||
|
|
||||||
|
for d in $(go list ./... | grep -v vendor); do
|
||||||
|
go test -race -coverprofile=profile.out -covermode=atomic "$d"
|
||||||
|
if [ -f profile.out ]; then
|
||||||
|
cat profile.out >> coverage.txt
|
||||||
|
rm profile.out
|
||||||
|
fi
|
||||||
|
done
|
|
@ -50,7 +50,6 @@ func inTables(r rune, ts ...table) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func inTable(r rune, t table) bool {
|
func inTable(r rune, t table) bool {
|
||||||
// func (t table) IncludesRune(r rune) bool {
|
|
||||||
if r < t[0].first {
|
if r < t[0].first {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,10 @@ func isEastAsian(locale string) bool {
|
||||||
|
|
||||||
// IsEastAsian return true if the current locale is CJK
|
// IsEastAsian return true if the current locale is CJK
|
||||||
func IsEastAsian() bool {
|
func IsEastAsian() bool {
|
||||||
locale := os.Getenv("LC_CTYPE")
|
locale := os.Getenv("LC_ALL")
|
||||||
|
if locale == "" {
|
||||||
|
locale = os.Getenv("LC_CTYPE")
|
||||||
|
}
|
||||||
if locale == "" {
|
if locale == "" {
|
||||||
locale = os.Getenv("LANG")
|
locale = os.Getenv("LANG")
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,23 @@
|
||||||
|
// Code generated by script/generate.go. DO NOT EDIT.
|
||||||
|
|
||||||
package runewidth
|
package runewidth
|
||||||
|
|
||||||
var combining = table{
|
var combining = table{
|
||||||
{0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3},
|
{0x0300, 0x036F}, {0x0483, 0x0489}, {0x07EB, 0x07F3},
|
||||||
{0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0D00, 0x0D01},
|
{0x0C00, 0x0C00}, {0x0C04, 0x0C04}, {0x0D00, 0x0D01},
|
||||||
{0x135D, 0x135F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1ABE},
|
{0x135D, 0x135F}, {0x1A7F, 0x1A7F}, {0x1AB0, 0x1AC0},
|
||||||
{0x1B6B, 0x1B73}, {0x1DC0, 0x1DF9}, {0x1DFB, 0x1DFF},
|
{0x1B6B, 0x1B73}, {0x1DC0, 0x1DF9}, {0x1DFB, 0x1DFF},
|
||||||
{0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF},
|
{0x20D0, 0x20F0}, {0x2CEF, 0x2CF1}, {0x2DE0, 0x2DFF},
|
||||||
{0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D},
|
{0x3099, 0x309A}, {0xA66F, 0xA672}, {0xA674, 0xA67D},
|
||||||
{0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1},
|
{0xA69E, 0xA69F}, {0xA6F0, 0xA6F1}, {0xA8E0, 0xA8F1},
|
||||||
{0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x10376, 0x1037A},
|
{0xFE20, 0xFE2F}, {0x101FD, 0x101FD}, {0x10376, 0x1037A},
|
||||||
{0x10F46, 0x10F50}, {0x11300, 0x11301}, {0x1133B, 0x1133C},
|
{0x10EAB, 0x10EAC}, {0x10F46, 0x10F50}, {0x11300, 0x11301},
|
||||||
{0x11366, 0x1136C}, {0x11370, 0x11374}, {0x16AF0, 0x16AF4},
|
{0x1133B, 0x1133C}, {0x11366, 0x1136C}, {0x11370, 0x11374},
|
||||||
{0x1D165, 0x1D169}, {0x1D16D, 0x1D172}, {0x1D17B, 0x1D182},
|
{0x16AF0, 0x16AF4}, {0x1D165, 0x1D169}, {0x1D16D, 0x1D172},
|
||||||
{0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD}, {0x1D242, 0x1D244},
|
{0x1D17B, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD},
|
||||||
{0x1E000, 0x1E006}, {0x1E008, 0x1E018}, {0x1E01B, 0x1E021},
|
{0x1D242, 0x1D244}, {0x1E000, 0x1E006}, {0x1E008, 0x1E018},
|
||||||
{0x1E023, 0x1E024}, {0x1E026, 0x1E02A}, {0x1E8D0, 0x1E8D6},
|
{0x1E01B, 0x1E021}, {0x1E023, 0x1E024}, {0x1E026, 0x1E02A},
|
||||||
|
{0x1E8D0, 0x1E8D6},
|
||||||
}
|
}
|
||||||
|
|
||||||
var doublewidth = table{
|
var doublewidth = table{
|
||||||
|
@ -32,29 +35,30 @@ var doublewidth = table{
|
||||||
{0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99},
|
{0x2B50, 0x2B50}, {0x2B55, 0x2B55}, {0x2E80, 0x2E99},
|
||||||
{0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB},
|
{0x2E9B, 0x2EF3}, {0x2F00, 0x2FD5}, {0x2FF0, 0x2FFB},
|
||||||
{0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF},
|
{0x3000, 0x303E}, {0x3041, 0x3096}, {0x3099, 0x30FF},
|
||||||
{0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31BA},
|
{0x3105, 0x312F}, {0x3131, 0x318E}, {0x3190, 0x31E3},
|
||||||
{0x31C0, 0x31E3}, {0x31F0, 0x321E}, {0x3220, 0x3247},
|
{0x31F0, 0x321E}, {0x3220, 0x3247}, {0x3250, 0x4DBF},
|
||||||
{0x3250, 0x4DBF}, {0x4E00, 0xA48C}, {0xA490, 0xA4C6},
|
{0x4E00, 0xA48C}, {0xA490, 0xA4C6}, {0xA960, 0xA97C},
|
||||||
{0xA960, 0xA97C}, {0xAC00, 0xD7A3}, {0xF900, 0xFAFF},
|
{0xAC00, 0xD7A3}, {0xF900, 0xFAFF}, {0xFE10, 0xFE19},
|
||||||
{0xFE10, 0xFE19}, {0xFE30, 0xFE52}, {0xFE54, 0xFE66},
|
{0xFE30, 0xFE52}, {0xFE54, 0xFE66}, {0xFE68, 0xFE6B},
|
||||||
{0xFE68, 0xFE6B}, {0xFF01, 0xFF60}, {0xFFE0, 0xFFE6},
|
{0xFF01, 0xFF60}, {0xFFE0, 0xFFE6}, {0x16FE0, 0x16FE4},
|
||||||
{0x16FE0, 0x16FE3}, {0x17000, 0x187F7}, {0x18800, 0x18AF2},
|
{0x16FF0, 0x16FF1}, {0x17000, 0x187F7}, {0x18800, 0x18CD5},
|
||||||
{0x1B000, 0x1B11E}, {0x1B150, 0x1B152}, {0x1B164, 0x1B167},
|
{0x18D00, 0x18D08}, {0x1B000, 0x1B11E}, {0x1B150, 0x1B152},
|
||||||
{0x1B170, 0x1B2FB}, {0x1F004, 0x1F004}, {0x1F0CF, 0x1F0CF},
|
{0x1B164, 0x1B167}, {0x1B170, 0x1B2FB}, {0x1F004, 0x1F004},
|
||||||
{0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A}, {0x1F200, 0x1F202},
|
{0x1F0CF, 0x1F0CF}, {0x1F18E, 0x1F18E}, {0x1F191, 0x1F19A},
|
||||||
{0x1F210, 0x1F23B}, {0x1F240, 0x1F248}, {0x1F250, 0x1F251},
|
{0x1F200, 0x1F202}, {0x1F210, 0x1F23B}, {0x1F240, 0x1F248},
|
||||||
{0x1F260, 0x1F265}, {0x1F300, 0x1F320}, {0x1F32D, 0x1F335},
|
{0x1F250, 0x1F251}, {0x1F260, 0x1F265}, {0x1F300, 0x1F320},
|
||||||
{0x1F337, 0x1F37C}, {0x1F37E, 0x1F393}, {0x1F3A0, 0x1F3CA},
|
{0x1F32D, 0x1F335}, {0x1F337, 0x1F37C}, {0x1F37E, 0x1F393},
|
||||||
{0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0}, {0x1F3F4, 0x1F3F4},
|
{0x1F3A0, 0x1F3CA}, {0x1F3CF, 0x1F3D3}, {0x1F3E0, 0x1F3F0},
|
||||||
{0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440}, {0x1F442, 0x1F4FC},
|
{0x1F3F4, 0x1F3F4}, {0x1F3F8, 0x1F43E}, {0x1F440, 0x1F440},
|
||||||
{0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E}, {0x1F550, 0x1F567},
|
{0x1F442, 0x1F4FC}, {0x1F4FF, 0x1F53D}, {0x1F54B, 0x1F54E},
|
||||||
{0x1F57A, 0x1F57A}, {0x1F595, 0x1F596}, {0x1F5A4, 0x1F5A4},
|
{0x1F550, 0x1F567}, {0x1F57A, 0x1F57A}, {0x1F595, 0x1F596},
|
||||||
{0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5}, {0x1F6CC, 0x1F6CC},
|
{0x1F5A4, 0x1F5A4}, {0x1F5FB, 0x1F64F}, {0x1F680, 0x1F6C5},
|
||||||
{0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D5}, {0x1F6EB, 0x1F6EC},
|
{0x1F6CC, 0x1F6CC}, {0x1F6D0, 0x1F6D2}, {0x1F6D5, 0x1F6D7},
|
||||||
{0x1F6F4, 0x1F6FA}, {0x1F7E0, 0x1F7EB}, {0x1F90D, 0x1F971},
|
{0x1F6EB, 0x1F6EC}, {0x1F6F4, 0x1F6FC}, {0x1F7E0, 0x1F7EB},
|
||||||
{0x1F973, 0x1F976}, {0x1F97A, 0x1F9A2}, {0x1F9A5, 0x1F9AA},
|
{0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1F978},
|
||||||
{0x1F9AE, 0x1F9CA}, {0x1F9CD, 0x1F9FF}, {0x1FA70, 0x1FA73},
|
{0x1F97A, 0x1F9CB}, {0x1F9CD, 0x1F9FF}, {0x1FA70, 0x1FA74},
|
||||||
{0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA82}, {0x1FA90, 0x1FA95},
|
{0x1FA78, 0x1FA7A}, {0x1FA80, 0x1FA86}, {0x1FA90, 0x1FAA8},
|
||||||
|
{0x1FAB0, 0x1FAB6}, {0x1FAC0, 0x1FAC2}, {0x1FAD0, 0x1FAD6},
|
||||||
{0x20000, 0x2FFFD}, {0x30000, 0x3FFFD},
|
{0x20000, 0x2FFFD}, {0x30000, 0x3FFFD},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +155,7 @@ var neutral = table{
|
||||||
{0x0600, 0x061C}, {0x061E, 0x070D}, {0x070F, 0x074A},
|
{0x0600, 0x061C}, {0x061E, 0x070D}, {0x070F, 0x074A},
|
||||||
{0x074D, 0x07B1}, {0x07C0, 0x07FA}, {0x07FD, 0x082D},
|
{0x074D, 0x07B1}, {0x07C0, 0x07FA}, {0x07FD, 0x082D},
|
||||||
{0x0830, 0x083E}, {0x0840, 0x085B}, {0x085E, 0x085E},
|
{0x0830, 0x083E}, {0x0840, 0x085B}, {0x085E, 0x085E},
|
||||||
{0x0860, 0x086A}, {0x08A0, 0x08B4}, {0x08B6, 0x08BD},
|
{0x0860, 0x086A}, {0x08A0, 0x08B4}, {0x08B6, 0x08C7},
|
||||||
{0x08D3, 0x0983}, {0x0985, 0x098C}, {0x098F, 0x0990},
|
{0x08D3, 0x0983}, {0x0985, 0x098C}, {0x098F, 0x0990},
|
||||||
{0x0993, 0x09A8}, {0x09AA, 0x09B0}, {0x09B2, 0x09B2},
|
{0x0993, 0x09A8}, {0x09AA, 0x09B0}, {0x09B2, 0x09B2},
|
||||||
{0x09B6, 0x09B9}, {0x09BC, 0x09C4}, {0x09C7, 0x09C8},
|
{0x09B6, 0x09B9}, {0x09BC, 0x09C4}, {0x09C7, 0x09C8},
|
||||||
|
@ -170,7 +174,7 @@ var neutral = table{
|
||||||
{0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, {0x0B13, 0x0B28},
|
{0x0B05, 0x0B0C}, {0x0B0F, 0x0B10}, {0x0B13, 0x0B28},
|
||||||
{0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, {0x0B35, 0x0B39},
|
{0x0B2A, 0x0B30}, {0x0B32, 0x0B33}, {0x0B35, 0x0B39},
|
||||||
{0x0B3C, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D},
|
{0x0B3C, 0x0B44}, {0x0B47, 0x0B48}, {0x0B4B, 0x0B4D},
|
||||||
{0x0B56, 0x0B57}, {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63},
|
{0x0B55, 0x0B57}, {0x0B5C, 0x0B5D}, {0x0B5F, 0x0B63},
|
||||||
{0x0B66, 0x0B77}, {0x0B82, 0x0B83}, {0x0B85, 0x0B8A},
|
{0x0B66, 0x0B77}, {0x0B82, 0x0B83}, {0x0B85, 0x0B8A},
|
||||||
{0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, {0x0B99, 0x0B9A},
|
{0x0B8E, 0x0B90}, {0x0B92, 0x0B95}, {0x0B99, 0x0B9A},
|
||||||
{0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4},
|
{0x0B9C, 0x0B9C}, {0x0B9E, 0x0B9F}, {0x0BA3, 0x0BA4},
|
||||||
|
@ -184,166 +188,169 @@ var neutral = table{
|
||||||
{0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9},
|
{0x0C92, 0x0CA8}, {0x0CAA, 0x0CB3}, {0x0CB5, 0x0CB9},
|
||||||
{0x0CBC, 0x0CC4}, {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD},
|
{0x0CBC, 0x0CC4}, {0x0CC6, 0x0CC8}, {0x0CCA, 0x0CCD},
|
||||||
{0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE3},
|
{0x0CD5, 0x0CD6}, {0x0CDE, 0x0CDE}, {0x0CE0, 0x0CE3},
|
||||||
{0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, {0x0D00, 0x0D03},
|
{0x0CE6, 0x0CEF}, {0x0CF1, 0x0CF2}, {0x0D00, 0x0D0C},
|
||||||
{0x0D05, 0x0D0C}, {0x0D0E, 0x0D10}, {0x0D12, 0x0D44},
|
{0x0D0E, 0x0D10}, {0x0D12, 0x0D44}, {0x0D46, 0x0D48},
|
||||||
{0x0D46, 0x0D48}, {0x0D4A, 0x0D4F}, {0x0D54, 0x0D63},
|
{0x0D4A, 0x0D4F}, {0x0D54, 0x0D63}, {0x0D66, 0x0D7F},
|
||||||
{0x0D66, 0x0D7F}, {0x0D82, 0x0D83}, {0x0D85, 0x0D96},
|
{0x0D81, 0x0D83}, {0x0D85, 0x0D96}, {0x0D9A, 0x0DB1},
|
||||||
{0x0D9A, 0x0DB1}, {0x0DB3, 0x0DBB}, {0x0DBD, 0x0DBD},
|
{0x0DB3, 0x0DBB}, {0x0DBD, 0x0DBD}, {0x0DC0, 0x0DC6},
|
||||||
{0x0DC0, 0x0DC6}, {0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4},
|
{0x0DCA, 0x0DCA}, {0x0DCF, 0x0DD4}, {0x0DD6, 0x0DD6},
|
||||||
{0x0DD6, 0x0DD6}, {0x0DD8, 0x0DDF}, {0x0DE6, 0x0DEF},
|
{0x0DD8, 0x0DDF}, {0x0DE6, 0x0DEF}, {0x0DF2, 0x0DF4},
|
||||||
{0x0DF2, 0x0DF4}, {0x0E01, 0x0E3A}, {0x0E3F, 0x0E5B},
|
{0x0E01, 0x0E3A}, {0x0E3F, 0x0E5B}, {0x0E81, 0x0E82},
|
||||||
{0x0E81, 0x0E82}, {0x0E84, 0x0E84}, {0x0E86, 0x0E8A},
|
{0x0E84, 0x0E84}, {0x0E86, 0x0E8A}, {0x0E8C, 0x0EA3},
|
||||||
{0x0E8C, 0x0EA3}, {0x0EA5, 0x0EA5}, {0x0EA7, 0x0EBD},
|
{0x0EA5, 0x0EA5}, {0x0EA7, 0x0EBD}, {0x0EC0, 0x0EC4},
|
||||||
{0x0EC0, 0x0EC4}, {0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECD},
|
{0x0EC6, 0x0EC6}, {0x0EC8, 0x0ECD}, {0x0ED0, 0x0ED9},
|
||||||
{0x0ED0, 0x0ED9}, {0x0EDC, 0x0EDF}, {0x0F00, 0x0F47},
|
{0x0EDC, 0x0EDF}, {0x0F00, 0x0F47}, {0x0F49, 0x0F6C},
|
||||||
{0x0F49, 0x0F6C}, {0x0F71, 0x0F97}, {0x0F99, 0x0FBC},
|
{0x0F71, 0x0F97}, {0x0F99, 0x0FBC}, {0x0FBE, 0x0FCC},
|
||||||
{0x0FBE, 0x0FCC}, {0x0FCE, 0x0FDA}, {0x1000, 0x10C5},
|
{0x0FCE, 0x0FDA}, {0x1000, 0x10C5}, {0x10C7, 0x10C7},
|
||||||
{0x10C7, 0x10C7}, {0x10CD, 0x10CD}, {0x10D0, 0x10FF},
|
{0x10CD, 0x10CD}, {0x10D0, 0x10FF}, {0x1160, 0x1248},
|
||||||
{0x1160, 0x1248}, {0x124A, 0x124D}, {0x1250, 0x1256},
|
{0x124A, 0x124D}, {0x1250, 0x1256}, {0x1258, 0x1258},
|
||||||
{0x1258, 0x1258}, {0x125A, 0x125D}, {0x1260, 0x1288},
|
{0x125A, 0x125D}, {0x1260, 0x1288}, {0x128A, 0x128D},
|
||||||
{0x128A, 0x128D}, {0x1290, 0x12B0}, {0x12B2, 0x12B5},
|
{0x1290, 0x12B0}, {0x12B2, 0x12B5}, {0x12B8, 0x12BE},
|
||||||
{0x12B8, 0x12BE}, {0x12C0, 0x12C0}, {0x12C2, 0x12C5},
|
{0x12C0, 0x12C0}, {0x12C2, 0x12C5}, {0x12C8, 0x12D6},
|
||||||
{0x12C8, 0x12D6}, {0x12D8, 0x1310}, {0x1312, 0x1315},
|
{0x12D8, 0x1310}, {0x1312, 0x1315}, {0x1318, 0x135A},
|
||||||
{0x1318, 0x135A}, {0x135D, 0x137C}, {0x1380, 0x1399},
|
{0x135D, 0x137C}, {0x1380, 0x1399}, {0x13A0, 0x13F5},
|
||||||
{0x13A0, 0x13F5}, {0x13F8, 0x13FD}, {0x1400, 0x169C},
|
{0x13F8, 0x13FD}, {0x1400, 0x169C}, {0x16A0, 0x16F8},
|
||||||
{0x16A0, 0x16F8}, {0x1700, 0x170C}, {0x170E, 0x1714},
|
{0x1700, 0x170C}, {0x170E, 0x1714}, {0x1720, 0x1736},
|
||||||
{0x1720, 0x1736}, {0x1740, 0x1753}, {0x1760, 0x176C},
|
{0x1740, 0x1753}, {0x1760, 0x176C}, {0x176E, 0x1770},
|
||||||
{0x176E, 0x1770}, {0x1772, 0x1773}, {0x1780, 0x17DD},
|
{0x1772, 0x1773}, {0x1780, 0x17DD}, {0x17E0, 0x17E9},
|
||||||
{0x17E0, 0x17E9}, {0x17F0, 0x17F9}, {0x1800, 0x180E},
|
{0x17F0, 0x17F9}, {0x1800, 0x180E}, {0x1810, 0x1819},
|
||||||
{0x1810, 0x1819}, {0x1820, 0x1878}, {0x1880, 0x18AA},
|
{0x1820, 0x1878}, {0x1880, 0x18AA}, {0x18B0, 0x18F5},
|
||||||
{0x18B0, 0x18F5}, {0x1900, 0x191E}, {0x1920, 0x192B},
|
{0x1900, 0x191E}, {0x1920, 0x192B}, {0x1930, 0x193B},
|
||||||
{0x1930, 0x193B}, {0x1940, 0x1940}, {0x1944, 0x196D},
|
{0x1940, 0x1940}, {0x1944, 0x196D}, {0x1970, 0x1974},
|
||||||
{0x1970, 0x1974}, {0x1980, 0x19AB}, {0x19B0, 0x19C9},
|
{0x1980, 0x19AB}, {0x19B0, 0x19C9}, {0x19D0, 0x19DA},
|
||||||
{0x19D0, 0x19DA}, {0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E},
|
{0x19DE, 0x1A1B}, {0x1A1E, 0x1A5E}, {0x1A60, 0x1A7C},
|
||||||
{0x1A60, 0x1A7C}, {0x1A7F, 0x1A89}, {0x1A90, 0x1A99},
|
{0x1A7F, 0x1A89}, {0x1A90, 0x1A99}, {0x1AA0, 0x1AAD},
|
||||||
{0x1AA0, 0x1AAD}, {0x1AB0, 0x1ABE}, {0x1B00, 0x1B4B},
|
{0x1AB0, 0x1AC0}, {0x1B00, 0x1B4B}, {0x1B50, 0x1B7C},
|
||||||
{0x1B50, 0x1B7C}, {0x1B80, 0x1BF3}, {0x1BFC, 0x1C37},
|
{0x1B80, 0x1BF3}, {0x1BFC, 0x1C37}, {0x1C3B, 0x1C49},
|
||||||
{0x1C3B, 0x1C49}, {0x1C4D, 0x1C88}, {0x1C90, 0x1CBA},
|
{0x1C4D, 0x1C88}, {0x1C90, 0x1CBA}, {0x1CBD, 0x1CC7},
|
||||||
{0x1CBD, 0x1CC7}, {0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9},
|
{0x1CD0, 0x1CFA}, {0x1D00, 0x1DF9}, {0x1DFB, 0x1F15},
|
||||||
{0x1DFB, 0x1F15}, {0x1F18, 0x1F1D}, {0x1F20, 0x1F45},
|
{0x1F18, 0x1F1D}, {0x1F20, 0x1F45}, {0x1F48, 0x1F4D},
|
||||||
{0x1F48, 0x1F4D}, {0x1F50, 0x1F57}, {0x1F59, 0x1F59},
|
{0x1F50, 0x1F57}, {0x1F59, 0x1F59}, {0x1F5B, 0x1F5B},
|
||||||
{0x1F5B, 0x1F5B}, {0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D},
|
{0x1F5D, 0x1F5D}, {0x1F5F, 0x1F7D}, {0x1F80, 0x1FB4},
|
||||||
{0x1F80, 0x1FB4}, {0x1FB6, 0x1FC4}, {0x1FC6, 0x1FD3},
|
{0x1FB6, 0x1FC4}, {0x1FC6, 0x1FD3}, {0x1FD6, 0x1FDB},
|
||||||
{0x1FD6, 0x1FDB}, {0x1FDD, 0x1FEF}, {0x1FF2, 0x1FF4},
|
{0x1FDD, 0x1FEF}, {0x1FF2, 0x1FF4}, {0x1FF6, 0x1FFE},
|
||||||
{0x1FF6, 0x1FFE}, {0x2000, 0x200F}, {0x2011, 0x2012},
|
{0x2000, 0x200F}, {0x2011, 0x2012}, {0x2017, 0x2017},
|
||||||
{0x2017, 0x2017}, {0x201A, 0x201B}, {0x201E, 0x201F},
|
{0x201A, 0x201B}, {0x201E, 0x201F}, {0x2023, 0x2023},
|
||||||
{0x2023, 0x2023}, {0x2028, 0x202F}, {0x2031, 0x2031},
|
{0x2028, 0x202F}, {0x2031, 0x2031}, {0x2034, 0x2034},
|
||||||
{0x2034, 0x2034}, {0x2036, 0x203A}, {0x203C, 0x203D},
|
{0x2036, 0x203A}, {0x203C, 0x203D}, {0x203F, 0x2064},
|
||||||
{0x203F, 0x2064}, {0x2066, 0x2071}, {0x2075, 0x207E},
|
{0x2066, 0x2071}, {0x2075, 0x207E}, {0x2080, 0x2080},
|
||||||
{0x2080, 0x2080}, {0x2085, 0x208E}, {0x2090, 0x209C},
|
{0x2085, 0x208E}, {0x2090, 0x209C}, {0x20A0, 0x20A8},
|
||||||
{0x20A0, 0x20A8}, {0x20AA, 0x20AB}, {0x20AD, 0x20BF},
|
{0x20AA, 0x20AB}, {0x20AD, 0x20BF}, {0x20D0, 0x20F0},
|
||||||
{0x20D0, 0x20F0}, {0x2100, 0x2102}, {0x2104, 0x2104},
|
{0x2100, 0x2102}, {0x2104, 0x2104}, {0x2106, 0x2108},
|
||||||
{0x2106, 0x2108}, {0x210A, 0x2112}, {0x2114, 0x2115},
|
{0x210A, 0x2112}, {0x2114, 0x2115}, {0x2117, 0x2120},
|
||||||
{0x2117, 0x2120}, {0x2123, 0x2125}, {0x2127, 0x212A},
|
{0x2123, 0x2125}, {0x2127, 0x212A}, {0x212C, 0x2152},
|
||||||
{0x212C, 0x2152}, {0x2155, 0x215A}, {0x215F, 0x215F},
|
{0x2155, 0x215A}, {0x215F, 0x215F}, {0x216C, 0x216F},
|
||||||
{0x216C, 0x216F}, {0x217A, 0x2188}, {0x218A, 0x218B},
|
{0x217A, 0x2188}, {0x218A, 0x218B}, {0x219A, 0x21B7},
|
||||||
{0x219A, 0x21B7}, {0x21BA, 0x21D1}, {0x21D3, 0x21D3},
|
{0x21BA, 0x21D1}, {0x21D3, 0x21D3}, {0x21D5, 0x21E6},
|
||||||
{0x21D5, 0x21E6}, {0x21E8, 0x21FF}, {0x2201, 0x2201},
|
{0x21E8, 0x21FF}, {0x2201, 0x2201}, {0x2204, 0x2206},
|
||||||
{0x2204, 0x2206}, {0x2209, 0x220A}, {0x220C, 0x220E},
|
{0x2209, 0x220A}, {0x220C, 0x220E}, {0x2210, 0x2210},
|
||||||
{0x2210, 0x2210}, {0x2212, 0x2214}, {0x2216, 0x2219},
|
{0x2212, 0x2214}, {0x2216, 0x2219}, {0x221B, 0x221C},
|
||||||
{0x221B, 0x221C}, {0x2221, 0x2222}, {0x2224, 0x2224},
|
{0x2221, 0x2222}, {0x2224, 0x2224}, {0x2226, 0x2226},
|
||||||
{0x2226, 0x2226}, {0x222D, 0x222D}, {0x222F, 0x2233},
|
{0x222D, 0x222D}, {0x222F, 0x2233}, {0x2238, 0x223B},
|
||||||
{0x2238, 0x223B}, {0x223E, 0x2247}, {0x2249, 0x224B},
|
{0x223E, 0x2247}, {0x2249, 0x224B}, {0x224D, 0x2251},
|
||||||
{0x224D, 0x2251}, {0x2253, 0x225F}, {0x2262, 0x2263},
|
{0x2253, 0x225F}, {0x2262, 0x2263}, {0x2268, 0x2269},
|
||||||
{0x2268, 0x2269}, {0x226C, 0x226D}, {0x2270, 0x2281},
|
{0x226C, 0x226D}, {0x2270, 0x2281}, {0x2284, 0x2285},
|
||||||
{0x2284, 0x2285}, {0x2288, 0x2294}, {0x2296, 0x2298},
|
{0x2288, 0x2294}, {0x2296, 0x2298}, {0x229A, 0x22A4},
|
||||||
{0x229A, 0x22A4}, {0x22A6, 0x22BE}, {0x22C0, 0x2311},
|
{0x22A6, 0x22BE}, {0x22C0, 0x2311}, {0x2313, 0x2319},
|
||||||
{0x2313, 0x2319}, {0x231C, 0x2328}, {0x232B, 0x23E8},
|
{0x231C, 0x2328}, {0x232B, 0x23E8}, {0x23ED, 0x23EF},
|
||||||
{0x23ED, 0x23EF}, {0x23F1, 0x23F2}, {0x23F4, 0x2426},
|
{0x23F1, 0x23F2}, {0x23F4, 0x2426}, {0x2440, 0x244A},
|
||||||
{0x2440, 0x244A}, {0x24EA, 0x24EA}, {0x254C, 0x254F},
|
{0x24EA, 0x24EA}, {0x254C, 0x254F}, {0x2574, 0x257F},
|
||||||
{0x2574, 0x257F}, {0x2590, 0x2591}, {0x2596, 0x259F},
|
{0x2590, 0x2591}, {0x2596, 0x259F}, {0x25A2, 0x25A2},
|
||||||
{0x25A2, 0x25A2}, {0x25AA, 0x25B1}, {0x25B4, 0x25B5},
|
{0x25AA, 0x25B1}, {0x25B4, 0x25B5}, {0x25B8, 0x25BB},
|
||||||
{0x25B8, 0x25BB}, {0x25BE, 0x25BF}, {0x25C2, 0x25C5},
|
{0x25BE, 0x25BF}, {0x25C2, 0x25C5}, {0x25C9, 0x25CA},
|
||||||
{0x25C9, 0x25CA}, {0x25CC, 0x25CD}, {0x25D2, 0x25E1},
|
{0x25CC, 0x25CD}, {0x25D2, 0x25E1}, {0x25E6, 0x25EE},
|
||||||
{0x25E6, 0x25EE}, {0x25F0, 0x25FC}, {0x25FF, 0x2604},
|
{0x25F0, 0x25FC}, {0x25FF, 0x2604}, {0x2607, 0x2608},
|
||||||
{0x2607, 0x2608}, {0x260A, 0x260D}, {0x2610, 0x2613},
|
{0x260A, 0x260D}, {0x2610, 0x2613}, {0x2616, 0x261B},
|
||||||
{0x2616, 0x261B}, {0x261D, 0x261D}, {0x261F, 0x263F},
|
{0x261D, 0x261D}, {0x261F, 0x263F}, {0x2641, 0x2641},
|
||||||
{0x2641, 0x2641}, {0x2643, 0x2647}, {0x2654, 0x265F},
|
{0x2643, 0x2647}, {0x2654, 0x265F}, {0x2662, 0x2662},
|
||||||
{0x2662, 0x2662}, {0x2666, 0x2666}, {0x266B, 0x266B},
|
{0x2666, 0x2666}, {0x266B, 0x266B}, {0x266E, 0x266E},
|
||||||
{0x266E, 0x266E}, {0x2670, 0x267E}, {0x2680, 0x2692},
|
{0x2670, 0x267E}, {0x2680, 0x2692}, {0x2694, 0x269D},
|
||||||
{0x2694, 0x269D}, {0x26A0, 0x26A0}, {0x26A2, 0x26A9},
|
{0x26A0, 0x26A0}, {0x26A2, 0x26A9}, {0x26AC, 0x26BC},
|
||||||
{0x26AC, 0x26BC}, {0x26C0, 0x26C3}, {0x26E2, 0x26E2},
|
{0x26C0, 0x26C3}, {0x26E2, 0x26E2}, {0x26E4, 0x26E7},
|
||||||
{0x26E4, 0x26E7}, {0x2700, 0x2704}, {0x2706, 0x2709},
|
{0x2700, 0x2704}, {0x2706, 0x2709}, {0x270C, 0x2727},
|
||||||
{0x270C, 0x2727}, {0x2729, 0x273C}, {0x273E, 0x274B},
|
{0x2729, 0x273C}, {0x273E, 0x274B}, {0x274D, 0x274D},
|
||||||
{0x274D, 0x274D}, {0x274F, 0x2752}, {0x2756, 0x2756},
|
{0x274F, 0x2752}, {0x2756, 0x2756}, {0x2758, 0x2775},
|
||||||
{0x2758, 0x2775}, {0x2780, 0x2794}, {0x2798, 0x27AF},
|
{0x2780, 0x2794}, {0x2798, 0x27AF}, {0x27B1, 0x27BE},
|
||||||
{0x27B1, 0x27BE}, {0x27C0, 0x27E5}, {0x27EE, 0x2984},
|
{0x27C0, 0x27E5}, {0x27EE, 0x2984}, {0x2987, 0x2B1A},
|
||||||
{0x2987, 0x2B1A}, {0x2B1D, 0x2B4F}, {0x2B51, 0x2B54},
|
{0x2B1D, 0x2B4F}, {0x2B51, 0x2B54}, {0x2B5A, 0x2B73},
|
||||||
{0x2B5A, 0x2B73}, {0x2B76, 0x2B95}, {0x2B98, 0x2C2E},
|
{0x2B76, 0x2B95}, {0x2B97, 0x2C2E}, {0x2C30, 0x2C5E},
|
||||||
{0x2C30, 0x2C5E}, {0x2C60, 0x2CF3}, {0x2CF9, 0x2D25},
|
{0x2C60, 0x2CF3}, {0x2CF9, 0x2D25}, {0x2D27, 0x2D27},
|
||||||
{0x2D27, 0x2D27}, {0x2D2D, 0x2D2D}, {0x2D30, 0x2D67},
|
{0x2D2D, 0x2D2D}, {0x2D30, 0x2D67}, {0x2D6F, 0x2D70},
|
||||||
{0x2D6F, 0x2D70}, {0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6},
|
{0x2D7F, 0x2D96}, {0x2DA0, 0x2DA6}, {0x2DA8, 0x2DAE},
|
||||||
{0x2DA8, 0x2DAE}, {0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE},
|
{0x2DB0, 0x2DB6}, {0x2DB8, 0x2DBE}, {0x2DC0, 0x2DC6},
|
||||||
{0x2DC0, 0x2DC6}, {0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6},
|
{0x2DC8, 0x2DCE}, {0x2DD0, 0x2DD6}, {0x2DD8, 0x2DDE},
|
||||||
{0x2DD8, 0x2DDE}, {0x2DE0, 0x2E4F}, {0x303F, 0x303F},
|
{0x2DE0, 0x2E52}, {0x303F, 0x303F}, {0x4DC0, 0x4DFF},
|
||||||
{0x4DC0, 0x4DFF}, {0xA4D0, 0xA62B}, {0xA640, 0xA6F7},
|
{0xA4D0, 0xA62B}, {0xA640, 0xA6F7}, {0xA700, 0xA7BF},
|
||||||
{0xA700, 0xA7BF}, {0xA7C2, 0xA7C6}, {0xA7F7, 0xA82B},
|
{0xA7C2, 0xA7CA}, {0xA7F5, 0xA82C}, {0xA830, 0xA839},
|
||||||
{0xA830, 0xA839}, {0xA840, 0xA877}, {0xA880, 0xA8C5},
|
{0xA840, 0xA877}, {0xA880, 0xA8C5}, {0xA8CE, 0xA8D9},
|
||||||
{0xA8CE, 0xA8D9}, {0xA8E0, 0xA953}, {0xA95F, 0xA95F},
|
{0xA8E0, 0xA953}, {0xA95F, 0xA95F}, {0xA980, 0xA9CD},
|
||||||
{0xA980, 0xA9CD}, {0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE},
|
{0xA9CF, 0xA9D9}, {0xA9DE, 0xA9FE}, {0xAA00, 0xAA36},
|
||||||
{0xAA00, 0xAA36}, {0xAA40, 0xAA4D}, {0xAA50, 0xAA59},
|
{0xAA40, 0xAA4D}, {0xAA50, 0xAA59}, {0xAA5C, 0xAAC2},
|
||||||
{0xAA5C, 0xAAC2}, {0xAADB, 0xAAF6}, {0xAB01, 0xAB06},
|
{0xAADB, 0xAAF6}, {0xAB01, 0xAB06}, {0xAB09, 0xAB0E},
|
||||||
{0xAB09, 0xAB0E}, {0xAB11, 0xAB16}, {0xAB20, 0xAB26},
|
{0xAB11, 0xAB16}, {0xAB20, 0xAB26}, {0xAB28, 0xAB2E},
|
||||||
{0xAB28, 0xAB2E}, {0xAB30, 0xAB67}, {0xAB70, 0xABED},
|
{0xAB30, 0xAB6B}, {0xAB70, 0xABED}, {0xABF0, 0xABF9},
|
||||||
{0xABF0, 0xABF9}, {0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB},
|
{0xD7B0, 0xD7C6}, {0xD7CB, 0xD7FB}, {0xD800, 0xDFFF},
|
||||||
{0xD800, 0xDFFF}, {0xFB00, 0xFB06}, {0xFB13, 0xFB17},
|
{0xFB00, 0xFB06}, {0xFB13, 0xFB17}, {0xFB1D, 0xFB36},
|
||||||
{0xFB1D, 0xFB36}, {0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E},
|
{0xFB38, 0xFB3C}, {0xFB3E, 0xFB3E}, {0xFB40, 0xFB41},
|
||||||
{0xFB40, 0xFB41}, {0xFB43, 0xFB44}, {0xFB46, 0xFBC1},
|
{0xFB43, 0xFB44}, {0xFB46, 0xFBC1}, {0xFBD3, 0xFD3F},
|
||||||
{0xFBD3, 0xFD3F}, {0xFD50, 0xFD8F}, {0xFD92, 0xFDC7},
|
{0xFD50, 0xFD8F}, {0xFD92, 0xFDC7}, {0xFDF0, 0xFDFD},
|
||||||
{0xFDF0, 0xFDFD}, {0xFE20, 0xFE2F}, {0xFE70, 0xFE74},
|
{0xFE20, 0xFE2F}, {0xFE70, 0xFE74}, {0xFE76, 0xFEFC},
|
||||||
{0xFE76, 0xFEFC}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFC},
|
{0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFC}, {0x10000, 0x1000B},
|
||||||
{0x10000, 0x1000B}, {0x1000D, 0x10026}, {0x10028, 0x1003A},
|
{0x1000D, 0x10026}, {0x10028, 0x1003A}, {0x1003C, 0x1003D},
|
||||||
{0x1003C, 0x1003D}, {0x1003F, 0x1004D}, {0x10050, 0x1005D},
|
{0x1003F, 0x1004D}, {0x10050, 0x1005D}, {0x10080, 0x100FA},
|
||||||
{0x10080, 0x100FA}, {0x10100, 0x10102}, {0x10107, 0x10133},
|
{0x10100, 0x10102}, {0x10107, 0x10133}, {0x10137, 0x1018E},
|
||||||
{0x10137, 0x1018E}, {0x10190, 0x1019B}, {0x101A0, 0x101A0},
|
{0x10190, 0x1019C}, {0x101A0, 0x101A0}, {0x101D0, 0x101FD},
|
||||||
{0x101D0, 0x101FD}, {0x10280, 0x1029C}, {0x102A0, 0x102D0},
|
{0x10280, 0x1029C}, {0x102A0, 0x102D0}, {0x102E0, 0x102FB},
|
||||||
{0x102E0, 0x102FB}, {0x10300, 0x10323}, {0x1032D, 0x1034A},
|
{0x10300, 0x10323}, {0x1032D, 0x1034A}, {0x10350, 0x1037A},
|
||||||
{0x10350, 0x1037A}, {0x10380, 0x1039D}, {0x1039F, 0x103C3},
|
{0x10380, 0x1039D}, {0x1039F, 0x103C3}, {0x103C8, 0x103D5},
|
||||||
{0x103C8, 0x103D5}, {0x10400, 0x1049D}, {0x104A0, 0x104A9},
|
{0x10400, 0x1049D}, {0x104A0, 0x104A9}, {0x104B0, 0x104D3},
|
||||||
{0x104B0, 0x104D3}, {0x104D8, 0x104FB}, {0x10500, 0x10527},
|
{0x104D8, 0x104FB}, {0x10500, 0x10527}, {0x10530, 0x10563},
|
||||||
{0x10530, 0x10563}, {0x1056F, 0x1056F}, {0x10600, 0x10736},
|
{0x1056F, 0x1056F}, {0x10600, 0x10736}, {0x10740, 0x10755},
|
||||||
{0x10740, 0x10755}, {0x10760, 0x10767}, {0x10800, 0x10805},
|
{0x10760, 0x10767}, {0x10800, 0x10805}, {0x10808, 0x10808},
|
||||||
{0x10808, 0x10808}, {0x1080A, 0x10835}, {0x10837, 0x10838},
|
{0x1080A, 0x10835}, {0x10837, 0x10838}, {0x1083C, 0x1083C},
|
||||||
{0x1083C, 0x1083C}, {0x1083F, 0x10855}, {0x10857, 0x1089E},
|
{0x1083F, 0x10855}, {0x10857, 0x1089E}, {0x108A7, 0x108AF},
|
||||||
{0x108A7, 0x108AF}, {0x108E0, 0x108F2}, {0x108F4, 0x108F5},
|
{0x108E0, 0x108F2}, {0x108F4, 0x108F5}, {0x108FB, 0x1091B},
|
||||||
{0x108FB, 0x1091B}, {0x1091F, 0x10939}, {0x1093F, 0x1093F},
|
{0x1091F, 0x10939}, {0x1093F, 0x1093F}, {0x10980, 0x109B7},
|
||||||
{0x10980, 0x109B7}, {0x109BC, 0x109CF}, {0x109D2, 0x10A03},
|
{0x109BC, 0x109CF}, {0x109D2, 0x10A03}, {0x10A05, 0x10A06},
|
||||||
{0x10A05, 0x10A06}, {0x10A0C, 0x10A13}, {0x10A15, 0x10A17},
|
{0x10A0C, 0x10A13}, {0x10A15, 0x10A17}, {0x10A19, 0x10A35},
|
||||||
{0x10A19, 0x10A35}, {0x10A38, 0x10A3A}, {0x10A3F, 0x10A48},
|
{0x10A38, 0x10A3A}, {0x10A3F, 0x10A48}, {0x10A50, 0x10A58},
|
||||||
{0x10A50, 0x10A58}, {0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6},
|
{0x10A60, 0x10A9F}, {0x10AC0, 0x10AE6}, {0x10AEB, 0x10AF6},
|
||||||
{0x10AEB, 0x10AF6}, {0x10B00, 0x10B35}, {0x10B39, 0x10B55},
|
{0x10B00, 0x10B35}, {0x10B39, 0x10B55}, {0x10B58, 0x10B72},
|
||||||
{0x10B58, 0x10B72}, {0x10B78, 0x10B91}, {0x10B99, 0x10B9C},
|
{0x10B78, 0x10B91}, {0x10B99, 0x10B9C}, {0x10BA9, 0x10BAF},
|
||||||
{0x10BA9, 0x10BAF}, {0x10C00, 0x10C48}, {0x10C80, 0x10CB2},
|
{0x10C00, 0x10C48}, {0x10C80, 0x10CB2}, {0x10CC0, 0x10CF2},
|
||||||
{0x10CC0, 0x10CF2}, {0x10CFA, 0x10D27}, {0x10D30, 0x10D39},
|
{0x10CFA, 0x10D27}, {0x10D30, 0x10D39}, {0x10E60, 0x10E7E},
|
||||||
{0x10E60, 0x10E7E}, {0x10F00, 0x10F27}, {0x10F30, 0x10F59},
|
{0x10E80, 0x10EA9}, {0x10EAB, 0x10EAD}, {0x10EB0, 0x10EB1},
|
||||||
|
{0x10F00, 0x10F27}, {0x10F30, 0x10F59}, {0x10FB0, 0x10FCB},
|
||||||
{0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x1106F},
|
{0x10FE0, 0x10FF6}, {0x11000, 0x1104D}, {0x11052, 0x1106F},
|
||||||
{0x1107F, 0x110C1}, {0x110CD, 0x110CD}, {0x110D0, 0x110E8},
|
{0x1107F, 0x110C1}, {0x110CD, 0x110CD}, {0x110D0, 0x110E8},
|
||||||
{0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11146},
|
{0x110F0, 0x110F9}, {0x11100, 0x11134}, {0x11136, 0x11147},
|
||||||
{0x11150, 0x11176}, {0x11180, 0x111CD}, {0x111D0, 0x111DF},
|
{0x11150, 0x11176}, {0x11180, 0x111DF}, {0x111E1, 0x111F4},
|
||||||
{0x111E1, 0x111F4}, {0x11200, 0x11211}, {0x11213, 0x1123E},
|
{0x11200, 0x11211}, {0x11213, 0x1123E}, {0x11280, 0x11286},
|
||||||
{0x11280, 0x11286}, {0x11288, 0x11288}, {0x1128A, 0x1128D},
|
{0x11288, 0x11288}, {0x1128A, 0x1128D}, {0x1128F, 0x1129D},
|
||||||
{0x1128F, 0x1129D}, {0x1129F, 0x112A9}, {0x112B0, 0x112EA},
|
{0x1129F, 0x112A9}, {0x112B0, 0x112EA}, {0x112F0, 0x112F9},
|
||||||
{0x112F0, 0x112F9}, {0x11300, 0x11303}, {0x11305, 0x1130C},
|
{0x11300, 0x11303}, {0x11305, 0x1130C}, {0x1130F, 0x11310},
|
||||||
{0x1130F, 0x11310}, {0x11313, 0x11328}, {0x1132A, 0x11330},
|
{0x11313, 0x11328}, {0x1132A, 0x11330}, {0x11332, 0x11333},
|
||||||
{0x11332, 0x11333}, {0x11335, 0x11339}, {0x1133B, 0x11344},
|
{0x11335, 0x11339}, {0x1133B, 0x11344}, {0x11347, 0x11348},
|
||||||
{0x11347, 0x11348}, {0x1134B, 0x1134D}, {0x11350, 0x11350},
|
{0x1134B, 0x1134D}, {0x11350, 0x11350}, {0x11357, 0x11357},
|
||||||
{0x11357, 0x11357}, {0x1135D, 0x11363}, {0x11366, 0x1136C},
|
{0x1135D, 0x11363}, {0x11366, 0x1136C}, {0x11370, 0x11374},
|
||||||
{0x11370, 0x11374}, {0x11400, 0x11459}, {0x1145B, 0x1145B},
|
{0x11400, 0x1145B}, {0x1145D, 0x11461}, {0x11480, 0x114C7},
|
||||||
{0x1145D, 0x1145F}, {0x11480, 0x114C7}, {0x114D0, 0x114D9},
|
{0x114D0, 0x114D9}, {0x11580, 0x115B5}, {0x115B8, 0x115DD},
|
||||||
{0x11580, 0x115B5}, {0x115B8, 0x115DD}, {0x11600, 0x11644},
|
{0x11600, 0x11644}, {0x11650, 0x11659}, {0x11660, 0x1166C},
|
||||||
{0x11650, 0x11659}, {0x11660, 0x1166C}, {0x11680, 0x116B8},
|
{0x11680, 0x116B8}, {0x116C0, 0x116C9}, {0x11700, 0x1171A},
|
||||||
{0x116C0, 0x116C9}, {0x11700, 0x1171A}, {0x1171D, 0x1172B},
|
{0x1171D, 0x1172B}, {0x11730, 0x1173F}, {0x11800, 0x1183B},
|
||||||
{0x11730, 0x1173F}, {0x11800, 0x1183B}, {0x118A0, 0x118F2},
|
{0x118A0, 0x118F2}, {0x118FF, 0x11906}, {0x11909, 0x11909},
|
||||||
{0x118FF, 0x118FF}, {0x119A0, 0x119A7}, {0x119AA, 0x119D7},
|
{0x1190C, 0x11913}, {0x11915, 0x11916}, {0x11918, 0x11935},
|
||||||
{0x119DA, 0x119E4}, {0x11A00, 0x11A47}, {0x11A50, 0x11AA2},
|
{0x11937, 0x11938}, {0x1193B, 0x11946}, {0x11950, 0x11959},
|
||||||
{0x11AC0, 0x11AF8}, {0x11C00, 0x11C08}, {0x11C0A, 0x11C36},
|
{0x119A0, 0x119A7}, {0x119AA, 0x119D7}, {0x119DA, 0x119E4},
|
||||||
{0x11C38, 0x11C45}, {0x11C50, 0x11C6C}, {0x11C70, 0x11C8F},
|
{0x11A00, 0x11A47}, {0x11A50, 0x11AA2}, {0x11AC0, 0x11AF8},
|
||||||
{0x11C92, 0x11CA7}, {0x11CA9, 0x11CB6}, {0x11D00, 0x11D06},
|
{0x11C00, 0x11C08}, {0x11C0A, 0x11C36}, {0x11C38, 0x11C45},
|
||||||
{0x11D08, 0x11D09}, {0x11D0B, 0x11D36}, {0x11D3A, 0x11D3A},
|
{0x11C50, 0x11C6C}, {0x11C70, 0x11C8F}, {0x11C92, 0x11CA7},
|
||||||
{0x11D3C, 0x11D3D}, {0x11D3F, 0x11D47}, {0x11D50, 0x11D59},
|
{0x11CA9, 0x11CB6}, {0x11D00, 0x11D06}, {0x11D08, 0x11D09},
|
||||||
{0x11D60, 0x11D65}, {0x11D67, 0x11D68}, {0x11D6A, 0x11D8E},
|
{0x11D0B, 0x11D36}, {0x11D3A, 0x11D3A}, {0x11D3C, 0x11D3D},
|
||||||
{0x11D90, 0x11D91}, {0x11D93, 0x11D98}, {0x11DA0, 0x11DA9},
|
{0x11D3F, 0x11D47}, {0x11D50, 0x11D59}, {0x11D60, 0x11D65},
|
||||||
{0x11EE0, 0x11EF8}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399},
|
{0x11D67, 0x11D68}, {0x11D6A, 0x11D8E}, {0x11D90, 0x11D91},
|
||||||
|
{0x11D93, 0x11D98}, {0x11DA0, 0x11DA9}, {0x11EE0, 0x11EF8},
|
||||||
|
{0x11FB0, 0x11FB0}, {0x11FC0, 0x11FF1}, {0x11FFF, 0x12399},
|
||||||
{0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543},
|
{0x12400, 0x1246E}, {0x12470, 0x12474}, {0x12480, 0x12543},
|
||||||
{0x13000, 0x1342E}, {0x13430, 0x13438}, {0x14400, 0x14646},
|
{0x13000, 0x1342E}, {0x13430, 0x13438}, {0x14400, 0x14646},
|
||||||
{0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69},
|
{0x16800, 0x16A38}, {0x16A40, 0x16A5E}, {0x16A60, 0x16A69},
|
||||||
|
@ -382,20 +389,22 @@ var neutral = table{
|
||||||
{0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x1EEF0, 0x1EEF1},
|
{0x1EEA5, 0x1EEA9}, {0x1EEAB, 0x1EEBB}, {0x1EEF0, 0x1EEF1},
|
||||||
{0x1F000, 0x1F003}, {0x1F005, 0x1F02B}, {0x1F030, 0x1F093},
|
{0x1F000, 0x1F003}, {0x1F005, 0x1F02B}, {0x1F030, 0x1F093},
|
||||||
{0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, {0x1F0C1, 0x1F0CE},
|
{0x1F0A0, 0x1F0AE}, {0x1F0B1, 0x1F0BF}, {0x1F0C1, 0x1F0CE},
|
||||||
{0x1F0D1, 0x1F0F5}, {0x1F10B, 0x1F10C}, {0x1F12E, 0x1F12F},
|
{0x1F0D1, 0x1F0F5}, {0x1F10B, 0x1F10F}, {0x1F12E, 0x1F12F},
|
||||||
{0x1F16A, 0x1F16C}, {0x1F1E6, 0x1F1FF}, {0x1F321, 0x1F32C},
|
{0x1F16A, 0x1F16F}, {0x1F1AD, 0x1F1AD}, {0x1F1E6, 0x1F1FF},
|
||||||
{0x1F336, 0x1F336}, {0x1F37D, 0x1F37D}, {0x1F394, 0x1F39F},
|
{0x1F321, 0x1F32C}, {0x1F336, 0x1F336}, {0x1F37D, 0x1F37D},
|
||||||
{0x1F3CB, 0x1F3CE}, {0x1F3D4, 0x1F3DF}, {0x1F3F1, 0x1F3F3},
|
{0x1F394, 0x1F39F}, {0x1F3CB, 0x1F3CE}, {0x1F3D4, 0x1F3DF},
|
||||||
{0x1F3F5, 0x1F3F7}, {0x1F43F, 0x1F43F}, {0x1F441, 0x1F441},
|
{0x1F3F1, 0x1F3F3}, {0x1F3F5, 0x1F3F7}, {0x1F43F, 0x1F43F},
|
||||||
{0x1F4FD, 0x1F4FE}, {0x1F53E, 0x1F54A}, {0x1F54F, 0x1F54F},
|
{0x1F441, 0x1F441}, {0x1F4FD, 0x1F4FE}, {0x1F53E, 0x1F54A},
|
||||||
{0x1F568, 0x1F579}, {0x1F57B, 0x1F594}, {0x1F597, 0x1F5A3},
|
{0x1F54F, 0x1F54F}, {0x1F568, 0x1F579}, {0x1F57B, 0x1F594},
|
||||||
{0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F}, {0x1F6C6, 0x1F6CB},
|
{0x1F597, 0x1F5A3}, {0x1F5A5, 0x1F5FA}, {0x1F650, 0x1F67F},
|
||||||
{0x1F6CD, 0x1F6CF}, {0x1F6D3, 0x1F6D4}, {0x1F6E0, 0x1F6EA},
|
{0x1F6C6, 0x1F6CB}, {0x1F6CD, 0x1F6CF}, {0x1F6D3, 0x1F6D4},
|
||||||
{0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773}, {0x1F780, 0x1F7D8},
|
{0x1F6E0, 0x1F6EA}, {0x1F6F0, 0x1F6F3}, {0x1F700, 0x1F773},
|
||||||
{0x1F800, 0x1F80B}, {0x1F810, 0x1F847}, {0x1F850, 0x1F859},
|
{0x1F780, 0x1F7D8}, {0x1F800, 0x1F80B}, {0x1F810, 0x1F847},
|
||||||
{0x1F860, 0x1F887}, {0x1F890, 0x1F8AD}, {0x1F900, 0x1F90B},
|
{0x1F850, 0x1F859}, {0x1F860, 0x1F887}, {0x1F890, 0x1F8AD},
|
||||||
{0x1FA00, 0x1FA53}, {0x1FA60, 0x1FA6D}, {0xE0001, 0xE0001},
|
{0x1F8B0, 0x1F8B1}, {0x1F900, 0x1F90B}, {0x1F93B, 0x1F93B},
|
||||||
{0xE0020, 0xE007F},
|
{0x1F946, 0x1F946}, {0x1FA00, 0x1FA53}, {0x1FA60, 0x1FA6D},
|
||||||
|
{0x1FB00, 0x1FB92}, {0x1FB94, 0x1FBCA}, {0x1FBF0, 0x1FBF9},
|
||||||
|
{0xE0001, 0xE0001}, {0xE0020, 0xE007F},
|
||||||
}
|
}
|
||||||
|
|
||||||
var emoji = table{
|
var emoji = table{
|
||||||
|
@ -423,5 +432,6 @@ var emoji = table{
|
||||||
{0x1F546, 0x1F64F}, {0x1F680, 0x1F6FF}, {0x1F774, 0x1F77F},
|
{0x1F546, 0x1F64F}, {0x1F680, 0x1F6FF}, {0x1F774, 0x1F77F},
|
||||||
{0x1F7D5, 0x1F7FF}, {0x1F80C, 0x1F80F}, {0x1F848, 0x1F84F},
|
{0x1F7D5, 0x1F7FF}, {0x1F80C, 0x1F80F}, {0x1F848, 0x1F84F},
|
||||||
{0x1F85A, 0x1F85F}, {0x1F888, 0x1F88F}, {0x1F8AE, 0x1F8FF},
|
{0x1F85A, 0x1F85F}, {0x1F888, 0x1F88F}, {0x1F8AE, 0x1F8FF},
|
||||||
{0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1FFFD},
|
{0x1F90C, 0x1F93A}, {0x1F93C, 0x1F945}, {0x1F947, 0x1FAFF},
|
||||||
|
{0x1FC00, 0x1FFFD},
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,6 @@ import (
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
errorEmoji = color.RedString("✘")
|
|
||||||
warningEmoji = color.YellowString("⚠")
|
|
||||||
)
|
|
||||||
|
|
||||||
var newLines = map[rune]bool{
|
var newLines = map[rune]bool{
|
||||||
0x000A: true,
|
0x000A: true,
|
||||||
0x000B: true,
|
0x000B: true,
|
||||||
|
@ -25,6 +20,14 @@ var newLines = map[rune]bool{
|
||||||
0x2029: true,
|
0x2029: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getErrorEmoji() string {
|
||||||
|
return color.RedString("✘")
|
||||||
|
}
|
||||||
|
|
||||||
|
func getWarningEmoji() string {
|
||||||
|
return color.YellowString("⚠")
|
||||||
|
}
|
||||||
|
|
||||||
// Friendly is an implementation of the Formatter interface
|
// Friendly is an implementation of the Formatter interface
|
||||||
// which formats the errors to JSON.
|
// which formats the errors to JSON.
|
||||||
type Friendly struct {
|
type Friendly struct {
|
||||||
|
@ -68,9 +71,9 @@ func (f *Friendly) printFriendlyFailure(failure lint.Failure, severity lint.Seve
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Friendly) printHeaderRow(failure lint.Failure, severity lint.Severity) {
|
func (f *Friendly) printHeaderRow(failure lint.Failure, severity lint.Severity) {
|
||||||
emoji := warningEmoji
|
emoji := getWarningEmoji()
|
||||||
if severity == lint.SeverityError {
|
if severity == lint.SeverityError {
|
||||||
emoji = errorEmoji
|
emoji = getErrorEmoji()
|
||||||
}
|
}
|
||||||
fmt.Print(f.table([][]string{{emoji, "https://revive.run/r#" + failure.RuleName, color.GreenString(failure.Failure)}}))
|
fmt.Print(f.table([][]string{{emoji, "https://revive.run/r#" + failure.RuleName, color.GreenString(failure.Failure)}}))
|
||||||
}
|
}
|
||||||
|
@ -85,9 +88,9 @@ type statEntry struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *Friendly) printSummary(errors, warnings int) {
|
func (f *Friendly) printSummary(errors, warnings int) {
|
||||||
emoji := warningEmoji
|
emoji := getWarningEmoji()
|
||||||
if errors > 0 {
|
if errors > 0 {
|
||||||
emoji = errorEmoji
|
emoji = getErrorEmoji()
|
||||||
}
|
}
|
||||||
problemsLabel := "problems"
|
problemsLabel := "problems"
|
||||||
if errors+warnings == 1 {
|
if errors+warnings == 1 {
|
||||||
|
|
|
@ -52,7 +52,7 @@ type cognitiveComplexityLinter struct {
|
||||||
func (w cognitiveComplexityLinter) lint() {
|
func (w cognitiveComplexityLinter) lint() {
|
||||||
f := w.file
|
f := w.file
|
||||||
for _, decl := range f.AST.Decls {
|
for _, decl := range f.AST.Decls {
|
||||||
if fn, ok := decl.(*ast.FuncDecl); ok {
|
if fn, ok := decl.(*ast.FuncDecl); ok && fn.Body != nil {
|
||||||
v := cognitiveComplexityVisitor{}
|
v := cognitiveComplexityVisitor{}
|
||||||
c := v.subTreeComplexity(fn.Body)
|
c := v.subTreeComplexity(fn.Body)
|
||||||
if c > w.maxComplexity {
|
if c > w.maxComplexity {
|
||||||
|
@ -109,7 +109,7 @@ func (v *cognitiveComplexityVisitor) Visit(n ast.Node) ast.Visitor {
|
||||||
return nil // skip visiting binexp sub-tree (already visited by binExpComplexity)
|
return nil // skip visiting binexp sub-tree (already visited by binExpComplexity)
|
||||||
case *ast.BranchStmt:
|
case *ast.BranchStmt:
|
||||||
if n.Label != nil {
|
if n.Label != nil {
|
||||||
v.complexity += 1
|
v.complexity++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TODO handle (at least) direct recursion
|
// TODO handle (at least) direct recursion
|
||||||
|
|
|
@ -0,0 +1,137 @@
|
||||||
|
package rule
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go/ast"
|
||||||
|
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
)
|
||||||
|
|
||||||
|
// DeferRule lints unused params in functions.
|
||||||
|
type DeferRule struct{}
|
||||||
|
|
||||||
|
// Apply applies the rule to given file.
|
||||||
|
func (r *DeferRule) Apply(file *lint.File, arguments lint.Arguments) []lint.Failure {
|
||||||
|
allow := r.allowFromArgs(arguments)
|
||||||
|
|
||||||
|
var failures []lint.Failure
|
||||||
|
onFailure := func(failure lint.Failure) {
|
||||||
|
failures = append(failures, failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
w := lintDeferRule{onFailure: onFailure, allow: allow}
|
||||||
|
|
||||||
|
ast.Walk(w, file.AST)
|
||||||
|
|
||||||
|
return failures
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name returns the rule name.
|
||||||
|
func (r *DeferRule) Name() string {
|
||||||
|
return "defer"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *DeferRule) allowFromArgs(args lint.Arguments) map[string]bool {
|
||||||
|
if len(args) < 1 {
|
||||||
|
allow := map[string]bool{
|
||||||
|
"loop": true,
|
||||||
|
"call-chain": true,
|
||||||
|
"method-call": true,
|
||||||
|
"return": true,
|
||||||
|
"recover": true,
|
||||||
|
}
|
||||||
|
|
||||||
|
return allow
|
||||||
|
}
|
||||||
|
|
||||||
|
aa, ok := args[0].([]interface{})
|
||||||
|
if !ok {
|
||||||
|
panic(fmt.Sprintf("Invalid argument '%v' for 'defer' rule. Expecting []string, got %T", args[0], args[0]))
|
||||||
|
}
|
||||||
|
|
||||||
|
allow := make(map[string]bool, len(aa))
|
||||||
|
for _, subcase := range aa {
|
||||||
|
sc, ok := subcase.(string)
|
||||||
|
if !ok {
|
||||||
|
panic(fmt.Sprintf("Invalid argument '%v' for 'defer' rule. Expecting string, got %T", subcase, subcase))
|
||||||
|
}
|
||||||
|
allow[sc] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
return allow
|
||||||
|
}
|
||||||
|
|
||||||
|
type lintDeferRule struct {
|
||||||
|
onFailure func(lint.Failure)
|
||||||
|
inALoop bool
|
||||||
|
inADefer bool
|
||||||
|
inAFuncLit bool
|
||||||
|
allow map[string]bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w lintDeferRule) Visit(node ast.Node) ast.Visitor {
|
||||||
|
switch n := node.(type) {
|
||||||
|
case *ast.ForStmt:
|
||||||
|
w.visitSubtree(n.Body, w.inADefer, true, w.inAFuncLit)
|
||||||
|
return nil
|
||||||
|
case *ast.RangeStmt:
|
||||||
|
w.visitSubtree(n.Body, w.inADefer, true, w.inAFuncLit)
|
||||||
|
return nil
|
||||||
|
case *ast.FuncLit:
|
||||||
|
w.visitSubtree(n.Body, w.inADefer, false, true)
|
||||||
|
return nil
|
||||||
|
case *ast.ReturnStmt:
|
||||||
|
if len(n.Results) != 0 && w.inADefer && w.inAFuncLit {
|
||||||
|
w.newFailure("return in a defer function has no effect", n, 1.0, "logic", "return")
|
||||||
|
}
|
||||||
|
case *ast.CallExpr:
|
||||||
|
if isIdent(n.Fun, "recover") && !w.inADefer {
|
||||||
|
// confidence is not 1 because recover can be in a function that is deferred elsewhere
|
||||||
|
w.newFailure("recover must be called inside a deferred function", n, 0.8, "logic", "recover")
|
||||||
|
}
|
||||||
|
case *ast.DeferStmt:
|
||||||
|
w.visitSubtree(n.Call.Fun, true, false, false)
|
||||||
|
|
||||||
|
if w.inALoop {
|
||||||
|
w.newFailure("prefer not to defer inside loops", n, 1.0, "bad practice", "loop")
|
||||||
|
}
|
||||||
|
|
||||||
|
switch fn := n.Call.Fun.(type) {
|
||||||
|
case *ast.CallExpr:
|
||||||
|
w.newFailure("prefer not to defer chains of function calls", fn, 1.0, "bad practice", "call-chain")
|
||||||
|
case *ast.SelectorExpr:
|
||||||
|
if id, ok := fn.X.(*ast.Ident); ok {
|
||||||
|
isMethodCall := id != nil && id.Obj != nil && id.Obj.Kind == ast.Typ
|
||||||
|
if isMethodCall {
|
||||||
|
w.newFailure("be careful when deferring calls to methods without pointer receiver", fn, 0.8, "bad practice", "method-call")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w lintDeferRule) visitSubtree(n ast.Node, inADefer, inALoop, inAFuncLit bool) {
|
||||||
|
nw := &lintDeferRule{
|
||||||
|
onFailure: w.onFailure,
|
||||||
|
inADefer: inADefer,
|
||||||
|
inALoop: inALoop,
|
||||||
|
inAFuncLit: inAFuncLit,
|
||||||
|
allow: w.allow}
|
||||||
|
ast.Walk(nw, n)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w lintDeferRule) newFailure(msg string, node ast.Node, confidence float64, cat string, subcase string) {
|
||||||
|
if !w.allow[subcase] {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
w.onFailure(lint.Failure{
|
||||||
|
Confidence: confidence,
|
||||||
|
Node: node,
|
||||||
|
Category: cat,
|
||||||
|
Failure: msg,
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package rule
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go/ast"
|
||||||
|
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EarlyReturnRule lints given else constructs.
|
||||||
|
type EarlyReturnRule struct{}
|
||||||
|
|
||||||
|
// Apply applies the rule to given file.
|
||||||
|
func (r *EarlyReturnRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
|
||||||
|
var failures []lint.Failure
|
||||||
|
|
||||||
|
onFailure := func(failure lint.Failure) {
|
||||||
|
failures = append(failures, failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
w := lintEarlyReturnRule{onFailure: onFailure}
|
||||||
|
ast.Walk(w, file.AST)
|
||||||
|
return failures
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name returns the rule name.
|
||||||
|
func (r *EarlyReturnRule) Name() string {
|
||||||
|
return "early-return"
|
||||||
|
}
|
||||||
|
|
||||||
|
type lintEarlyReturnRule struct {
|
||||||
|
onFailure func(lint.Failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w lintEarlyReturnRule) Visit(node ast.Node) ast.Visitor {
|
||||||
|
switch n := node.(type) {
|
||||||
|
case *ast.IfStmt:
|
||||||
|
if n.Else == nil {
|
||||||
|
// no else branch
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
elseBlock, ok := n.Else.(*ast.BlockStmt)
|
||||||
|
if !ok {
|
||||||
|
// is if-else-if
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
lenElseBlock := len(elseBlock.List)
|
||||||
|
if lenElseBlock < 1 {
|
||||||
|
// empty else block, continue (there is another rule that warns on empty blocks)
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
lenThenBlock := len(n.Body.List)
|
||||||
|
if lenThenBlock < 1 {
|
||||||
|
// then block is empty thus the stmt can be simplified
|
||||||
|
w.onFailure(lint.Failure{
|
||||||
|
Confidence: 1,
|
||||||
|
Node: n,
|
||||||
|
Failure: "if c { } else {... return} can be simplified to if !c { ... return }",
|
||||||
|
})
|
||||||
|
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
_, lastThenStmtIsReturn := n.Body.List[lenThenBlock-1].(*ast.ReturnStmt)
|
||||||
|
_, lastElseStmtIsReturn := elseBlock.List[lenElseBlock-1].(*ast.ReturnStmt)
|
||||||
|
if lastElseStmtIsReturn && !lastThenStmtIsReturn {
|
||||||
|
w.onFailure(lint.Failure{
|
||||||
|
Confidence: 1,
|
||||||
|
Node: n,
|
||||||
|
Failure: "if c {...} else {... return } can be simplified to if !c { ... return } ...",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return w
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ func (r *EmptyBlockRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure
|
||||||
failures = append(failures, failure)
|
failures = append(failures, failure)
|
||||||
}
|
}
|
||||||
|
|
||||||
w := lintEmptyBlock{make([]*ast.BlockStmt, 0), onFailure}
|
w := lintEmptyBlock{make(map[*ast.BlockStmt]bool, 0), onFailure}
|
||||||
ast.Walk(w, file.AST)
|
ast.Walk(w, file.AST)
|
||||||
return failures
|
return failures
|
||||||
}
|
}
|
||||||
|
@ -28,49 +28,38 @@ func (r *EmptyBlockRule) Name() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
type lintEmptyBlock struct {
|
type lintEmptyBlock struct {
|
||||||
ignore []*ast.BlockStmt
|
ignore map[*ast.BlockStmt]bool
|
||||||
onFailure func(lint.Failure)
|
onFailure func(lint.Failure)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w lintEmptyBlock) Visit(node ast.Node) ast.Visitor {
|
func (w lintEmptyBlock) Visit(node ast.Node) ast.Visitor {
|
||||||
fd, ok := node.(*ast.FuncDecl)
|
switch n := node.(type) {
|
||||||
if ok {
|
case *ast.FuncDecl:
|
||||||
w.ignore = append(w.ignore, fd.Body)
|
w.ignore[n.Body] = true
|
||||||
return w
|
return w
|
||||||
}
|
case *ast.FuncLit:
|
||||||
|
w.ignore[n.Body] = true
|
||||||
fl, ok := node.(*ast.FuncLit)
|
|
||||||
if ok {
|
|
||||||
w.ignore = append(w.ignore, fl.Body)
|
|
||||||
return w
|
return w
|
||||||
|
case *ast.RangeStmt:
|
||||||
|
if len(n.Body.List) == 0 {
|
||||||
|
w.onFailure(lint.Failure{
|
||||||
|
Confidence: 0.9,
|
||||||
|
Node: n,
|
||||||
|
Category: "logic",
|
||||||
|
Failure: "this block is empty, you can remove it",
|
||||||
|
})
|
||||||
|
return nil // skip visiting the range subtree (it will produce a duplicated failure)
|
||||||
}
|
}
|
||||||
|
case *ast.BlockStmt:
|
||||||
block, ok := node.(*ast.BlockStmt)
|
if !w.ignore[n] && len(n.List) == 0 {
|
||||||
if !ok {
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
|
|
||||||
if mustIgnore(block, w.ignore) {
|
|
||||||
return w
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(block.List) == 0 {
|
|
||||||
w.onFailure(lint.Failure{
|
w.onFailure(lint.Failure{
|
||||||
Confidence: 1,
|
Confidence: 1,
|
||||||
Node: block,
|
Node: n,
|
||||||
Category: "logic",
|
Category: "logic",
|
||||||
Failure: "this block is empty, you can remove it",
|
Failure: "this block is empty, you can remove it",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return w
|
return w
|
||||||
}
|
}
|
||||||
|
|
||||||
func mustIgnore(block *ast.BlockStmt, blackList []*ast.BlockStmt) bool {
|
|
||||||
for _, b := range blackList {
|
|
||||||
if b == block {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
package rule
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go/ast"
|
||||||
|
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
)
|
||||||
|
|
||||||
|
// IdenticalBranchesRule warns on constant logical expressions.
|
||||||
|
type IdenticalBranchesRule struct{}
|
||||||
|
|
||||||
|
// Apply applies the rule to given file.
|
||||||
|
func (r *IdenticalBranchesRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
|
||||||
|
var failures []lint.Failure
|
||||||
|
|
||||||
|
onFailure := func(failure lint.Failure) {
|
||||||
|
failures = append(failures, failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
astFile := file.AST
|
||||||
|
w := &lintIdenticalBranches{astFile, onFailure}
|
||||||
|
ast.Walk(w, astFile)
|
||||||
|
return failures
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name returns the rule name.
|
||||||
|
func (r *IdenticalBranchesRule) Name() string {
|
||||||
|
return "identical-branches"
|
||||||
|
}
|
||||||
|
|
||||||
|
type lintIdenticalBranches struct {
|
||||||
|
file *ast.File
|
||||||
|
onFailure func(lint.Failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *lintIdenticalBranches) Visit(node ast.Node) ast.Visitor {
|
||||||
|
n, ok := node.(*ast.IfStmt)
|
||||||
|
if !ok {
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
if n.Else == nil {
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
branches := []*ast.BlockStmt{n.Body}
|
||||||
|
|
||||||
|
elseBranch, ok := n.Else.(*ast.BlockStmt)
|
||||||
|
if !ok { // if-else-if construction
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
branches = append(branches, elseBranch)
|
||||||
|
|
||||||
|
if w.identicalBranches(branches) {
|
||||||
|
w.newFailure(n, "both branches of the if are identical")
|
||||||
|
}
|
||||||
|
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *lintIdenticalBranches) identicalBranches(branches []*ast.BlockStmt) bool {
|
||||||
|
if len(branches) < 2 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
ref := gofmt(branches[0])
|
||||||
|
for i := 1; i < len(branches); i++ {
|
||||||
|
if gofmt(branches[i]) != ref {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w lintIdenticalBranches) newFailure(node ast.Node, msg string) {
|
||||||
|
w.onFailure(lint.Failure{
|
||||||
|
Confidence: 1,
|
||||||
|
Node: node,
|
||||||
|
Category: "logic",
|
||||||
|
Failure: msg,
|
||||||
|
})
|
||||||
|
}
|
|
@ -0,0 +1,183 @@
|
||||||
|
package rule
|
||||||
|
|
||||||
|
import (
|
||||||
|
"go/ast"
|
||||||
|
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UnconditionalRecursionRule lints given else constructs.
|
||||||
|
type UnconditionalRecursionRule struct{}
|
||||||
|
|
||||||
|
// Apply applies the rule to given file.
|
||||||
|
func (r *UnconditionalRecursionRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
|
||||||
|
var failures []lint.Failure
|
||||||
|
|
||||||
|
onFailure := func(failure lint.Failure) {
|
||||||
|
failures = append(failures, failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
w := lintUnconditionalRecursionRule{onFailure: onFailure}
|
||||||
|
ast.Walk(w, file.AST)
|
||||||
|
return failures
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name returns the rule name.
|
||||||
|
func (r *UnconditionalRecursionRule) Name() string {
|
||||||
|
return "unconditional-recursion"
|
||||||
|
}
|
||||||
|
|
||||||
|
type funcDesc struct {
|
||||||
|
reciverID *ast.Ident
|
||||||
|
id *ast.Ident
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fd *funcDesc) equal(other *funcDesc) bool {
|
||||||
|
receiversAreEqual := (fd.reciverID == nil && other.reciverID == nil) || fd.reciverID != nil && other.reciverID != nil && fd.reciverID.Name == other.reciverID.Name
|
||||||
|
idsAreEqual := (fd.id == nil && other.id == nil) || fd.id.Name == other.id.Name
|
||||||
|
|
||||||
|
return receiversAreEqual && idsAreEqual
|
||||||
|
}
|
||||||
|
|
||||||
|
type funcStatus struct {
|
||||||
|
funcDesc *funcDesc
|
||||||
|
seenConditionalExit bool
|
||||||
|
}
|
||||||
|
|
||||||
|
type lintUnconditionalRecursionRule struct {
|
||||||
|
onFailure func(lint.Failure)
|
||||||
|
currentFunc *funcStatus
|
||||||
|
}
|
||||||
|
|
||||||
|
// Visit will traverse the file AST.
|
||||||
|
// The rule is based in the following algorithm: inside each function body we search for calls to the function itself.
|
||||||
|
// We do not search inside conditional control structures (if, for, switch, ...) because any recursive call inside them is conditioned
|
||||||
|
// We do search inside conditional control structures are statements that will take the control out of the function (return, exit, panic)
|
||||||
|
// If we find conditional control exits, it means the function is NOT unconditionally-recursive
|
||||||
|
// If we find a recursive call before finding any conditional exit, a failure is generated
|
||||||
|
// In resume: if we found a recursive call control-dependant from the entry point of the function then we raise a failure.
|
||||||
|
func (w lintUnconditionalRecursionRule) Visit(node ast.Node) ast.Visitor {
|
||||||
|
switch n := node.(type) {
|
||||||
|
case *ast.FuncDecl:
|
||||||
|
var rec *ast.Ident
|
||||||
|
switch {
|
||||||
|
case n.Recv == nil || n.Recv.NumFields() < 1 || len(n.Recv.List[0].Names) < 1:
|
||||||
|
rec = nil
|
||||||
|
default:
|
||||||
|
rec = n.Recv.List[0].Names[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
w.currentFunc = &funcStatus{&funcDesc{rec, n.Name}, false}
|
||||||
|
case *ast.CallExpr:
|
||||||
|
var funcID *ast.Ident
|
||||||
|
var selector *ast.Ident
|
||||||
|
switch c := n.Fun.(type) {
|
||||||
|
case *ast.Ident:
|
||||||
|
selector = nil
|
||||||
|
funcID = c
|
||||||
|
case *ast.SelectorExpr:
|
||||||
|
var ok bool
|
||||||
|
selector, ok = c.X.(*ast.Ident)
|
||||||
|
if !ok { // a.b....Foo()
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
funcID = c.Sel
|
||||||
|
default:
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
if w.currentFunc != nil && // not in a func body
|
||||||
|
!w.currentFunc.seenConditionalExit && // there is a conditional exit in the function
|
||||||
|
w.currentFunc.funcDesc.equal(&funcDesc{selector, funcID}) {
|
||||||
|
w.onFailure(lint.Failure{
|
||||||
|
Category: "logic",
|
||||||
|
Confidence: 1,
|
||||||
|
Node: n,
|
||||||
|
Failure: "unconditional recursive call",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
case *ast.IfStmt:
|
||||||
|
w.updateFuncStatus(n.Body)
|
||||||
|
w.updateFuncStatus(n.Else)
|
||||||
|
return nil
|
||||||
|
case *ast.SelectStmt:
|
||||||
|
w.updateFuncStatus(n.Body)
|
||||||
|
return nil
|
||||||
|
case *ast.RangeStmt:
|
||||||
|
w.updateFuncStatus(n.Body)
|
||||||
|
return nil
|
||||||
|
case *ast.TypeSwitchStmt:
|
||||||
|
w.updateFuncStatus(n.Body)
|
||||||
|
return nil
|
||||||
|
case *ast.SwitchStmt:
|
||||||
|
w.updateFuncStatus(n.Body)
|
||||||
|
return nil
|
||||||
|
case *ast.GoStmt:
|
||||||
|
for _, a := range n.Call.Args {
|
||||||
|
ast.Walk(w, a) // check if arguments have a recursive call
|
||||||
|
}
|
||||||
|
return nil // recursive async call is not an issue
|
||||||
|
case *ast.ForStmt:
|
||||||
|
if n.Cond != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
// unconditional loop
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
return w
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *lintUnconditionalRecursionRule) updateFuncStatus(node ast.Node) {
|
||||||
|
if node == nil || w.currentFunc == nil || w.currentFunc.seenConditionalExit {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
w.currentFunc.seenConditionalExit = w.hasControlExit(node)
|
||||||
|
}
|
||||||
|
|
||||||
|
var exitFunctions = map[string]map[string]bool{
|
||||||
|
"os": map[string]bool{"Exit": true},
|
||||||
|
"syscall": map[string]bool{"Exit": true},
|
||||||
|
"log": map[string]bool{
|
||||||
|
"Fatal": true,
|
||||||
|
"Fatalf": true,
|
||||||
|
"Fatalln": true,
|
||||||
|
"Panic": true,
|
||||||
|
"Panicf": true,
|
||||||
|
"Panicln": true,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *lintUnconditionalRecursionRule) hasControlExit(node ast.Node) bool {
|
||||||
|
// isExit returns true if the given node makes control exit the function
|
||||||
|
isExit := func(node ast.Node) bool {
|
||||||
|
switch n := node.(type) {
|
||||||
|
case *ast.ReturnStmt:
|
||||||
|
return true
|
||||||
|
case *ast.CallExpr:
|
||||||
|
if isIdent(n.Fun, "panic") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
se, ok := n.Fun.(*ast.SelectorExpr)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
id, ok := se.X.(*ast.Ident)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
fn := se.Sel.Name
|
||||||
|
pkg := id.Name
|
||||||
|
if exitFunctions[pkg] != nil && exitFunctions[pkg][fn] { // it's a call to an exit function
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(pick(node, isExit, nil)) != 0
|
||||||
|
}
|
|
@ -0,0 +1,115 @@
|
||||||
|
package rule
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go/ast"
|
||||||
|
"go/token"
|
||||||
|
|
||||||
|
"github.com/mgechev/revive/lint"
|
||||||
|
)
|
||||||
|
|
||||||
|
// UnexportedNamingRule lints wrongly named unexported symbols.
|
||||||
|
type UnexportedNamingRule struct{}
|
||||||
|
|
||||||
|
// Apply applies the rule to given file.
|
||||||
|
func (r *UnexportedNamingRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
|
||||||
|
var failures []lint.Failure
|
||||||
|
onFailure := func(failure lint.Failure) {
|
||||||
|
failures = append(failures, failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
ba := &unexportablenamingLinter{onFailure}
|
||||||
|
ast.Walk(ba, file.AST)
|
||||||
|
|
||||||
|
return failures
|
||||||
|
}
|
||||||
|
|
||||||
|
// Name returns the rule name.
|
||||||
|
func (r *UnexportedNamingRule) Name() string {
|
||||||
|
return "unexported-naming"
|
||||||
|
}
|
||||||
|
|
||||||
|
type unexportablenamingLinter struct {
|
||||||
|
onFailure func(lint.Failure)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (unl unexportablenamingLinter) Visit(node ast.Node) ast.Visitor {
|
||||||
|
switch n := node.(type) {
|
||||||
|
case *ast.FuncDecl:
|
||||||
|
unl.lintFunction(n.Type, n.Body)
|
||||||
|
return nil
|
||||||
|
case *ast.FuncLit:
|
||||||
|
unl.lintFunction(n.Type, n.Body)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
case *ast.AssignStmt:
|
||||||
|
if n.Tok != token.DEFINE {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
ids := []*ast.Ident{}
|
||||||
|
for _, e := range n.Lhs {
|
||||||
|
id, ok := e.(*ast.Ident)
|
||||||
|
if !ok {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
ids = append(ids, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
unl.lintIDs(ids)
|
||||||
|
|
||||||
|
case *ast.DeclStmt:
|
||||||
|
gd, ok := n.Decl.(*ast.GenDecl)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(gd.Specs) < 1 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
vs, ok := gd.Specs[0].(*ast.ValueSpec)
|
||||||
|
if !ok {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
unl.lintIDs(vs.Names)
|
||||||
|
}
|
||||||
|
|
||||||
|
return unl
|
||||||
|
}
|
||||||
|
|
||||||
|
func (unl unexportablenamingLinter) lintFunction(ft *ast.FuncType, body *ast.BlockStmt) {
|
||||||
|
unl.lintFields(ft.Params)
|
||||||
|
unl.lintFields(ft.Results)
|
||||||
|
|
||||||
|
if body != nil {
|
||||||
|
ast.Walk(unl, body)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (unl unexportablenamingLinter) lintFields(fields *ast.FieldList) {
|
||||||
|
if fields == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
ids := []*ast.Ident{}
|
||||||
|
for _, field := range fields.List {
|
||||||
|
ids = append(ids, field.Names...)
|
||||||
|
}
|
||||||
|
|
||||||
|
unl.lintIDs(ids)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (unl unexportablenamingLinter) lintIDs(ids []*ast.Ident) {
|
||||||
|
for _, id := range ids {
|
||||||
|
if id.IsExported() {
|
||||||
|
unl.onFailure(lint.Failure{
|
||||||
|
Node: id,
|
||||||
|
Confidence: 1,
|
||||||
|
Category: "naming",
|
||||||
|
Failure: fmt.Sprintf("the symbol %s is local, its name should start with a lowercase letter", id.String()),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ import (
|
||||||
type UnusedReceiverRule struct{}
|
type UnusedReceiverRule struct{}
|
||||||
|
|
||||||
// Apply applies the rule to given file.
|
// Apply applies the rule to given file.
|
||||||
func (_ *UnusedReceiverRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
|
func (*UnusedReceiverRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure {
|
||||||
var failures []lint.Failure
|
var failures []lint.Failure
|
||||||
|
|
||||||
onFailure := func(failure lint.Failure) {
|
onFailure := func(failure lint.Failure) {
|
||||||
|
@ -26,7 +26,7 @@ func (_ *UnusedReceiverRule) Apply(file *lint.File, _ lint.Arguments) []lint.Fai
|
||||||
}
|
}
|
||||||
|
|
||||||
// Name returns the rule name.
|
// Name returns the rule name.
|
||||||
func (_ *UnusedReceiverRule) Name() string {
|
func (*UnusedReceiverRule) Name() string {
|
||||||
return "unused-receiver"
|
return "unused-receiver"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,8 +182,8 @@ func isExprABooleanLit(n ast.Node) (lexeme string, ok bool) {
|
||||||
return oper.Name, (oper.Name == trueName || oper.Name == falseName)
|
return oper.Name, (oper.Name == trueName || oper.Name == falseName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// gofmt returns a string representation of the expression.
|
// gofmt returns a string representation of an AST subtree.
|
||||||
func gofmt(x ast.Expr) string {
|
func gofmt(x interface{}) string {
|
||||||
buf := bytes.Buffer{}
|
buf := bytes.Buffer{}
|
||||||
fs := token.NewFileSet()
|
fs := token.NewFileSet()
|
||||||
printer.Fprint(&buf, fs, x)
|
printer.Fprint(&buf, fs, x)
|
||||||
|
|
|
@ -13,9 +13,9 @@ stages:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go 1.14"
|
displayName: "Install Go 1.15"
|
||||||
inputs:
|
inputs:
|
||||||
version: "1.14"
|
version: "1.15"
|
||||||
- script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
|
- script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
|
||||||
- script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml
|
- script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml
|
||||||
- script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml
|
- script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml
|
||||||
|
@ -36,9 +36,9 @@ stages:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go 1.14"
|
displayName: "Install Go 1.15"
|
||||||
inputs:
|
inputs:
|
||||||
version: "1.14"
|
version: "1.15"
|
||||||
- task: Go@0
|
- task: Go@0
|
||||||
displayName: "go fmt ./..."
|
displayName: "go fmt ./..."
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -51,9 +51,9 @@ stages:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go 1.14"
|
displayName: "Install Go 1.15"
|
||||||
inputs:
|
inputs:
|
||||||
version: "1.14"
|
version: "1.15"
|
||||||
- task: Go@0
|
- task: Go@0
|
||||||
displayName: "Generate coverage"
|
displayName: "Generate coverage"
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -71,9 +71,9 @@ stages:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go 1.14"
|
displayName: "Install Go 1.15"
|
||||||
inputs:
|
inputs:
|
||||||
version: "1.14"
|
version: "1.15"
|
||||||
- script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
|
- script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
|
||||||
- task: Bash@3
|
- task: Bash@3
|
||||||
inputs:
|
inputs:
|
||||||
|
@ -86,9 +86,9 @@ stages:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go 1.14"
|
displayName: "Install Go 1.15"
|
||||||
inputs:
|
inputs:
|
||||||
version: "1.14"
|
version: "1.15"
|
||||||
- script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
|
- script: echo "##vso[task.setvariable variable=PATH]${PATH}:/home/vsts/go/bin/"
|
||||||
- script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml
|
- script: mkdir -p ${HOME}/go/src/github.com/pelletier/go-toml
|
||||||
- script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml
|
- script: cp -R . ${HOME}/go/src/github.com/pelletier/go-toml
|
||||||
|
@ -102,6 +102,15 @@ stages:
|
||||||
displayName: "unit tests"
|
displayName: "unit tests"
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
linux 1.15:
|
||||||
|
goVersion: '1.15'
|
||||||
|
imageName: 'ubuntu-latest'
|
||||||
|
mac 1.15:
|
||||||
|
goVersion: '1.15'
|
||||||
|
imageName: 'macOS-latest'
|
||||||
|
windows 1.15:
|
||||||
|
goVersion: '1.15'
|
||||||
|
imageName: 'windows-latest'
|
||||||
linux 1.14:
|
linux 1.14:
|
||||||
goVersion: '1.14'
|
goVersion: '1.14'
|
||||||
imageName: 'ubuntu-latest'
|
imageName: 'ubuntu-latest'
|
||||||
|
@ -111,15 +120,6 @@ stages:
|
||||||
windows 1.14:
|
windows 1.14:
|
||||||
goVersion: '1.14'
|
goVersion: '1.14'
|
||||||
imageName: 'windows-latest'
|
imageName: 'windows-latest'
|
||||||
linux 1.13:
|
|
||||||
goVersion: '1.13'
|
|
||||||
imageName: 'ubuntu-latest'
|
|
||||||
mac 1.13:
|
|
||||||
goVersion: '1.13'
|
|
||||||
imageName: 'macOS-latest'
|
|
||||||
windows 1.13:
|
|
||||||
goVersion: '1.13'
|
|
||||||
imageName: 'windows-latest'
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: $(imageName)
|
vmImage: $(imageName)
|
||||||
steps:
|
steps:
|
||||||
|
@ -155,7 +155,7 @@ stages:
|
||||||
- task: GoTool@0
|
- task: GoTool@0
|
||||||
displayName: "Install Go"
|
displayName: "Install Go"
|
||||||
inputs:
|
inputs:
|
||||||
version: 1.14
|
version: 1.15
|
||||||
- task: Bash@3
|
- task: Bash@3
|
||||||
inputs:
|
inputs:
|
||||||
targetType: inline
|
targetType: inline
|
||||||
|
|
|
@ -1,164 +0,0 @@
|
||||||
{
|
|
||||||
"array": {
|
|
||||||
"key1": [
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3
|
|
||||||
],
|
|
||||||
"key2": [
|
|
||||||
"red",
|
|
||||||
"yellow",
|
|
||||||
"green"
|
|
||||||
],
|
|
||||||
"key3": [
|
|
||||||
[
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
],
|
|
||||||
[
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"key4": [
|
|
||||||
[
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"a",
|
|
||||||
"b",
|
|
||||||
"c"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"key5": [
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3
|
|
||||||
],
|
|
||||||
"key6": [
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"boolean": {
|
|
||||||
"False": false,
|
|
||||||
"True": true
|
|
||||||
},
|
|
||||||
"datetime": {
|
|
||||||
"key1": "1979-05-27T07:32:00Z",
|
|
||||||
"key2": "1979-05-27T00:32:00-07:00",
|
|
||||||
"key3": "1979-05-27T00:32:00.999999-07:00"
|
|
||||||
},
|
|
||||||
"float": {
|
|
||||||
"both": {
|
|
||||||
"key": 6.626e-34
|
|
||||||
},
|
|
||||||
"exponent": {
|
|
||||||
"key1": 5e+22,
|
|
||||||
"key2": 1000000,
|
|
||||||
"key3": -0.02
|
|
||||||
},
|
|
||||||
"fractional": {
|
|
||||||
"key1": 1,
|
|
||||||
"key2": 3.1415,
|
|
||||||
"key3": -0.01
|
|
||||||
},
|
|
||||||
"underscores": {
|
|
||||||
"key1": 9224617.445991227,
|
|
||||||
"key2": 1e+100
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fruit": [{
|
|
||||||
"name": "apple",
|
|
||||||
"physical": {
|
|
||||||
"color": "red",
|
|
||||||
"shape": "round"
|
|
||||||
},
|
|
||||||
"variety": [{
|
|
||||||
"name": "red delicious"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "granny smith"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "banana",
|
|
||||||
"variety": [{
|
|
||||||
"name": "plantain"
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"integer": {
|
|
||||||
"key1": 99,
|
|
||||||
"key2": 42,
|
|
||||||
"key3": 0,
|
|
||||||
"key4": -17,
|
|
||||||
"underscores": {
|
|
||||||
"key1": 1000,
|
|
||||||
"key2": 5349221,
|
|
||||||
"key3": 12345
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"products": [{
|
|
||||||
"name": "Hammer",
|
|
||||||
"sku": 738594937
|
|
||||||
},
|
|
||||||
{},
|
|
||||||
{
|
|
||||||
"color": "gray",
|
|
||||||
"name": "Nail",
|
|
||||||
"sku": 284758393
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"string": {
|
|
||||||
"basic": {
|
|
||||||
"basic": "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."
|
|
||||||
},
|
|
||||||
"literal": {
|
|
||||||
"multiline": {
|
|
||||||
"lines": "The first newline is\ntrimmed in raw strings.\n All other whitespace\n is preserved.\n",
|
|
||||||
"regex2": "I [dw]on't need \\d{2} apples"
|
|
||||||
},
|
|
||||||
"quoted": "Tom \"Dubs\" Preston-Werner",
|
|
||||||
"regex": "\u003c\\i\\c*\\s*\u003e",
|
|
||||||
"winpath": "C:\\Users\\nodejs\\templates",
|
|
||||||
"winpath2": "\\\\ServerX\\admin$\\system32\\"
|
|
||||||
},
|
|
||||||
"multiline": {
|
|
||||||
"continued": {
|
|
||||||
"key1": "The quick brown fox jumps over the lazy dog.",
|
|
||||||
"key2": "The quick brown fox jumps over the lazy dog.",
|
|
||||||
"key3": "The quick brown fox jumps over the lazy dog."
|
|
||||||
},
|
|
||||||
"key1": "One\nTwo",
|
|
||||||
"key2": "One\nTwo",
|
|
||||||
"key3": "One\nTwo"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"table": {
|
|
||||||
"inline": {
|
|
||||||
"name": {
|
|
||||||
"first": "Tom",
|
|
||||||
"last": "Preston-Werner"
|
|
||||||
},
|
|
||||||
"point": {
|
|
||||||
"x": 1,
|
|
||||||
"y": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"key": "value",
|
|
||||||
"subtable": {
|
|
||||||
"key": "another value"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"x": {
|
|
||||||
"y": {
|
|
||||||
"z": {
|
|
||||||
"w": {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -20,11 +20,15 @@ git clone ${reference_git} ${ref_tempdir} >/dev/null 2>/dev/null
|
||||||
pushd ${ref_tempdir} >/dev/null
|
pushd ${ref_tempdir} >/dev/null
|
||||||
git checkout ${reference_ref} >/dev/null 2>/dev/null
|
git checkout ${reference_ref} >/dev/null 2>/dev/null
|
||||||
go test -bench=. -benchmem | tee ${ref_benchmark}
|
go test -bench=. -benchmem | tee ${ref_benchmark}
|
||||||
|
cd benchmark
|
||||||
|
go test -bench=. -benchmem | tee -a ${ref_benchmark}
|
||||||
popd >/dev/null
|
popd >/dev/null
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== local"
|
echo "=== local"
|
||||||
go test -bench=. -benchmem | tee ${local_benchmark}
|
go test -bench=. -benchmem | tee ${local_benchmark}
|
||||||
|
cd benchmark
|
||||||
|
go test -bench=. -benchmem | tee -a ${local_benchmark}
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "=== diff"
|
echo "=== diff"
|
||||||
|
|
|
@ -1,244 +0,0 @@
|
||||||
################################################################################
|
|
||||||
## Comment
|
|
||||||
|
|
||||||
# Speak your mind with the hash symbol. They go from the symbol to the end of
|
|
||||||
# the line.
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Table
|
|
||||||
|
|
||||||
# Tables (also known as hash tables or dictionaries) are collections of
|
|
||||||
# key/value pairs. They appear in square brackets on a line by themselves.
|
|
||||||
|
|
||||||
[table]
|
|
||||||
|
|
||||||
key = "value" # Yeah, you can do this.
|
|
||||||
|
|
||||||
# Nested tables are denoted by table names with dots in them. Name your tables
|
|
||||||
# whatever crap you please, just don't use #, ., [ or ].
|
|
||||||
|
|
||||||
[table.subtable]
|
|
||||||
|
|
||||||
key = "another value"
|
|
||||||
|
|
||||||
# You don't need to specify all the super-tables if you don't want to. TOML
|
|
||||||
# knows how to do it for you.
|
|
||||||
|
|
||||||
# [x] you
|
|
||||||
# [x.y] don't
|
|
||||||
# [x.y.z] need these
|
|
||||||
[x.y.z.w] # for this to work
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Inline Table
|
|
||||||
|
|
||||||
# Inline tables provide a more compact syntax for expressing tables. They are
|
|
||||||
# especially useful for grouped data that can otherwise quickly become verbose.
|
|
||||||
# Inline tables are enclosed in curly braces `{` and `}`. No newlines are
|
|
||||||
# allowed between the curly braces unless they are valid within a value.
|
|
||||||
|
|
||||||
[table.inline]
|
|
||||||
|
|
||||||
name = { first = "Tom", last = "Preston-Werner" }
|
|
||||||
point = { x = 1, y = 2 }
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## String
|
|
||||||
|
|
||||||
# There are four ways to express strings: basic, multi-line basic, literal, and
|
|
||||||
# multi-line literal. All strings must contain only valid UTF-8 characters.
|
|
||||||
|
|
||||||
[string.basic]
|
|
||||||
|
|
||||||
basic = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."
|
|
||||||
|
|
||||||
[string.multiline]
|
|
||||||
|
|
||||||
# The following strings are byte-for-byte equivalent:
|
|
||||||
key1 = "One\nTwo"
|
|
||||||
key2 = """One\nTwo"""
|
|
||||||
key3 = """
|
|
||||||
One
|
|
||||||
Two"""
|
|
||||||
|
|
||||||
[string.multiline.continued]
|
|
||||||
|
|
||||||
# The following strings are byte-for-byte equivalent:
|
|
||||||
key1 = "The quick brown fox jumps over the lazy dog."
|
|
||||||
|
|
||||||
key2 = """
|
|
||||||
The quick brown \
|
|
||||||
|
|
||||||
|
|
||||||
fox jumps over \
|
|
||||||
the lazy dog."""
|
|
||||||
|
|
||||||
key3 = """\
|
|
||||||
The quick brown \
|
|
||||||
fox jumps over \
|
|
||||||
the lazy dog.\
|
|
||||||
"""
|
|
||||||
|
|
||||||
[string.literal]
|
|
||||||
|
|
||||||
# What you see is what you get.
|
|
||||||
winpath = 'C:\Users\nodejs\templates'
|
|
||||||
winpath2 = '\\ServerX\admin$\system32\'
|
|
||||||
quoted = 'Tom "Dubs" Preston-Werner'
|
|
||||||
regex = '<\i\c*\s*>'
|
|
||||||
|
|
||||||
|
|
||||||
[string.literal.multiline]
|
|
||||||
|
|
||||||
regex2 = '''I [dw]on't need \d{2} apples'''
|
|
||||||
lines = '''
|
|
||||||
The first newline is
|
|
||||||
trimmed in raw strings.
|
|
||||||
All other whitespace
|
|
||||||
is preserved.
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Integer
|
|
||||||
|
|
||||||
# Integers are whole numbers. Positive numbers may be prefixed with a plus sign.
|
|
||||||
# Negative numbers are prefixed with a minus sign.
|
|
||||||
|
|
||||||
[integer]
|
|
||||||
|
|
||||||
key1 = +99
|
|
||||||
key2 = 42
|
|
||||||
key3 = 0
|
|
||||||
key4 = -17
|
|
||||||
|
|
||||||
[integer.underscores]
|
|
||||||
|
|
||||||
# For large numbers, you may use underscores to enhance readability. Each
|
|
||||||
# underscore must be surrounded by at least one digit.
|
|
||||||
key1 = 1_000
|
|
||||||
key2 = 5_349_221
|
|
||||||
key3 = 1_2_3_4_5 # valid but inadvisable
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Float
|
|
||||||
|
|
||||||
# A float consists of an integer part (which may be prefixed with a plus or
|
|
||||||
# minus sign) followed by a fractional part and/or an exponent part.
|
|
||||||
|
|
||||||
[float.fractional]
|
|
||||||
|
|
||||||
key1 = +1.0
|
|
||||||
key2 = 3.1415
|
|
||||||
key3 = -0.01
|
|
||||||
|
|
||||||
[float.exponent]
|
|
||||||
|
|
||||||
key1 = 5e+22
|
|
||||||
key2 = 1e6
|
|
||||||
key3 = -2E-2
|
|
||||||
|
|
||||||
[float.both]
|
|
||||||
|
|
||||||
key = 6.626e-34
|
|
||||||
|
|
||||||
[float.underscores]
|
|
||||||
|
|
||||||
key1 = 9_224_617.445_991_228_313
|
|
||||||
key2 = 1e1_00
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Boolean
|
|
||||||
|
|
||||||
# Booleans are just the tokens you're used to. Always lowercase.
|
|
||||||
|
|
||||||
[boolean]
|
|
||||||
|
|
||||||
True = true
|
|
||||||
False = false
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Datetime
|
|
||||||
|
|
||||||
# Datetimes are RFC 3339 dates.
|
|
||||||
|
|
||||||
[datetime]
|
|
||||||
|
|
||||||
key1 = 1979-05-27T07:32:00Z
|
|
||||||
key2 = 1979-05-27T00:32:00-07:00
|
|
||||||
key3 = 1979-05-27T00:32:00.999999-07:00
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Array
|
|
||||||
|
|
||||||
# Arrays are square brackets with other primitives inside. Whitespace is
|
|
||||||
# ignored. Elements are separated by commas. Data types may not be mixed.
|
|
||||||
|
|
||||||
[array]
|
|
||||||
|
|
||||||
key1 = [ 1, 2, 3 ]
|
|
||||||
key2 = [ "red", "yellow", "green" ]
|
|
||||||
key3 = [ [ 1, 2 ], [3, 4, 5] ]
|
|
||||||
#key4 = [ [ 1, 2 ], ["a", "b", "c"] ] # this is ok
|
|
||||||
|
|
||||||
# Arrays can also be multiline. So in addition to ignoring whitespace, arrays
|
|
||||||
# also ignore newlines between the brackets. Terminating commas are ok before
|
|
||||||
# the closing bracket.
|
|
||||||
|
|
||||||
key5 = [
|
|
||||||
1, 2, 3
|
|
||||||
]
|
|
||||||
key6 = [
|
|
||||||
1,
|
|
||||||
2, # this is ok
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
## Array of Tables
|
|
||||||
|
|
||||||
# These can be expressed by using a table name in double brackets. Each table
|
|
||||||
# with the same double bracketed name will be an element in the array. The
|
|
||||||
# tables are inserted in the order encountered.
|
|
||||||
|
|
||||||
[[products]]
|
|
||||||
|
|
||||||
name = "Hammer"
|
|
||||||
sku = 738594937
|
|
||||||
|
|
||||||
[[products]]
|
|
||||||
|
|
||||||
[[products]]
|
|
||||||
|
|
||||||
name = "Nail"
|
|
||||||
sku = 284758393
|
|
||||||
color = "gray"
|
|
||||||
|
|
||||||
|
|
||||||
# You can create nested arrays of tables as well.
|
|
||||||
|
|
||||||
[[fruit]]
|
|
||||||
name = "apple"
|
|
||||||
|
|
||||||
[fruit.physical]
|
|
||||||
color = "red"
|
|
||||||
shape = "round"
|
|
||||||
|
|
||||||
[[fruit.variety]]
|
|
||||||
name = "red delicious"
|
|
||||||
|
|
||||||
[[fruit.variety]]
|
|
||||||
name = "granny smith"
|
|
||||||
|
|
||||||
[[fruit]]
|
|
||||||
name = "banana"
|
|
||||||
|
|
||||||
[[fruit.variety]]
|
|
||||||
name = "plantain"
|
|
|
@ -1,121 +0,0 @@
|
||||||
---
|
|
||||||
array:
|
|
||||||
key1:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
key2:
|
|
||||||
- red
|
|
||||||
- yellow
|
|
||||||
- green
|
|
||||||
key3:
|
|
||||||
- - 1
|
|
||||||
- 2
|
|
||||||
- - 3
|
|
||||||
- 4
|
|
||||||
- 5
|
|
||||||
key4:
|
|
||||||
- - 1
|
|
||||||
- 2
|
|
||||||
- - a
|
|
||||||
- b
|
|
||||||
- c
|
|
||||||
key5:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
- 3
|
|
||||||
key6:
|
|
||||||
- 1
|
|
||||||
- 2
|
|
||||||
boolean:
|
|
||||||
'False': false
|
|
||||||
'True': true
|
|
||||||
datetime:
|
|
||||||
key1: '1979-05-27T07:32:00Z'
|
|
||||||
key2: '1979-05-27T00:32:00-07:00'
|
|
||||||
key3: '1979-05-27T00:32:00.999999-07:00'
|
|
||||||
float:
|
|
||||||
both:
|
|
||||||
key: 6.626e-34
|
|
||||||
exponent:
|
|
||||||
key1: 5.0e+22
|
|
||||||
key2: 1000000
|
|
||||||
key3: -0.02
|
|
||||||
fractional:
|
|
||||||
key1: 1
|
|
||||||
key2: 3.1415
|
|
||||||
key3: -0.01
|
|
||||||
underscores:
|
|
||||||
key1: 9224617.445991227
|
|
||||||
key2: 1.0e+100
|
|
||||||
fruit:
|
|
||||||
- name: apple
|
|
||||||
physical:
|
|
||||||
color: red
|
|
||||||
shape: round
|
|
||||||
variety:
|
|
||||||
- name: red delicious
|
|
||||||
- name: granny smith
|
|
||||||
- name: banana
|
|
||||||
variety:
|
|
||||||
- name: plantain
|
|
||||||
integer:
|
|
||||||
key1: 99
|
|
||||||
key2: 42
|
|
||||||
key3: 0
|
|
||||||
key4: -17
|
|
||||||
underscores:
|
|
||||||
key1: 1000
|
|
||||||
key2: 5349221
|
|
||||||
key3: 12345
|
|
||||||
products:
|
|
||||||
- name: Hammer
|
|
||||||
sku: 738594937
|
|
||||||
- {}
|
|
||||||
- color: gray
|
|
||||||
name: Nail
|
|
||||||
sku: 284758393
|
|
||||||
string:
|
|
||||||
basic:
|
|
||||||
basic: "I'm a string. \"You can quote me\". Name\tJosé\nLocation\tSF."
|
|
||||||
literal:
|
|
||||||
multiline:
|
|
||||||
lines: |
|
|
||||||
The first newline is
|
|
||||||
trimmed in raw strings.
|
|
||||||
All other whitespace
|
|
||||||
is preserved.
|
|
||||||
regex2: I [dw]on't need \d{2} apples
|
|
||||||
quoted: Tom "Dubs" Preston-Werner
|
|
||||||
regex: "<\\i\\c*\\s*>"
|
|
||||||
winpath: C:\Users\nodejs\templates
|
|
||||||
winpath2: "\\\\ServerX\\admin$\\system32\\"
|
|
||||||
multiline:
|
|
||||||
continued:
|
|
||||||
key1: The quick brown fox jumps over the lazy dog.
|
|
||||||
key2: The quick brown fox jumps over the lazy dog.
|
|
||||||
key3: The quick brown fox jumps over the lazy dog.
|
|
||||||
key1: |-
|
|
||||||
One
|
|
||||||
Two
|
|
||||||
key2: |-
|
|
||||||
One
|
|
||||||
Two
|
|
||||||
key3: |-
|
|
||||||
One
|
|
||||||
Two
|
|
||||||
table:
|
|
||||||
inline:
|
|
||||||
name:
|
|
||||||
first: Tom
|
|
||||||
last: Preston-Werner
|
|
||||||
point:
|
|
||||||
x: 1
|
|
||||||
y: 2
|
|
||||||
key: value
|
|
||||||
subtable:
|
|
||||||
key: another value
|
|
||||||
x:
|
|
||||||
y:
|
|
||||||
z:
|
|
||||||
w: {}
|
|
|
@ -2,8 +2,4 @@ module github.com/pelletier/go-toml
|
||||||
|
|
||||||
go 1.12
|
go 1.12
|
||||||
|
|
||||||
require (
|
require github.com/davecgh/go-spew v1.1.1
|
||||||
github.com/BurntSushi/toml v0.3.1
|
|
||||||
github.com/davecgh/go-spew v1.1.1
|
|
||||||
gopkg.in/yaml.v2 v2.3.0
|
|
||||||
)
|
|
||||||
|
|
|
@ -306,7 +306,7 @@ func (l *tomlLexer) lexComma() tomlLexStateFn {
|
||||||
// Parse the key and emits its value without escape sequences.
|
// Parse the key and emits its value without escape sequences.
|
||||||
// bare keys, basic string keys and literal string keys are supported.
|
// bare keys, basic string keys and literal string keys are supported.
|
||||||
func (l *tomlLexer) lexKey() tomlLexStateFn {
|
func (l *tomlLexer) lexKey() tomlLexStateFn {
|
||||||
growingString := ""
|
var sb strings.Builder
|
||||||
|
|
||||||
for r := l.peek(); isKeyChar(r) || r == '\n' || r == '\r'; r = l.peek() {
|
for r := l.peek(); isKeyChar(r) || r == '\n' || r == '\r'; r = l.peek() {
|
||||||
if r == '"' {
|
if r == '"' {
|
||||||
|
@ -315,7 +315,9 @@ func (l *tomlLexer) lexKey() tomlLexStateFn {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return l.errorf(err.Error())
|
return l.errorf(err.Error())
|
||||||
}
|
}
|
||||||
growingString += "\"" + str + "\""
|
sb.WriteString("\"")
|
||||||
|
sb.WriteString(str)
|
||||||
|
sb.WriteString("\"")
|
||||||
l.next()
|
l.next()
|
||||||
continue
|
continue
|
||||||
} else if r == '\'' {
|
} else if r == '\'' {
|
||||||
|
@ -324,41 +326,45 @@ func (l *tomlLexer) lexKey() tomlLexStateFn {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return l.errorf(err.Error())
|
return l.errorf(err.Error())
|
||||||
}
|
}
|
||||||
growingString += "'" + str + "'"
|
sb.WriteString("'")
|
||||||
|
sb.WriteString(str)
|
||||||
|
sb.WriteString("'")
|
||||||
l.next()
|
l.next()
|
||||||
continue
|
continue
|
||||||
} else if r == '\n' {
|
} else if r == '\n' {
|
||||||
return l.errorf("keys cannot contain new lines")
|
return l.errorf("keys cannot contain new lines")
|
||||||
} else if isSpace(r) {
|
} else if isSpace(r) {
|
||||||
str := " "
|
var str strings.Builder
|
||||||
|
str.WriteString(" ")
|
||||||
|
|
||||||
// skip trailing whitespace
|
// skip trailing whitespace
|
||||||
l.next()
|
l.next()
|
||||||
for r = l.peek(); isSpace(r); r = l.peek() {
|
for r = l.peek(); isSpace(r); r = l.peek() {
|
||||||
str += string(r)
|
str.WriteRune(r)
|
||||||
l.next()
|
l.next()
|
||||||
}
|
}
|
||||||
// break loop if not a dot
|
// break loop if not a dot
|
||||||
if r != '.' {
|
if r != '.' {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
str += "."
|
str.WriteString(".")
|
||||||
// skip trailing whitespace after dot
|
// skip trailing whitespace after dot
|
||||||
l.next()
|
l.next()
|
||||||
for r = l.peek(); isSpace(r); r = l.peek() {
|
for r = l.peek(); isSpace(r); r = l.peek() {
|
||||||
str += string(r)
|
str.WriteRune(r)
|
||||||
l.next()
|
l.next()
|
||||||
}
|
}
|
||||||
growingString += str
|
sb.WriteString(str.String())
|
||||||
continue
|
continue
|
||||||
} else if r == '.' {
|
} else if r == '.' {
|
||||||
// skip
|
// skip
|
||||||
} else if !isValidBareChar(r) {
|
} else if !isValidBareChar(r) {
|
||||||
return l.errorf("keys cannot contain %c character", r)
|
return l.errorf("keys cannot contain %c character", r)
|
||||||
}
|
}
|
||||||
growingString += string(r)
|
sb.WriteRune(r)
|
||||||
l.next()
|
l.next()
|
||||||
}
|
}
|
||||||
l.emitWithValue(tokenKey, growingString)
|
l.emitWithValue(tokenKey, sb.String())
|
||||||
return l.lexVoid
|
return l.lexVoid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +389,7 @@ func (l *tomlLexer) lexLeftBracket() tomlLexStateFn {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *tomlLexer) lexLiteralStringAsString(terminator string, discardLeadingNewLine bool) (string, error) {
|
func (l *tomlLexer) lexLiteralStringAsString(terminator string, discardLeadingNewLine bool) (string, error) {
|
||||||
growingString := ""
|
var sb strings.Builder
|
||||||
|
|
||||||
if discardLeadingNewLine {
|
if discardLeadingNewLine {
|
||||||
if l.follow("\r\n") {
|
if l.follow("\r\n") {
|
||||||
|
@ -397,14 +403,14 @@ func (l *tomlLexer) lexLiteralStringAsString(terminator string, discardLeadingNe
|
||||||
// find end of string
|
// find end of string
|
||||||
for {
|
for {
|
||||||
if l.follow(terminator) {
|
if l.follow(terminator) {
|
||||||
return growingString, nil
|
return sb.String(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
next := l.peek()
|
next := l.peek()
|
||||||
if next == eof {
|
if next == eof {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
growingString += string(l.next())
|
sb.WriteRune(l.next())
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", errors.New("unclosed string")
|
return "", errors.New("unclosed string")
|
||||||
|
@ -438,7 +444,7 @@ func (l *tomlLexer) lexLiteralString() tomlLexStateFn {
|
||||||
// Terminator is the substring indicating the end of the token.
|
// Terminator is the substring indicating the end of the token.
|
||||||
// The resulting string does not include the terminator.
|
// The resulting string does not include the terminator.
|
||||||
func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine, acceptNewLines bool) (string, error) {
|
func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine, acceptNewLines bool) (string, error) {
|
||||||
growingString := ""
|
var sb strings.Builder
|
||||||
|
|
||||||
if discardLeadingNewLine {
|
if discardLeadingNewLine {
|
||||||
if l.follow("\r\n") {
|
if l.follow("\r\n") {
|
||||||
|
@ -451,7 +457,7 @@ func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine,
|
||||||
|
|
||||||
for {
|
for {
|
||||||
if l.follow(terminator) {
|
if l.follow(terminator) {
|
||||||
return growingString, nil
|
return sb.String(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if l.follow("\\") {
|
if l.follow("\\") {
|
||||||
|
@ -469,61 +475,61 @@ func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine,
|
||||||
l.next()
|
l.next()
|
||||||
}
|
}
|
||||||
case '"':
|
case '"':
|
||||||
growingString += "\""
|
sb.WriteString("\"")
|
||||||
l.next()
|
l.next()
|
||||||
case 'n':
|
case 'n':
|
||||||
growingString += "\n"
|
sb.WriteString("\n")
|
||||||
l.next()
|
l.next()
|
||||||
case 'b':
|
case 'b':
|
||||||
growingString += "\b"
|
sb.WriteString("\b")
|
||||||
l.next()
|
l.next()
|
||||||
case 'f':
|
case 'f':
|
||||||
growingString += "\f"
|
sb.WriteString("\f")
|
||||||
l.next()
|
l.next()
|
||||||
case '/':
|
case '/':
|
||||||
growingString += "/"
|
sb.WriteString("/")
|
||||||
l.next()
|
l.next()
|
||||||
case 't':
|
case 't':
|
||||||
growingString += "\t"
|
sb.WriteString("\t")
|
||||||
l.next()
|
l.next()
|
||||||
case 'r':
|
case 'r':
|
||||||
growingString += "\r"
|
sb.WriteString("\r")
|
||||||
l.next()
|
l.next()
|
||||||
case '\\':
|
case '\\':
|
||||||
growingString += "\\"
|
sb.WriteString("\\")
|
||||||
l.next()
|
l.next()
|
||||||
case 'u':
|
case 'u':
|
||||||
l.next()
|
l.next()
|
||||||
code := ""
|
var code strings.Builder
|
||||||
for i := 0; i < 4; i++ {
|
for i := 0; i < 4; i++ {
|
||||||
c := l.peek()
|
c := l.peek()
|
||||||
if !isHexDigit(c) {
|
if !isHexDigit(c) {
|
||||||
return "", errors.New("unfinished unicode escape")
|
return "", errors.New("unfinished unicode escape")
|
||||||
}
|
}
|
||||||
l.next()
|
l.next()
|
||||||
code = code + string(c)
|
code.WriteRune(c)
|
||||||
}
|
}
|
||||||
intcode, err := strconv.ParseInt(code, 16, 32)
|
intcode, err := strconv.ParseInt(code.String(), 16, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.New("invalid unicode escape: \\u" + code)
|
return "", errors.New("invalid unicode escape: \\u" + code.String())
|
||||||
}
|
}
|
||||||
growingString += string(rune(intcode))
|
sb.WriteRune(rune(intcode))
|
||||||
case 'U':
|
case 'U':
|
||||||
l.next()
|
l.next()
|
||||||
code := ""
|
var code strings.Builder
|
||||||
for i := 0; i < 8; i++ {
|
for i := 0; i < 8; i++ {
|
||||||
c := l.peek()
|
c := l.peek()
|
||||||
if !isHexDigit(c) {
|
if !isHexDigit(c) {
|
||||||
return "", errors.New("unfinished unicode escape")
|
return "", errors.New("unfinished unicode escape")
|
||||||
}
|
}
|
||||||
l.next()
|
l.next()
|
||||||
code = code + string(c)
|
code.WriteRune(c)
|
||||||
}
|
}
|
||||||
intcode, err := strconv.ParseInt(code, 16, 64)
|
intcode, err := strconv.ParseInt(code.String(), 16, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", errors.New("invalid unicode escape: \\U" + code)
|
return "", errors.New("invalid unicode escape: \\U" + code.String())
|
||||||
}
|
}
|
||||||
growingString += string(rune(intcode))
|
sb.WriteRune(rune(intcode))
|
||||||
default:
|
default:
|
||||||
return "", errors.New("invalid escape sequence: \\" + string(l.peek()))
|
return "", errors.New("invalid escape sequence: \\" + string(l.peek()))
|
||||||
}
|
}
|
||||||
|
@ -534,7 +540,7 @@ func (l *tomlLexer) lexStringAsString(terminator string, discardLeadingNewLine,
|
||||||
return "", fmt.Errorf("unescaped control character %U", r)
|
return "", fmt.Errorf("unescaped control character %U", r)
|
||||||
}
|
}
|
||||||
l.next()
|
l.next()
|
||||||
growingString += string(r)
|
sb.WriteRune(r)
|
||||||
}
|
}
|
||||||
|
|
||||||
if l.peek() == eof {
|
if l.peek() == eof {
|
||||||
|
@ -769,19 +775,19 @@ func init() {
|
||||||
// /!\ also matches the empty string
|
// /!\ also matches the empty string
|
||||||
//
|
//
|
||||||
// Example matches:
|
// Example matches:
|
||||||
//1979-05-27T07:32:00Z
|
// 1979-05-27T07:32:00Z
|
||||||
//1979-05-27T00:32:00-07:00
|
// 1979-05-27T00:32:00-07:00
|
||||||
//1979-05-27T00:32:00.999999-07:00
|
// 1979-05-27T00:32:00.999999-07:00
|
||||||
//1979-05-27 07:32:00Z
|
// 1979-05-27 07:32:00Z
|
||||||
//1979-05-27 00:32:00-07:00
|
// 1979-05-27 00:32:00-07:00
|
||||||
//1979-05-27 00:32:00.999999-07:00
|
// 1979-05-27 00:32:00.999999-07:00
|
||||||
//1979-05-27T07:32:00
|
// 1979-05-27T07:32:00
|
||||||
//1979-05-27T00:32:00.999999
|
// 1979-05-27T00:32:00.999999
|
||||||
//1979-05-27 07:32:00
|
// 1979-05-27 07:32:00
|
||||||
//1979-05-27 00:32:00.999999
|
// 1979-05-27 00:32:00.999999
|
||||||
//1979-05-27
|
// 1979-05-27
|
||||||
//07:32:00
|
// 07:32:00
|
||||||
//00:32:00.999999
|
// 00:32:00.999999
|
||||||
dateRegexp = regexp.MustCompile(`^(?:\d{1,4}-\d{2}-\d{2})?(?:[T ]?\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})?)?`)
|
dateRegexp = regexp.MustCompile(`^(?:\d{1,4}-\d{2}-\d{2})?(?:[T ]?\d{2}:\d{2}:\d{2}(\.\d{1,9})?(Z|[+-]\d{2}:\d{2})?)?`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,7 @@ var textUnmarshalerType = reflect.TypeOf(new(encoding.TextUnmarshaler)).Elem()
|
||||||
var localDateType = reflect.TypeOf(LocalDate{})
|
var localDateType = reflect.TypeOf(LocalDate{})
|
||||||
var localTimeType = reflect.TypeOf(LocalTime{})
|
var localTimeType = reflect.TypeOf(LocalTime{})
|
||||||
var localDateTimeType = reflect.TypeOf(LocalDateTime{})
|
var localDateTimeType = reflect.TypeOf(LocalDateTime{})
|
||||||
|
var mapStringInterfaceType = reflect.TypeOf(map[string]interface{}{})
|
||||||
|
|
||||||
// Check if the given marshal type maps to a Tree primitive
|
// Check if the given marshal type maps to a Tree primitive
|
||||||
func isPrimitive(mtype reflect.Type) bool {
|
func isPrimitive(mtype reflect.Type) bool {
|
||||||
|
@ -436,6 +437,7 @@ func (e *Encoder) valueToTree(mtype reflect.Type, mval reflect.Value) (*Tree, er
|
||||||
if tree, ok := val.(*Tree); ok && mtypef.Anonymous && !opts.nameFromTag && !e.promoteAnon {
|
if tree, ok := val.(*Tree); ok && mtypef.Anonymous && !opts.nameFromTag && !e.promoteAnon {
|
||||||
e.appendTree(tval, tree)
|
e.appendTree(tval, tree)
|
||||||
} else {
|
} else {
|
||||||
|
val = e.wrapTomlValue(val, tval)
|
||||||
tval.SetPathWithOptions([]string{opts.name}, SetOptions{
|
tval.SetPathWithOptions([]string{opts.name}, SetOptions{
|
||||||
Comment: opts.comment,
|
Comment: opts.comment,
|
||||||
Commented: opts.commented,
|
Commented: opts.commented,
|
||||||
|
@ -474,6 +476,7 @@ func (e *Encoder) valueToTree(mtype reflect.Type, mval reflect.Value) (*Tree, er
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
val = e.wrapTomlValue(val, tval)
|
||||||
if e.quoteMapKeys {
|
if e.quoteMapKeys {
|
||||||
keyStr, err := tomlValueStringRepresentation(key.String(), "", "", e.order, e.arraysOneElementPerLine)
|
keyStr, err := tomlValueStringRepresentation(key.String(), "", "", e.order, e.arraysOneElementPerLine)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -516,13 +519,13 @@ func (e *Encoder) valueToOtherSlice(mtype reflect.Type, mval reflect.Value) (int
|
||||||
|
|
||||||
// Convert given marshal value to toml value
|
// Convert given marshal value to toml value
|
||||||
func (e *Encoder) valueToToml(mtype reflect.Type, mval reflect.Value) (interface{}, error) {
|
func (e *Encoder) valueToToml(mtype reflect.Type, mval reflect.Value) (interface{}, error) {
|
||||||
e.line++
|
|
||||||
if mtype.Kind() == reflect.Ptr {
|
if mtype.Kind() == reflect.Ptr {
|
||||||
switch {
|
switch {
|
||||||
case isCustomMarshaler(mtype):
|
case isCustomMarshaler(mtype):
|
||||||
return callCustomMarshaler(mval)
|
return callCustomMarshaler(mval)
|
||||||
case isTextMarshaler(mtype):
|
case isTextMarshaler(mtype):
|
||||||
return callTextMarshaler(mval)
|
b, err := callTextMarshaler(mval)
|
||||||
|
return string(b), err
|
||||||
default:
|
default:
|
||||||
return e.valueToToml(mtype.Elem(), mval.Elem())
|
return e.valueToToml(mtype.Elem(), mval.Elem())
|
||||||
}
|
}
|
||||||
|
@ -534,7 +537,8 @@ func (e *Encoder) valueToToml(mtype reflect.Type, mval reflect.Value) (interface
|
||||||
case isCustomMarshaler(mtype):
|
case isCustomMarshaler(mtype):
|
||||||
return callCustomMarshaler(mval)
|
return callCustomMarshaler(mval)
|
||||||
case isTextMarshaler(mtype):
|
case isTextMarshaler(mtype):
|
||||||
return callTextMarshaler(mval)
|
b, err := callTextMarshaler(mval)
|
||||||
|
return string(b), err
|
||||||
case isTree(mtype):
|
case isTree(mtype):
|
||||||
return e.valueToTree(mtype, mval)
|
return e.valueToTree(mtype, mval)
|
||||||
case isOtherSequence(mtype), isCustomMarshalerSequence(mtype), isTextMarshalerSequence(mtype):
|
case isOtherSequence(mtype), isCustomMarshalerSequence(mtype), isTextMarshalerSequence(mtype):
|
||||||
|
@ -577,6 +581,25 @@ func (e *Encoder) appendTree(t, o *Tree) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Create a toml value with the current line number as the position line
|
||||||
|
func (e *Encoder) wrapTomlValue(val interface{}, parent *Tree) interface{} {
|
||||||
|
_, isTree := val.(*Tree)
|
||||||
|
_, isTreeS := val.([]*Tree)
|
||||||
|
if isTree || isTreeS {
|
||||||
|
return val
|
||||||
|
}
|
||||||
|
|
||||||
|
ret := &tomlValue{
|
||||||
|
value: val,
|
||||||
|
position: Position{
|
||||||
|
e.line,
|
||||||
|
parent.position.Col,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
e.line++
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
// Unmarshal attempts to unmarshal the Tree into a Go struct pointed by v.
|
// Unmarshal attempts to unmarshal the Tree into a Go struct pointed by v.
|
||||||
// Neither Unmarshaler interfaces nor UnmarshalTOML functions are supported for
|
// Neither Unmarshaler interfaces nor UnmarshalTOML functions are supported for
|
||||||
// sub-structs, and only definite types can be unmarshaled.
|
// sub-structs, and only definite types can be unmarshaled.
|
||||||
|
@ -681,6 +704,8 @@ func (d *Decoder) unmarshal(v interface{}) error {
|
||||||
|
|
||||||
switch elem.Kind() {
|
switch elem.Kind() {
|
||||||
case reflect.Struct, reflect.Map:
|
case reflect.Struct, reflect.Map:
|
||||||
|
case reflect.Interface:
|
||||||
|
elem = mapStringInterfaceType
|
||||||
default:
|
default:
|
||||||
return errors.New("only a pointer to struct or map can be unmarshaled from TOML")
|
return errors.New("only a pointer to struct or map can be unmarshaled from TOML")
|
||||||
}
|
}
|
||||||
|
@ -717,6 +742,10 @@ func (d *Decoder) valueFromTree(mtype reflect.Type, tval *Tree, mval1 *reflect.V
|
||||||
if mvalPtr := reflect.New(mtype); isCustomUnmarshaler(mvalPtr.Type()) {
|
if mvalPtr := reflect.New(mtype); isCustomUnmarshaler(mvalPtr.Type()) {
|
||||||
d.visitor.visitAll()
|
d.visitor.visitAll()
|
||||||
|
|
||||||
|
if tval == nil {
|
||||||
|
return mvalPtr.Elem(), nil
|
||||||
|
}
|
||||||
|
|
||||||
if err := callCustomUnmarshaler(mvalPtr, tval.ToMap()); err != nil {
|
if err := callCustomUnmarshaler(mvalPtr, tval.ToMap()); err != nil {
|
||||||
return reflect.ValueOf(nil), fmt.Errorf("unmarshal toml: %v", err)
|
return reflect.ValueOf(nil), fmt.Errorf("unmarshal toml: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,6 +122,89 @@ func (t *Tree) GetPath(keys []string) interface{} {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetArray returns the value at key in the Tree.
|
||||||
|
// It returns []string, []int64, etc type if key has homogeneous lists
|
||||||
|
// Key is a dot-separated path (e.g. a.b.c) without single/double quoted strings.
|
||||||
|
// Returns nil if the path does not exist in the tree.
|
||||||
|
// If keys is of length zero, the current tree is returned.
|
||||||
|
func (t *Tree) GetArray(key string) interface{} {
|
||||||
|
if key == "" {
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
return t.GetArrayPath(strings.Split(key, "."))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetArrayPath returns the element in the tree indicated by 'keys'.
|
||||||
|
// If keys is of length zero, the current tree is returned.
|
||||||
|
func (t *Tree) GetArrayPath(keys []string) interface{} {
|
||||||
|
if len(keys) == 0 {
|
||||||
|
return t
|
||||||
|
}
|
||||||
|
subtree := t
|
||||||
|
for _, intermediateKey := range keys[:len(keys)-1] {
|
||||||
|
value, exists := subtree.values[intermediateKey]
|
||||||
|
if !exists {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
switch node := value.(type) {
|
||||||
|
case *Tree:
|
||||||
|
subtree = node
|
||||||
|
case []*Tree:
|
||||||
|
// go to most recent element
|
||||||
|
if len(node) == 0 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
subtree = node[len(node)-1]
|
||||||
|
default:
|
||||||
|
return nil // cannot navigate through other node types
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// branch based on final node type
|
||||||
|
switch node := subtree.values[keys[len(keys)-1]].(type) {
|
||||||
|
case *tomlValue:
|
||||||
|
switch n := node.value.(type) {
|
||||||
|
case []interface{}:
|
||||||
|
return getArray(n)
|
||||||
|
default:
|
||||||
|
return node.value
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return node
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if homogeneous array, then return slice type object over []interface{}
|
||||||
|
func getArray(n []interface{}) interface{} {
|
||||||
|
var s []string
|
||||||
|
var i64 []int64
|
||||||
|
var f64 []float64
|
||||||
|
var bl []bool
|
||||||
|
for _, value := range n {
|
||||||
|
switch v := value.(type) {
|
||||||
|
case string:
|
||||||
|
s = append(s, v)
|
||||||
|
case int64:
|
||||||
|
i64 = append(i64, v)
|
||||||
|
case float64:
|
||||||
|
f64 = append(f64, v)
|
||||||
|
case bool:
|
||||||
|
bl = append(bl, v)
|
||||||
|
default:
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(s) == len(n) {
|
||||||
|
return s
|
||||||
|
} else if len(i64) == len(n) {
|
||||||
|
return i64
|
||||||
|
} else if len(f64) == len(n) {
|
||||||
|
return f64
|
||||||
|
} else if len(bl) == len(n) {
|
||||||
|
return bl
|
||||||
|
}
|
||||||
|
return n
|
||||||
|
}
|
||||||
|
|
||||||
// GetPosition returns the position of the given key.
|
// GetPosition returns the position of the given key.
|
||||||
func (t *Tree) GetPosition(key string) Position {
|
func (t *Tree) GetPosition(key string) Position {
|
||||||
if key == "" {
|
if key == "" {
|
||||||
|
@ -130,6 +213,50 @@ func (t *Tree) GetPosition(key string) Position {
|
||||||
return t.GetPositionPath(strings.Split(key, "."))
|
return t.GetPositionPath(strings.Split(key, "."))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetPositionPath sets the position of element in the tree indicated by 'keys'.
|
||||||
|
// If keys is of length zero, the current tree position is set.
|
||||||
|
func (t *Tree) SetPositionPath(keys []string, pos Position) {
|
||||||
|
if len(keys) == 0 {
|
||||||
|
t.position = pos
|
||||||
|
return
|
||||||
|
}
|
||||||
|
subtree := t
|
||||||
|
for _, intermediateKey := range keys[:len(keys)-1] {
|
||||||
|
value, exists := subtree.values[intermediateKey]
|
||||||
|
if !exists {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
switch node := value.(type) {
|
||||||
|
case *Tree:
|
||||||
|
subtree = node
|
||||||
|
case []*Tree:
|
||||||
|
// go to most recent element
|
||||||
|
if len(node) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
subtree = node[len(node)-1]
|
||||||
|
default:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// branch based on final node type
|
||||||
|
switch node := subtree.values[keys[len(keys)-1]].(type) {
|
||||||
|
case *tomlValue:
|
||||||
|
node.position = pos
|
||||||
|
return
|
||||||
|
case *Tree:
|
||||||
|
node.position = pos
|
||||||
|
return
|
||||||
|
case []*Tree:
|
||||||
|
// go to most recent element
|
||||||
|
if len(node) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
node[len(node)-1].position = pos
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// GetPositionPath returns the element in the tree indicated by 'keys'.
|
// GetPositionPath returns the element in the tree indicated by 'keys'.
|
||||||
// If keys is of length zero, the current tree is returned.
|
// If keys is of length zero, the current tree is returned.
|
||||||
func (t *Tree) GetPositionPath(keys []string) Position {
|
func (t *Tree) GetPositionPath(keys []string) Position {
|
||||||
|
@ -212,7 +339,8 @@ func (t *Tree) SetPathWithOptions(keys []string, opts SetOptions, value interfac
|
||||||
// go to most recent element
|
// go to most recent element
|
||||||
if len(node) == 0 {
|
if len(node) == 0 {
|
||||||
// create element if it does not exist
|
// create element if it does not exist
|
||||||
subtree.values[intermediateKey] = append(node, newTreeWithPosition(Position{Line: t.position.Line + i, Col: t.position.Col}))
|
node = append(node, newTreeWithPosition(Position{Line: t.position.Line + i, Col: t.position.Col}))
|
||||||
|
subtree.values[intermediateKey] = node
|
||||||
}
|
}
|
||||||
subtree = node[len(node)-1]
|
subtree = node[len(node)-1]
|
||||||
}
|
}
|
||||||
|
@ -232,6 +360,8 @@ func (t *Tree) SetPathWithOptions(keys []string, opts SetOptions, value interfac
|
||||||
toInsert = value
|
toInsert = value
|
||||||
case *tomlValue:
|
case *tomlValue:
|
||||||
v.comment = opts.Comment
|
v.comment = opts.Comment
|
||||||
|
v.commented = opts.Commented
|
||||||
|
v.multiline = opts.Multiline
|
||||||
toInsert = v
|
toInsert = v
|
||||||
default:
|
default:
|
||||||
toInsert = &tomlValue{value: value,
|
toInsert = &tomlValue{value: value,
|
||||||
|
|
|
@ -57,6 +57,19 @@ func simpleValueCoercion(object interface{}) (interface{}, error) {
|
||||||
return float64(original), nil
|
return float64(original), nil
|
||||||
case fmt.Stringer:
|
case fmt.Stringer:
|
||||||
return original.String(), nil
|
return original.String(), nil
|
||||||
|
case []interface{}:
|
||||||
|
value := reflect.ValueOf(original)
|
||||||
|
length := value.Len()
|
||||||
|
arrayValue := reflect.MakeSlice(value.Type(), 0, length)
|
||||||
|
for i := 0; i < length; i++ {
|
||||||
|
val := value.Index(i).Interface()
|
||||||
|
simpleValue, err := simpleValueCoercion(val)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
arrayValue = reflect.Append(arrayValue, reflect.ValueOf(simpleValue))
|
||||||
|
}
|
||||||
|
return arrayValue.Interface(), nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("cannot convert type %T to Tree", object)
|
return nil, fmt.Errorf("cannot convert type %T to Tree", object)
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ func tomlValueStringRepresentation(v interface{}, commented string, indent strin
|
||||||
return "\"" + encodeTomlString(value) + "\"", nil
|
return "\"" + encodeTomlString(value) + "\"", nil
|
||||||
case []byte:
|
case []byte:
|
||||||
b, _ := v.([]byte)
|
b, _ := v.([]byte)
|
||||||
return tomlValueStringRepresentation(string(b), commented, indent, ord, arraysOneElementPerLine)
|
return string(b), nil
|
||||||
case bool:
|
case bool:
|
||||||
if value {
|
if value {
|
||||||
return "true", nil
|
return "true", nil
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
// various CPU architectures.
|
// various CPU architectures.
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
// Initialized reports whether the CPU features were initialized.
|
// Initialized reports whether the CPU features were initialized.
|
||||||
//
|
//
|
||||||
// For some GOOS/GOARCH combinations initialization of the CPU features depends
|
// For some GOOS/GOARCH combinations initialization of the CPU features depends
|
||||||
|
@ -169,3 +174,94 @@ var S390X struct {
|
||||||
HasVXE bool // vector-enhancements facility 1
|
HasVXE bool // vector-enhancements facility 1
|
||||||
_ CacheLinePad
|
_ CacheLinePad
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
archInit()
|
||||||
|
initOptions()
|
||||||
|
processOptions()
|
||||||
|
}
|
||||||
|
|
||||||
|
// options contains the cpu debug options that can be used in GODEBUG.
|
||||||
|
// Options are arch dependent and are added by the arch specific initOptions functions.
|
||||||
|
// Features that are mandatory for the specific GOARCH should have the Required field set
|
||||||
|
// (e.g. SSE2 on amd64).
|
||||||
|
var options []option
|
||||||
|
|
||||||
|
// Option names should be lower case. e.g. avx instead of AVX.
|
||||||
|
type option struct {
|
||||||
|
Name string
|
||||||
|
Feature *bool
|
||||||
|
Specified bool // whether feature value was specified in GODEBUG
|
||||||
|
Enable bool // whether feature should be enabled
|
||||||
|
Required bool // whether feature is mandatory and can not be disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
func processOptions() {
|
||||||
|
env := os.Getenv("GODEBUG")
|
||||||
|
field:
|
||||||
|
for env != "" {
|
||||||
|
field := ""
|
||||||
|
i := strings.IndexByte(env, ',')
|
||||||
|
if i < 0 {
|
||||||
|
field, env = env, ""
|
||||||
|
} else {
|
||||||
|
field, env = env[:i], env[i+1:]
|
||||||
|
}
|
||||||
|
if len(field) < 4 || field[:4] != "cpu." {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
i = strings.IndexByte(field, '=')
|
||||||
|
if i < 0 {
|
||||||
|
print("GODEBUG sys/cpu: no value specified for \"", field, "\"\n")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
key, value := field[4:i], field[i+1:] // e.g. "SSE2", "on"
|
||||||
|
|
||||||
|
var enable bool
|
||||||
|
switch value {
|
||||||
|
case "on":
|
||||||
|
enable = true
|
||||||
|
case "off":
|
||||||
|
enable = false
|
||||||
|
default:
|
||||||
|
print("GODEBUG sys/cpu: value \"", value, "\" not supported for cpu option \"", key, "\"\n")
|
||||||
|
continue field
|
||||||
|
}
|
||||||
|
|
||||||
|
if key == "all" {
|
||||||
|
for i := range options {
|
||||||
|
options[i].Specified = true
|
||||||
|
options[i].Enable = enable || options[i].Required
|
||||||
|
}
|
||||||
|
continue field
|
||||||
|
}
|
||||||
|
|
||||||
|
for i := range options {
|
||||||
|
if options[i].Name == key {
|
||||||
|
options[i].Specified = true
|
||||||
|
options[i].Enable = enable
|
||||||
|
continue field
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print("GODEBUG sys/cpu: unknown cpu feature \"", key, "\"\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, o := range options {
|
||||||
|
if !o.Specified {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if o.Enable && !*o.Feature {
|
||||||
|
print("GODEBUG sys/cpu: can not enable \"", o.Name, "\", missing CPU support\n")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if !o.Enable && o.Required {
|
||||||
|
print("GODEBUG sys/cpu: can not disable \"", o.Name, "\", required CPU feature\n")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
*o.Feature = o.Enable
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
const cacheLineSize = 128
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// getsystemcfg constants
|
// getsystemcfg constants
|
||||||
_SC_IMPL = 2
|
_SC_IMPL = 2
|
||||||
|
@ -15,7 +13,7 @@ const (
|
||||||
_IMPL_POWER9 = 0x20000
|
_IMPL_POWER9 = 0x20000
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func archInit() {
|
||||||
impl := getsystemcfg(_SC_IMPL)
|
impl := getsystemcfg(_SC_IMPL)
|
||||||
if impl&_IMPL_POWER8 != 0 {
|
if impl&_IMPL_POWER8 != 0 {
|
||||||
PPC64.IsPOWER8 = true
|
PPC64.IsPOWER8 = true
|
||||||
|
|
|
@ -38,3 +38,36 @@ const (
|
||||||
hwcap2_SHA2 = 1 << 3
|
hwcap2_SHA2 = 1 << 3
|
||||||
hwcap2_CRC32 = 1 << 4
|
hwcap2_CRC32 = 1 << 4
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func initOptions() {
|
||||||
|
options = []option{
|
||||||
|
{Name: "pmull", Feature: &ARM.HasPMULL},
|
||||||
|
{Name: "sha1", Feature: &ARM.HasSHA1},
|
||||||
|
{Name: "sha2", Feature: &ARM.HasSHA2},
|
||||||
|
{Name: "swp", Feature: &ARM.HasSWP},
|
||||||
|
{Name: "thumb", Feature: &ARM.HasTHUMB},
|
||||||
|
{Name: "thumbee", Feature: &ARM.HasTHUMBEE},
|
||||||
|
{Name: "tls", Feature: &ARM.HasTLS},
|
||||||
|
{Name: "vfp", Feature: &ARM.HasVFP},
|
||||||
|
{Name: "vfpd32", Feature: &ARM.HasVFPD32},
|
||||||
|
{Name: "vfpv3", Feature: &ARM.HasVFPv3},
|
||||||
|
{Name: "vfpv3d16", Feature: &ARM.HasVFPv3D16},
|
||||||
|
{Name: "vfpv4", Feature: &ARM.HasVFPv4},
|
||||||
|
{Name: "half", Feature: &ARM.HasHALF},
|
||||||
|
{Name: "26bit", Feature: &ARM.Has26BIT},
|
||||||
|
{Name: "fastmul", Feature: &ARM.HasFASTMUL},
|
||||||
|
{Name: "fpa", Feature: &ARM.HasFPA},
|
||||||
|
{Name: "edsp", Feature: &ARM.HasEDSP},
|
||||||
|
{Name: "java", Feature: &ARM.HasJAVA},
|
||||||
|
{Name: "iwmmxt", Feature: &ARM.HasIWMMXT},
|
||||||
|
{Name: "crunch", Feature: &ARM.HasCRUNCH},
|
||||||
|
{Name: "neon", Feature: &ARM.HasNEON},
|
||||||
|
{Name: "idivt", Feature: &ARM.HasIDIVT},
|
||||||
|
{Name: "idiva", Feature: &ARM.HasIDIVA},
|
||||||
|
{Name: "lpae", Feature: &ARM.HasLPAE},
|
||||||
|
{Name: "evtstrm", Feature: &ARM.HasEVTSTRM},
|
||||||
|
{Name: "aes", Feature: &ARM.HasAES},
|
||||||
|
{Name: "crc32", Feature: &ARM.HasCRC32},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -8,7 +8,36 @@ import "runtime"
|
||||||
|
|
||||||
const cacheLineSize = 64
|
const cacheLineSize = 64
|
||||||
|
|
||||||
func init() {
|
func initOptions() {
|
||||||
|
options = []option{
|
||||||
|
{Name: "fp", Feature: &ARM64.HasFP},
|
||||||
|
{Name: "asimd", Feature: &ARM64.HasASIMD},
|
||||||
|
{Name: "evstrm", Feature: &ARM64.HasEVTSTRM},
|
||||||
|
{Name: "aes", Feature: &ARM64.HasAES},
|
||||||
|
{Name: "fphp", Feature: &ARM64.HasFPHP},
|
||||||
|
{Name: "jscvt", Feature: &ARM64.HasJSCVT},
|
||||||
|
{Name: "lrcpc", Feature: &ARM64.HasLRCPC},
|
||||||
|
{Name: "pmull", Feature: &ARM64.HasPMULL},
|
||||||
|
{Name: "sha1", Feature: &ARM64.HasSHA1},
|
||||||
|
{Name: "sha2", Feature: &ARM64.HasSHA2},
|
||||||
|
{Name: "sha3", Feature: &ARM64.HasSHA3},
|
||||||
|
{Name: "sha512", Feature: &ARM64.HasSHA512},
|
||||||
|
{Name: "sm3", Feature: &ARM64.HasSM3},
|
||||||
|
{Name: "sm4", Feature: &ARM64.HasSM4},
|
||||||
|
{Name: "sve", Feature: &ARM64.HasSVE},
|
||||||
|
{Name: "crc32", Feature: &ARM64.HasCRC32},
|
||||||
|
{Name: "atomics", Feature: &ARM64.HasATOMICS},
|
||||||
|
{Name: "asimdhp", Feature: &ARM64.HasASIMDHP},
|
||||||
|
{Name: "cpuid", Feature: &ARM64.HasCPUID},
|
||||||
|
{Name: "asimrdm", Feature: &ARM64.HasASIMDRDM},
|
||||||
|
{Name: "fcma", Feature: &ARM64.HasFCMA},
|
||||||
|
{Name: "dcpop", Feature: &ARM64.HasDCPOP},
|
||||||
|
{Name: "asimddp", Feature: &ARM64.HasASIMDDP},
|
||||||
|
{Name: "asimdfhm", Feature: &ARM64.HasASIMDFHM},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func archInit() {
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "android", "darwin", "netbsd":
|
case "android", "darwin", "netbsd":
|
||||||
// Android and iOS don't seem to allow reading these registers.
|
// Android and iOS don't seem to allow reading these registers.
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
func init() {
|
func archInit() {
|
||||||
if err := readHWCAP(); err != nil {
|
if err := readHWCAP(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// 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.
|
||||||
|
|
||||||
|
// +build linux
|
||||||
// +build mips64 mips64le
|
// +build mips64 mips64le
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
const cacheLineSize = 128
|
|
||||||
|
|
||||||
// HWCAP/HWCAP2 bits. These are exposed by the kernel.
|
// HWCAP/HWCAP2 bits. These are exposed by the kernel.
|
||||||
const (
|
const (
|
||||||
// ISA Level
|
// ISA Level
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
const cacheLineSize = 256
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// bit mask values from /usr/include/bits/hwcap.h
|
// bit mask values from /usr/include/bits/hwcap.h
|
||||||
hwcap_ZARCH = 2
|
hwcap_ZARCH = 2
|
||||||
|
|
|
@ -7,3 +7,9 @@
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
const cacheLineSize = 32
|
const cacheLineSize = 32
|
||||||
|
|
||||||
|
func initOptions() {
|
||||||
|
options = []option{
|
||||||
|
{Name: "msa", Feature: &MIPS64X.HasMSA},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -7,3 +7,5 @@
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
const cacheLineSize = 32
|
const cacheLineSize = 32
|
||||||
|
|
||||||
|
func initOptions() {}
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// Copyright 2020 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,arm
|
||||||
|
|
||||||
|
package cpu
|
||||||
|
|
||||||
|
func archInit() {}
|
|
@ -0,0 +1,16 @@
|
||||||
|
// Copyright 2020 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 ppc64 ppc64le
|
||||||
|
|
||||||
|
package cpu
|
||||||
|
|
||||||
|
const cacheLineSize = 128
|
||||||
|
|
||||||
|
func initOptions() {
|
||||||
|
options = []option{
|
||||||
|
{Name: "darn", Feature: &PPC64.HasDARN},
|
||||||
|
{Name: "scv", Feature: &PPC64.HasSCV},
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,3 +7,5 @@
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
const cacheLineSize = 32
|
const cacheLineSize = 32
|
||||||
|
|
||||||
|
func initOptions() {}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Copyright 2020 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 cpu
|
||||||
|
|
||||||
|
const cacheLineSize = 256
|
||||||
|
|
||||||
|
func initOptions() {
|
||||||
|
options = []option{
|
||||||
|
{Name: "zarch", Feature: &S390X.HasZARCH},
|
||||||
|
{Name: "stfle", Feature: &S390X.HasSTFLE},
|
||||||
|
{Name: "ldisp", Feature: &S390X.HasLDISP},
|
||||||
|
{Name: "eimm", Feature: &S390X.HasEIMM},
|
||||||
|
{Name: "dfp", Feature: &S390X.HasDFP},
|
||||||
|
{Name: "etf3eh", Feature: &S390X.HasETF3EH},
|
||||||
|
{Name: "msa", Feature: &S390X.HasMSA},
|
||||||
|
{Name: "aes", Feature: &S390X.HasAES},
|
||||||
|
{Name: "aescbc", Feature: &S390X.HasAESCBC},
|
||||||
|
{Name: "aesctr", Feature: &S390X.HasAESCTR},
|
||||||
|
{Name: "aesgcm", Feature: &S390X.HasAESGCM},
|
||||||
|
{Name: "ghash", Feature: &S390X.HasGHASH},
|
||||||
|
{Name: "sha1", Feature: &S390X.HasSHA1},
|
||||||
|
{Name: "sha256", Feature: &S390X.HasSHA256},
|
||||||
|
{Name: "sha3", Feature: &S390X.HasSHA3},
|
||||||
|
{Name: "sha512", Feature: &S390X.HasSHA512},
|
||||||
|
{Name: "vx", Feature: &S390X.HasVX},
|
||||||
|
{Name: "vxe", Feature: &S390X.HasVXE},
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,3 +11,7 @@ package cpu
|
||||||
// rules are good enough.
|
// rules are good enough.
|
||||||
|
|
||||||
const cacheLineSize = 0
|
const cacheLineSize = 0
|
||||||
|
|
||||||
|
func initOptions() {}
|
||||||
|
|
||||||
|
func archInit() {}
|
||||||
|
|
|
@ -6,9 +6,37 @@
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
|
import "runtime"
|
||||||
|
|
||||||
const cacheLineSize = 64
|
const cacheLineSize = 64
|
||||||
|
|
||||||
func init() {
|
func initOptions() {
|
||||||
|
options = []option{
|
||||||
|
{Name: "adx", Feature: &X86.HasADX},
|
||||||
|
{Name: "aes", Feature: &X86.HasAES},
|
||||||
|
{Name: "avx", Feature: &X86.HasAVX},
|
||||||
|
{Name: "avx2", Feature: &X86.HasAVX2},
|
||||||
|
{Name: "bmi1", Feature: &X86.HasBMI1},
|
||||||
|
{Name: "bmi2", Feature: &X86.HasBMI2},
|
||||||
|
{Name: "erms", Feature: &X86.HasERMS},
|
||||||
|
{Name: "fma", Feature: &X86.HasFMA},
|
||||||
|
{Name: "osxsave", Feature: &X86.HasOSXSAVE},
|
||||||
|
{Name: "pclmulqdq", Feature: &X86.HasPCLMULQDQ},
|
||||||
|
{Name: "popcnt", Feature: &X86.HasPOPCNT},
|
||||||
|
{Name: "rdrand", Feature: &X86.HasRDRAND},
|
||||||
|
{Name: "rdseed", Feature: &X86.HasRDSEED},
|
||||||
|
{Name: "sse3", Feature: &X86.HasSSE3},
|
||||||
|
{Name: "sse41", Feature: &X86.HasSSE41},
|
||||||
|
{Name: "sse42", Feature: &X86.HasSSE42},
|
||||||
|
{Name: "ssse3", Feature: &X86.HasSSSE3},
|
||||||
|
|
||||||
|
// These capabilities should always be enabled on amd64:
|
||||||
|
{Name: "sse2", Feature: &X86.HasSSE2, Required: runtime.GOARCH == "amd64"},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func archInit() {
|
||||||
|
|
||||||
Initialized = true
|
Initialized = true
|
||||||
|
|
||||||
maxID, _, _, _ := cpuid(0, 0)
|
maxID, _, _, _ := cpuid(0, 0)
|
||||||
|
@ -52,6 +80,7 @@ func init() {
|
||||||
X86.HasERMS = isSet(9, ebx7)
|
X86.HasERMS = isSet(9, ebx7)
|
||||||
X86.HasRDSEED = isSet(18, ebx7)
|
X86.HasRDSEED = isSet(18, ebx7)
|
||||||
X86.HasADX = isSet(19, ebx7)
|
X86.HasADX = isSet(19, ebx7)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isSet(bitpos uint, value uint32) bool {
|
func isSet(bitpos uint, value uint32) bool {
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
// Copyright 2019 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 mips64, OpenBSD
|
||||||
|
//
|
||||||
|
|
||||||
|
// Just jump to package syscall's implementation for all these functions.
|
||||||
|
// The runtime may know about them.
|
||||||
|
|
||||||
|
TEXT ·Syscall(SB),NOSPLIT,$0-56
|
||||||
|
JMP syscall·Syscall(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall6(SB),NOSPLIT,$0-80
|
||||||
|
JMP syscall·Syscall6(SB)
|
||||||
|
|
||||||
|
TEXT ·Syscall9(SB),NOSPLIT,$0-104
|
||||||
|
JMP syscall·Syscall9(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-56
|
||||||
|
JMP syscall·RawSyscall(SB)
|
||||||
|
|
||||||
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
|
||||||
|
JMP syscall·RawSyscall6(SB)
|
|
@ -16,3 +16,9 @@ func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
||||||
_, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
|
_, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk))))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command.
|
||||||
|
func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error {
|
||||||
|
_, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore))))
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
|
@ -20,6 +20,15 @@ func IoctlSetInt(fd int, req uint, value int) error {
|
||||||
return ioctl(fd, req, uintptr(value))
|
return ioctl(fd, req, uintptr(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IoctlSetPointerInt performs an ioctl operation which sets an
|
||||||
|
// integer value on fd, using the specified request number. The ioctl
|
||||||
|
// argument is called with a pointer to the integer value, rather than
|
||||||
|
// passing the integer value directly.
|
||||||
|
func IoctlSetPointerInt(fd int, req uint, value int) error {
|
||||||
|
v := int32(value)
|
||||||
|
return ioctl(fd, req, uintptr(unsafe.Pointer(&v)))
|
||||||
|
}
|
||||||
|
|
||||||
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
||||||
//
|
//
|
||||||
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
||||||
|
|
|
@ -73,26 +73,22 @@ aix_ppc64)
|
||||||
darwin_386)
|
darwin_386)
|
||||||
mkerrors="$mkerrors -m32"
|
mkerrors="$mkerrors -m32"
|
||||||
mksyscall="go run mksyscall.go -l32"
|
mksyscall="go run mksyscall.go -l32"
|
||||||
mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
mkasm="go run mkasm_darwin.go"
|
mkasm="go run mkasm_darwin.go"
|
||||||
;;
|
;;
|
||||||
darwin_amd64)
|
darwin_amd64)
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
mksysnum="go run mksysnum.go $(xcrun --show-sdk-path --sdk macosx)/usr/include/sys/syscall.h"
|
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||||
mkasm="go run mkasm_darwin.go"
|
mkasm="go run mkasm_darwin.go"
|
||||||
;;
|
;;
|
||||||
darwin_arm)
|
darwin_arm)
|
||||||
mkerrors="$mkerrors"
|
mkerrors="$mkerrors"
|
||||||
mksyscall="go run mksyscall.go -l32"
|
mksyscall="go run mksyscall.go -l32"
|
||||||
mksysnum="go run mksysnum.go $(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"
|
||||||
mkasm="go run mkasm_darwin.go"
|
mkasm="go run mkasm_darwin.go"
|
||||||
;;
|
;;
|
||||||
darwin_arm64)
|
darwin_arm64)
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
mksysnum="go run mksysnum.go $(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"
|
||||||
mkasm="go run mkasm_darwin.go"
|
mkasm="go run mkasm_darwin.go"
|
||||||
;;
|
;;
|
||||||
|
@ -184,6 +180,15 @@ openbsd_arm64)
|
||||||
# API consistent across platforms.
|
# API consistent across platforms.
|
||||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||||
;;
|
;;
|
||||||
|
openbsd_mips64)
|
||||||
|
mkerrors="$mkerrors -m64"
|
||||||
|
mksyscall="go run mksyscall.go -openbsd"
|
||||||
|
mksysctl="go run mksysctl_openbsd.go"
|
||||||
|
mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
|
||||||
|
# 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="go run mksyscall_solaris.go"
|
mksyscall="go run mksyscall_solaris.go"
|
||||||
mkerrors="$mkerrors -m64"
|
mkerrors="$mkerrors -m64"
|
||||||
|
@ -217,8 +222,6 @@ esac
|
||||||
# aix/ppc64 script generates files instead of writing to stdin.
|
# aix/ppc64 script generates files instead of writing to stdin.
|
||||||
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ;
|
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ;
|
||||||
elif [ "$GOOS" == "darwin" ]; then
|
elif [ "$GOOS" == "darwin" ]; then
|
||||||
# pre-1.12, direct syscalls
|
|
||||||
echo "$mksyscall -tags $GOOS,$GOARCH,!go1.12 $syscall_goos syscall_darwin_${GOARCH}.1_11.go $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.1_11.go";
|
|
||||||
# 1.12 and later, syscalls via libSystem
|
# 1.12 and later, syscalls via libSystem
|
||||||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
|
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
|
||||||
# 1.13 and later, syscalls via libSystem (including syscallPtr)
|
# 1.13 and later, syscalls via libSystem (including syscallPtr)
|
||||||
|
|
|
@ -58,6 +58,7 @@ includes_Darwin='
|
||||||
#define _DARWIN_USE_64_BIT_INODE
|
#define _DARWIN_USE_64_BIT_INODE
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/attr.h>
|
#include <sys/attr.h>
|
||||||
|
#include <sys/clonefile.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>
|
||||||
|
@ -107,6 +108,7 @@ includes_FreeBSD='
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/disk.h>
|
#include <sys/disk.h>
|
||||||
#include <sys/event.h>
|
#include <sys/event.h>
|
||||||
|
#include <sys/sched.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
|
@ -192,9 +194,12 @@ struct ltchars {
|
||||||
#include <sys/xattr.h>
|
#include <sys/xattr.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
|
#include <linux/can/error.h>
|
||||||
|
#include <linux/can/raw.h>
|
||||||
#include <linux/capability.h>
|
#include <linux/capability.h>
|
||||||
#include <linux/cryptouser.h>
|
#include <linux/cryptouser.h>
|
||||||
#include <linux/devlink.h>
|
#include <linux/devlink.h>
|
||||||
|
#include <linux/dm-ioctl.h>
|
||||||
#include <linux/errqueue.h>
|
#include <linux/errqueue.h>
|
||||||
#include <linux/falloc.h>
|
#include <linux/falloc.h>
|
||||||
#include <linux/fanotify.h>
|
#include <linux/fanotify.h>
|
||||||
|
@ -297,6 +302,7 @@ includes_NetBSD='
|
||||||
#include <sys/extattr.h>
|
#include <sys/extattr.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
|
#include <sys/sched.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
|
@ -325,6 +331,7 @@ includes_OpenBSD='
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
#include <sys/sched.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -507,11 +514,14 @@ ccflags="$@"
|
||||||
$2 ~ /^(CLOCK|TIMER)_/ ||
|
$2 ~ /^(CLOCK|TIMER)_/ ||
|
||||||
$2 ~ /^CAN_/ ||
|
$2 ~ /^CAN_/ ||
|
||||||
$2 ~ /^CAP_/ ||
|
$2 ~ /^CAP_/ ||
|
||||||
|
$2 ~ /^CP_/ ||
|
||||||
|
$2 ~ /^CPUSTATES$/ ||
|
||||||
$2 ~ /^ALG_/ ||
|
$2 ~ /^ALG_/ ||
|
||||||
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ ||
|
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ ||
|
||||||
$2 ~ /^FS_IOC_.*(ENCRYPTION|VERITY|[GS]ETFLAGS)/ ||
|
$2 ~ /^FS_IOC_.*(ENCRYPTION|VERITY|[GS]ETFLAGS)/ ||
|
||||||
$2 ~ /^FS_VERITY_/ ||
|
$2 ~ /^FS_VERITY_/ ||
|
||||||
$2 ~ /^FSCRYPT_/ ||
|
$2 ~ /^FSCRYPT_/ ||
|
||||||
|
$2 ~ /^DM_/ ||
|
||||||
$2 ~ /^GRND_/ ||
|
$2 ~ /^GRND_/ ||
|
||||||
$2 ~ /^RND/ ||
|
$2 ~ /^RND/ ||
|
||||||
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
||||||
|
|
|
@ -527,6 +527,23 @@ func SysctlClockinfo(name string) (*Clockinfo, error) {
|
||||||
return &ci, nil
|
return &ci, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SysctlTimeval(name string) (*Timeval, error) {
|
||||||
|
mib, err := sysctlmib(name)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
var tv Timeval
|
||||||
|
n := uintptr(unsafe.Sizeof(tv))
|
||||||
|
if err := sysctl(mib, (*byte)(unsafe.Pointer(&tv)), &n, nil, 0); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if n != unsafe.Sizeof(tv) {
|
||||||
|
return nil, EIO
|
||||||
|
}
|
||||||
|
return &tv, nil
|
||||||
|
}
|
||||||
|
|
||||||
//sys utimes(path string, timeval *[2]Timeval) (err error)
|
//sys utimes(path string, timeval *[2]Timeval) (err error)
|
||||||
|
|
||||||
func Utimes(path string, tv []Timeval) error {
|
func Utimes(path string, tv []Timeval) error {
|
||||||
|
|
|
@ -10,6 +10,8 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const _SYS_GETDIRENTRIES64 = 344
|
||||||
|
|
||||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||||
// To implement this using libSystem we'd need syscall_syscallPtr for
|
// To implement this using libSystem we'd need syscall_syscallPtr for
|
||||||
// fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
|
// fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
|
||||||
|
@ -20,7 +22,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||||
} else {
|
} else {
|
||||||
p = unsafe.Pointer(&_zero)
|
p = unsafe.Pointer(&_zero)
|
||||||
}
|
}
|
||||||
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
||||||
n = int(r0)
|
n = int(r0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
return n, errnoErr(e1)
|
return n, errnoErr(e1)
|
||||||
|
|
|
@ -49,6 +49,11 @@ type SockaddrDatalink struct {
|
||||||
raw RawSockaddrDatalink
|
raw RawSockaddrDatalink
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Some external packages rely on SYS___SYSCTL being defined to implement their
|
||||||
|
// own sysctl wrappers. Provide it here, even though direct syscalls are no
|
||||||
|
// longer supported on darwin.
|
||||||
|
const SYS___SYSCTL = 202
|
||||||
|
|
||||||
// Translate "kern.hostname" to []_C_int{0,1,2,3}.
|
// Translate "kern.hostname" to []_C_int{0,1,2,3}.
|
||||||
func nametomib(name string) (mib []_C_int, err error) {
|
func nametomib(name string) (mib []_C_int, err error) {
|
||||||
const siz = unsafe.Sizeof(mib[0])
|
const siz = unsafe.Sizeof(mib[0])
|
||||||
|
@ -396,6 +401,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sys Chroot(path string) (err error)
|
//sys Chroot(path string) (err error)
|
||||||
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
//sys ClockGettime(clockid int32, time *Timespec) (err error)
|
||||||
//sys Close(fd int) (err error)
|
//sys Close(fd int) (err error)
|
||||||
|
//sys Clonefile(src string, dst string, flags int) (err error)
|
||||||
|
//sys Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error)
|
||||||
//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 Exchangedata(path1 string, path2 string, options int) (err error)
|
//sys Exchangedata(path1 string, path2 string, options int) (err error)
|
||||||
|
@ -407,6 +414,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (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 Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||||
|
//sys Fclonefileat(srcDirfd int, dstDirfd int, dst string, 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 Fsync(fd int) (err error)
|
//sys Fsync(fd int) (err error)
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
// Copyright 2019 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,386,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
|
|
|
@ -44,10 +44,6 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
|
||||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
|
||||||
// of darwin/386 the syscall is called sysctl instead of __sysctl.
|
|
||||||
const SYS___SYSCTL = SYS_SYSCTL
|
|
||||||
|
|
||||||
//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 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
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
// Copyright 2019 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,amd64,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
//sys Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) = SYS_GETDIRENTRIES64
|
|
|
@ -44,10 +44,6 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
|
||||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||||
|
|
||||||
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
|
||||||
// of darwin/amd64 the syscall is called sysctl instead of __sysctl.
|
|
||||||
const SYS___SYSCTL = SYS_SYSCTL
|
|
||||||
|
|
||||||
//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 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
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
// Copyright 2019 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,arm,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
||||||
return 0, ENOSYS
|
|
||||||
}
|
|
|
@ -44,10 +44,6 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
//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)
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
// Copyright 2019 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,arm64,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
||||||
return 0, ENOSYS
|
|
||||||
}
|
|
|
@ -46,10 +46,6 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
|
||||||
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/arm64 the syscall is called sysctl instead of __sysctl.
|
|
||||||
const SYS___SYSCTL = SYS_SYSCTL
|
|
||||||
|
|
||||||
//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)
|
||||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||||
|
|
|
@ -55,3 +55,36 @@ func Pwritev(fd int, iovs [][]byte, off int64) (n int, err error) {
|
||||||
n, err = pwritev(fd, iovecs, off)
|
n, err = pwritev(fd, iovecs, off)
|
||||||
return n, err
|
return n, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
|
||||||
|
|
||||||
|
func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
|
||||||
|
var rsa RawSockaddrAny
|
||||||
|
var len _Socklen = SizeofSockaddrAny
|
||||||
|
nfd, err = accept4(fd, &rsa, &len, flags)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len > SizeofSockaddrAny {
|
||||||
|
panic("RawSockaddrAny too small")
|
||||||
|
}
|
||||||
|
sa, err = anyToSockaddr(fd, &rsa)
|
||||||
|
if err != nil {
|
||||||
|
Close(nfd)
|
||||||
|
nfd = 0
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
|
||||||
|
|
||||||
|
func Pipe2(p []int, flags int) error {
|
||||||
|
if len(p) != 2 {
|
||||||
|
return EINVAL
|
||||||
|
}
|
||||||
|
var pp [2]_C_int
|
||||||
|
err := pipe2(&pp, flags)
|
||||||
|
p[0] = int(pp[0])
|
||||||
|
p[1] = int(pp[1])
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
|
@ -82,15 +82,6 @@ func IoctlRetInt(fd int, req uint) (int, error) {
|
||||||
return int(ret), nil
|
return int(ret), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// IoctlSetPointerInt performs an ioctl operation which sets an
|
|
||||||
// integer value on fd, using the specified request number. The ioctl
|
|
||||||
// argument is called with a pointer to the integer value, rather than
|
|
||||||
// passing the integer value directly.
|
|
||||||
func IoctlSetPointerInt(fd int, req uint, value int) error {
|
|
||||||
v := int32(value)
|
|
||||||
return ioctl(fd, req, uintptr(unsafe.Pointer(&v)))
|
|
||||||
}
|
|
||||||
|
|
||||||
func IoctlSetRTCTime(fd int, value *RTCTime) error {
|
func IoctlSetRTCTime(fd int, value *RTCTime) error {
|
||||||
err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
|
err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
|
||||||
runtime.KeepAlive(value)
|
runtime.KeepAlive(value)
|
||||||
|
@ -145,6 +136,12 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
|
||||||
return openat(dirfd, path, flags|O_LARGEFILE, mode)
|
return openat(dirfd, path, flags|O_LARGEFILE, mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys openat2(dirfd int, path string, open_how *OpenHow, size int) (fd int, err error)
|
||||||
|
|
||||||
|
func Openat2(dirfd int, path string, how *OpenHow) (fd int, err error) {
|
||||||
|
return openat2(dirfd, path, how, SizeofOpenHow)
|
||||||
|
}
|
||||||
|
|
||||||
//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
|
//sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
|
||||||
|
|
||||||
func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
|
func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
|
||||||
|
@ -885,6 +882,35 @@ func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP6, nil
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP6, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SockaddrIUCV implements the Sockaddr interface for AF_IUCV sockets.
|
||||||
|
type SockaddrIUCV struct {
|
||||||
|
UserID string
|
||||||
|
Name string
|
||||||
|
raw RawSockaddrIUCV
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
|
sa.raw.Family = AF_IUCV
|
||||||
|
// These are EBCDIC encoded by the kernel, but we still need to pad them
|
||||||
|
// with blanks. Initializing with blanks allows the caller to feed in either
|
||||||
|
// a padded or an unpadded string.
|
||||||
|
for i := 0; i < 8; i++ {
|
||||||
|
sa.raw.Nodeid[i] = ' '
|
||||||
|
sa.raw.User_id[i] = ' '
|
||||||
|
sa.raw.Name[i] = ' '
|
||||||
|
}
|
||||||
|
if len(sa.UserID) > 8 || len(sa.Name) > 8 {
|
||||||
|
return nil, 0, EINVAL
|
||||||
|
}
|
||||||
|
for i, b := range []byte(sa.UserID[:]) {
|
||||||
|
sa.raw.User_id[i] = int8(b)
|
||||||
|
}
|
||||||
|
for i, b := range []byte(sa.Name[:]) {
|
||||||
|
sa.raw.Name[i] = int8(b)
|
||||||
|
}
|
||||||
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrIUCV, nil
|
||||||
|
}
|
||||||
|
|
||||||
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
||||||
switch rsa.Addr.Family {
|
switch rsa.Addr.Family {
|
||||||
case AF_NETLINK:
|
case AF_NETLINK:
|
||||||
|
@ -1065,6 +1091,38 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return sa, nil
|
return sa, nil
|
||||||
|
case AF_IUCV:
|
||||||
|
pp := (*RawSockaddrIUCV)(unsafe.Pointer(rsa))
|
||||||
|
|
||||||
|
var user [8]byte
|
||||||
|
var name [8]byte
|
||||||
|
|
||||||
|
for i := 0; i < 8; i++ {
|
||||||
|
user[i] = byte(pp.User_id[i])
|
||||||
|
name[i] = byte(pp.Name[i])
|
||||||
|
}
|
||||||
|
|
||||||
|
sa := &SockaddrIUCV{
|
||||||
|
UserID: string(user[:]),
|
||||||
|
Name: string(name[:]),
|
||||||
|
}
|
||||||
|
return sa, nil
|
||||||
|
|
||||||
|
case AF_CAN:
|
||||||
|
pp := (*RawSockaddrCAN)(unsafe.Pointer(rsa))
|
||||||
|
sa := &SockaddrCAN{
|
||||||
|
Ifindex: int(pp.Ifindex),
|
||||||
|
}
|
||||||
|
rx := (*[4]byte)(unsafe.Pointer(&sa.RxID))
|
||||||
|
for i := 0; i < 4; i++ {
|
||||||
|
rx[i] = pp.Addr[i]
|
||||||
|
}
|
||||||
|
tx := (*[4]byte)(unsafe.Pointer(&sa.TxID))
|
||||||
|
for i := 0; i < 4; i++ {
|
||||||
|
tx[i] = pp.Addr[i+4]
|
||||||
|
}
|
||||||
|
return sa, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil, EAFNOSUPPORT
|
return nil, EAFNOSUPPORT
|
||||||
}
|
}
|
||||||
|
@ -1965,10 +2023,15 @@ func isGroupMember(gid int) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys faccessat(dirfd int, path string, mode uint32) (err error)
|
//sys faccessat(dirfd int, path string, mode uint32) (err error)
|
||||||
|
//sys Faccessat2(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
|
if flags == 0 {
|
||||||
return EINVAL
|
return faccessat(dirfd, path, mode)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := Faccessat2(dirfd, path, mode, flags); err != ENOSYS && err != EPERM {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Linux kernel faccessat system call does not take any flags.
|
// The Linux kernel faccessat system call does not take any flags.
|
||||||
|
@ -1977,8 +2040,8 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
||||||
// Because people naturally expect syscall.Faccessat to act
|
// Because people naturally expect syscall.Faccessat to act
|
||||||
// like C faccessat, we do the same.
|
// like C faccessat, we do the same.
|
||||||
|
|
||||||
if flags == 0 {
|
if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
|
||||||
return faccessat(dirfd, path, mode)
|
return EINVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
var st Stat_t
|
var st Stat_t
|
||||||
|
@ -2122,6 +2185,18 @@ func Klogset(typ int, arg int) (err error) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RemoteIovec is Iovec with the pointer replaced with an integer.
|
||||||
|
// It is used for ProcessVMReadv and ProcessVMWritev, where the pointer
|
||||||
|
// refers to a location in a different process' address space, which
|
||||||
|
// would confuse the Go garbage collector.
|
||||||
|
type RemoteIovec struct {
|
||||||
|
Base uintptr
|
||||||
|
Len int
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys ProcessVMReadv(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) = SYS_PROCESS_VM_READV
|
||||||
|
//sys ProcessVMWritev(pid int, localIov []Iovec, remoteIov []RemoteIovec, flags uint) (n int, err error) = SYS_PROCESS_VM_WRITEV
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unimplemented
|
* Unimplemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"syscall"
|
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -49,10 +48,6 @@ func Pipe2(p []int, flags int) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Underlying system call writes to newoffset via pointer.
|
|
||||||
// Implemented in assembly to avoid allocation.
|
|
||||||
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
|
|
||||||
|
|
||||||
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
||||||
newoffset, errno := seek(fd, offset, whence)
|
newoffset, errno := seek(fd, offset, whence)
|
||||||
if errno != 0 {
|
if errno != 0 {
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Copyright 2009 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,!gccgo,linux
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
// Underlying system call writes to newoffset via pointer.
|
||||||
|
// Implemented in assembly to avoid allocation.
|
||||||
|
func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno)
|
|
@ -0,0 +1,35 @@
|
||||||
|
// Copyright 2019 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
|
||||||
|
|
||||||
|
func setTimespec(sec, nsec int64) Timespec {
|
||||||
|
return Timespec{Sec: sec, Nsec: nsec}
|
||||||
|
}
|
||||||
|
|
||||||
|
func setTimeval(sec, usec int64) Timeval {
|
||||||
|
return Timeval{Sec: sec, Usec: usec}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||||
|
k.Ident = uint64(fd)
|
||||||
|
k.Filter = int16(mode)
|
||||||
|
k.Flags = uint16(flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (iov *Iovec) SetLen(length int) {
|
||||||
|
iov.Len = uint64(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msghdr *Msghdr) SetControllen(length int) {
|
||||||
|
msghdr.Controllen = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmsg *Cmsghdr) SetLen(length int) {
|
||||||
|
cmsg.Len = uint32(length)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
|
||||||
|
// of OpenBSD the syscall is called sysctl instead of __sysctl.
|
||||||
|
const SYS___SYSCTL = SYS_SYSCTL
|
|
@ -232,6 +232,8 @@ const (
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x10
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
CLOCK_UPTIME_RAW = 0x8
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
CLOCK_UPTIME_RAW_APPROX = 0x9
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CLONE_NOFOLLOW = 0x1
|
||||||
|
CLONE_NOOWNERCOPY = 0x2
|
||||||
CR0 = 0x0
|
CR0 = 0x0
|
||||||
CR1 = 0x1000
|
CR1 = 0x1000
|
||||||
CR2 = 0x2000
|
CR2 = 0x2000
|
||||||
|
|
|
@ -232,6 +232,8 @@ const (
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x10
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
CLOCK_UPTIME_RAW = 0x8
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
CLOCK_UPTIME_RAW_APPROX = 0x9
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CLONE_NOFOLLOW = 0x1
|
||||||
|
CLONE_NOOWNERCOPY = 0x2
|
||||||
CR0 = 0x0
|
CR0 = 0x0
|
||||||
CR1 = 0x1000
|
CR1 = 0x1000
|
||||||
CR2 = 0x2000
|
CR2 = 0x2000
|
||||||
|
|
|
@ -232,6 +232,8 @@ const (
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x10
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
CLOCK_UPTIME_RAW = 0x8
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
CLOCK_UPTIME_RAW_APPROX = 0x9
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CLONE_NOFOLLOW = 0x1
|
||||||
|
CLONE_NOOWNERCOPY = 0x2
|
||||||
CR0 = 0x0
|
CR0 = 0x0
|
||||||
CR1 = 0x1000
|
CR1 = 0x1000
|
||||||
CR2 = 0x2000
|
CR2 = 0x2000
|
||||||
|
|
|
@ -232,6 +232,8 @@ const (
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x10
|
CLOCK_THREAD_CPUTIME_ID = 0x10
|
||||||
CLOCK_UPTIME_RAW = 0x8
|
CLOCK_UPTIME_RAW = 0x8
|
||||||
CLOCK_UPTIME_RAW_APPROX = 0x9
|
CLOCK_UPTIME_RAW_APPROX = 0x9
|
||||||
|
CLONE_NOFOLLOW = 0x1
|
||||||
|
CLONE_NOOWNERCOPY = 0x2
|
||||||
CR0 = 0x0
|
CR0 = 0x0
|
||||||
CR1 = 0x1000
|
CR1 = 0x1000
|
||||||
CR2 = 0x2000
|
CR2 = 0x2000
|
||||||
|
|
|
@ -339,6 +339,12 @@ const (
|
||||||
CLOCK_UPTIME_FAST = 0x8
|
CLOCK_UPTIME_FAST = 0x8
|
||||||
CLOCK_UPTIME_PRECISE = 0x7
|
CLOCK_UPTIME_PRECISE = 0x7
|
||||||
CLOCK_VIRTUAL = 0x1
|
CLOCK_VIRTUAL = 0x1
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x30000
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -339,6 +339,12 @@ const (
|
||||||
CLOCK_UPTIME_FAST = 0x8
|
CLOCK_UPTIME_FAST = 0x8
|
||||||
CLOCK_UPTIME_PRECISE = 0x7
|
CLOCK_UPTIME_PRECISE = 0x7
|
||||||
CLOCK_VIRTUAL = 0x1
|
CLOCK_VIRTUAL = 0x1
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x30000
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -339,6 +339,12 @@ const (
|
||||||
CLOCK_UPTIME_FAST = 0x8
|
CLOCK_UPTIME_FAST = 0x8
|
||||||
CLOCK_UPTIME_PRECISE = 0x7
|
CLOCK_UPTIME_PRECISE = 0x7
|
||||||
CLOCK_VIRTUAL = 0x1
|
CLOCK_VIRTUAL = 0x1
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x30000
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -339,6 +339,12 @@ const (
|
||||||
CLOCK_UPTIME_FAST = 0x8
|
CLOCK_UPTIME_FAST = 0x8
|
||||||
CLOCK_UPTIME_PRECISE = 0x7
|
CLOCK_UPTIME_PRECISE = 0x7
|
||||||
CLOCK_VIRTUAL = 0x1
|
CLOCK_VIRTUAL = 0x1
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x30000
|
CRTSCTS = 0x30000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -244,8 +244,66 @@ const (
|
||||||
CAN_EFF_FLAG = 0x80000000
|
CAN_EFF_FLAG = 0x80000000
|
||||||
CAN_EFF_ID_BITS = 0x1d
|
CAN_EFF_ID_BITS = 0x1d
|
||||||
CAN_EFF_MASK = 0x1fffffff
|
CAN_EFF_MASK = 0x1fffffff
|
||||||
|
CAN_ERR_ACK = 0x20
|
||||||
|
CAN_ERR_BUSERROR = 0x80
|
||||||
|
CAN_ERR_BUSOFF = 0x40
|
||||||
|
CAN_ERR_CRTL = 0x4
|
||||||
|
CAN_ERR_CRTL_ACTIVE = 0x40
|
||||||
|
CAN_ERR_CRTL_RX_OVERFLOW = 0x1
|
||||||
|
CAN_ERR_CRTL_RX_PASSIVE = 0x10
|
||||||
|
CAN_ERR_CRTL_RX_WARNING = 0x4
|
||||||
|
CAN_ERR_CRTL_TX_OVERFLOW = 0x2
|
||||||
|
CAN_ERR_CRTL_TX_PASSIVE = 0x20
|
||||||
|
CAN_ERR_CRTL_TX_WARNING = 0x8
|
||||||
|
CAN_ERR_CRTL_UNSPEC = 0x0
|
||||||
|
CAN_ERR_DLC = 0x8
|
||||||
CAN_ERR_FLAG = 0x20000000
|
CAN_ERR_FLAG = 0x20000000
|
||||||
|
CAN_ERR_LOSTARB = 0x2
|
||||||
|
CAN_ERR_LOSTARB_UNSPEC = 0x0
|
||||||
CAN_ERR_MASK = 0x1fffffff
|
CAN_ERR_MASK = 0x1fffffff
|
||||||
|
CAN_ERR_PROT = 0x8
|
||||||
|
CAN_ERR_PROT_ACTIVE = 0x40
|
||||||
|
CAN_ERR_PROT_BIT = 0x1
|
||||||
|
CAN_ERR_PROT_BIT0 = 0x8
|
||||||
|
CAN_ERR_PROT_BIT1 = 0x10
|
||||||
|
CAN_ERR_PROT_FORM = 0x2
|
||||||
|
CAN_ERR_PROT_LOC_ACK = 0x19
|
||||||
|
CAN_ERR_PROT_LOC_ACK_DEL = 0x1b
|
||||||
|
CAN_ERR_PROT_LOC_CRC_DEL = 0x18
|
||||||
|
CAN_ERR_PROT_LOC_CRC_SEQ = 0x8
|
||||||
|
CAN_ERR_PROT_LOC_DATA = 0xa
|
||||||
|
CAN_ERR_PROT_LOC_DLC = 0xb
|
||||||
|
CAN_ERR_PROT_LOC_EOF = 0x1a
|
||||||
|
CAN_ERR_PROT_LOC_ID04_00 = 0xe
|
||||||
|
CAN_ERR_PROT_LOC_ID12_05 = 0xf
|
||||||
|
CAN_ERR_PROT_LOC_ID17_13 = 0x7
|
||||||
|
CAN_ERR_PROT_LOC_ID20_18 = 0x6
|
||||||
|
CAN_ERR_PROT_LOC_ID28_21 = 0x2
|
||||||
|
CAN_ERR_PROT_LOC_IDE = 0x5
|
||||||
|
CAN_ERR_PROT_LOC_INTERM = 0x12
|
||||||
|
CAN_ERR_PROT_LOC_RES0 = 0x9
|
||||||
|
CAN_ERR_PROT_LOC_RES1 = 0xd
|
||||||
|
CAN_ERR_PROT_LOC_RTR = 0xc
|
||||||
|
CAN_ERR_PROT_LOC_SOF = 0x3
|
||||||
|
CAN_ERR_PROT_LOC_SRTR = 0x4
|
||||||
|
CAN_ERR_PROT_LOC_UNSPEC = 0x0
|
||||||
|
CAN_ERR_PROT_OVERLOAD = 0x20
|
||||||
|
CAN_ERR_PROT_STUFF = 0x4
|
||||||
|
CAN_ERR_PROT_TX = 0x80
|
||||||
|
CAN_ERR_PROT_UNSPEC = 0x0
|
||||||
|
CAN_ERR_RESTARTED = 0x100
|
||||||
|
CAN_ERR_TRX = 0x10
|
||||||
|
CAN_ERR_TRX_CANH_NO_WIRE = 0x4
|
||||||
|
CAN_ERR_TRX_CANH_SHORT_TO_BAT = 0x5
|
||||||
|
CAN_ERR_TRX_CANH_SHORT_TO_GND = 0x7
|
||||||
|
CAN_ERR_TRX_CANH_SHORT_TO_VCC = 0x6
|
||||||
|
CAN_ERR_TRX_CANL_NO_WIRE = 0x40
|
||||||
|
CAN_ERR_TRX_CANL_SHORT_TO_BAT = 0x50
|
||||||
|
CAN_ERR_TRX_CANL_SHORT_TO_CANH = 0x80
|
||||||
|
CAN_ERR_TRX_CANL_SHORT_TO_GND = 0x70
|
||||||
|
CAN_ERR_TRX_CANL_SHORT_TO_VCC = 0x60
|
||||||
|
CAN_ERR_TRX_UNSPEC = 0x0
|
||||||
|
CAN_ERR_TX_TIMEOUT = 0x1
|
||||||
CAN_INV_FILTER = 0x20000000
|
CAN_INV_FILTER = 0x20000000
|
||||||
CAN_ISOTP = 0x6
|
CAN_ISOTP = 0x6
|
||||||
CAN_J1939 = 0x7
|
CAN_J1939 = 0x7
|
||||||
|
@ -265,6 +323,7 @@ const (
|
||||||
CAP_AUDIT_READ = 0x25
|
CAP_AUDIT_READ = 0x25
|
||||||
CAP_AUDIT_WRITE = 0x1d
|
CAP_AUDIT_WRITE = 0x1d
|
||||||
CAP_BLOCK_SUSPEND = 0x24
|
CAP_BLOCK_SUSPEND = 0x24
|
||||||
|
CAP_BPF = 0x27
|
||||||
CAP_CHOWN = 0x0
|
CAP_CHOWN = 0x0
|
||||||
CAP_DAC_OVERRIDE = 0x1
|
CAP_DAC_OVERRIDE = 0x1
|
||||||
CAP_DAC_READ_SEARCH = 0x2
|
CAP_DAC_READ_SEARCH = 0x2
|
||||||
|
@ -273,7 +332,7 @@ const (
|
||||||
CAP_IPC_LOCK = 0xe
|
CAP_IPC_LOCK = 0xe
|
||||||
CAP_IPC_OWNER = 0xf
|
CAP_IPC_OWNER = 0xf
|
||||||
CAP_KILL = 0x5
|
CAP_KILL = 0x5
|
||||||
CAP_LAST_CAP = 0x25
|
CAP_LAST_CAP = 0x27
|
||||||
CAP_LEASE = 0x1c
|
CAP_LEASE = 0x1c
|
||||||
CAP_LINUX_IMMUTABLE = 0x9
|
CAP_LINUX_IMMUTABLE = 0x9
|
||||||
CAP_MAC_ADMIN = 0x21
|
CAP_MAC_ADMIN = 0x21
|
||||||
|
@ -283,6 +342,7 @@ const (
|
||||||
CAP_NET_BIND_SERVICE = 0xa
|
CAP_NET_BIND_SERVICE = 0xa
|
||||||
CAP_NET_BROADCAST = 0xb
|
CAP_NET_BROADCAST = 0xb
|
||||||
CAP_NET_RAW = 0xd
|
CAP_NET_RAW = 0xd
|
||||||
|
CAP_PERFMON = 0x26
|
||||||
CAP_SETFCAP = 0x1f
|
CAP_SETFCAP = 0x1f
|
||||||
CAP_SETGID = 0x6
|
CAP_SETGID = 0x6
|
||||||
CAP_SETPCAP = 0x8
|
CAP_SETPCAP = 0x8
|
||||||
|
@ -372,8 +432,54 @@ const (
|
||||||
DEVLINK_GENL_NAME = "devlink"
|
DEVLINK_GENL_NAME = "devlink"
|
||||||
DEVLINK_GENL_VERSION = 0x1
|
DEVLINK_GENL_VERSION = 0x1
|
||||||
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
|
||||||
|
DEVMEM_MAGIC = 0x454d444d
|
||||||
DEVPTS_SUPER_MAGIC = 0x1cd1
|
DEVPTS_SUPER_MAGIC = 0x1cd1
|
||||||
DMA_BUF_MAGIC = 0x444d4142
|
DMA_BUF_MAGIC = 0x444d4142
|
||||||
|
DM_ACTIVE_PRESENT_FLAG = 0x20
|
||||||
|
DM_BUFFER_FULL_FLAG = 0x100
|
||||||
|
DM_CONTROL_NODE = "control"
|
||||||
|
DM_DATA_OUT_FLAG = 0x10000
|
||||||
|
DM_DEFERRED_REMOVE = 0x20000
|
||||||
|
DM_DEV_ARM_POLL = 0xc138fd10
|
||||||
|
DM_DEV_CREATE = 0xc138fd03
|
||||||
|
DM_DEV_REMOVE = 0xc138fd04
|
||||||
|
DM_DEV_RENAME = 0xc138fd05
|
||||||
|
DM_DEV_SET_GEOMETRY = 0xc138fd0f
|
||||||
|
DM_DEV_STATUS = 0xc138fd07
|
||||||
|
DM_DEV_SUSPEND = 0xc138fd06
|
||||||
|
DM_DEV_WAIT = 0xc138fd08
|
||||||
|
DM_DIR = "mapper"
|
||||||
|
DM_GET_TARGET_VERSION = 0xc138fd11
|
||||||
|
DM_INACTIVE_PRESENT_FLAG = 0x40
|
||||||
|
DM_INTERNAL_SUSPEND_FLAG = 0x40000
|
||||||
|
DM_IOCTL = 0xfd
|
||||||
|
DM_LIST_DEVICES = 0xc138fd02
|
||||||
|
DM_LIST_VERSIONS = 0xc138fd0d
|
||||||
|
DM_MAX_TYPE_NAME = 0x10
|
||||||
|
DM_NAME_LEN = 0x80
|
||||||
|
DM_NOFLUSH_FLAG = 0x800
|
||||||
|
DM_PERSISTENT_DEV_FLAG = 0x8
|
||||||
|
DM_QUERY_INACTIVE_TABLE_FLAG = 0x1000
|
||||||
|
DM_READONLY_FLAG = 0x1
|
||||||
|
DM_REMOVE_ALL = 0xc138fd01
|
||||||
|
DM_SECURE_DATA_FLAG = 0x8000
|
||||||
|
DM_SKIP_BDGET_FLAG = 0x200
|
||||||
|
DM_SKIP_LOCKFS_FLAG = 0x400
|
||||||
|
DM_STATUS_TABLE_FLAG = 0x10
|
||||||
|
DM_SUSPEND_FLAG = 0x2
|
||||||
|
DM_TABLE_CLEAR = 0xc138fd0a
|
||||||
|
DM_TABLE_DEPS = 0xc138fd0b
|
||||||
|
DM_TABLE_LOAD = 0xc138fd09
|
||||||
|
DM_TABLE_STATUS = 0xc138fd0c
|
||||||
|
DM_TARGET_MSG = 0xc138fd0e
|
||||||
|
DM_UEVENT_GENERATED_FLAG = 0x2000
|
||||||
|
DM_UUID_FLAG = 0x4000
|
||||||
|
DM_UUID_LEN = 0x81
|
||||||
|
DM_VERSION = 0xc138fd00
|
||||||
|
DM_VERSION_EXTRA = "-ioctl (2020-02-27)"
|
||||||
|
DM_VERSION_MAJOR = 0x4
|
||||||
|
DM_VERSION_MINOR = 0x2a
|
||||||
|
DM_VERSION_PATCHLEVEL = 0x0
|
||||||
DT_BLK = 0x6
|
DT_BLK = 0x6
|
||||||
DT_CHR = 0x2
|
DT_CHR = 0x2
|
||||||
DT_DIR = 0x4
|
DT_DIR = 0x4
|
||||||
|
@ -475,6 +581,7 @@ const (
|
||||||
ETH_P_MOBITEX = 0x15
|
ETH_P_MOBITEX = 0x15
|
||||||
ETH_P_MPLS_MC = 0x8848
|
ETH_P_MPLS_MC = 0x8848
|
||||||
ETH_P_MPLS_UC = 0x8847
|
ETH_P_MPLS_UC = 0x8847
|
||||||
|
ETH_P_MRP = 0x88e3
|
||||||
ETH_P_MVRP = 0x88f5
|
ETH_P_MVRP = 0x88f5
|
||||||
ETH_P_NCSI = 0x88f8
|
ETH_P_NCSI = 0x88f8
|
||||||
ETH_P_NSH = 0x894f
|
ETH_P_NSH = 0x894f
|
||||||
|
@ -602,8 +709,9 @@ const (
|
||||||
FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0
|
FSCRYPT_POLICY_FLAGS_PAD_4 = 0x0
|
||||||
FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1
|
FSCRYPT_POLICY_FLAGS_PAD_8 = 0x1
|
||||||
FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3
|
FSCRYPT_POLICY_FLAGS_PAD_MASK = 0x3
|
||||||
FSCRYPT_POLICY_FLAGS_VALID = 0xf
|
FSCRYPT_POLICY_FLAGS_VALID = 0x1f
|
||||||
FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4
|
FSCRYPT_POLICY_FLAG_DIRECT_KEY = 0x4
|
||||||
|
FSCRYPT_POLICY_FLAG_IV_INO_LBLK_32 = 0x10
|
||||||
FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8
|
FSCRYPT_POLICY_FLAG_IV_INO_LBLK_64 = 0x8
|
||||||
FSCRYPT_POLICY_V1 = 0x0
|
FSCRYPT_POLICY_V1 = 0x0
|
||||||
FSCRYPT_POLICY_V2 = 0x2
|
FSCRYPT_POLICY_V2 = 0x2
|
||||||
|
@ -632,7 +740,7 @@ const (
|
||||||
FS_POLICY_FLAGS_PAD_4 = 0x0
|
FS_POLICY_FLAGS_PAD_4 = 0x0
|
||||||
FS_POLICY_FLAGS_PAD_8 = 0x1
|
FS_POLICY_FLAGS_PAD_8 = 0x1
|
||||||
FS_POLICY_FLAGS_PAD_MASK = 0x3
|
FS_POLICY_FLAGS_PAD_MASK = 0x3
|
||||||
FS_POLICY_FLAGS_VALID = 0xf
|
FS_POLICY_FLAGS_VALID = 0x1f
|
||||||
FS_VERITY_FL = 0x100000
|
FS_VERITY_FL = 0x100000
|
||||||
FS_VERITY_HASH_ALG_SHA256 = 0x1
|
FS_VERITY_HASH_ALG_SHA256 = 0x1
|
||||||
FS_VERITY_HASH_ALG_SHA512 = 0x2
|
FS_VERITY_HASH_ALG_SHA512 = 0x2
|
||||||
|
@ -834,6 +942,7 @@ const (
|
||||||
IPPROTO_EGP = 0x8
|
IPPROTO_EGP = 0x8
|
||||||
IPPROTO_ENCAP = 0x62
|
IPPROTO_ENCAP = 0x62
|
||||||
IPPROTO_ESP = 0x32
|
IPPROTO_ESP = 0x32
|
||||||
|
IPPROTO_ETHERNET = 0x8f
|
||||||
IPPROTO_FRAGMENT = 0x2c
|
IPPROTO_FRAGMENT = 0x2c
|
||||||
IPPROTO_GRE = 0x2f
|
IPPROTO_GRE = 0x2f
|
||||||
IPPROTO_HOPOPTS = 0x0
|
IPPROTO_HOPOPTS = 0x0
|
||||||
|
@ -847,6 +956,7 @@ const (
|
||||||
IPPROTO_L2TP = 0x73
|
IPPROTO_L2TP = 0x73
|
||||||
IPPROTO_MH = 0x87
|
IPPROTO_MH = 0x87
|
||||||
IPPROTO_MPLS = 0x89
|
IPPROTO_MPLS = 0x89
|
||||||
|
IPPROTO_MPTCP = 0x106
|
||||||
IPPROTO_MTP = 0x5c
|
IPPROTO_MTP = 0x5c
|
||||||
IPPROTO_NONE = 0x3b
|
IPPROTO_NONE = 0x3b
|
||||||
IPPROTO_PIM = 0x67
|
IPPROTO_PIM = 0x67
|
||||||
|
@ -1016,6 +1126,7 @@ const (
|
||||||
KEYCTL_CAPS0_PERSISTENT_KEYRINGS = 0x2
|
KEYCTL_CAPS0_PERSISTENT_KEYRINGS = 0x2
|
||||||
KEYCTL_CAPS0_PUBLIC_KEY = 0x8
|
KEYCTL_CAPS0_PUBLIC_KEY = 0x8
|
||||||
KEYCTL_CAPS0_RESTRICT_KEYRING = 0x40
|
KEYCTL_CAPS0_RESTRICT_KEYRING = 0x40
|
||||||
|
KEYCTL_CAPS1_NOTIFICATIONS = 0x4
|
||||||
KEYCTL_CAPS1_NS_KEYRING_NAME = 0x1
|
KEYCTL_CAPS1_NS_KEYRING_NAME = 0x1
|
||||||
KEYCTL_CAPS1_NS_KEY_TAG = 0x2
|
KEYCTL_CAPS1_NS_KEY_TAG = 0x2
|
||||||
KEYCTL_CHOWN = 0x4
|
KEYCTL_CHOWN = 0x4
|
||||||
|
@ -1053,6 +1164,7 @@ const (
|
||||||
KEYCTL_SUPPORTS_VERIFY = 0x8
|
KEYCTL_SUPPORTS_VERIFY = 0x8
|
||||||
KEYCTL_UNLINK = 0x9
|
KEYCTL_UNLINK = 0x9
|
||||||
KEYCTL_UPDATE = 0x2
|
KEYCTL_UPDATE = 0x2
|
||||||
|
KEYCTL_WATCH_KEY = 0x20
|
||||||
KEY_REQKEY_DEFL_DEFAULT = 0x0
|
KEY_REQKEY_DEFL_DEFAULT = 0x0
|
||||||
KEY_REQKEY_DEFL_GROUP_KEYRING = 0x6
|
KEY_REQKEY_DEFL_GROUP_KEYRING = 0x6
|
||||||
KEY_REQKEY_DEFL_NO_CHANGE = -0x1
|
KEY_REQKEY_DEFL_NO_CHANGE = -0x1
|
||||||
|
@ -1096,6 +1208,8 @@ const (
|
||||||
LOOP_SET_FD = 0x4c00
|
LOOP_SET_FD = 0x4c00
|
||||||
LOOP_SET_STATUS = 0x4c02
|
LOOP_SET_STATUS = 0x4c02
|
||||||
LOOP_SET_STATUS64 = 0x4c04
|
LOOP_SET_STATUS64 = 0x4c04
|
||||||
|
LOOP_SET_STATUS_CLEARABLE_FLAGS = 0x4
|
||||||
|
LOOP_SET_STATUS_SETTABLE_FLAGS = 0xc
|
||||||
LO_KEY_SIZE = 0x20
|
LO_KEY_SIZE = 0x20
|
||||||
LO_NAME_SIZE = 0x40
|
LO_NAME_SIZE = 0x40
|
||||||
MADV_COLD = 0x14
|
MADV_COLD = 0x14
|
||||||
|
@ -1929,6 +2043,7 @@ const (
|
||||||
SOL_ATM = 0x108
|
SOL_ATM = 0x108
|
||||||
SOL_CAIF = 0x116
|
SOL_CAIF = 0x116
|
||||||
SOL_CAN_BASE = 0x64
|
SOL_CAN_BASE = 0x64
|
||||||
|
SOL_CAN_RAW = 0x65
|
||||||
SOL_DCCP = 0x10d
|
SOL_DCCP = 0x10d
|
||||||
SOL_DECNET = 0x105
|
SOL_DECNET = 0x105
|
||||||
SOL_ICMPV6 = 0x3a
|
SOL_ICMPV6 = 0x3a
|
||||||
|
@ -1992,8 +2107,10 @@ const (
|
||||||
STATX_ATTR_APPEND = 0x20
|
STATX_ATTR_APPEND = 0x20
|
||||||
STATX_ATTR_AUTOMOUNT = 0x1000
|
STATX_ATTR_AUTOMOUNT = 0x1000
|
||||||
STATX_ATTR_COMPRESSED = 0x4
|
STATX_ATTR_COMPRESSED = 0x4
|
||||||
|
STATX_ATTR_DAX = 0x2000
|
||||||
STATX_ATTR_ENCRYPTED = 0x800
|
STATX_ATTR_ENCRYPTED = 0x800
|
||||||
STATX_ATTR_IMMUTABLE = 0x10
|
STATX_ATTR_IMMUTABLE = 0x10
|
||||||
|
STATX_ATTR_MOUNT_ROOT = 0x2000
|
||||||
STATX_ATTR_NODUMP = 0x40
|
STATX_ATTR_NODUMP = 0x40
|
||||||
STATX_ATTR_VERITY = 0x100000
|
STATX_ATTR_VERITY = 0x100000
|
||||||
STATX_BASIC_STATS = 0x7ff
|
STATX_BASIC_STATS = 0x7ff
|
||||||
|
@ -2002,6 +2119,7 @@ const (
|
||||||
STATX_CTIME = 0x80
|
STATX_CTIME = 0x80
|
||||||
STATX_GID = 0x10
|
STATX_GID = 0x10
|
||||||
STATX_INO = 0x100
|
STATX_INO = 0x100
|
||||||
|
STATX_MNT_ID = 0x1000
|
||||||
STATX_MODE = 0x2
|
STATX_MODE = 0x2
|
||||||
STATX_MTIME = 0x40
|
STATX_MTIME = 0x40
|
||||||
STATX_NLINK = 0x4
|
STATX_NLINK = 0x4
|
||||||
|
|
|
@ -192,6 +192,7 @@ const (
|
||||||
PPPIOCSRASYNCMAP = 0x40047454
|
PPPIOCSRASYNCMAP = 0x40047454
|
||||||
PPPIOCSXASYNCMAP = 0x4020744f
|
PPPIOCSXASYNCMAP = 0x4020744f
|
||||||
PPPIOCXFERUNIT = 0x744e
|
PPPIOCXFERUNIT = 0x744e
|
||||||
|
PROT_BTI = 0x10
|
||||||
PR_SET_PTRACER_ANY = 0xffffffffffffffff
|
PR_SET_PTRACER_ANY = 0xffffffffffffffff
|
||||||
PTRACE_SYSEMU = 0x1f
|
PTRACE_SYSEMU = 0x1f
|
||||||
PTRACE_SYSEMU_SINGLESTEP = 0x20
|
PTRACE_SYSEMU_SINGLESTEP = 0x20
|
||||||
|
|
|
@ -158,6 +158,12 @@ const (
|
||||||
CLONE_SIGHAND = 0x800
|
CLONE_SIGHAND = 0x800
|
||||||
CLONE_VFORK = 0x4000
|
CLONE_VFORK = 0x4000
|
||||||
CLONE_VM = 0x100
|
CLONE_VM = 0x100
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -158,6 +158,12 @@ const (
|
||||||
CLONE_SIGHAND = 0x800
|
CLONE_SIGHAND = 0x800
|
||||||
CLONE_VFORK = 0x4000
|
CLONE_VFORK = 0x4000
|
||||||
CLONE_VM = 0x100
|
CLONE_VM = 0x100
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -150,6 +150,12 @@ const (
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -158,6 +158,12 @@ const (
|
||||||
CLONE_SIGHAND = 0x800
|
CLONE_SIGHAND = 0x800
|
||||||
CLONE_VFORK = 0x4000
|
CLONE_VFORK = 0x4000
|
||||||
CLONE_VM = 0x100
|
CLONE_VM = 0x100
|
||||||
|
CPUSTATES = 0x5
|
||||||
|
CP_IDLE = 0x4
|
||||||
|
CP_INTR = 0x3
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -146,6 +146,13 @@ const (
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CPUSTATES = 0x6
|
||||||
|
CP_IDLE = 0x5
|
||||||
|
CP_INTR = 0x4
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SPIN = 0x3
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -153,6 +153,13 @@ const (
|
||||||
CLOCK_REALTIME = 0x0
|
CLOCK_REALTIME = 0x0
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x4
|
CLOCK_THREAD_CPUTIME_ID = 0x4
|
||||||
CLOCK_UPTIME = 0x5
|
CLOCK_UPTIME = 0x5
|
||||||
|
CPUSTATES = 0x6
|
||||||
|
CP_IDLE = 0x5
|
||||||
|
CP_INTR = 0x4
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SPIN = 0x3
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -146,6 +146,13 @@ const (
|
||||||
BRKINT = 0x2
|
BRKINT = 0x2
|
||||||
CFLUSH = 0xf
|
CFLUSH = 0xf
|
||||||
CLOCAL = 0x8000
|
CLOCAL = 0x8000
|
||||||
|
CPUSTATES = 0x6
|
||||||
|
CP_IDLE = 0x5
|
||||||
|
CP_INTR = 0x4
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SPIN = 0x3
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -156,6 +156,13 @@ const (
|
||||||
CLOCK_REALTIME = 0x0
|
CLOCK_REALTIME = 0x0
|
||||||
CLOCK_THREAD_CPUTIME_ID = 0x4
|
CLOCK_THREAD_CPUTIME_ID = 0x4
|
||||||
CLOCK_UPTIME = 0x5
|
CLOCK_UPTIME = 0x5
|
||||||
|
CPUSTATES = 0x6
|
||||||
|
CP_IDLE = 0x5
|
||||||
|
CP_INTR = 0x4
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SPIN = 0x3
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
CREAD = 0x800
|
CREAD = 0x800
|
||||||
CRTSCTS = 0x10000
|
CRTSCTS = 0x10000
|
||||||
CS5 = 0x0
|
CS5 = 0x0
|
||||||
|
|
|
@ -0,0 +1,1862 @@
|
||||||
|
// mkerrors.sh -m64
|
||||||
|
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||||
|
|
||||||
|
// +build mips64,openbsd
|
||||||
|
|
||||||
|
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
|
||||||
|
// cgo -godefs -- -m64 _const.go
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "syscall"
|
||||||
|
|
||||||
|
const (
|
||||||
|
AF_APPLETALK = 0x10
|
||||||
|
AF_BLUETOOTH = 0x20
|
||||||
|
AF_CCITT = 0xa
|
||||||
|
AF_CHAOS = 0x5
|
||||||
|
AF_CNT = 0x15
|
||||||
|
AF_COIP = 0x14
|
||||||
|
AF_DATAKIT = 0x9
|
||||||
|
AF_DECnet = 0xc
|
||||||
|
AF_DLI = 0xd
|
||||||
|
AF_E164 = 0x1a
|
||||||
|
AF_ECMA = 0x8
|
||||||
|
AF_ENCAP = 0x1c
|
||||||
|
AF_HYLINK = 0xf
|
||||||
|
AF_IMPLINK = 0x3
|
||||||
|
AF_INET = 0x2
|
||||||
|
AF_INET6 = 0x18
|
||||||
|
AF_IPX = 0x17
|
||||||
|
AF_ISDN = 0x1a
|
||||||
|
AF_ISO = 0x7
|
||||||
|
AF_KEY = 0x1e
|
||||||
|
AF_LAT = 0xe
|
||||||
|
AF_LINK = 0x12
|
||||||
|
AF_LOCAL = 0x1
|
||||||
|
AF_MAX = 0x24
|
||||||
|
AF_MPLS = 0x21
|
||||||
|
AF_NATM = 0x1b
|
||||||
|
AF_NS = 0x6
|
||||||
|
AF_OSI = 0x7
|
||||||
|
AF_PUP = 0x4
|
||||||
|
AF_ROUTE = 0x11
|
||||||
|
AF_SIP = 0x1d
|
||||||
|
AF_SNA = 0xb
|
||||||
|
AF_UNIX = 0x1
|
||||||
|
AF_UNSPEC = 0x0
|
||||||
|
ALTWERASE = 0x200
|
||||||
|
ARPHRD_ETHER = 0x1
|
||||||
|
ARPHRD_FRELAY = 0xf
|
||||||
|
ARPHRD_IEEE1394 = 0x18
|
||||||
|
ARPHRD_IEEE802 = 0x6
|
||||||
|
B0 = 0x0
|
||||||
|
B110 = 0x6e
|
||||||
|
B115200 = 0x1c200
|
||||||
|
B1200 = 0x4b0
|
||||||
|
B134 = 0x86
|
||||||
|
B14400 = 0x3840
|
||||||
|
B150 = 0x96
|
||||||
|
B1800 = 0x708
|
||||||
|
B19200 = 0x4b00
|
||||||
|
B200 = 0xc8
|
||||||
|
B230400 = 0x38400
|
||||||
|
B2400 = 0x960
|
||||||
|
B28800 = 0x7080
|
||||||
|
B300 = 0x12c
|
||||||
|
B38400 = 0x9600
|
||||||
|
B4800 = 0x12c0
|
||||||
|
B50 = 0x32
|
||||||
|
B57600 = 0xe100
|
||||||
|
B600 = 0x258
|
||||||
|
B7200 = 0x1c20
|
||||||
|
B75 = 0x4b
|
||||||
|
B76800 = 0x12c00
|
||||||
|
B9600 = 0x2580
|
||||||
|
BIOCFLUSH = 0x20004268
|
||||||
|
BIOCGBLEN = 0x40044266
|
||||||
|
BIOCGDIRFILT = 0x4004427c
|
||||||
|
BIOCGDLT = 0x4004426a
|
||||||
|
BIOCGDLTLIST = 0xc010427b
|
||||||
|
BIOCGETIF = 0x4020426b
|
||||||
|
BIOCGFILDROP = 0x40044278
|
||||||
|
BIOCGHDRCMPLT = 0x40044274
|
||||||
|
BIOCGRSIG = 0x40044273
|
||||||
|
BIOCGRTIMEOUT = 0x4010426e
|
||||||
|
BIOCGSTATS = 0x4008426f
|
||||||
|
BIOCIMMEDIATE = 0x80044270
|
||||||
|
BIOCLOCK = 0x20004276
|
||||||
|
BIOCPROMISC = 0x20004269
|
||||||
|
BIOCSBLEN = 0xc0044266
|
||||||
|
BIOCSDIRFILT = 0x8004427d
|
||||||
|
BIOCSDLT = 0x8004427a
|
||||||
|
BIOCSETF = 0x80104267
|
||||||
|
BIOCSETIF = 0x8020426c
|
||||||
|
BIOCSETWF = 0x80104277
|
||||||
|
BIOCSFILDROP = 0x80044279
|
||||||
|
BIOCSHDRCMPLT = 0x80044275
|
||||||
|
BIOCSRSIG = 0x80044272
|
||||||
|
BIOCSRTIMEOUT = 0x8010426d
|
||||||
|
BIOCVERSION = 0x40044271
|
||||||
|
BPF_A = 0x10
|
||||||
|
BPF_ABS = 0x20
|
||||||
|
BPF_ADD = 0x0
|
||||||
|
BPF_ALIGNMENT = 0x4
|
||||||
|
BPF_ALU = 0x4
|
||||||
|
BPF_AND = 0x50
|
||||||
|
BPF_B = 0x10
|
||||||
|
BPF_DIRECTION_IN = 0x1
|
||||||
|
BPF_DIRECTION_OUT = 0x2
|
||||||
|
BPF_DIV = 0x30
|
||||||
|
BPF_FILDROP_CAPTURE = 0x1
|
||||||
|
BPF_FILDROP_DROP = 0x2
|
||||||
|
BPF_FILDROP_PASS = 0x0
|
||||||
|
BPF_H = 0x8
|
||||||
|
BPF_IMM = 0x0
|
||||||
|
BPF_IND = 0x40
|
||||||
|
BPF_JA = 0x0
|
||||||
|
BPF_JEQ = 0x10
|
||||||
|
BPF_JGE = 0x30
|
||||||
|
BPF_JGT = 0x20
|
||||||
|
BPF_JMP = 0x5
|
||||||
|
BPF_JSET = 0x40
|
||||||
|
BPF_K = 0x0
|
||||||
|
BPF_LD = 0x0
|
||||||
|
BPF_LDX = 0x1
|
||||||
|
BPF_LEN = 0x80
|
||||||
|
BPF_LSH = 0x60
|
||||||
|
BPF_MAJOR_VERSION = 0x1
|
||||||
|
BPF_MAXBUFSIZE = 0x200000
|
||||||
|
BPF_MAXINSNS = 0x200
|
||||||
|
BPF_MEM = 0x60
|
||||||
|
BPF_MEMWORDS = 0x10
|
||||||
|
BPF_MINBUFSIZE = 0x20
|
||||||
|
BPF_MINOR_VERSION = 0x1
|
||||||
|
BPF_MISC = 0x7
|
||||||
|
BPF_MSH = 0xa0
|
||||||
|
BPF_MUL = 0x20
|
||||||
|
BPF_NEG = 0x80
|
||||||
|
BPF_OR = 0x40
|
||||||
|
BPF_RELEASE = 0x30bb6
|
||||||
|
BPF_RET = 0x6
|
||||||
|
BPF_RSH = 0x70
|
||||||
|
BPF_ST = 0x2
|
||||||
|
BPF_STX = 0x3
|
||||||
|
BPF_SUB = 0x10
|
||||||
|
BPF_TAX = 0x0
|
||||||
|
BPF_TXA = 0x80
|
||||||
|
BPF_W = 0x0
|
||||||
|
BPF_X = 0x8
|
||||||
|
BRKINT = 0x2
|
||||||
|
CFLUSH = 0xf
|
||||||
|
CLOCAL = 0x8000
|
||||||
|
CLOCK_BOOTTIME = 0x6
|
||||||
|
CLOCK_MONOTONIC = 0x3
|
||||||
|
CLOCK_PROCESS_CPUTIME_ID = 0x2
|
||||||
|
CLOCK_REALTIME = 0x0
|
||||||
|
CLOCK_THREAD_CPUTIME_ID = 0x4
|
||||||
|
CLOCK_UPTIME = 0x5
|
||||||
|
CPUSTATES = 0x6
|
||||||
|
CP_IDLE = 0x5
|
||||||
|
CP_INTR = 0x4
|
||||||
|
CP_NICE = 0x1
|
||||||
|
CP_SPIN = 0x3
|
||||||
|
CP_SYS = 0x2
|
||||||
|
CP_USER = 0x0
|
||||||
|
CREAD = 0x800
|
||||||
|
CRTSCTS = 0x10000
|
||||||
|
CS5 = 0x0
|
||||||
|
CS6 = 0x100
|
||||||
|
CS7 = 0x200
|
||||||
|
CS8 = 0x300
|
||||||
|
CSIZE = 0x300
|
||||||
|
CSTART = 0x11
|
||||||
|
CSTATUS = 0xff
|
||||||
|
CSTOP = 0x13
|
||||||
|
CSTOPB = 0x400
|
||||||
|
CSUSP = 0x1a
|
||||||
|
CTL_HW = 0x6
|
||||||
|
CTL_KERN = 0x1
|
||||||
|
CTL_MAXNAME = 0xc
|
||||||
|
CTL_NET = 0x4
|
||||||
|
DIOCADDQUEUE = 0xc110445d
|
||||||
|
DIOCADDRULE = 0xcd604404
|
||||||
|
DIOCADDSTATE = 0xc1084425
|
||||||
|
DIOCCHANGERULE = 0xcd60441a
|
||||||
|
DIOCCLRIFFLAG = 0xc028445a
|
||||||
|
DIOCCLRSRCNODES = 0x20004455
|
||||||
|
DIOCCLRSTATES = 0xc0e04412
|
||||||
|
DIOCCLRSTATUS = 0xc0284416
|
||||||
|
DIOCGETLIMIT = 0xc0084427
|
||||||
|
DIOCGETQSTATS = 0xc1204460
|
||||||
|
DIOCGETQUEUE = 0xc110445f
|
||||||
|
DIOCGETQUEUES = 0xc110445e
|
||||||
|
DIOCGETRULE = 0xcd604407
|
||||||
|
DIOCGETRULES = 0xcd604406
|
||||||
|
DIOCGETRULESET = 0xc444443b
|
||||||
|
DIOCGETRULESETS = 0xc444443a
|
||||||
|
DIOCGETSRCNODES = 0xc0104454
|
||||||
|
DIOCGETSTATE = 0xc1084413
|
||||||
|
DIOCGETSTATES = 0xc0104419
|
||||||
|
DIOCGETSTATUS = 0xc1e84415
|
||||||
|
DIOCGETSYNFLWATS = 0xc0084463
|
||||||
|
DIOCGETTIMEOUT = 0xc008441e
|
||||||
|
DIOCIGETIFACES = 0xc0284457
|
||||||
|
DIOCKILLSRCNODES = 0xc080445b
|
||||||
|
DIOCKILLSTATES = 0xc0e04429
|
||||||
|
DIOCNATLOOK = 0xc0504417
|
||||||
|
DIOCOSFPADD = 0xc088444f
|
||||||
|
DIOCOSFPFLUSH = 0x2000444e
|
||||||
|
DIOCOSFPGET = 0xc0884450
|
||||||
|
DIOCRADDADDRS = 0xc4504443
|
||||||
|
DIOCRADDTABLES = 0xc450443d
|
||||||
|
DIOCRCLRADDRS = 0xc4504442
|
||||||
|
DIOCRCLRASTATS = 0xc4504448
|
||||||
|
DIOCRCLRTABLES = 0xc450443c
|
||||||
|
DIOCRCLRTSTATS = 0xc4504441
|
||||||
|
DIOCRDELADDRS = 0xc4504444
|
||||||
|
DIOCRDELTABLES = 0xc450443e
|
||||||
|
DIOCRGETADDRS = 0xc4504446
|
||||||
|
DIOCRGETASTATS = 0xc4504447
|
||||||
|
DIOCRGETTABLES = 0xc450443f
|
||||||
|
DIOCRGETTSTATS = 0xc4504440
|
||||||
|
DIOCRINADEFINE = 0xc450444d
|
||||||
|
DIOCRSETADDRS = 0xc4504445
|
||||||
|
DIOCRSETTFLAGS = 0xc450444a
|
||||||
|
DIOCRTSTADDRS = 0xc4504449
|
||||||
|
DIOCSETDEBUG = 0xc0044418
|
||||||
|
DIOCSETHOSTID = 0xc0044456
|
||||||
|
DIOCSETIFFLAG = 0xc0284459
|
||||||
|
DIOCSETLIMIT = 0xc0084428
|
||||||
|
DIOCSETREASS = 0xc004445c
|
||||||
|
DIOCSETSTATUSIF = 0xc0284414
|
||||||
|
DIOCSETSYNCOOKIES = 0xc0014462
|
||||||
|
DIOCSETSYNFLWATS = 0xc0084461
|
||||||
|
DIOCSETTIMEOUT = 0xc008441d
|
||||||
|
DIOCSTART = 0x20004401
|
||||||
|
DIOCSTOP = 0x20004402
|
||||||
|
DIOCXBEGIN = 0xc0104451
|
||||||
|
DIOCXCOMMIT = 0xc0104452
|
||||||
|
DIOCXROLLBACK = 0xc0104453
|
||||||
|
DLT_ARCNET = 0x7
|
||||||
|
DLT_ATM_RFC1483 = 0xb
|
||||||
|
DLT_AX25 = 0x3
|
||||||
|
DLT_CHAOS = 0x5
|
||||||
|
DLT_C_HDLC = 0x68
|
||||||
|
DLT_EN10MB = 0x1
|
||||||
|
DLT_EN3MB = 0x2
|
||||||
|
DLT_ENC = 0xd
|
||||||
|
DLT_FDDI = 0xa
|
||||||
|
DLT_IEEE802 = 0x6
|
||||||
|
DLT_IEEE802_11 = 0x69
|
||||||
|
DLT_IEEE802_11_RADIO = 0x7f
|
||||||
|
DLT_LOOP = 0xc
|
||||||
|
DLT_MPLS = 0xdb
|
||||||
|
DLT_NULL = 0x0
|
||||||
|
DLT_OPENFLOW = 0x10b
|
||||||
|
DLT_PFLOG = 0x75
|
||||||
|
DLT_PFSYNC = 0x12
|
||||||
|
DLT_PPP = 0x9
|
||||||
|
DLT_PPP_BSDOS = 0x10
|
||||||
|
DLT_PPP_ETHER = 0x33
|
||||||
|
DLT_PPP_SERIAL = 0x32
|
||||||
|
DLT_PRONET = 0x4
|
||||||
|
DLT_RAW = 0xe
|
||||||
|
DLT_SLIP = 0x8
|
||||||
|
DLT_SLIP_BSDOS = 0xf
|
||||||
|
DLT_USBPCAP = 0xf9
|
||||||
|
DLT_USER0 = 0x93
|
||||||
|
DLT_USER1 = 0x94
|
||||||
|
DLT_USER10 = 0x9d
|
||||||
|
DLT_USER11 = 0x9e
|
||||||
|
DLT_USER12 = 0x9f
|
||||||
|
DLT_USER13 = 0xa0
|
||||||
|
DLT_USER14 = 0xa1
|
||||||
|
DLT_USER15 = 0xa2
|
||||||
|
DLT_USER2 = 0x95
|
||||||
|
DLT_USER3 = 0x96
|
||||||
|
DLT_USER4 = 0x97
|
||||||
|
DLT_USER5 = 0x98
|
||||||
|
DLT_USER6 = 0x99
|
||||||
|
DLT_USER7 = 0x9a
|
||||||
|
DLT_USER8 = 0x9b
|
||||||
|
DLT_USER9 = 0x9c
|
||||||
|
DT_BLK = 0x6
|
||||||
|
DT_CHR = 0x2
|
||||||
|
DT_DIR = 0x4
|
||||||
|
DT_FIFO = 0x1
|
||||||
|
DT_LNK = 0xa
|
||||||
|
DT_REG = 0x8
|
||||||
|
DT_SOCK = 0xc
|
||||||
|
DT_UNKNOWN = 0x0
|
||||||
|
ECHO = 0x8
|
||||||
|
ECHOCTL = 0x40
|
||||||
|
ECHOE = 0x2
|
||||||
|
ECHOK = 0x4
|
||||||
|
ECHOKE = 0x1
|
||||||
|
ECHONL = 0x10
|
||||||
|
ECHOPRT = 0x20
|
||||||
|
EMT_TAGOVF = 0x1
|
||||||
|
EMUL_ENABLED = 0x1
|
||||||
|
EMUL_NATIVE = 0x2
|
||||||
|
ENDRUNDISC = 0x9
|
||||||
|
ETHERMIN = 0x2e
|
||||||
|
ETHERMTU = 0x5dc
|
||||||
|
ETHERTYPE_8023 = 0x4
|
||||||
|
ETHERTYPE_AARP = 0x80f3
|
||||||
|
ETHERTYPE_ACCTON = 0x8390
|
||||||
|
ETHERTYPE_AEONIC = 0x8036
|
||||||
|
ETHERTYPE_ALPHA = 0x814a
|
||||||
|
ETHERTYPE_AMBER = 0x6008
|
||||||
|
ETHERTYPE_AMOEBA = 0x8145
|
||||||
|
ETHERTYPE_AOE = 0x88a2
|
||||||
|
ETHERTYPE_APOLLO = 0x80f7
|
||||||
|
ETHERTYPE_APOLLODOMAIN = 0x8019
|
||||||
|
ETHERTYPE_APPLETALK = 0x809b
|
||||||
|
ETHERTYPE_APPLITEK = 0x80c7
|
||||||
|
ETHERTYPE_ARGONAUT = 0x803a
|
||||||
|
ETHERTYPE_ARP = 0x806
|
||||||
|
ETHERTYPE_AT = 0x809b
|
||||||
|
ETHERTYPE_ATALK = 0x809b
|
||||||
|
ETHERTYPE_ATOMIC = 0x86df
|
||||||
|
ETHERTYPE_ATT = 0x8069
|
||||||
|
ETHERTYPE_ATTSTANFORD = 0x8008
|
||||||
|
ETHERTYPE_AUTOPHON = 0x806a
|
||||||
|
ETHERTYPE_AXIS = 0x8856
|
||||||
|
ETHERTYPE_BCLOOP = 0x9003
|
||||||
|
ETHERTYPE_BOFL = 0x8102
|
||||||
|
ETHERTYPE_CABLETRON = 0x7034
|
||||||
|
ETHERTYPE_CHAOS = 0x804
|
||||||
|
ETHERTYPE_COMDESIGN = 0x806c
|
||||||
|
ETHERTYPE_COMPUGRAPHIC = 0x806d
|
||||||
|
ETHERTYPE_COUNTERPOINT = 0x8062
|
||||||
|
ETHERTYPE_CRONUS = 0x8004
|
||||||
|
ETHERTYPE_CRONUSVLN = 0x8003
|
||||||
|
ETHERTYPE_DCA = 0x1234
|
||||||
|
ETHERTYPE_DDE = 0x807b
|
||||||
|
ETHERTYPE_DEBNI = 0xaaaa
|
||||||
|
ETHERTYPE_DECAM = 0x8048
|
||||||
|
ETHERTYPE_DECCUST = 0x6006
|
||||||
|
ETHERTYPE_DECDIAG = 0x6005
|
||||||
|
ETHERTYPE_DECDNS = 0x803c
|
||||||
|
ETHERTYPE_DECDTS = 0x803e
|
||||||
|
ETHERTYPE_DECEXPER = 0x6000
|
||||||
|
ETHERTYPE_DECLAST = 0x8041
|
||||||
|
ETHERTYPE_DECLTM = 0x803f
|
||||||
|
ETHERTYPE_DECMUMPS = 0x6009
|
||||||
|
ETHERTYPE_DECNETBIOS = 0x8040
|
||||||
|
ETHERTYPE_DELTACON = 0x86de
|
||||||
|
ETHERTYPE_DIDDLE = 0x4321
|
||||||
|
ETHERTYPE_DLOG1 = 0x660
|
||||||
|
ETHERTYPE_DLOG2 = 0x661
|
||||||
|
ETHERTYPE_DN = 0x6003
|
||||||
|
ETHERTYPE_DOGFIGHT = 0x1989
|
||||||
|
ETHERTYPE_DSMD = 0x8039
|
||||||
|
ETHERTYPE_ECMA = 0x803
|
||||||
|
ETHERTYPE_ENCRYPT = 0x803d
|
||||||
|
ETHERTYPE_ES = 0x805d
|
||||||
|
ETHERTYPE_EXCELAN = 0x8010
|
||||||
|
ETHERTYPE_EXPERDATA = 0x8049
|
||||||
|
ETHERTYPE_FLIP = 0x8146
|
||||||
|
ETHERTYPE_FLOWCONTROL = 0x8808
|
||||||
|
ETHERTYPE_FRARP = 0x808
|
||||||
|
ETHERTYPE_GENDYN = 0x8068
|
||||||
|
ETHERTYPE_HAYES = 0x8130
|
||||||
|
ETHERTYPE_HIPPI_FP = 0x8180
|
||||||
|
ETHERTYPE_HITACHI = 0x8820
|
||||||
|
ETHERTYPE_HP = 0x8005
|
||||||
|
ETHERTYPE_IEEEPUP = 0xa00
|
||||||
|
ETHERTYPE_IEEEPUPAT = 0xa01
|
||||||
|
ETHERTYPE_IMLBL = 0x4c42
|
||||||
|
ETHERTYPE_IMLBLDIAG = 0x424c
|
||||||
|
ETHERTYPE_IP = 0x800
|
||||||
|
ETHERTYPE_IPAS = 0x876c
|
||||||
|
ETHERTYPE_IPV6 = 0x86dd
|
||||||
|
ETHERTYPE_IPX = 0x8137
|
||||||
|
ETHERTYPE_IPXNEW = 0x8037
|
||||||
|
ETHERTYPE_KALPANA = 0x8582
|
||||||
|
ETHERTYPE_LANBRIDGE = 0x8038
|
||||||
|
ETHERTYPE_LANPROBE = 0x8888
|
||||||
|
ETHERTYPE_LAT = 0x6004
|
||||||
|
ETHERTYPE_LBACK = 0x9000
|
||||||
|
ETHERTYPE_LITTLE = 0x8060
|
||||||
|
ETHERTYPE_LLDP = 0x88cc
|
||||||
|
ETHERTYPE_LOGICRAFT = 0x8148
|
||||||
|
ETHERTYPE_LOOPBACK = 0x9000
|
||||||
|
ETHERTYPE_MACSEC = 0x88e5
|
||||||
|
ETHERTYPE_MATRA = 0x807a
|
||||||
|
ETHERTYPE_MAX = 0xffff
|
||||||
|
ETHERTYPE_MERIT = 0x807c
|
||||||
|
ETHERTYPE_MICP = 0x873a
|
||||||
|
ETHERTYPE_MOPDL = 0x6001
|
||||||
|
ETHERTYPE_MOPRC = 0x6002
|
||||||
|
ETHERTYPE_MOTOROLA = 0x818d
|
||||||
|
ETHERTYPE_MPLS = 0x8847
|
||||||
|
ETHERTYPE_MPLS_MCAST = 0x8848
|
||||||
|
ETHERTYPE_MUMPS = 0x813f
|
||||||
|
ETHERTYPE_NBPCC = 0x3c04
|
||||||
|
ETHERTYPE_NBPCLAIM = 0x3c09
|
||||||
|
ETHERTYPE_NBPCLREQ = 0x3c05
|
||||||
|
ETHERTYPE_NBPCLRSP = 0x3c06
|
||||||
|
ETHERTYPE_NBPCREQ = 0x3c02
|
||||||
|
ETHERTYPE_NBPCRSP = 0x3c03
|
||||||
|
ETHERTYPE_NBPDG = 0x3c07
|
||||||
|
ETHERTYPE_NBPDGB = 0x3c08
|
||||||
|
ETHERTYPE_NBPDLTE = 0x3c0a
|
||||||
|
ETHERTYPE_NBPRAR = 0x3c0c
|
||||||
|
ETHERTYPE_NBPRAS = 0x3c0b
|
||||||
|
ETHERTYPE_NBPRST = 0x3c0d
|
||||||
|
ETHERTYPE_NBPSCD = 0x3c01
|
||||||
|
ETHERTYPE_NBPVCD = 0x3c00
|
||||||
|
ETHERTYPE_NBS = 0x802
|
||||||
|
ETHERTYPE_NCD = 0x8149
|
||||||
|
ETHERTYPE_NESTAR = 0x8006
|
||||||
|
ETHERTYPE_NETBEUI = 0x8191
|
||||||
|
ETHERTYPE_NOVELL = 0x8138
|
||||||
|
ETHERTYPE_NS = 0x600
|
||||||
|
ETHERTYPE_NSAT = 0x601
|
||||||
|
ETHERTYPE_NSCOMPAT = 0x807
|
||||||
|
ETHERTYPE_NTRAILER = 0x10
|
||||||
|
ETHERTYPE_OS9 = 0x7007
|
||||||
|
ETHERTYPE_OS9NET = 0x7009
|
||||||
|
ETHERTYPE_PACER = 0x80c6
|
||||||
|
ETHERTYPE_PAE = 0x888e
|
||||||
|
ETHERTYPE_PBB = 0x88e7
|
||||||
|
ETHERTYPE_PCS = 0x4242
|
||||||
|
ETHERTYPE_PLANNING = 0x8044
|
||||||
|
ETHERTYPE_PPP = 0x880b
|
||||||
|
ETHERTYPE_PPPOE = 0x8864
|
||||||
|
ETHERTYPE_PPPOEDISC = 0x8863
|
||||||
|
ETHERTYPE_PRIMENTS = 0x7031
|
||||||
|
ETHERTYPE_PUP = 0x200
|
||||||
|
ETHERTYPE_PUPAT = 0x200
|
||||||
|
ETHERTYPE_QINQ = 0x88a8
|
||||||
|
ETHERTYPE_RACAL = 0x7030
|
||||||
|
ETHERTYPE_RATIONAL = 0x8150
|
||||||
|
ETHERTYPE_RAWFR = 0x6559
|
||||||
|
ETHERTYPE_RCL = 0x1995
|
||||||
|
ETHERTYPE_RDP = 0x8739
|
||||||
|
ETHERTYPE_RETIX = 0x80f2
|
||||||
|
ETHERTYPE_REVARP = 0x8035
|
||||||
|
ETHERTYPE_SCA = 0x6007
|
||||||
|
ETHERTYPE_SECTRA = 0x86db
|
||||||
|
ETHERTYPE_SECUREDATA = 0x876d
|
||||||
|
ETHERTYPE_SGITW = 0x817e
|
||||||
|
ETHERTYPE_SG_BOUNCE = 0x8016
|
||||||
|
ETHERTYPE_SG_DIAG = 0x8013
|
||||||
|
ETHERTYPE_SG_NETGAMES = 0x8014
|
||||||
|
ETHERTYPE_SG_RESV = 0x8015
|
||||||
|
ETHERTYPE_SIMNET = 0x5208
|
||||||
|
ETHERTYPE_SLOW = 0x8809
|
||||||
|
ETHERTYPE_SNA = 0x80d5
|
||||||
|
ETHERTYPE_SNMP = 0x814c
|
||||||
|
ETHERTYPE_SONIX = 0xfaf5
|
||||||
|
ETHERTYPE_SPIDER = 0x809f
|
||||||
|
ETHERTYPE_SPRITE = 0x500
|
||||||
|
ETHERTYPE_STP = 0x8181
|
||||||
|
ETHERTYPE_TALARIS = 0x812b
|
||||||
|
ETHERTYPE_TALARISMC = 0x852b
|
||||||
|
ETHERTYPE_TCPCOMP = 0x876b
|
||||||
|
ETHERTYPE_TCPSM = 0x9002
|
||||||
|
ETHERTYPE_TEC = 0x814f
|
||||||
|
ETHERTYPE_TIGAN = 0x802f
|
||||||
|
ETHERTYPE_TRAIL = 0x1000
|
||||||
|
ETHERTYPE_TRANSETHER = 0x6558
|
||||||
|
ETHERTYPE_TYMSHARE = 0x802e
|
||||||
|
ETHERTYPE_UBBST = 0x7005
|
||||||
|
ETHERTYPE_UBDEBUG = 0x900
|
||||||
|
ETHERTYPE_UBDIAGLOOP = 0x7002
|
||||||
|
ETHERTYPE_UBDL = 0x7000
|
||||||
|
ETHERTYPE_UBNIU = 0x7001
|
||||||
|
ETHERTYPE_UBNMC = 0x7003
|
||||||
|
ETHERTYPE_VALID = 0x1600
|
||||||
|
ETHERTYPE_VARIAN = 0x80dd
|
||||||
|
ETHERTYPE_VAXELN = 0x803b
|
||||||
|
ETHERTYPE_VEECO = 0x8067
|
||||||
|
ETHERTYPE_VEXP = 0x805b
|
||||||
|
ETHERTYPE_VGLAB = 0x8131
|
||||||
|
ETHERTYPE_VINES = 0xbad
|
||||||
|
ETHERTYPE_VINESECHO = 0xbaf
|
||||||
|
ETHERTYPE_VINESLOOP = 0xbae
|
||||||
|
ETHERTYPE_VITAL = 0xff00
|
||||||
|
ETHERTYPE_VLAN = 0x8100
|
||||||
|
ETHERTYPE_VLTLMAN = 0x8080
|
||||||
|
ETHERTYPE_VPROD = 0x805c
|
||||||
|
ETHERTYPE_VURESERVED = 0x8147
|
||||||
|
ETHERTYPE_WATERLOO = 0x8130
|
||||||
|
ETHERTYPE_WELLFLEET = 0x8103
|
||||||
|
ETHERTYPE_X25 = 0x805
|
||||||
|
ETHERTYPE_X75 = 0x801
|
||||||
|
ETHERTYPE_XNSSM = 0x9001
|
||||||
|
ETHERTYPE_XTP = 0x817d
|
||||||
|
ETHER_ADDR_LEN = 0x6
|
||||||
|
ETHER_ALIGN = 0x2
|
||||||
|
ETHER_CRC_LEN = 0x4
|
||||||
|
ETHER_CRC_POLY_BE = 0x4c11db6
|
||||||
|
ETHER_CRC_POLY_LE = 0xedb88320
|
||||||
|
ETHER_HDR_LEN = 0xe
|
||||||
|
ETHER_MAX_DIX_LEN = 0x600
|
||||||
|
ETHER_MAX_HARDMTU_LEN = 0xff9b
|
||||||
|
ETHER_MAX_LEN = 0x5ee
|
||||||
|
ETHER_MIN_LEN = 0x40
|
||||||
|
ETHER_TYPE_LEN = 0x2
|
||||||
|
ETHER_VLAN_ENCAP_LEN = 0x4
|
||||||
|
EVFILT_AIO = -0x3
|
||||||
|
EVFILT_DEVICE = -0x8
|
||||||
|
EVFILT_PROC = -0x5
|
||||||
|
EVFILT_READ = -0x1
|
||||||
|
EVFILT_SIGNAL = -0x6
|
||||||
|
EVFILT_SYSCOUNT = 0x8
|
||||||
|
EVFILT_TIMER = -0x7
|
||||||
|
EVFILT_VNODE = -0x4
|
||||||
|
EVFILT_WRITE = -0x2
|
||||||
|
EVL_ENCAPLEN = 0x4
|
||||||
|
EVL_PRIO_BITS = 0xd
|
||||||
|
EVL_PRIO_MAX = 0x7
|
||||||
|
EVL_VLID_MASK = 0xfff
|
||||||
|
EVL_VLID_MAX = 0xffe
|
||||||
|
EVL_VLID_MIN = 0x1
|
||||||
|
EVL_VLID_NULL = 0x0
|
||||||
|
EV_ADD = 0x1
|
||||||
|
EV_CLEAR = 0x20
|
||||||
|
EV_DELETE = 0x2
|
||||||
|
EV_DISABLE = 0x8
|
||||||
|
EV_DISPATCH = 0x80
|
||||||
|
EV_ENABLE = 0x4
|
||||||
|
EV_EOF = 0x8000
|
||||||
|
EV_ERROR = 0x4000
|
||||||
|
EV_FLAG1 = 0x2000
|
||||||
|
EV_ONESHOT = 0x10
|
||||||
|
EV_RECEIPT = 0x40
|
||||||
|
EV_SYSFLAGS = 0xf000
|
||||||
|
EXTA = 0x4b00
|
||||||
|
EXTB = 0x9600
|
||||||
|
EXTPROC = 0x800
|
||||||
|
FD_CLOEXEC = 0x1
|
||||||
|
FD_SETSIZE = 0x400
|
||||||
|
FLUSHO = 0x800000
|
||||||
|
F_DUPFD = 0x0
|
||||||
|
F_DUPFD_CLOEXEC = 0xa
|
||||||
|
F_GETFD = 0x1
|
||||||
|
F_GETFL = 0x3
|
||||||
|
F_GETLK = 0x7
|
||||||
|
F_GETOWN = 0x5
|
||||||
|
F_ISATTY = 0xb
|
||||||
|
F_OK = 0x0
|
||||||
|
F_RDLCK = 0x1
|
||||||
|
F_SETFD = 0x2
|
||||||
|
F_SETFL = 0x4
|
||||||
|
F_SETLK = 0x8
|
||||||
|
F_SETLKW = 0x9
|
||||||
|
F_SETOWN = 0x6
|
||||||
|
F_UNLCK = 0x2
|
||||||
|
F_WRLCK = 0x3
|
||||||
|
HUPCL = 0x4000
|
||||||
|
HW_MACHINE = 0x1
|
||||||
|
ICANON = 0x100
|
||||||
|
ICMP6_FILTER = 0x12
|
||||||
|
ICRNL = 0x100
|
||||||
|
IEXTEN = 0x400
|
||||||
|
IFAN_ARRIVAL = 0x0
|
||||||
|
IFAN_DEPARTURE = 0x1
|
||||||
|
IFF_ALLMULTI = 0x200
|
||||||
|
IFF_BROADCAST = 0x2
|
||||||
|
IFF_CANTCHANGE = 0x8e52
|
||||||
|
IFF_DEBUG = 0x4
|
||||||
|
IFF_LINK0 = 0x1000
|
||||||
|
IFF_LINK1 = 0x2000
|
||||||
|
IFF_LINK2 = 0x4000
|
||||||
|
IFF_LOOPBACK = 0x8
|
||||||
|
IFF_MULTICAST = 0x8000
|
||||||
|
IFF_NOARP = 0x80
|
||||||
|
IFF_OACTIVE = 0x400
|
||||||
|
IFF_POINTOPOINT = 0x10
|
||||||
|
IFF_PROMISC = 0x100
|
||||||
|
IFF_RUNNING = 0x40
|
||||||
|
IFF_SIMPLEX = 0x800
|
||||||
|
IFF_STATICARP = 0x20
|
||||||
|
IFF_UP = 0x1
|
||||||
|
IFNAMSIZ = 0x10
|
||||||
|
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_BLUETOOTH = 0xf8
|
||||||
|
IFT_BRIDGE = 0xd1
|
||||||
|
IFT_BSC = 0x53
|
||||||
|
IFT_CARP = 0xf7
|
||||||
|
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_DOCSCABLEUPSTREAMCHANNEL = 0xcd
|
||||||
|
IFT_DS0 = 0x51
|
||||||
|
IFT_DS0BUNDLE = 0x52
|
||||||
|
IFT_DS1FDL = 0xaa
|
||||||
|
IFT_DS3 = 0x1e
|
||||||
|
IFT_DTM = 0x8c
|
||||||
|
IFT_DUMMY = 0xf1
|
||||||
|
IFT_DVBASILN = 0xac
|
||||||
|
IFT_DVBASIOUT = 0xad
|
||||||
|
IFT_DVBRCCDOWNSTREAM = 0x93
|
||||||
|
IFT_DVBRCCMACLAYER = 0x92
|
||||||
|
IFT_DVBRCCUPSTREAM = 0x94
|
||||||
|
IFT_ECONET = 0xce
|
||||||
|
IFT_ENC = 0xf4
|
||||||
|
IFT_EON = 0x19
|
||||||
|
IFT_EPLRS = 0x57
|
||||||
|
IFT_ESCON = 0x49
|
||||||
|
IFT_ETHER = 0x6
|
||||||
|
IFT_FAITH = 0xf3
|
||||||
|
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_IEEE1394 = 0x90
|
||||||
|
IFT_IEEE80211 = 0x47
|
||||||
|
IFT_IEEE80212 = 0x37
|
||||||
|
IFT_IEEE8023ADLAG = 0xa1
|
||||||
|
IFT_IFGSN = 0x91
|
||||||
|
IFT_IMT = 0xbe
|
||||||
|
IFT_INFINIBAND = 0xc7
|
||||||
|
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_L2VLAN = 0x87
|
||||||
|
IFT_L3IPVLAN = 0x88
|
||||||
|
IFT_L3IPXVLAN = 0x89
|
||||||
|
IFT_LAPB = 0x10
|
||||||
|
IFT_LAPD = 0x4d
|
||||||
|
IFT_LAPF = 0x77
|
||||||
|
IFT_LINEGROUP = 0xd2
|
||||||
|
IFT_LOCALTALK = 0x2a
|
||||||
|
IFT_LOOP = 0x18
|
||||||
|
IFT_MBIM = 0xfa
|
||||||
|
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 = 0xf5
|
||||||
|
IFT_PFLOW = 0xf9
|
||||||
|
IFT_PFSYNC = 0xf6
|
||||||
|
IFT_PLC = 0xae
|
||||||
|
IFT_PON155 = 0xcf
|
||||||
|
IFT_PON622 = 0xd0
|
||||||
|
IFT_POS = 0xab
|
||||||
|
IFT_PPP = 0x17
|
||||||
|
IFT_PPPMULTILINKBUNDLE = 0x6c
|
||||||
|
IFT_PROPATM = 0xc5
|
||||||
|
IFT_PROPBWAP2MP = 0xb8
|
||||||
|
IFT_PROPCNLS = 0x59
|
||||||
|
IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
|
||||||
|
IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
|
||||||
|
IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
|
||||||
|
IFT_PROPMUX = 0x36
|
||||||
|
IFT_PROPVIRTUAL = 0x35
|
||||||
|
IFT_PROPWIRELESSP2P = 0x9d
|
||||||
|
IFT_PTPSERIAL = 0x16
|
||||||
|
IFT_PVC = 0xf2
|
||||||
|
IFT_Q2931 = 0xc9
|
||||||
|
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_SIPSIG = 0xcc
|
||||||
|
IFT_SIPTG = 0xcb
|
||||||
|
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_T1 = 0x12
|
||||||
|
IFT_TDLC = 0x74
|
||||||
|
IFT_TELINK = 0xc8
|
||||||
|
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_VIRTUALTG = 0xca
|
||||||
|
IFT_VOICEDID = 0xd5
|
||||||
|
IFT_VOICEEM = 0x64
|
||||||
|
IFT_VOICEEMFGD = 0xd3
|
||||||
|
IFT_VOICEENCAP = 0x67
|
||||||
|
IFT_VOICEFGDEANA = 0xd4
|
||||||
|
IFT_VOICEFXO = 0x65
|
||||||
|
IFT_VOICEFXS = 0x66
|
||||||
|
IFT_VOICEOVERATM = 0x98
|
||||||
|
IFT_VOICEOVERCABLE = 0xc6
|
||||||
|
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
|
||||||
|
IGNBRK = 0x1
|
||||||
|
IGNCR = 0x80
|
||||||
|
IGNPAR = 0x4
|
||||||
|
IMAXBEL = 0x2000
|
||||||
|
INLCR = 0x40
|
||||||
|
INPCK = 0x10
|
||||||
|
IN_CLASSA_HOST = 0xffffff
|
||||||
|
IN_CLASSA_MAX = 0x80
|
||||||
|
IN_CLASSA_NET = 0xff000000
|
||||||
|
IN_CLASSA_NSHIFT = 0x18
|
||||||
|
IN_CLASSB_HOST = 0xffff
|
||||||
|
IN_CLASSB_MAX = 0x10000
|
||||||
|
IN_CLASSB_NET = 0xffff0000
|
||||||
|
IN_CLASSB_NSHIFT = 0x10
|
||||||
|
IN_CLASSC_HOST = 0xff
|
||||||
|
IN_CLASSC_NET = 0xffffff00
|
||||||
|
IN_CLASSC_NSHIFT = 0x8
|
||||||
|
IN_CLASSD_HOST = 0xfffffff
|
||||||
|
IN_CLASSD_NET = 0xf0000000
|
||||||
|
IN_CLASSD_NSHIFT = 0x1c
|
||||||
|
IN_LOOPBACKNET = 0x7f
|
||||||
|
IN_RFC3021_HOST = 0x1
|
||||||
|
IN_RFC3021_NET = 0xfffffffe
|
||||||
|
IN_RFC3021_NSHIFT = 0x1f
|
||||||
|
IPPROTO_AH = 0x33
|
||||||
|
IPPROTO_CARP = 0x70
|
||||||
|
IPPROTO_DIVERT = 0x102
|
||||||
|
IPPROTO_DONE = 0x101
|
||||||
|
IPPROTO_DSTOPTS = 0x3c
|
||||||
|
IPPROTO_EGP = 0x8
|
||||||
|
IPPROTO_ENCAP = 0x62
|
||||||
|
IPPROTO_EON = 0x50
|
||||||
|
IPPROTO_ESP = 0x32
|
||||||
|
IPPROTO_ETHERIP = 0x61
|
||||||
|
IPPROTO_FRAGMENT = 0x2c
|
||||||
|
IPPROTO_GGP = 0x3
|
||||||
|
IPPROTO_GRE = 0x2f
|
||||||
|
IPPROTO_HOPOPTS = 0x0
|
||||||
|
IPPROTO_ICMP = 0x1
|
||||||
|
IPPROTO_ICMPV6 = 0x3a
|
||||||
|
IPPROTO_IDP = 0x16
|
||||||
|
IPPROTO_IGMP = 0x2
|
||||||
|
IPPROTO_IP = 0x0
|
||||||
|
IPPROTO_IPCOMP = 0x6c
|
||||||
|
IPPROTO_IPIP = 0x4
|
||||||
|
IPPROTO_IPV4 = 0x4
|
||||||
|
IPPROTO_IPV6 = 0x29
|
||||||
|
IPPROTO_MAX = 0x100
|
||||||
|
IPPROTO_MAXID = 0x103
|
||||||
|
IPPROTO_MOBILE = 0x37
|
||||||
|
IPPROTO_MPLS = 0x89
|
||||||
|
IPPROTO_NONE = 0x3b
|
||||||
|
IPPROTO_PFSYNC = 0xf0
|
||||||
|
IPPROTO_PIM = 0x67
|
||||||
|
IPPROTO_PUP = 0xc
|
||||||
|
IPPROTO_RAW = 0xff
|
||||||
|
IPPROTO_ROUTING = 0x2b
|
||||||
|
IPPROTO_RSVP = 0x2e
|
||||||
|
IPPROTO_TCP = 0x6
|
||||||
|
IPPROTO_TP = 0x1d
|
||||||
|
IPPROTO_UDP = 0x11
|
||||||
|
IPPROTO_UDPLITE = 0x88
|
||||||
|
IPV6_AUTH_LEVEL = 0x35
|
||||||
|
IPV6_AUTOFLOWLABEL = 0x3b
|
||||||
|
IPV6_CHECKSUM = 0x1a
|
||||||
|
IPV6_DEFAULT_MULTICAST_HOPS = 0x1
|
||||||
|
IPV6_DEFAULT_MULTICAST_LOOP = 0x1
|
||||||
|
IPV6_DEFHLIM = 0x40
|
||||||
|
IPV6_DONTFRAG = 0x3e
|
||||||
|
IPV6_DSTOPTS = 0x32
|
||||||
|
IPV6_ESP_NETWORK_LEVEL = 0x37
|
||||||
|
IPV6_ESP_TRANS_LEVEL = 0x36
|
||||||
|
IPV6_FAITH = 0x1d
|
||||||
|
IPV6_FLOWINFO_MASK = 0xfffffff
|
||||||
|
IPV6_FLOWLABEL_MASK = 0xfffff
|
||||||
|
IPV6_FRAGTTL = 0x78
|
||||||
|
IPV6_HLIMDEC = 0x1
|
||||||
|
IPV6_HOPLIMIT = 0x2f
|
||||||
|
IPV6_HOPOPTS = 0x31
|
||||||
|
IPV6_IPCOMP_LEVEL = 0x3c
|
||||||
|
IPV6_JOIN_GROUP = 0xc
|
||||||
|
IPV6_LEAVE_GROUP = 0xd
|
||||||
|
IPV6_MAXHLIM = 0xff
|
||||||
|
IPV6_MAXPACKET = 0xffff
|
||||||
|
IPV6_MINHOPCOUNT = 0x41
|
||||||
|
IPV6_MMTU = 0x500
|
||||||
|
IPV6_MULTICAST_HOPS = 0xa
|
||||||
|
IPV6_MULTICAST_IF = 0x9
|
||||||
|
IPV6_MULTICAST_LOOP = 0xb
|
||||||
|
IPV6_NEXTHOP = 0x30
|
||||||
|
IPV6_OPTIONS = 0x1
|
||||||
|
IPV6_PATHMTU = 0x2c
|
||||||
|
IPV6_PIPEX = 0x3f
|
||||||
|
IPV6_PKTINFO = 0x2e
|
||||||
|
IPV6_PORTRANGE = 0xe
|
||||||
|
IPV6_PORTRANGE_DEFAULT = 0x0
|
||||||
|
IPV6_PORTRANGE_HIGH = 0x1
|
||||||
|
IPV6_PORTRANGE_LOW = 0x2
|
||||||
|
IPV6_RECVDSTOPTS = 0x28
|
||||||
|
IPV6_RECVDSTPORT = 0x40
|
||||||
|
IPV6_RECVHOPLIMIT = 0x25
|
||||||
|
IPV6_RECVHOPOPTS = 0x27
|
||||||
|
IPV6_RECVPATHMTU = 0x2b
|
||||||
|
IPV6_RECVPKTINFO = 0x24
|
||||||
|
IPV6_RECVRTHDR = 0x26
|
||||||
|
IPV6_RECVTCLASS = 0x39
|
||||||
|
IPV6_RTABLE = 0x1021
|
||||||
|
IPV6_RTHDR = 0x33
|
||||||
|
IPV6_RTHDRDSTOPTS = 0x23
|
||||||
|
IPV6_RTHDR_LOOSE = 0x0
|
||||||
|
IPV6_RTHDR_STRICT = 0x1
|
||||||
|
IPV6_RTHDR_TYPE_0 = 0x0
|
||||||
|
IPV6_SOCKOPT_RESERVED1 = 0x3
|
||||||
|
IPV6_TCLASS = 0x3d
|
||||||
|
IPV6_UNICAST_HOPS = 0x4
|
||||||
|
IPV6_USE_MIN_MTU = 0x2a
|
||||||
|
IPV6_V6ONLY = 0x1b
|
||||||
|
IPV6_VERSION = 0x60
|
||||||
|
IPV6_VERSION_MASK = 0xf0
|
||||||
|
IP_ADD_MEMBERSHIP = 0xc
|
||||||
|
IP_AUTH_LEVEL = 0x14
|
||||||
|
IP_DEFAULT_MULTICAST_LOOP = 0x1
|
||||||
|
IP_DEFAULT_MULTICAST_TTL = 0x1
|
||||||
|
IP_DF = 0x4000
|
||||||
|
IP_DROP_MEMBERSHIP = 0xd
|
||||||
|
IP_ESP_NETWORK_LEVEL = 0x16
|
||||||
|
IP_ESP_TRANS_LEVEL = 0x15
|
||||||
|
IP_HDRINCL = 0x2
|
||||||
|
IP_IPCOMP_LEVEL = 0x1d
|
||||||
|
IP_IPDEFTTL = 0x25
|
||||||
|
IP_IPSECFLOWINFO = 0x24
|
||||||
|
IP_IPSEC_LOCAL_AUTH = 0x1b
|
||||||
|
IP_IPSEC_LOCAL_CRED = 0x19
|
||||||
|
IP_IPSEC_LOCAL_ID = 0x17
|
||||||
|
IP_IPSEC_REMOTE_AUTH = 0x1c
|
||||||
|
IP_IPSEC_REMOTE_CRED = 0x1a
|
||||||
|
IP_IPSEC_REMOTE_ID = 0x18
|
||||||
|
IP_MAXPACKET = 0xffff
|
||||||
|
IP_MAX_MEMBERSHIPS = 0xfff
|
||||||
|
IP_MF = 0x2000
|
||||||
|
IP_MINTTL = 0x20
|
||||||
|
IP_MIN_MEMBERSHIPS = 0xf
|
||||||
|
IP_MSS = 0x240
|
||||||
|
IP_MULTICAST_IF = 0x9
|
||||||
|
IP_MULTICAST_LOOP = 0xb
|
||||||
|
IP_MULTICAST_TTL = 0xa
|
||||||
|
IP_OFFMASK = 0x1fff
|
||||||
|
IP_OPTIONS = 0x1
|
||||||
|
IP_PIPEX = 0x22
|
||||||
|
IP_PORTRANGE = 0x13
|
||||||
|
IP_PORTRANGE_DEFAULT = 0x0
|
||||||
|
IP_PORTRANGE_HIGH = 0x1
|
||||||
|
IP_PORTRANGE_LOW = 0x2
|
||||||
|
IP_RECVDSTADDR = 0x7
|
||||||
|
IP_RECVDSTPORT = 0x21
|
||||||
|
IP_RECVIF = 0x1e
|
||||||
|
IP_RECVOPTS = 0x5
|
||||||
|
IP_RECVRETOPTS = 0x6
|
||||||
|
IP_RECVRTABLE = 0x23
|
||||||
|
IP_RECVTTL = 0x1f
|
||||||
|
IP_RETOPTS = 0x8
|
||||||
|
IP_RF = 0x8000
|
||||||
|
IP_RTABLE = 0x1021
|
||||||
|
IP_SENDSRCADDR = 0x7
|
||||||
|
IP_TOS = 0x3
|
||||||
|
IP_TTL = 0x4
|
||||||
|
ISIG = 0x80
|
||||||
|
ISTRIP = 0x20
|
||||||
|
IUCLC = 0x1000
|
||||||
|
IXANY = 0x800
|
||||||
|
IXOFF = 0x400
|
||||||
|
IXON = 0x200
|
||||||
|
KERN_HOSTNAME = 0xa
|
||||||
|
KERN_OSRELEASE = 0x2
|
||||||
|
KERN_OSTYPE = 0x1
|
||||||
|
KERN_VERSION = 0x4
|
||||||
|
LCNT_OVERLOAD_FLUSH = 0x6
|
||||||
|
LOCK_EX = 0x2
|
||||||
|
LOCK_NB = 0x4
|
||||||
|
LOCK_SH = 0x1
|
||||||
|
LOCK_UN = 0x8
|
||||||
|
MADV_DONTNEED = 0x4
|
||||||
|
MADV_FREE = 0x6
|
||||||
|
MADV_NORMAL = 0x0
|
||||||
|
MADV_RANDOM = 0x1
|
||||||
|
MADV_SEQUENTIAL = 0x2
|
||||||
|
MADV_SPACEAVAIL = 0x5
|
||||||
|
MADV_WILLNEED = 0x3
|
||||||
|
MAP_ANON = 0x1000
|
||||||
|
MAP_ANONYMOUS = 0x1000
|
||||||
|
MAP_CONCEAL = 0x8000
|
||||||
|
MAP_COPY = 0x2
|
||||||
|
MAP_FILE = 0x0
|
||||||
|
MAP_FIXED = 0x10
|
||||||
|
MAP_FLAGMASK = 0xfff7
|
||||||
|
MAP_HASSEMAPHORE = 0x0
|
||||||
|
MAP_INHERIT = 0x0
|
||||||
|
MAP_INHERIT_COPY = 0x1
|
||||||
|
MAP_INHERIT_NONE = 0x2
|
||||||
|
MAP_INHERIT_SHARE = 0x0
|
||||||
|
MAP_INHERIT_ZERO = 0x3
|
||||||
|
MAP_NOEXTEND = 0x0
|
||||||
|
MAP_NORESERVE = 0x0
|
||||||
|
MAP_PRIVATE = 0x2
|
||||||
|
MAP_RENAME = 0x0
|
||||||
|
MAP_SHARED = 0x1
|
||||||
|
MAP_STACK = 0x4000
|
||||||
|
MAP_TRYFIXED = 0x0
|
||||||
|
MCL_CURRENT = 0x1
|
||||||
|
MCL_FUTURE = 0x2
|
||||||
|
MNT_ASYNC = 0x40
|
||||||
|
MNT_DEFEXPORTED = 0x200
|
||||||
|
MNT_DELEXPORT = 0x20000
|
||||||
|
MNT_DOOMED = 0x8000000
|
||||||
|
MNT_EXPORTANON = 0x400
|
||||||
|
MNT_EXPORTED = 0x100
|
||||||
|
MNT_EXRDONLY = 0x80
|
||||||
|
MNT_FORCE = 0x80000
|
||||||
|
MNT_LAZY = 0x3
|
||||||
|
MNT_LOCAL = 0x1000
|
||||||
|
MNT_NOATIME = 0x8000
|
||||||
|
MNT_NODEV = 0x10
|
||||||
|
MNT_NOEXEC = 0x4
|
||||||
|
MNT_NOPERM = 0x20
|
||||||
|
MNT_NOSUID = 0x8
|
||||||
|
MNT_NOWAIT = 0x2
|
||||||
|
MNT_QUOTA = 0x2000
|
||||||
|
MNT_RDONLY = 0x1
|
||||||
|
MNT_RELOAD = 0x40000
|
||||||
|
MNT_ROOTFS = 0x4000
|
||||||
|
MNT_SOFTDEP = 0x4000000
|
||||||
|
MNT_STALLED = 0x100000
|
||||||
|
MNT_SWAPPABLE = 0x200000
|
||||||
|
MNT_SYNCHRONOUS = 0x2
|
||||||
|
MNT_UPDATE = 0x10000
|
||||||
|
MNT_VISFLAGMASK = 0x400ffff
|
||||||
|
MNT_WAIT = 0x1
|
||||||
|
MNT_WANTRDWR = 0x2000000
|
||||||
|
MNT_WXALLOWED = 0x800
|
||||||
|
MSG_BCAST = 0x100
|
||||||
|
MSG_CMSG_CLOEXEC = 0x800
|
||||||
|
MSG_CTRUNC = 0x20
|
||||||
|
MSG_DONTROUTE = 0x4
|
||||||
|
MSG_DONTWAIT = 0x80
|
||||||
|
MSG_EOR = 0x8
|
||||||
|
MSG_MCAST = 0x200
|
||||||
|
MSG_NOSIGNAL = 0x400
|
||||||
|
MSG_OOB = 0x1
|
||||||
|
MSG_PEEK = 0x2
|
||||||
|
MSG_TRUNC = 0x10
|
||||||
|
MSG_WAITALL = 0x40
|
||||||
|
MS_ASYNC = 0x1
|
||||||
|
MS_INVALIDATE = 0x4
|
||||||
|
MS_SYNC = 0x2
|
||||||
|
NAME_MAX = 0xff
|
||||||
|
NET_RT_DUMP = 0x1
|
||||||
|
NET_RT_FLAGS = 0x2
|
||||||
|
NET_RT_IFLIST = 0x3
|
||||||
|
NET_RT_IFNAMES = 0x6
|
||||||
|
NET_RT_MAXID = 0x7
|
||||||
|
NET_RT_STATS = 0x4
|
||||||
|
NET_RT_TABLE = 0x5
|
||||||
|
NFDBITS = 0x20
|
||||||
|
NOFLSH = 0x80000000
|
||||||
|
NOKERNINFO = 0x2000000
|
||||||
|
NOTE_ATTRIB = 0x8
|
||||||
|
NOTE_CHANGE = 0x1
|
||||||
|
NOTE_CHILD = 0x4
|
||||||
|
NOTE_DELETE = 0x1
|
||||||
|
NOTE_EOF = 0x2
|
||||||
|
NOTE_EXEC = 0x20000000
|
||||||
|
NOTE_EXIT = 0x80000000
|
||||||
|
NOTE_EXTEND = 0x4
|
||||||
|
NOTE_FORK = 0x40000000
|
||||||
|
NOTE_LINK = 0x10
|
||||||
|
NOTE_LOWAT = 0x1
|
||||||
|
NOTE_PCTRLMASK = 0xf0000000
|
||||||
|
NOTE_PDATAMASK = 0xfffff
|
||||||
|
NOTE_RENAME = 0x20
|
||||||
|
NOTE_REVOKE = 0x40
|
||||||
|
NOTE_TRACK = 0x1
|
||||||
|
NOTE_TRACKERR = 0x2
|
||||||
|
NOTE_TRUNCATE = 0x80
|
||||||
|
NOTE_WRITE = 0x2
|
||||||
|
OCRNL = 0x10
|
||||||
|
OLCUC = 0x20
|
||||||
|
ONLCR = 0x2
|
||||||
|
ONLRET = 0x80
|
||||||
|
ONOCR = 0x40
|
||||||
|
ONOEOT = 0x8
|
||||||
|
OPOST = 0x1
|
||||||
|
OXTABS = 0x4
|
||||||
|
O_ACCMODE = 0x3
|
||||||
|
O_APPEND = 0x8
|
||||||
|
O_ASYNC = 0x40
|
||||||
|
O_CLOEXEC = 0x10000
|
||||||
|
O_CREAT = 0x200
|
||||||
|
O_DIRECTORY = 0x20000
|
||||||
|
O_DSYNC = 0x80
|
||||||
|
O_EXCL = 0x800
|
||||||
|
O_EXLOCK = 0x20
|
||||||
|
O_FSYNC = 0x80
|
||||||
|
O_NDELAY = 0x4
|
||||||
|
O_NOCTTY = 0x8000
|
||||||
|
O_NOFOLLOW = 0x100
|
||||||
|
O_NONBLOCK = 0x4
|
||||||
|
O_RDONLY = 0x0
|
||||||
|
O_RDWR = 0x2
|
||||||
|
O_RSYNC = 0x80
|
||||||
|
O_SHLOCK = 0x10
|
||||||
|
O_SYNC = 0x80
|
||||||
|
O_TRUNC = 0x400
|
||||||
|
O_WRONLY = 0x1
|
||||||
|
PARENB = 0x1000
|
||||||
|
PARMRK = 0x8
|
||||||
|
PARODD = 0x2000
|
||||||
|
PENDIN = 0x20000000
|
||||||
|
PF_FLUSH = 0x1
|
||||||
|
PRIO_PGRP = 0x1
|
||||||
|
PRIO_PROCESS = 0x0
|
||||||
|
PRIO_USER = 0x2
|
||||||
|
PROT_EXEC = 0x4
|
||||||
|
PROT_NONE = 0x0
|
||||||
|
PROT_READ = 0x1
|
||||||
|
PROT_WRITE = 0x2
|
||||||
|
RLIMIT_CORE = 0x4
|
||||||
|
RLIMIT_CPU = 0x0
|
||||||
|
RLIMIT_DATA = 0x2
|
||||||
|
RLIMIT_FSIZE = 0x1
|
||||||
|
RLIMIT_MEMLOCK = 0x6
|
||||||
|
RLIMIT_NOFILE = 0x8
|
||||||
|
RLIMIT_NPROC = 0x7
|
||||||
|
RLIMIT_RSS = 0x5
|
||||||
|
RLIMIT_STACK = 0x3
|
||||||
|
RLIM_INFINITY = 0x7fffffffffffffff
|
||||||
|
RTAX_AUTHOR = 0x6
|
||||||
|
RTAX_BFD = 0xb
|
||||||
|
RTAX_BRD = 0x7
|
||||||
|
RTAX_DNS = 0xc
|
||||||
|
RTAX_DST = 0x0
|
||||||
|
RTAX_GATEWAY = 0x1
|
||||||
|
RTAX_GENMASK = 0x3
|
||||||
|
RTAX_IFA = 0x5
|
||||||
|
RTAX_IFP = 0x4
|
||||||
|
RTAX_LABEL = 0xa
|
||||||
|
RTAX_MAX = 0xf
|
||||||
|
RTAX_NETMASK = 0x2
|
||||||
|
RTAX_SEARCH = 0xe
|
||||||
|
RTAX_SRC = 0x8
|
||||||
|
RTAX_SRCMASK = 0x9
|
||||||
|
RTAX_STATIC = 0xd
|
||||||
|
RTA_AUTHOR = 0x40
|
||||||
|
RTA_BFD = 0x800
|
||||||
|
RTA_BRD = 0x80
|
||||||
|
RTA_DNS = 0x1000
|
||||||
|
RTA_DST = 0x1
|
||||||
|
RTA_GATEWAY = 0x2
|
||||||
|
RTA_GENMASK = 0x8
|
||||||
|
RTA_IFA = 0x20
|
||||||
|
RTA_IFP = 0x10
|
||||||
|
RTA_LABEL = 0x400
|
||||||
|
RTA_NETMASK = 0x4
|
||||||
|
RTA_SEARCH = 0x4000
|
||||||
|
RTA_SRC = 0x100
|
||||||
|
RTA_SRCMASK = 0x200
|
||||||
|
RTA_STATIC = 0x2000
|
||||||
|
RTF_ANNOUNCE = 0x4000
|
||||||
|
RTF_BFD = 0x1000000
|
||||||
|
RTF_BLACKHOLE = 0x1000
|
||||||
|
RTF_BROADCAST = 0x400000
|
||||||
|
RTF_CACHED = 0x20000
|
||||||
|
RTF_CLONED = 0x10000
|
||||||
|
RTF_CLONING = 0x100
|
||||||
|
RTF_CONNECTED = 0x800000
|
||||||
|
RTF_DONE = 0x40
|
||||||
|
RTF_DYNAMIC = 0x10
|
||||||
|
RTF_FMASK = 0x110fc08
|
||||||
|
RTF_GATEWAY = 0x2
|
||||||
|
RTF_HOST = 0x4
|
||||||
|
RTF_LLINFO = 0x400
|
||||||
|
RTF_LOCAL = 0x200000
|
||||||
|
RTF_MODIFIED = 0x20
|
||||||
|
RTF_MPATH = 0x40000
|
||||||
|
RTF_MPLS = 0x100000
|
||||||
|
RTF_MULTICAST = 0x200
|
||||||
|
RTF_PERMANENT_ARP = 0x2000
|
||||||
|
RTF_PROTO1 = 0x8000
|
||||||
|
RTF_PROTO2 = 0x4000
|
||||||
|
RTF_PROTO3 = 0x2000
|
||||||
|
RTF_REJECT = 0x8
|
||||||
|
RTF_STATIC = 0x800
|
||||||
|
RTF_UP = 0x1
|
||||||
|
RTF_USETRAILERS = 0x8000
|
||||||
|
RTM_80211INFO = 0x15
|
||||||
|
RTM_ADD = 0x1
|
||||||
|
RTM_BFD = 0x12
|
||||||
|
RTM_CHANGE = 0x3
|
||||||
|
RTM_CHGADDRATTR = 0x14
|
||||||
|
RTM_DELADDR = 0xd
|
||||||
|
RTM_DELETE = 0x2
|
||||||
|
RTM_DESYNC = 0x10
|
||||||
|
RTM_GET = 0x4
|
||||||
|
RTM_IFANNOUNCE = 0xf
|
||||||
|
RTM_IFINFO = 0xe
|
||||||
|
RTM_INVALIDATE = 0x11
|
||||||
|
RTM_LOSING = 0x5
|
||||||
|
RTM_MAXSIZE = 0x800
|
||||||
|
RTM_MISS = 0x7
|
||||||
|
RTM_NEWADDR = 0xc
|
||||||
|
RTM_PROPOSAL = 0x13
|
||||||
|
RTM_REDIRECT = 0x6
|
||||||
|
RTM_RESOLVE = 0xb
|
||||||
|
RTM_RTTUNIT = 0xf4240
|
||||||
|
RTM_VERSION = 0x5
|
||||||
|
RTV_EXPIRE = 0x4
|
||||||
|
RTV_HOPCOUNT = 0x2
|
||||||
|
RTV_MTU = 0x1
|
||||||
|
RTV_RPIPE = 0x8
|
||||||
|
RTV_RTT = 0x40
|
||||||
|
RTV_RTTVAR = 0x80
|
||||||
|
RTV_SPIPE = 0x10
|
||||||
|
RTV_SSTHRESH = 0x20
|
||||||
|
RT_TABLEID_BITS = 0x8
|
||||||
|
RT_TABLEID_MASK = 0xff
|
||||||
|
RT_TABLEID_MAX = 0xff
|
||||||
|
RUSAGE_CHILDREN = -0x1
|
||||||
|
RUSAGE_SELF = 0x0
|
||||||
|
RUSAGE_THREAD = 0x1
|
||||||
|
SCM_RIGHTS = 0x1
|
||||||
|
SCM_TIMESTAMP = 0x4
|
||||||
|
SHUT_RD = 0x0
|
||||||
|
SHUT_RDWR = 0x2
|
||||||
|
SHUT_WR = 0x1
|
||||||
|
SIOCADDMULTI = 0x80206931
|
||||||
|
SIOCAIFADDR = 0x8040691a
|
||||||
|
SIOCAIFGROUP = 0x80286987
|
||||||
|
SIOCATMARK = 0x40047307
|
||||||
|
SIOCBRDGADD = 0x8060693c
|
||||||
|
SIOCBRDGADDL = 0x80606949
|
||||||
|
SIOCBRDGADDS = 0x80606941
|
||||||
|
SIOCBRDGARL = 0x808c694d
|
||||||
|
SIOCBRDGDADDR = 0x81286947
|
||||||
|
SIOCBRDGDEL = 0x8060693d
|
||||||
|
SIOCBRDGDELS = 0x80606942
|
||||||
|
SIOCBRDGFLUSH = 0x80606948
|
||||||
|
SIOCBRDGFRL = 0x808c694e
|
||||||
|
SIOCBRDGGCACHE = 0xc0186941
|
||||||
|
SIOCBRDGGFD = 0xc0186952
|
||||||
|
SIOCBRDGGHT = 0xc0186951
|
||||||
|
SIOCBRDGGIFFLGS = 0xc060693e
|
||||||
|
SIOCBRDGGMA = 0xc0186953
|
||||||
|
SIOCBRDGGPARAM = 0xc0406958
|
||||||
|
SIOCBRDGGPRI = 0xc0186950
|
||||||
|
SIOCBRDGGRL = 0xc030694f
|
||||||
|
SIOCBRDGGTO = 0xc0186946
|
||||||
|
SIOCBRDGIFS = 0xc0606942
|
||||||
|
SIOCBRDGRTS = 0xc0206943
|
||||||
|
SIOCBRDGSADDR = 0xc1286944
|
||||||
|
SIOCBRDGSCACHE = 0x80186940
|
||||||
|
SIOCBRDGSFD = 0x80186952
|
||||||
|
SIOCBRDGSHT = 0x80186951
|
||||||
|
SIOCBRDGSIFCOST = 0x80606955
|
||||||
|
SIOCBRDGSIFFLGS = 0x8060693f
|
||||||
|
SIOCBRDGSIFPRIO = 0x80606954
|
||||||
|
SIOCBRDGSIFPROT = 0x8060694a
|
||||||
|
SIOCBRDGSMA = 0x80186953
|
||||||
|
SIOCBRDGSPRI = 0x80186950
|
||||||
|
SIOCBRDGSPROTO = 0x8018695a
|
||||||
|
SIOCBRDGSTO = 0x80186945
|
||||||
|
SIOCBRDGSTXHC = 0x80186959
|
||||||
|
SIOCDELLABEL = 0x80206997
|
||||||
|
SIOCDELMULTI = 0x80206932
|
||||||
|
SIOCDIFADDR = 0x80206919
|
||||||
|
SIOCDIFGROUP = 0x80286989
|
||||||
|
SIOCDIFPARENT = 0x802069b4
|
||||||
|
SIOCDIFPHYADDR = 0x80206949
|
||||||
|
SIOCDPWE3NEIGHBOR = 0x802069de
|
||||||
|
SIOCDVNETID = 0x802069af
|
||||||
|
SIOCGETKALIVE = 0xc01869a4
|
||||||
|
SIOCGETLABEL = 0x8020699a
|
||||||
|
SIOCGETMPWCFG = 0xc02069ae
|
||||||
|
SIOCGETPFLOW = 0xc02069fe
|
||||||
|
SIOCGETPFSYNC = 0xc02069f8
|
||||||
|
SIOCGETSGCNT = 0xc0207534
|
||||||
|
SIOCGETVIFCNT = 0xc0287533
|
||||||
|
SIOCGETVLAN = 0xc0206990
|
||||||
|
SIOCGIFADDR = 0xc0206921
|
||||||
|
SIOCGIFBRDADDR = 0xc0206923
|
||||||
|
SIOCGIFCONF = 0xc0106924
|
||||||
|
SIOCGIFDATA = 0xc020691b
|
||||||
|
SIOCGIFDESCR = 0xc0206981
|
||||||
|
SIOCGIFDSTADDR = 0xc0206922
|
||||||
|
SIOCGIFFLAGS = 0xc0206911
|
||||||
|
SIOCGIFGATTR = 0xc028698b
|
||||||
|
SIOCGIFGENERIC = 0xc020693a
|
||||||
|
SIOCGIFGLIST = 0xc028698d
|
||||||
|
SIOCGIFGMEMB = 0xc028698a
|
||||||
|
SIOCGIFGROUP = 0xc0286988
|
||||||
|
SIOCGIFHARDMTU = 0xc02069a5
|
||||||
|
SIOCGIFLLPRIO = 0xc02069b6
|
||||||
|
SIOCGIFMEDIA = 0xc0406938
|
||||||
|
SIOCGIFMETRIC = 0xc0206917
|
||||||
|
SIOCGIFMTU = 0xc020697e
|
||||||
|
SIOCGIFNETMASK = 0xc0206925
|
||||||
|
SIOCGIFPAIR = 0xc02069b1
|
||||||
|
SIOCGIFPARENT = 0xc02069b3
|
||||||
|
SIOCGIFPRIORITY = 0xc020699c
|
||||||
|
SIOCGIFRDOMAIN = 0xc02069a0
|
||||||
|
SIOCGIFRTLABEL = 0xc0206983
|
||||||
|
SIOCGIFRXR = 0x802069aa
|
||||||
|
SIOCGIFSFFPAGE = 0xc1126939
|
||||||
|
SIOCGIFXFLAGS = 0xc020699e
|
||||||
|
SIOCGLIFPHYADDR = 0xc218694b
|
||||||
|
SIOCGLIFPHYDF = 0xc02069c2
|
||||||
|
SIOCGLIFPHYECN = 0xc02069c8
|
||||||
|
SIOCGLIFPHYRTABLE = 0xc02069a2
|
||||||
|
SIOCGLIFPHYTTL = 0xc02069a9
|
||||||
|
SIOCGPGRP = 0x40047309
|
||||||
|
SIOCGPWE3 = 0xc0206998
|
||||||
|
SIOCGPWE3CTRLWORD = 0xc02069dc
|
||||||
|
SIOCGPWE3FAT = 0xc02069dd
|
||||||
|
SIOCGPWE3NEIGHBOR = 0xc21869de
|
||||||
|
SIOCGRXHPRIO = 0xc02069db
|
||||||
|
SIOCGSPPPPARAMS = 0xc0206994
|
||||||
|
SIOCGTXHPRIO = 0xc02069c6
|
||||||
|
SIOCGUMBINFO = 0xc02069be
|
||||||
|
SIOCGUMBPARAM = 0xc02069c0
|
||||||
|
SIOCGVH = 0xc02069f6
|
||||||
|
SIOCGVNETFLOWID = 0xc02069c4
|
||||||
|
SIOCGVNETID = 0xc02069a7
|
||||||
|
SIOCIFAFATTACH = 0x801169ab
|
||||||
|
SIOCIFAFDETACH = 0x801169ac
|
||||||
|
SIOCIFCREATE = 0x8020697a
|
||||||
|
SIOCIFDESTROY = 0x80206979
|
||||||
|
SIOCIFGCLONERS = 0xc0106978
|
||||||
|
SIOCSETKALIVE = 0x801869a3
|
||||||
|
SIOCSETLABEL = 0x80206999
|
||||||
|
SIOCSETMPWCFG = 0x802069ad
|
||||||
|
SIOCSETPFLOW = 0x802069fd
|
||||||
|
SIOCSETPFSYNC = 0x802069f7
|
||||||
|
SIOCSETVLAN = 0x8020698f
|
||||||
|
SIOCSIFADDR = 0x8020690c
|
||||||
|
SIOCSIFBRDADDR = 0x80206913
|
||||||
|
SIOCSIFDESCR = 0x80206980
|
||||||
|
SIOCSIFDSTADDR = 0x8020690e
|
||||||
|
SIOCSIFFLAGS = 0x80206910
|
||||||
|
SIOCSIFGATTR = 0x8028698c
|
||||||
|
SIOCSIFGENERIC = 0x80206939
|
||||||
|
SIOCSIFLLADDR = 0x8020691f
|
||||||
|
SIOCSIFLLPRIO = 0x802069b5
|
||||||
|
SIOCSIFMEDIA = 0xc0206937
|
||||||
|
SIOCSIFMETRIC = 0x80206918
|
||||||
|
SIOCSIFMTU = 0x8020697f
|
||||||
|
SIOCSIFNETMASK = 0x80206916
|
||||||
|
SIOCSIFPAIR = 0x802069b0
|
||||||
|
SIOCSIFPARENT = 0x802069b2
|
||||||
|
SIOCSIFPRIORITY = 0x8020699b
|
||||||
|
SIOCSIFRDOMAIN = 0x8020699f
|
||||||
|
SIOCSIFRTLABEL = 0x80206982
|
||||||
|
SIOCSIFXFLAGS = 0x8020699d
|
||||||
|
SIOCSLIFPHYADDR = 0x8218694a
|
||||||
|
SIOCSLIFPHYDF = 0x802069c1
|
||||||
|
SIOCSLIFPHYECN = 0x802069c7
|
||||||
|
SIOCSLIFPHYRTABLE = 0x802069a1
|
||||||
|
SIOCSLIFPHYTTL = 0x802069a8
|
||||||
|
SIOCSPGRP = 0x80047308
|
||||||
|
SIOCSPWE3CTRLWORD = 0x802069dc
|
||||||
|
SIOCSPWE3FAT = 0x802069dd
|
||||||
|
SIOCSPWE3NEIGHBOR = 0x821869de
|
||||||
|
SIOCSRXHPRIO = 0x802069db
|
||||||
|
SIOCSSPPPPARAMS = 0x80206993
|
||||||
|
SIOCSTXHPRIO = 0x802069c5
|
||||||
|
SIOCSUMBPARAM = 0x802069bf
|
||||||
|
SIOCSVH = 0xc02069f5
|
||||||
|
SIOCSVNETFLOWID = 0x802069c3
|
||||||
|
SIOCSVNETID = 0x802069a6
|
||||||
|
SIOCSWGDPID = 0xc018695b
|
||||||
|
SIOCSWGMAXFLOW = 0xc0186960
|
||||||
|
SIOCSWGMAXGROUP = 0xc018695d
|
||||||
|
SIOCSWSDPID = 0x8018695c
|
||||||
|
SIOCSWSPORTNO = 0xc060695f
|
||||||
|
SOCK_CLOEXEC = 0x8000
|
||||||
|
SOCK_DGRAM = 0x2
|
||||||
|
SOCK_DNS = 0x1000
|
||||||
|
SOCK_NONBLOCK = 0x4000
|
||||||
|
SOCK_RAW = 0x3
|
||||||
|
SOCK_RDM = 0x4
|
||||||
|
SOCK_SEQPACKET = 0x5
|
||||||
|
SOCK_STREAM = 0x1
|
||||||
|
SOL_SOCKET = 0xffff
|
||||||
|
SOMAXCONN = 0x80
|
||||||
|
SO_ACCEPTCONN = 0x2
|
||||||
|
SO_BINDANY = 0x1000
|
||||||
|
SO_BROADCAST = 0x20
|
||||||
|
SO_DEBUG = 0x1
|
||||||
|
SO_DOMAIN = 0x1024
|
||||||
|
SO_DONTROUTE = 0x10
|
||||||
|
SO_ERROR = 0x1007
|
||||||
|
SO_KEEPALIVE = 0x8
|
||||||
|
SO_LINGER = 0x80
|
||||||
|
SO_NETPROC = 0x1020
|
||||||
|
SO_OOBINLINE = 0x100
|
||||||
|
SO_PEERCRED = 0x1022
|
||||||
|
SO_PROTOCOL = 0x1025
|
||||||
|
SO_RCVBUF = 0x1002
|
||||||
|
SO_RCVLOWAT = 0x1004
|
||||||
|
SO_RCVTIMEO = 0x1006
|
||||||
|
SO_REUSEADDR = 0x4
|
||||||
|
SO_REUSEPORT = 0x200
|
||||||
|
SO_RTABLE = 0x1021
|
||||||
|
SO_SNDBUF = 0x1001
|
||||||
|
SO_SNDLOWAT = 0x1003
|
||||||
|
SO_SNDTIMEO = 0x1005
|
||||||
|
SO_SPLICE = 0x1023
|
||||||
|
SO_TIMESTAMP = 0x800
|
||||||
|
SO_TYPE = 0x1008
|
||||||
|
SO_USELOOPBACK = 0x40
|
||||||
|
SO_ZEROIZE = 0x2000
|
||||||
|
S_BLKSIZE = 0x200
|
||||||
|
S_IEXEC = 0x40
|
||||||
|
S_IFBLK = 0x6000
|
||||||
|
S_IFCHR = 0x2000
|
||||||
|
S_IFDIR = 0x4000
|
||||||
|
S_IFIFO = 0x1000
|
||||||
|
S_IFLNK = 0xa000
|
||||||
|
S_IFMT = 0xf000
|
||||||
|
S_IFREG = 0x8000
|
||||||
|
S_IFSOCK = 0xc000
|
||||||
|
S_IREAD = 0x100
|
||||||
|
S_IRGRP = 0x20
|
||||||
|
S_IROTH = 0x4
|
||||||
|
S_IRUSR = 0x100
|
||||||
|
S_IRWXG = 0x38
|
||||||
|
S_IRWXO = 0x7
|
||||||
|
S_IRWXU = 0x1c0
|
||||||
|
S_ISGID = 0x400
|
||||||
|
S_ISTXT = 0x200
|
||||||
|
S_ISUID = 0x800
|
||||||
|
S_ISVTX = 0x200
|
||||||
|
S_IWGRP = 0x10
|
||||||
|
S_IWOTH = 0x2
|
||||||
|
S_IWRITE = 0x80
|
||||||
|
S_IWUSR = 0x80
|
||||||
|
S_IXGRP = 0x8
|
||||||
|
S_IXOTH = 0x1
|
||||||
|
S_IXUSR = 0x40
|
||||||
|
TCIFLUSH = 0x1
|
||||||
|
TCIOFF = 0x3
|
||||||
|
TCIOFLUSH = 0x3
|
||||||
|
TCION = 0x4
|
||||||
|
TCOFLUSH = 0x2
|
||||||
|
TCOOFF = 0x1
|
||||||
|
TCOON = 0x2
|
||||||
|
TCP_MAXBURST = 0x4
|
||||||
|
TCP_MAXSEG = 0x2
|
||||||
|
TCP_MAXWIN = 0xffff
|
||||||
|
TCP_MAX_SACK = 0x3
|
||||||
|
TCP_MAX_WINSHIFT = 0xe
|
||||||
|
TCP_MD5SIG = 0x4
|
||||||
|
TCP_MSS = 0x200
|
||||||
|
TCP_NODELAY = 0x1
|
||||||
|
TCP_NOPUSH = 0x10
|
||||||
|
TCP_SACKHOLE_LIMIT = 0x80
|
||||||
|
TCP_SACK_ENABLE = 0x8
|
||||||
|
TCSAFLUSH = 0x2
|
||||||
|
TIMER_ABSTIME = 0x1
|
||||||
|
TIMER_RELTIME = 0x0
|
||||||
|
TIOCCBRK = 0x2000747a
|
||||||
|
TIOCCDTR = 0x20007478
|
||||||
|
TIOCCHKVERAUTH = 0x2000741e
|
||||||
|
TIOCCLRVERAUTH = 0x2000741d
|
||||||
|
TIOCCONS = 0x80047462
|
||||||
|
TIOCDRAIN = 0x2000745e
|
||||||
|
TIOCEXCL = 0x2000740d
|
||||||
|
TIOCEXT = 0x80047460
|
||||||
|
TIOCFLAG_CLOCAL = 0x2
|
||||||
|
TIOCFLAG_CRTSCTS = 0x4
|
||||||
|
TIOCFLAG_MDMBUF = 0x8
|
||||||
|
TIOCFLAG_PPS = 0x10
|
||||||
|
TIOCFLAG_SOFTCAR = 0x1
|
||||||
|
TIOCFLUSH = 0x80047410
|
||||||
|
TIOCGETA = 0x402c7413
|
||||||
|
TIOCGETD = 0x4004741a
|
||||||
|
TIOCGFLAGS = 0x4004745d
|
||||||
|
TIOCGPGRP = 0x40047477
|
||||||
|
TIOCGSID = 0x40047463
|
||||||
|
TIOCGTSTAMP = 0x4010745b
|
||||||
|
TIOCGWINSZ = 0x40087468
|
||||||
|
TIOCMBIC = 0x8004746b
|
||||||
|
TIOCMBIS = 0x8004746c
|
||||||
|
TIOCMGET = 0x4004746a
|
||||||
|
TIOCMODG = 0x4004746a
|
||||||
|
TIOCMODS = 0x8004746d
|
||||||
|
TIOCMSET = 0x8004746d
|
||||||
|
TIOCM_CAR = 0x40
|
||||||
|
TIOCM_CD = 0x40
|
||||||
|
TIOCM_CTS = 0x20
|
||||||
|
TIOCM_DSR = 0x100
|
||||||
|
TIOCM_DTR = 0x2
|
||||||
|
TIOCM_LE = 0x1
|
||||||
|
TIOCM_RI = 0x80
|
||||||
|
TIOCM_RNG = 0x80
|
||||||
|
TIOCM_RTS = 0x4
|
||||||
|
TIOCM_SR = 0x10
|
||||||
|
TIOCM_ST = 0x8
|
||||||
|
TIOCNOTTY = 0x20007471
|
||||||
|
TIOCNXCL = 0x2000740e
|
||||||
|
TIOCOUTQ = 0x40047473
|
||||||
|
TIOCPKT = 0x80047470
|
||||||
|
TIOCPKT_DATA = 0x0
|
||||||
|
TIOCPKT_DOSTOP = 0x20
|
||||||
|
TIOCPKT_FLUSHREAD = 0x1
|
||||||
|
TIOCPKT_FLUSHWRITE = 0x2
|
||||||
|
TIOCPKT_IOCTL = 0x40
|
||||||
|
TIOCPKT_NOSTOP = 0x10
|
||||||
|
TIOCPKT_START = 0x8
|
||||||
|
TIOCPKT_STOP = 0x4
|
||||||
|
TIOCREMOTE = 0x80047469
|
||||||
|
TIOCSBRK = 0x2000747b
|
||||||
|
TIOCSCTTY = 0x20007461
|
||||||
|
TIOCSDTR = 0x20007479
|
||||||
|
TIOCSETA = 0x802c7414
|
||||||
|
TIOCSETAF = 0x802c7416
|
||||||
|
TIOCSETAW = 0x802c7415
|
||||||
|
TIOCSETD = 0x8004741b
|
||||||
|
TIOCSETVERAUTH = 0x8004741c
|
||||||
|
TIOCSFLAGS = 0x8004745c
|
||||||
|
TIOCSIG = 0x8004745f
|
||||||
|
TIOCSPGRP = 0x80047476
|
||||||
|
TIOCSTART = 0x2000746e
|
||||||
|
TIOCSTAT = 0x20007465
|
||||||
|
TIOCSTOP = 0x2000746f
|
||||||
|
TIOCSTSTAMP = 0x8008745a
|
||||||
|
TIOCSWINSZ = 0x80087467
|
||||||
|
TIOCUCNTL = 0x80047466
|
||||||
|
TIOCUCNTL_CBRK = 0x7a
|
||||||
|
TIOCUCNTL_SBRK = 0x7b
|
||||||
|
TOSTOP = 0x400000
|
||||||
|
UTIME_NOW = -0x2
|
||||||
|
UTIME_OMIT = -0x1
|
||||||
|
VDISCARD = 0xf
|
||||||
|
VDSUSP = 0xb
|
||||||
|
VEOF = 0x0
|
||||||
|
VEOL = 0x1
|
||||||
|
VEOL2 = 0x2
|
||||||
|
VERASE = 0x3
|
||||||
|
VINTR = 0x8
|
||||||
|
VKILL = 0x5
|
||||||
|
VLNEXT = 0xe
|
||||||
|
VMIN = 0x10
|
||||||
|
VM_ANONMIN = 0x7
|
||||||
|
VM_LOADAVG = 0x2
|
||||||
|
VM_MALLOC_CONF = 0xc
|
||||||
|
VM_MAXID = 0xd
|
||||||
|
VM_MAXSLP = 0xa
|
||||||
|
VM_METER = 0x1
|
||||||
|
VM_NKMEMPAGES = 0x6
|
||||||
|
VM_PSSTRINGS = 0x3
|
||||||
|
VM_SWAPENCRYPT = 0x5
|
||||||
|
VM_USPACE = 0xb
|
||||||
|
VM_UVMEXP = 0x4
|
||||||
|
VM_VNODEMIN = 0x9
|
||||||
|
VM_VTEXTMIN = 0x8
|
||||||
|
VQUIT = 0x9
|
||||||
|
VREPRINT = 0x6
|
||||||
|
VSTART = 0xc
|
||||||
|
VSTATUS = 0x12
|
||||||
|
VSTOP = 0xd
|
||||||
|
VSUSP = 0xa
|
||||||
|
VTIME = 0x11
|
||||||
|
VWERASE = 0x4
|
||||||
|
WALTSIG = 0x4
|
||||||
|
WCONTINUED = 0x8
|
||||||
|
WCOREFLAG = 0x80
|
||||||
|
WNOHANG = 0x1
|
||||||
|
WUNTRACED = 0x2
|
||||||
|
XCASE = 0x1000000
|
||||||
|
)
|
||||||
|
|
||||||
|
// Errors
|
||||||
|
const (
|
||||||
|
E2BIG = syscall.Errno(0x7)
|
||||||
|
EACCES = syscall.Errno(0xd)
|
||||||
|
EADDRINUSE = syscall.Errno(0x30)
|
||||||
|
EADDRNOTAVAIL = syscall.Errno(0x31)
|
||||||
|
EAFNOSUPPORT = syscall.Errno(0x2f)
|
||||||
|
EAGAIN = syscall.Errno(0x23)
|
||||||
|
EALREADY = syscall.Errno(0x25)
|
||||||
|
EAUTH = syscall.Errno(0x50)
|
||||||
|
EBADF = syscall.Errno(0x9)
|
||||||
|
EBADMSG = syscall.Errno(0x5c)
|
||||||
|
EBADRPC = syscall.Errno(0x48)
|
||||||
|
EBUSY = syscall.Errno(0x10)
|
||||||
|
ECANCELED = syscall.Errno(0x58)
|
||||||
|
ECHILD = syscall.Errno(0xa)
|
||||||
|
ECONNABORTED = syscall.Errno(0x35)
|
||||||
|
ECONNREFUSED = syscall.Errno(0x3d)
|
||||||
|
ECONNRESET = syscall.Errno(0x36)
|
||||||
|
EDEADLK = syscall.Errno(0xb)
|
||||||
|
EDESTADDRREQ = syscall.Errno(0x27)
|
||||||
|
EDOM = syscall.Errno(0x21)
|
||||||
|
EDQUOT = syscall.Errno(0x45)
|
||||||
|
EEXIST = syscall.Errno(0x11)
|
||||||
|
EFAULT = syscall.Errno(0xe)
|
||||||
|
EFBIG = syscall.Errno(0x1b)
|
||||||
|
EFTYPE = syscall.Errno(0x4f)
|
||||||
|
EHOSTDOWN = syscall.Errno(0x40)
|
||||||
|
EHOSTUNREACH = syscall.Errno(0x41)
|
||||||
|
EIDRM = syscall.Errno(0x59)
|
||||||
|
EILSEQ = syscall.Errno(0x54)
|
||||||
|
EINPROGRESS = syscall.Errno(0x24)
|
||||||
|
EINTR = syscall.Errno(0x4)
|
||||||
|
EINVAL = syscall.Errno(0x16)
|
||||||
|
EIO = syscall.Errno(0x5)
|
||||||
|
EIPSEC = syscall.Errno(0x52)
|
||||||
|
EISCONN = syscall.Errno(0x38)
|
||||||
|
EISDIR = syscall.Errno(0x15)
|
||||||
|
ELAST = syscall.Errno(0x5f)
|
||||||
|
ELOOP = syscall.Errno(0x3e)
|
||||||
|
EMEDIUMTYPE = syscall.Errno(0x56)
|
||||||
|
EMFILE = syscall.Errno(0x18)
|
||||||
|
EMLINK = syscall.Errno(0x1f)
|
||||||
|
EMSGSIZE = syscall.Errno(0x28)
|
||||||
|
ENAMETOOLONG = syscall.Errno(0x3f)
|
||||||
|
ENEEDAUTH = syscall.Errno(0x51)
|
||||||
|
ENETDOWN = syscall.Errno(0x32)
|
||||||
|
ENETRESET = syscall.Errno(0x34)
|
||||||
|
ENETUNREACH = syscall.Errno(0x33)
|
||||||
|
ENFILE = syscall.Errno(0x17)
|
||||||
|
ENOATTR = syscall.Errno(0x53)
|
||||||
|
ENOBUFS = syscall.Errno(0x37)
|
||||||
|
ENODEV = syscall.Errno(0x13)
|
||||||
|
ENOENT = syscall.Errno(0x2)
|
||||||
|
ENOEXEC = syscall.Errno(0x8)
|
||||||
|
ENOLCK = syscall.Errno(0x4d)
|
||||||
|
ENOMEDIUM = syscall.Errno(0x55)
|
||||||
|
ENOMEM = syscall.Errno(0xc)
|
||||||
|
ENOMSG = syscall.Errno(0x5a)
|
||||||
|
ENOPROTOOPT = syscall.Errno(0x2a)
|
||||||
|
ENOSPC = syscall.Errno(0x1c)
|
||||||
|
ENOSYS = syscall.Errno(0x4e)
|
||||||
|
ENOTBLK = syscall.Errno(0xf)
|
||||||
|
ENOTCONN = syscall.Errno(0x39)
|
||||||
|
ENOTDIR = syscall.Errno(0x14)
|
||||||
|
ENOTEMPTY = syscall.Errno(0x42)
|
||||||
|
ENOTRECOVERABLE = syscall.Errno(0x5d)
|
||||||
|
ENOTSOCK = syscall.Errno(0x26)
|
||||||
|
ENOTSUP = syscall.Errno(0x5b)
|
||||||
|
ENOTTY = syscall.Errno(0x19)
|
||||||
|
ENXIO = syscall.Errno(0x6)
|
||||||
|
EOPNOTSUPP = syscall.Errno(0x2d)
|
||||||
|
EOVERFLOW = syscall.Errno(0x57)
|
||||||
|
EOWNERDEAD = syscall.Errno(0x5e)
|
||||||
|
EPERM = syscall.Errno(0x1)
|
||||||
|
EPFNOSUPPORT = syscall.Errno(0x2e)
|
||||||
|
EPIPE = syscall.Errno(0x20)
|
||||||
|
EPROCLIM = syscall.Errno(0x43)
|
||||||
|
EPROCUNAVAIL = syscall.Errno(0x4c)
|
||||||
|
EPROGMISMATCH = syscall.Errno(0x4b)
|
||||||
|
EPROGUNAVAIL = syscall.Errno(0x4a)
|
||||||
|
EPROTO = syscall.Errno(0x5f)
|
||||||
|
EPROTONOSUPPORT = syscall.Errno(0x2b)
|
||||||
|
EPROTOTYPE = syscall.Errno(0x29)
|
||||||
|
ERANGE = syscall.Errno(0x22)
|
||||||
|
EREMOTE = syscall.Errno(0x47)
|
||||||
|
EROFS = syscall.Errno(0x1e)
|
||||||
|
ERPCMISMATCH = syscall.Errno(0x49)
|
||||||
|
ESHUTDOWN = syscall.Errno(0x3a)
|
||||||
|
ESOCKTNOSUPPORT = syscall.Errno(0x2c)
|
||||||
|
ESPIPE = syscall.Errno(0x1d)
|
||||||
|
ESRCH = syscall.Errno(0x3)
|
||||||
|
ESTALE = syscall.Errno(0x46)
|
||||||
|
ETIMEDOUT = syscall.Errno(0x3c)
|
||||||
|
ETOOMANYREFS = syscall.Errno(0x3b)
|
||||||
|
ETXTBSY = syscall.Errno(0x1a)
|
||||||
|
EUSERS = syscall.Errno(0x44)
|
||||||
|
EWOULDBLOCK = syscall.Errno(0x23)
|
||||||
|
EXDEV = syscall.Errno(0x12)
|
||||||
|
)
|
||||||
|
|
||||||
|
// Signals
|
||||||
|
const (
|
||||||
|
SIGABRT = syscall.Signal(0x6)
|
||||||
|
SIGALRM = syscall.Signal(0xe)
|
||||||
|
SIGBUS = syscall.Signal(0xa)
|
||||||
|
SIGCHLD = syscall.Signal(0x14)
|
||||||
|
SIGCONT = syscall.Signal(0x13)
|
||||||
|
SIGEMT = syscall.Signal(0x7)
|
||||||
|
SIGFPE = syscall.Signal(0x8)
|
||||||
|
SIGHUP = syscall.Signal(0x1)
|
||||||
|
SIGILL = syscall.Signal(0x4)
|
||||||
|
SIGINFO = syscall.Signal(0x1d)
|
||||||
|
SIGINT = syscall.Signal(0x2)
|
||||||
|
SIGIO = syscall.Signal(0x17)
|
||||||
|
SIGIOT = syscall.Signal(0x6)
|
||||||
|
SIGKILL = syscall.Signal(0x9)
|
||||||
|
SIGPIPE = syscall.Signal(0xd)
|
||||||
|
SIGPROF = syscall.Signal(0x1b)
|
||||||
|
SIGQUIT = syscall.Signal(0x3)
|
||||||
|
SIGSEGV = syscall.Signal(0xb)
|
||||||
|
SIGSTOP = syscall.Signal(0x11)
|
||||||
|
SIGSYS = syscall.Signal(0xc)
|
||||||
|
SIGTERM = syscall.Signal(0xf)
|
||||||
|
SIGTHR = syscall.Signal(0x20)
|
||||||
|
SIGTRAP = syscall.Signal(0x5)
|
||||||
|
SIGTSTP = syscall.Signal(0x12)
|
||||||
|
SIGTTIN = syscall.Signal(0x15)
|
||||||
|
SIGTTOU = syscall.Signal(0x16)
|
||||||
|
SIGURG = syscall.Signal(0x10)
|
||||||
|
SIGUSR1 = syscall.Signal(0x1e)
|
||||||
|
SIGUSR2 = syscall.Signal(0x1f)
|
||||||
|
SIGVTALRM = syscall.Signal(0x1a)
|
||||||
|
SIGWINCH = syscall.Signal(0x1c)
|
||||||
|
SIGXCPU = syscall.Signal(0x18)
|
||||||
|
SIGXFSZ = syscall.Signal(0x19)
|
||||||
|
)
|
||||||
|
|
||||||
|
// Error table
|
||||||
|
var errorList = [...]struct {
|
||||||
|
num syscall.Errno
|
||||||
|
name string
|
||||||
|
desc string
|
||||||
|
}{
|
||||||
|
{1, "EPERM", "operation not permitted"},
|
||||||
|
{2, "ENOENT", "no such file or directory"},
|
||||||
|
{3, "ESRCH", "no such process"},
|
||||||
|
{4, "EINTR", "interrupted system call"},
|
||||||
|
{5, "EIO", "input/output error"},
|
||||||
|
{6, "ENXIO", "device not configured"},
|
||||||
|
{7, "E2BIG", "argument list too long"},
|
||||||
|
{8, "ENOEXEC", "exec format error"},
|
||||||
|
{9, "EBADF", "bad file descriptor"},
|
||||||
|
{10, "ECHILD", "no child processes"},
|
||||||
|
{11, "EDEADLK", "resource deadlock avoided"},
|
||||||
|
{12, "ENOMEM", "cannot allocate memory"},
|
||||||
|
{13, "EACCES", "permission denied"},
|
||||||
|
{14, "EFAULT", "bad address"},
|
||||||
|
{15, "ENOTBLK", "block device required"},
|
||||||
|
{16, "EBUSY", "device busy"},
|
||||||
|
{17, "EEXIST", "file exists"},
|
||||||
|
{18, "EXDEV", "cross-device link"},
|
||||||
|
{19, "ENODEV", "operation not supported by device"},
|
||||||
|
{20, "ENOTDIR", "not a directory"},
|
||||||
|
{21, "EISDIR", "is a directory"},
|
||||||
|
{22, "EINVAL", "invalid argument"},
|
||||||
|
{23, "ENFILE", "too many open files in system"},
|
||||||
|
{24, "EMFILE", "too many open files"},
|
||||||
|
{25, "ENOTTY", "inappropriate ioctl for device"},
|
||||||
|
{26, "ETXTBSY", "text file busy"},
|
||||||
|
{27, "EFBIG", "file too large"},
|
||||||
|
{28, "ENOSPC", "no space left on device"},
|
||||||
|
{29, "ESPIPE", "illegal seek"},
|
||||||
|
{30, "EROFS", "read-only file system"},
|
||||||
|
{31, "EMLINK", "too many links"},
|
||||||
|
{32, "EPIPE", "broken pipe"},
|
||||||
|
{33, "EDOM", "numerical argument out of domain"},
|
||||||
|
{34, "ERANGE", "result too large"},
|
||||||
|
{35, "EAGAIN", "resource temporarily unavailable"},
|
||||||
|
{36, "EINPROGRESS", "operation now in progress"},
|
||||||
|
{37, "EALREADY", "operation already in progress"},
|
||||||
|
{38, "ENOTSOCK", "socket operation on non-socket"},
|
||||||
|
{39, "EDESTADDRREQ", "destination address required"},
|
||||||
|
{40, "EMSGSIZE", "message too long"},
|
||||||
|
{41, "EPROTOTYPE", "protocol wrong type for socket"},
|
||||||
|
{42, "ENOPROTOOPT", "protocol not available"},
|
||||||
|
{43, "EPROTONOSUPPORT", "protocol not supported"},
|
||||||
|
{44, "ESOCKTNOSUPPORT", "socket type not supported"},
|
||||||
|
{45, "EOPNOTSUPP", "operation not supported"},
|
||||||
|
{46, "EPFNOSUPPORT", "protocol family not supported"},
|
||||||
|
{47, "EAFNOSUPPORT", "address family not supported by protocol family"},
|
||||||
|
{48, "EADDRINUSE", "address already in use"},
|
||||||
|
{49, "EADDRNOTAVAIL", "can't assign requested address"},
|
||||||
|
{50, "ENETDOWN", "network is down"},
|
||||||
|
{51, "ENETUNREACH", "network is unreachable"},
|
||||||
|
{52, "ENETRESET", "network dropped connection on reset"},
|
||||||
|
{53, "ECONNABORTED", "software caused connection abort"},
|
||||||
|
{54, "ECONNRESET", "connection reset by peer"},
|
||||||
|
{55, "ENOBUFS", "no buffer space available"},
|
||||||
|
{56, "EISCONN", "socket is already connected"},
|
||||||
|
{57, "ENOTCONN", "socket is not connected"},
|
||||||
|
{58, "ESHUTDOWN", "can't send after socket shutdown"},
|
||||||
|
{59, "ETOOMANYREFS", "too many references: can't splice"},
|
||||||
|
{60, "ETIMEDOUT", "operation timed out"},
|
||||||
|
{61, "ECONNREFUSED", "connection refused"},
|
||||||
|
{62, "ELOOP", "too many levels of symbolic links"},
|
||||||
|
{63, "ENAMETOOLONG", "file name too long"},
|
||||||
|
{64, "EHOSTDOWN", "host is down"},
|
||||||
|
{65, "EHOSTUNREACH", "no route to host"},
|
||||||
|
{66, "ENOTEMPTY", "directory not empty"},
|
||||||
|
{67, "EPROCLIM", "too many processes"},
|
||||||
|
{68, "EUSERS", "too many users"},
|
||||||
|
{69, "EDQUOT", "disk quota exceeded"},
|
||||||
|
{70, "ESTALE", "stale NFS file handle"},
|
||||||
|
{71, "EREMOTE", "too many levels of remote in path"},
|
||||||
|
{72, "EBADRPC", "RPC struct is bad"},
|
||||||
|
{73, "ERPCMISMATCH", "RPC version wrong"},
|
||||||
|
{74, "EPROGUNAVAIL", "RPC program not available"},
|
||||||
|
{75, "EPROGMISMATCH", "program version wrong"},
|
||||||
|
{76, "EPROCUNAVAIL", "bad procedure for program"},
|
||||||
|
{77, "ENOLCK", "no locks available"},
|
||||||
|
{78, "ENOSYS", "function not implemented"},
|
||||||
|
{79, "EFTYPE", "inappropriate file type or format"},
|
||||||
|
{80, "EAUTH", "authentication error"},
|
||||||
|
{81, "ENEEDAUTH", "need authenticator"},
|
||||||
|
{82, "EIPSEC", "IPsec processing failure"},
|
||||||
|
{83, "ENOATTR", "attribute not found"},
|
||||||
|
{84, "EILSEQ", "illegal byte sequence"},
|
||||||
|
{85, "ENOMEDIUM", "no medium found"},
|
||||||
|
{86, "EMEDIUMTYPE", "wrong medium type"},
|
||||||
|
{87, "EOVERFLOW", "value too large to be stored in data type"},
|
||||||
|
{88, "ECANCELED", "operation canceled"},
|
||||||
|
{89, "EIDRM", "identifier removed"},
|
||||||
|
{90, "ENOMSG", "no message of desired type"},
|
||||||
|
{91, "ENOTSUP", "not supported"},
|
||||||
|
{92, "EBADMSG", "bad message"},
|
||||||
|
{93, "ENOTRECOVERABLE", "state not recoverable"},
|
||||||
|
{94, "EOWNERDEAD", "previous owner died"},
|
||||||
|
{95, "ELAST", "protocol error"},
|
||||||
|
}
|
||||||
|
|
||||||
|
// Signal table
|
||||||
|
var signalList = [...]struct {
|
||||||
|
num syscall.Signal
|
||||||
|
name string
|
||||||
|
desc string
|
||||||
|
}{
|
||||||
|
{1, "SIGHUP", "hangup"},
|
||||||
|
{2, "SIGINT", "interrupt"},
|
||||||
|
{3, "SIGQUIT", "quit"},
|
||||||
|
{4, "SIGILL", "illegal instruction"},
|
||||||
|
{5, "SIGTRAP", "trace/BPT trap"},
|
||||||
|
{6, "SIGABRT", "abort trap"},
|
||||||
|
{7, "SIGEMT", "EMT trap"},
|
||||||
|
{8, "SIGFPE", "floating point exception"},
|
||||||
|
{9, "SIGKILL", "killed"},
|
||||||
|
{10, "SIGBUS", "bus error"},
|
||||||
|
{11, "SIGSEGV", "segmentation fault"},
|
||||||
|
{12, "SIGSYS", "bad system call"},
|
||||||
|
{13, "SIGPIPE", "broken pipe"},
|
||||||
|
{14, "SIGALRM", "alarm clock"},
|
||||||
|
{15, "SIGTERM", "terminated"},
|
||||||
|
{16, "SIGURG", "urgent I/O condition"},
|
||||||
|
{17, "SIGSTOP", "suspended (signal)"},
|
||||||
|
{18, "SIGTSTP", "suspended"},
|
||||||
|
{19, "SIGCONT", "continued"},
|
||||||
|
{20, "SIGCHLD", "child exited"},
|
||||||
|
{21, "SIGTTIN", "stopped (tty input)"},
|
||||||
|
{22, "SIGTTOU", "stopped (tty output)"},
|
||||||
|
{23, "SIGIO", "I/O possible"},
|
||||||
|
{24, "SIGXCPU", "cputime limit exceeded"},
|
||||||
|
{25, "SIGXFSZ", "filesize limit exceeded"},
|
||||||
|
{26, "SIGVTALRM", "virtual timer expired"},
|
||||||
|
{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"},
|
||||||
|
{32, "SIGTHR", "thread AST"},
|
||||||
|
}
|
|
@ -1,1809 +0,0 @@
|
||||||
// go run mksyscall.go -l32 -tags darwin,386,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_386.1_11.go syscall_darwin_386.go
|
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
|
||||||
|
|
||||||
// +build darwin,386,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"syscall"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ syscall.Errno
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setgroups(ngid int, gid *_Gid_t) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
|
|
||||||
wpid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func socket(domain int, typ int, proto int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Shutdown(s int, how int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
|
|
||||||
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimes(path string, timeval *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Madvise(b []byte, behav int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlockall(flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mprotect(b []byte, prot int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Msync(b []byte, flags int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlockall() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func pipe() (r int, w int, err error) {
|
|
||||||
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
|
|
||||||
r = int(r0)
|
|
||||||
w = int(r1)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func removexattr(path string, attr string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fremovexattr(fd int, attr string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func listxattr(path string, dest *byte, size int, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func kill(pid int, signum int, posix int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(mib) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&mib[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Access(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chdir(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chflags(path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chmod(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chown(path string, uid int, gid int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chroot(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Close(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
|
|
||||||
nfd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Dup2(from int, to int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Exchangedata(path1 string, path2 string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path1)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(path2)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Exit(code int) {
|
|
||||||
Syscall(SYS_EXIT, uintptr(code), 0, 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchdir(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchflags(fd int, flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchmod(fd int, mode uint32) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchown(fd int, uid int, gid int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fpathconf(fd int, name int) (val int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fsync(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Ftruncate(fd int, length int64) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getdtablesize() (size int) {
|
|
||||||
r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
|
|
||||||
size = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getegid() (egid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
|
|
||||||
egid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Geteuid() (uid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
|
|
||||||
uid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getgid() (gid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
|
|
||||||
gid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpgid(pid int) (pgid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
|
|
||||||
pgid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpgrp() (pgrp int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
|
||||||
pgrp = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpid() (pid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
|
||||||
pid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getppid() (ppid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
|
|
||||||
ppid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpriority(which int, who int) (prio int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
|
|
||||||
prio = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getrlimit(which int, lim *Rlimit) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getrusage(who int, rusage *Rusage) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getsid(pid int) (sid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
|
|
||||||
sid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Gettimeofday(tp *Timeval) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getuid() (uid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
|
|
||||||
uid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Issetugid() (tainted bool) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)
|
|
||||||
tainted = bool(r0 != 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Kqueue() (fd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Lchown(path string, uid int, gid int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Link(path string, link string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Listen(s int, backlog int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkdir(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mknod(path string, mode uint32, dev int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pathconf(path string, name int) (val int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pread(fd int, p []byte, offset int64) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func read(fd int, p []byte) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Readlink(path string, buf []byte) (n int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p1 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p1 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p1 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p1 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Rename(from string, to string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(from)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(to)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(from)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(to)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Revoke(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Rmdir(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|
||||||
r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)
|
|
||||||
newoffset = int64(int64(r1)<<32 | int64(r0))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setegid(egid int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Seteuid(euid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setgid(gid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setlogin(name string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(name)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setpgid(pid int, pgid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setpriority(which int, who int, prio int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setprivexec(flag int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setregid(rgid int, egid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setreuid(ruid int, euid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setrlimit(which int, lim *Rlimit) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setsid() (pid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
|
|
||||||
pid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Settimeofday(tp *Timeval) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setuid(uid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Symlink(path string, link string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(newpath)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Sync() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Truncate(path string, length int64) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Umask(newmask int) (oldmask int) {
|
|
||||||
r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
|
|
||||||
oldmask = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Undelete(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unlink(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unmount(path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
|
||||||
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
|
|
||||||
ret = uintptr(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func munmap(addr uintptr, length uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstatfs(fd int, stat *Statfs_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(buf), uintptr(size), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Lstat(path string, stat *Stat_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Stat(path string, stat *Stat_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Statfs(path string, stat *Statfs_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
|
@ -958,6 +958,56 @@ func libc_close_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefile(src string, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefile_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefile libc_clonefile
|
||||||
|
//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefileat libc_clonefileat
|
||||||
|
//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
func Dup(fd int) (nfd int, err error) {
|
||||||
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
||||||
nfd = int(r0)
|
nfd = int(r0)
|
||||||
|
@ -1146,6 +1196,26 @@ func libc_fchownat_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_fclonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_fclonefileat libc_fclonefileat
|
||||||
|
//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
func Flock(fd int, how int) (err error) {
|
||||||
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|
|
@ -110,6 +110,10 @@ TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_clock_gettime(SB)
|
JMP libc_clock_gettime(SB)
|
||||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_close(SB)
|
JMP libc_close(SB)
|
||||||
|
TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefile(SB)
|
||||||
|
TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefileat(SB)
|
||||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_dup(SB)
|
JMP libc_dup(SB)
|
||||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -132,6 +136,8 @@ TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchown(SB)
|
JMP libc_fchown(SB)
|
||||||
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchownat(SB)
|
JMP libc_fchownat(SB)
|
||||||
|
TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_fclonefileat(SB)
|
||||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_flock(SB)
|
JMP libc_flock(SB)
|
||||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -164,6 +170,8 @@ TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getrusage(SB)
|
JMP libc_getrusage(SB)
|
||||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getsid(SB)
|
JMP libc_getsid(SB)
|
||||||
|
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_gettimeofday(SB)
|
||||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getuid(SB)
|
JMP libc_getuid(SB)
|
||||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -266,8 +274,6 @@ TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_munmap(SB)
|
JMP libc_munmap(SB)
|
||||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_ptrace(SB)
|
JMP libc_ptrace(SB)
|
||||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
|
||||||
JMP libc_gettimeofday(SB)
|
|
||||||
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fstat64(SB)
|
JMP libc_fstat64(SB)
|
||||||
TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
|
|
@ -1,1809 +0,0 @@
|
||||||
// go run mksyscall.go -tags darwin,amd64,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.1_11.go syscall_darwin_amd64.go
|
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
|
||||||
|
|
||||||
// +build darwin,amd64,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"syscall"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ syscall.Errno
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setgroups(ngid int, gid *_Gid_t) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
|
|
||||||
wpid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func socket(domain int, typ int, proto int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Shutdown(s int, how int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
|
|
||||||
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimes(path string, timeval *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Madvise(b []byte, behav int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlockall(flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mprotect(b []byte, prot int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Msync(b []byte, flags int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlockall() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func pipe() (r int, w int, err error) {
|
|
||||||
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
|
|
||||||
r = int(r0)
|
|
||||||
w = int(r1)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func removexattr(path string, attr string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fremovexattr(fd int, attr string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func listxattr(path string, dest *byte, size int, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func kill(pid int, signum int, posix int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(mib) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&mib[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Access(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chdir(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chflags(path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chmod(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chown(path string, uid int, gid int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chroot(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Close(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
|
|
||||||
nfd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Dup2(from int, to int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Exchangedata(path1 string, path2 string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path1)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(path2)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Exit(code int) {
|
|
||||||
Syscall(SYS_EXIT, uintptr(code), 0, 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchdir(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchflags(fd int, flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchmod(fd int, mode uint32) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchown(fd int, uid int, gid int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fpathconf(fd int, name int) (val int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fsync(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Ftruncate(fd int, length int64) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getdtablesize() (size int) {
|
|
||||||
r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
|
|
||||||
size = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getegid() (egid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
|
|
||||||
egid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Geteuid() (uid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
|
|
||||||
uid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getgid() (gid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
|
|
||||||
gid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpgid(pid int) (pgid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
|
|
||||||
pgid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpgrp() (pgrp int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
|
||||||
pgrp = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpid() (pid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
|
||||||
pid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getppid() (ppid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
|
|
||||||
ppid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpriority(which int, who int) (prio int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
|
|
||||||
prio = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getrlimit(which int, lim *Rlimit) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getrusage(who int, rusage *Rusage) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getsid(pid int) (sid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
|
|
||||||
sid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Gettimeofday(tp *Timeval) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getuid() (uid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
|
|
||||||
uid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Issetugid() (tainted bool) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)
|
|
||||||
tainted = bool(r0 != 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Kqueue() (fd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Lchown(path string, uid int, gid int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Link(path string, link string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Listen(s int, backlog int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkdir(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mknod(path string, mode uint32, dev int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pathconf(path string, name int) (val int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pread(fd int, p []byte, offset int64) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func read(fd int, p []byte) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Readlink(path string, buf []byte) (n int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p1 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p1 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p1 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p1 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Rename(from string, to string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(from)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(to)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(from)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(to)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Revoke(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Rmdir(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
|
|
||||||
newoffset = int64(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setegid(egid int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Seteuid(euid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setgid(gid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setlogin(name string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(name)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setpgid(pid int, pgid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setpriority(which int, who int, prio int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setprivexec(flag int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setregid(rgid int, egid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setreuid(ruid int, euid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setrlimit(which int, lim *Rlimit) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setsid() (pid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
|
|
||||||
pid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Settimeofday(tp *Timeval) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setuid(uid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Symlink(path string, link string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(newpath)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Sync() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Truncate(path string, length int64) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Umask(newmask int) (oldmask int) {
|
|
||||||
r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
|
|
||||||
oldmask = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Undelete(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unlink(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unmount(path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos))
|
|
||||||
ret = uintptr(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func munmap(addr uintptr, length uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSTAT64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FSTATAT64, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstatfs(fd int, stat *Statfs_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSTATFS64, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_GETFSSTAT64, uintptr(buf), uintptr(size), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Lstat(path string, stat *Stat_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Stat(path string, stat *Stat_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Statfs(path string, stat *Statfs_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
|
@ -958,6 +958,56 @@ func libc_close_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefile(src string, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefile_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefile libc_clonefile
|
||||||
|
//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefileat libc_clonefileat
|
||||||
|
//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
func Dup(fd int) (nfd int, err error) {
|
||||||
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
||||||
nfd = int(r0)
|
nfd = int(r0)
|
||||||
|
@ -1146,6 +1196,26 @@ func libc_fchownat_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_fclonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_fclonefileat libc_fclonefileat
|
||||||
|
//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
func Flock(fd int, how int) (err error) {
|
||||||
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|
|
@ -110,6 +110,10 @@ TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_clock_gettime(SB)
|
JMP libc_clock_gettime(SB)
|
||||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_close(SB)
|
JMP libc_close(SB)
|
||||||
|
TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefile(SB)
|
||||||
|
TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefileat(SB)
|
||||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_dup(SB)
|
JMP libc_dup(SB)
|
||||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -132,6 +136,8 @@ TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchown(SB)
|
JMP libc_fchown(SB)
|
||||||
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchownat(SB)
|
JMP libc_fchownat(SB)
|
||||||
|
TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_fclonefileat(SB)
|
||||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_flock(SB)
|
JMP libc_flock(SB)
|
||||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -164,6 +170,8 @@ TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getrusage(SB)
|
JMP libc_getrusage(SB)
|
||||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getsid(SB)
|
JMP libc_getsid(SB)
|
||||||
|
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_gettimeofday(SB)
|
||||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getuid(SB)
|
JMP libc_getuid(SB)
|
||||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -266,8 +274,6 @@ TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_munmap(SB)
|
JMP libc_munmap(SB)
|
||||||
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_ptrace_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_ptrace(SB)
|
JMP libc_ptrace(SB)
|
||||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
|
||||||
JMP libc_gettimeofday(SB)
|
|
||||||
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstat64_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fstat64(SB)
|
JMP libc_fstat64(SB)
|
||||||
TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstatat64_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
|
|
@ -1,1782 +0,0 @@
|
||||||
// go run mksyscall.go -l32 -tags darwin,arm,!go1.12 syscall_bsd.go syscall_darwin.go syscall_darwin_arm.1_11.go syscall_darwin_arm.go
|
|
||||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
|
||||||
|
|
||||||
// +build darwin,arm,!go1.12
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"syscall"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
var _ syscall.Errno
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getgroups(ngid int, gid *_Gid_t) (n int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setgroups(ngid int, gid *_Gid_t) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
|
|
||||||
wpid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func socket(domain int, typ int, proto int) (fd int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Shutdown(s int, how int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
|
|
||||||
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func utimes(path string, timeval *[2]Timeval) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Madvise(b []byte, behav int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mlockall(flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mprotect(b []byte, prot int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Msync(b []byte, flags int) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlock(b []byte) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(b) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&b[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Munlockall() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_GETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func pipe() (r int, w int, err error) {
|
|
||||||
r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0)
|
|
||||||
r = int(r0)
|
|
||||||
w = int(r1)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getxattr(path string, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fgetxattr(fd int, attr string, dest *byte, size int, position uint32, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setxattr(path string, attr string, data *byte, size int, position uint32, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fsetxattr(fd int, attr string, data *byte, size int, position uint32, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(data)), uintptr(size), uintptr(position), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func removexattr(path string, attr string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fremovexattr(fd int, attr string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(attr)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func listxattr(path string, dest *byte, size int, options int) (sz int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func flistxattr(fd int, dest *byte, size int, options int) (sz int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_FLISTXATTR, uintptr(fd), uintptr(unsafe.Pointer(dest)), uintptr(size), uintptr(options), 0, 0)
|
|
||||||
sz = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) {
|
|
||||||
_, _, e1 := Syscall6(SYS_SETATTRLIST, uintptr(unsafe.Pointer(path)), uintptr(list), uintptr(buf), uintptr(size), uintptr(options), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func fcntl(fd int, cmd int, arg int) (val int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg))
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func kill(pid int, signum int, posix int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(mib) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&mib[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(offset>>32), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Access(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Adjtime(delta *Timeval, olddelta *Timeval) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chdir(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chflags(path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chmod(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chown(path string, uid int, gid int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Chroot(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Close(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0)
|
|
||||||
nfd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Dup2(from int, to int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Exchangedata(path1 string, path2 string, options int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path1)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(path2)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Exit(code int) {
|
|
||||||
Syscall(SYS_EXIT, uintptr(code), 0, 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchdir(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchflags(fd int, flags int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchmod(fd int, mode uint32) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchown(fd int, uid int, gid int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fpathconf(fd int, name int) (val int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0)
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fsync(fd int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Ftruncate(fd int, length int64) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getdtablesize() (size int) {
|
|
||||||
r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0)
|
|
||||||
size = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getegid() (egid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0)
|
|
||||||
egid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Geteuid() (uid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0)
|
|
||||||
uid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getgid() (gid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0)
|
|
||||||
gid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpgid(pid int) (pgid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
|
|
||||||
pgid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpgrp() (pgrp int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0)
|
|
||||||
pgrp = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpid() (pid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0)
|
|
||||||
pid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getppid() (ppid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0)
|
|
||||||
ppid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getpriority(which int, who int) (prio int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
|
|
||||||
prio = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getrlimit(which int, lim *Rlimit) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getrusage(who int, rusage *Rusage) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getsid(pid int) (sid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
|
|
||||||
sid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Gettimeofday(tp *Timeval) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Getuid() (uid int) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0)
|
|
||||||
uid = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Issetugid() (tainted bool) {
|
|
||||||
r0, _, _ := RawSyscall(SYS_ISSETUGID, 0, 0, 0)
|
|
||||||
tainted = bool(r0 != 0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Kqueue() (fd int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Lchown(path string, uid int, gid int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Link(path string, link string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(pathfd), uintptr(unsafe.Pointer(_p0)), uintptr(linkfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Listen(s int, backlog int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkdir(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Mknod(path string, mode uint32, dev int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Open(path string, mode int, perm uint32) (fd int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm))
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0)
|
|
||||||
fd = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pathconf(path string, name int) (val int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0)
|
|
||||||
val = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pread(fd int, p []byte, offset int64) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func read(fd int, p []byte) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Readlink(path string, buf []byte) (n int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p1 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p1 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 unsafe.Pointer
|
|
||||||
if len(buf) > 0 {
|
|
||||||
_p1 = unsafe.Pointer(&buf[0])
|
|
||||||
} else {
|
|
||||||
_p1 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Rename(from string, to string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(from)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(to)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Renameat(fromfd int, from string, tofd int, to string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(from)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(to)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(fromfd), uintptr(unsafe.Pointer(_p0)), uintptr(tofd), uintptr(unsafe.Pointer(_p1)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Revoke(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Rmdir(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|
||||||
r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0)
|
|
||||||
newoffset = int64(int64(r1)<<32 | int64(r0))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setegid(egid int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETEGID, uintptr(egid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Seteuid(euid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setgid(gid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setlogin(name string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(name)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setpgid(pid int, pgid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setpriority(which int, who int, prio int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setprivexec(flag int) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SETPRIVEXEC, uintptr(flag), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setregid(rgid int, egid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setreuid(ruid int, euid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setrlimit(which int, lim *Rlimit) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setsid() (pid int, err error) {
|
|
||||||
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
|
|
||||||
pid = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Settimeofday(tp *Timeval) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Setuid(uid int) (err error) {
|
|
||||||
_, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Symlink(path string, link string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(link)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(oldpath)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var _p1 *byte
|
|
||||||
_p1, err = BytePtrFromString(newpath)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Sync() (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_SYNC, 0, 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Truncate(path string, length int64) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Umask(newmask int) (oldmask int) {
|
|
||||||
r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0)
|
|
||||||
oldmask = int(r0)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Undelete(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unlink(path string) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unlinkat(dirfd int, path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Unmount(path string, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func write(fd int, p []byte) (n int, err error) {
|
|
||||||
var _p0 unsafe.Pointer
|
|
||||||
if len(p) > 0 {
|
|
||||||
_p0 = unsafe.Pointer(&p[0])
|
|
||||||
} else {
|
|
||||||
_p0 = unsafe.Pointer(&_zero)
|
|
||||||
}
|
|
||||||
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) {
|
|
||||||
r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0)
|
|
||||||
ret = uintptr(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func munmap(addr uintptr, length uintptr) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func readlen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Fstatfs(fd int, stat *Statfs_t) (err error) {
|
|
||||||
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) {
|
|
||||||
r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(buf), uintptr(size), uintptr(flags))
|
|
||||||
n = int(r0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Lstat(path string, stat *Stat_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Stat(path string, stat *Stat_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
|
||||||
|
|
||||||
func Statfs(path string, stat *Statfs_t) (err error) {
|
|
||||||
var _p0 *byte
|
|
||||||
_p0, err = BytePtrFromString(path)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
|
|
||||||
if e1 != 0 {
|
|
||||||
err = errnoErr(e1)
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
|
@ -958,6 +958,56 @@ func libc_close_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefile(src string, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefile_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefile libc_clonefile
|
||||||
|
//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefileat libc_clonefileat
|
||||||
|
//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
func Dup(fd int) (nfd int, err error) {
|
||||||
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
||||||
nfd = int(r0)
|
nfd = int(r0)
|
||||||
|
@ -1146,6 +1196,26 @@ func libc_fchownat_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_fclonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_fclonefileat libc_fclonefileat
|
||||||
|
//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
func Flock(fd int, how int) (err error) {
|
||||||
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|
|
@ -110,6 +110,10 @@ TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_clock_gettime(SB)
|
JMP libc_clock_gettime(SB)
|
||||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_close(SB)
|
JMP libc_close(SB)
|
||||||
|
TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefile(SB)
|
||||||
|
TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefileat(SB)
|
||||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_dup(SB)
|
JMP libc_dup(SB)
|
||||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -132,6 +136,8 @@ TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchown(SB)
|
JMP libc_fchown(SB)
|
||||||
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchownat(SB)
|
JMP libc_fchownat(SB)
|
||||||
|
TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_fclonefileat(SB)
|
||||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_flock(SB)
|
JMP libc_flock(SB)
|
||||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -164,6 +170,8 @@ TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getrusage(SB)
|
JMP libc_getrusage(SB)
|
||||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getsid(SB)
|
JMP libc_getsid(SB)
|
||||||
|
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_gettimeofday(SB)
|
||||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getuid(SB)
|
JMP libc_getuid(SB)
|
||||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -264,8 +272,6 @@ TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_mmap(SB)
|
JMP libc_mmap(SB)
|
||||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_munmap(SB)
|
JMP libc_munmap(SB)
|
||||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
|
||||||
JMP libc_gettimeofday(SB)
|
|
||||||
TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fstat(SB)
|
JMP libc_fstat(SB)
|
||||||
TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
|
|
@ -958,6 +958,56 @@ func libc_close_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefile(src string, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall(funcPC(libc_clonefile_trampoline), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(flags))
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefile_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefile libc_clonefile
|
||||||
|
//go:cgo_import_dynamic libc_clonefile clonefile "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Clonefileat(srcDirfd int, src string, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(src)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var _p1 *byte
|
||||||
|
_p1, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_clonefileat_trampoline), uintptr(srcDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_clonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_clonefileat libc_clonefileat
|
||||||
|
//go:cgo_import_dynamic libc_clonefileat clonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Dup(fd int) (nfd int, err error) {
|
func Dup(fd int) (nfd int, err error) {
|
||||||
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
r0, _, e1 := syscall_syscall(funcPC(libc_dup_trampoline), uintptr(fd), 0, 0)
|
||||||
nfd = int(r0)
|
nfd = int(r0)
|
||||||
|
@ -1146,6 +1196,26 @@ func libc_fchownat_trampoline()
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func Fclonefileat(srcDirfd int, dstDirfd int, dst string, flags int) (err error) {
|
||||||
|
var _p0 *byte
|
||||||
|
_p0, err = BytePtrFromString(dst)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_, _, e1 := syscall_syscall6(funcPC(libc_fclonefileat_trampoline), uintptr(srcDirfd), uintptr(dstDirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = errnoErr(e1)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func libc_fclonefileat_trampoline()
|
||||||
|
|
||||||
|
//go:linkname libc_fclonefileat libc_fclonefileat
|
||||||
|
//go:cgo_import_dynamic libc_fclonefileat fclonefileat "/usr/lib/libSystem.B.dylib"
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
func Flock(fd int, how int) (err error) {
|
func Flock(fd int, how int) (err error) {
|
||||||
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
_, _, e1 := syscall_syscall(funcPC(libc_flock_trampoline), uintptr(fd), uintptr(how), 0)
|
||||||
if e1 != 0 {
|
if e1 != 0 {
|
||||||
|
|
|
@ -110,6 +110,10 @@ TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_clock_gettime(SB)
|
JMP libc_clock_gettime(SB)
|
||||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_close(SB)
|
JMP libc_close(SB)
|
||||||
|
TEXT ·libc_clonefile_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefile(SB)
|
||||||
|
TEXT ·libc_clonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_clonefileat(SB)
|
||||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_dup(SB)
|
JMP libc_dup(SB)
|
||||||
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_dup2_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -132,6 +136,8 @@ TEXT ·libc_fchown_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchown(SB)
|
JMP libc_fchown(SB)
|
||||||
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fchownat_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fchownat(SB)
|
JMP libc_fchownat(SB)
|
||||||
|
TEXT ·libc_fclonefileat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_fclonefileat(SB)
|
||||||
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_flock_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_flock(SB)
|
JMP libc_flock(SB)
|
||||||
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fpathconf_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -164,6 +170,8 @@ TEXT ·libc_getrusage_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getrusage(SB)
|
JMP libc_getrusage(SB)
|
||||||
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getsid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getsid(SB)
|
JMP libc_getsid(SB)
|
||||||
|
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
JMP libc_gettimeofday(SB)
|
||||||
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_getuid_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_getuid(SB)
|
JMP libc_getuid(SB)
|
||||||
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_issetugid_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
@ -264,8 +272,6 @@ TEXT ·libc_mmap_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_mmap(SB)
|
JMP libc_mmap(SB)
|
||||||
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_munmap_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_munmap(SB)
|
JMP libc_munmap(SB)
|
||||||
TEXT ·libc_gettimeofday_trampoline(SB),NOSPLIT,$0-0
|
|
||||||
JMP libc_gettimeofday(SB)
|
|
||||||
TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstat_trampoline(SB),NOSPLIT,$0-0
|
||||||
JMP libc_fstat(SB)
|
JMP libc_fstat(SB)
|
||||||
TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
|
TEXT ·libc_fstatat_trampoline(SB),NOSPLIT,$0-0
|
||||||
|
|
|
@ -13,17 +13,23 @@ import (
|
||||||
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
|
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
|
||||||
//go:cgo_import_dynamic libc_writev writev "libc.so"
|
//go:cgo_import_dynamic libc_writev writev "libc.so"
|
||||||
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
|
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
|
||||||
|
//go:cgo_import_dynamic libc_accept4 accept4 "libc.so"
|
||||||
|
//go:cgo_import_dynamic libc_pipe2 pipe2 "libc.so"
|
||||||
|
|
||||||
//go:linkname procreadv libc_readv
|
//go:linkname procreadv libc_readv
|
||||||
//go:linkname procpreadv libc_preadv
|
//go:linkname procpreadv libc_preadv
|
||||||
//go:linkname procwritev libc_writev
|
//go:linkname procwritev libc_writev
|
||||||
//go:linkname procpwritev libc_pwritev
|
//go:linkname procpwritev libc_pwritev
|
||||||
|
//go:linkname procaccept4 libc_accept4
|
||||||
|
//go:linkname procpipe2 libc_pipe2
|
||||||
|
|
||||||
var (
|
var (
|
||||||
procreadv,
|
procreadv,
|
||||||
procpreadv,
|
procpreadv,
|
||||||
procwritev,
|
procwritev,
|
||||||
procpwritev syscallFunc
|
procpwritev,
|
||||||
|
procaccept4,
|
||||||
|
procpipe2 syscallFunc
|
||||||
)
|
)
|
||||||
|
|
||||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
@ -85,3 +91,24 @@ func pwritev(fd int, iovs []Iovec, off int64) (n int, err error) {
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
|
||||||
|
r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procaccept4)), 4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
|
||||||
|
fd = int(r0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||||
|
|
||||||
|
func pipe2(p *[2]_C_int, flags int) (err error) {
|
||||||
|
_, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procpipe2)), 2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0, 0)
|
||||||
|
if e1 != 0 {
|
||||||
|
err = e1
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue