* Use export GOPROXY=https://goproxy.cn before build * Add go version to generate command * Reproduced the entire build procedure - see notes I've used: sudo go clean -i -r -cache -testcache -modcache make clean make generate make golangci-lint make revive make swagger-check make swagger-validate make test-vendor <--- this now fails make vendor <--- this now produced changes git commit -a <--- this commit * Add fix from #8059 to complete CI teststags/v1.10.0-rc1
github.com/willf/bitset v0.0.0-20180426185212-8ce1146b8621 // indirect | github.com/willf/bitset v0.0.0-20180426185212-8ce1146b8621 // indirect | ||||
github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53 | github.com/yohcop/openid-go v0.0.0-20160914080427-2c050d2dae53 | ||||
go.etcd.io/bbolt v1.3.3 // indirect | go.etcd.io/bbolt v1.3.3 // indirect | ||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 | |||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 | |||||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 | golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 | ||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 | golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 | ||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 | |||||
golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 | |||||
golang.org/x/text v0.3.2 | golang.org/x/text v0.3.2 | ||||
golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74 // indirect | |||||
golang.org/x/tools v0.0.0-20190830223141-573d9926052a // indirect | |||||
google.golang.org/appengine v1.6.2 // indirect | |||||
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/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect | |||||
gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0 | gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0 | ||||
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df | gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df | ||||
gopkg.in/ini.v1 v1.46.0 | gopkg.in/ini.v1 v1.46.0 |
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= | golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= | ||||
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | ||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM= | |||||
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= | |||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= | ||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= | ||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= | ||||
golang.org/x/sys v0.0.0-20190730183949-1393eb018365/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | golang.org/x/sys v0.0.0-20190730183949-1393eb018365/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= | golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3 h1:4y9KwBHBgBNwDbtu44R5o1fdOCQUEXhbk/P4A9WmJq0= | ||||
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | ||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 h1:ng0gs1AKnRRuEMZoTLLlbOd+C17zUDepwGQBb/n+JVg= | |||||
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= | |||||
golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 h1:tdsQdquKbTNMsSZLqnLELJGzCANp9oXhu6zFBW6ODx4= | |||||
golang.org/x/sys v0.0.0-20190902133755-9109b7679e13/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 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= | golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= | ||||
golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= | ||||
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= | ||||
golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74 h1:4cFkmztxtMslUX2SctSl+blCyXfpzhGOy9LhKAqSMA4= | |||||
golang.org/x/tools v0.0.0-20190828213141-aed303cbaa74/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | |||||
golang.org/x/tools v0.0.0-20190830223141-573d9926052a h1:XAHT1kdPpnU8Hk+FPi42KZFhtNFEk4vBg1U4OmIeHTU= | |||||
golang.org/x/tools v0.0.0-20190830223141-573d9926052a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= | |||||
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= | ||||
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/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= | google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= | ||||
google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= | google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= | ||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= | google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= | ||||
google.golang.org/appengine v1.6.2 h1:j8RI1yW0SkI+paT6uGwMlrMI/6zwYA6/CFil8rxOzGI= | |||||
google.golang.org/appengine v1.6.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= | |||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= | google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= | ||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= | google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= | ||||
google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= | google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= | ||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= | ||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | ||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= | |||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | |||||
gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0 h1:oxOEwvhxLMpWpN+0pb2r9TWrM0DCFBHxbuIlS27tmFg= | gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0 h1:oxOEwvhxLMpWpN+0pb2r9TWrM0DCFBHxbuIlS27tmFg= | ||||
gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0/go.mod h1:s2mQFI9McjArkyCwyEwU//+luQENTnD/Lfb/7Sj3/kQ= | gopkg.in/editorconfig/editorconfig-core-go.v1 v1.3.0/go.mod h1:s2mQFI9McjArkyCwyEwU//+luQENTnD/Lfb/7Sj3/kQ= | ||||
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= | gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= |
htmlDoc = NewHTMLParser(t, resp.Body) | htmlDoc = NewHTMLParser(t, resp.Body) | ||||
titleHTML, err := htmlDoc.doc.Find(".comments .event .text b").First().Html() | titleHTML, err := htmlDoc.doc.Find(".comments .event .text b").First().Html() | ||||
assert.NoError(t, err) | assert.NoError(t, err) | ||||
assert.Equal(t, "<i>XSS PR</i>", titleHTML) | |||||
assert.Equal(t, "<strike><i>XSS PR</i></strike>", titleHTML) | |||||
titleHTML, err = htmlDoc.doc.Find(".comments .event .text b").Next().Html() | titleHTML, err = htmlDoc.doc.Find(".comments .event .text b").Next().Html() | ||||
assert.NoError(t, err) | assert.NoError(t, err) | ||||
assert.Equal(t, "<u>XSS PR</u>", titleHTML) | assert.Equal(t, "<u>XSS PR</u>", titleHTML) |
package unix | package unix | ||||
import ( | import ( | ||||
"math/bits" | |||||
"unsafe" | "unsafe" | ||||
) | ) | ||||
func (s *CPUSet) Count() int { | func (s *CPUSet) Count() int { | ||||
c := 0 | c := 0 | ||||
for _, b := range s { | for _, b := range s { | ||||
c += onesCount64(uint64(b)) | |||||
c += bits.OnesCount64(uint64(b)) | |||||
} | } | ||||
return c | return c | ||||
} | } | ||||
// onesCount64 is a copy of Go 1.9's math/bits.OnesCount64. | |||||
// Once this package can require Go 1.9, we can delete this | |||||
// and update the caller to use bits.OnesCount64. | |||||
func onesCount64(x uint64) int { | |||||
const m0 = 0x5555555555555555 // 01010101 ... | |||||
const m1 = 0x3333333333333333 // 00110011 ... | |||||
const m2 = 0x0f0f0f0f0f0f0f0f // 00001111 ... | |||||
// Unused in this function, but definitions preserved for | |||||
// documentation purposes: | |||||
// | |||||
// const m3 = 0x00ff00ff00ff00ff // etc. | |||||
// const m4 = 0x0000ffff0000ffff | |||||
// | |||||
// Implementation: Parallel summing of adjacent bits. | |||||
// See "Hacker's Delight", Chap. 5: Counting Bits. | |||||
// The following pattern shows the general approach: | |||||
// | |||||
// x = x>>1&(m0&m) + x&(m0&m) | |||||
// x = x>>2&(m1&m) + x&(m1&m) | |||||
// x = x>>4&(m2&m) + x&(m2&m) | |||||
// x = x>>8&(m3&m) + x&(m3&m) | |||||
// x = x>>16&(m4&m) + x&(m4&m) | |||||
// x = x>>32&(m5&m) + x&(m5&m) | |||||
// return int(x) | |||||
// | |||||
// Masking (& operations) can be left away when there's no | |||||
// danger that a field's sum will carry over into the next | |||||
// field: Since the result cannot be > 64, 8 bits is enough | |||||
// and we can ignore the masks for the shifts by 8 and up. | |||||
// Per "Hacker's Delight", the first line can be simplified | |||||
// more, but it saves at best one instruction, so we leave | |||||
// it alone for clarity. | |||||
const m = 1<<64 - 1 | |||||
x = x>>1&(m0&m) + x&(m0&m) | |||||
x = x>>2&(m1&m) + x&(m1&m) | |||||
x = (x>>4 + x) & (m2 & m) | |||||
x += x >> 8 | |||||
x += x >> 16 | |||||
x += x >> 32 | |||||
return int(x) & (1<<7 - 1) | |||||
} |
package unix | package unix | ||||
import "runtime" | |||||
import ( | |||||
"runtime" | |||||
"unsafe" | |||||
) | |||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. | ||||
// | // | ||||
func IoctlSetWinsize(fd int, req uint, value *Winsize) error { | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { | ||||
// TODO: if we get the chance, remove the req parameter and | // TODO: if we get the chance, remove the req parameter and | ||||
// hardcode TIOCSWINSZ. | // hardcode TIOCSWINSZ. | ||||
err := ioctlSetWinsize(fd, req, value) | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
runtime.KeepAlive(value) | runtime.KeepAlive(value) | ||||
return err | return err | ||||
} | } | ||||
// The req value will usually be TCSETA or TIOCSETA. | // The req value will usually be TCSETA or TIOCSETA. | ||||
func IoctlSetTermios(fd int, req uint, value *Termios) error { | func IoctlSetTermios(fd int, req uint, value *Termios) error { | ||||
// TODO: if we get the chance, remove the req parameter. | // TODO: if we get the chance, remove the req parameter. | ||||
err := ioctlSetTermios(fd, req, value) | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
runtime.KeepAlive(value) | runtime.KeepAlive(value) | ||||
return err | return err | ||||
} | } | ||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
// | |||||
// A few ioctl requests use the return value as an output parameter; | |||||
// for those, IoctlRetInt should be used instead of this function. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} |
#include <linux/netfilter/nfnetlink.h> | #include <linux/netfilter/nfnetlink.h> | ||||
#include <linux/netlink.h> | #include <linux/netlink.h> | ||||
#include <linux/net_namespace.h> | #include <linux/net_namespace.h> | ||||
#include <linux/nsfs.h> | |||||
#include <linux/perf_event.h> | #include <linux/perf_event.h> | ||||
#include <linux/random.h> | #include <linux/random.h> | ||||
#include <linux/reboot.h> | #include <linux/reboot.h> | ||||
$2 ~ /^SYSCTL_VERS/ || | $2 ~ /^SYSCTL_VERS/ || | ||||
$2 !~ "MNT_BITS" && | $2 !~ "MNT_BITS" && | ||||
$2 ~ /^(MS|MNT|UMOUNT)_/ || | $2 ~ /^(MS|MNT|UMOUNT)_/ || | ||||
$2 ~ /^NS_GET_/ || | |||||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || | $2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ || | ||||
$2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ || | $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ || | ||||
$2 ~ /^KEXEC_/ || | $2 ~ /^KEXEC_/ || |
func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 } | func (w WaitStatus) Continued() bool { return w&0x01000000 != 0 } | ||||
func (w WaitStatus) CoreDump() bool { return w&0x200 != 0 } | |||||
func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 } | |||||
func (w WaitStatus) TrapCause() int { return -1 } | func (w WaitStatus) TrapCause() int { return -1 } | ||||
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX | // fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX | ||||
// There is no way to create a custom fcntl and to keep //sys fcntl easily, | // There is no way to create a custom fcntl and to keep //sys fcntl easily, | ||||
// Therefore, the programmer must call dup2 instead of fcntl in this case. | // Therefore, the programmer must call dup2 instead of fcntl in this case. |
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func Uname(uname *Utsname) error { | func Uname(uname *Utsname) error { | ||||
mib := []_C_int{CTL_KERN, KERN_OSTYPE} | mib := []_C_int{CTL_KERN, KERN_OSTYPE} | ||||
n := unsafe.Sizeof(uname.Sysname) | n := unsafe.Sizeof(uname.Sysname) |
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error { | func sysctlUname(mib []_C_int, old *byte, oldlen *uintptr) error { | ||||
err := sysctl(mib, old, oldlen, nil, 0) | err := sysctl(mib, old, oldlen, nil, 0) | ||||
if err != nil { | if err != nil { |
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func Uname(uname *Utsname) error { | func Uname(uname *Utsname) error { | ||||
mib := []_C_int{CTL_KERN, KERN_OSTYPE} | mib := []_C_int{CTL_KERN, KERN_OSTYPE} | ||||
n := unsafe.Sizeof(uname.Sysname) | n := unsafe.Sizeof(uname.Sysname) |
// ioctl itself should not be exposed directly, but additional get/set | // ioctl itself should not be exposed directly, but additional get/set | ||||
// functions for specific types are permissible. | // functions for specific types are permissible. | ||||
// IoctlRetInt performs an ioctl operation specified by req on a device | |||||
// associated with opened file descriptor fd, and returns a non-negative | |||||
// integer that is returned by the ioctl syscall. | |||||
func IoctlRetInt(fd int, req uint) (int, error) { | |||||
ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0) | |||||
if err != 0 { | |||||
return 0, err | |||||
} | |||||
return int(ret), nil | |||||
} | |||||
// IoctlSetPointerInt performs an ioctl operation which sets an | // IoctlSetPointerInt performs an ioctl operation which sets an | ||||
// integer value on fd, using the specified request number. The ioctl | // integer value on fd, using the specified request number. The ioctl | ||||
// argument is called with a pointer to the integer value, rather than | // argument is called with a pointer to the integer value, rather than | ||||
return ioctl(fd, req, uintptr(unsafe.Pointer(&v))) | return ioctl(fd, req, uintptr(unsafe.Pointer(&v))) | ||||
} | } | ||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
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) | ||||
return err | return err | ||||
} | } | ||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetUint32(fd int, req uint) (uint32, error) { | func IoctlGetUint32(fd int, req uint) (uint32, error) { | ||||
var value uint32 | var value uint32 | ||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | ||||
return value, err | return value, err | ||||
} | } | ||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetRTCTime(fd int) (*RTCTime, error) { | func IoctlGetRTCTime(fd int) (*RTCTime, error) { | ||||
var value RTCTime | var value RTCTime | ||||
err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) | err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value))) |
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) { | func IoctlGetPtmget(fd int, req uint) (*Ptmget, error) { | ||||
var value Ptmget | var value Ptmget | ||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) |
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
// ioctl itself should not be exposed directly, but additional get/set | |||||
// functions for specific types are permissible. | |||||
// IoctlSetInt performs an ioctl operation which sets an integer value | |||||
// on fd, using the specified request number. | |||||
func IoctlSetInt(fd int, req uint, value int) error { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) error { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
// IoctlGetInt performs an ioctl operation which gets an integer value | |||||
// from fd, using the specified request number. | |||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
//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) { |
//sys ioctl(fd int, req uint, arg uintptr) (err error) | //sys ioctl(fd int, req uint, arg uintptr) (err error) | ||||
func IoctlSetInt(fd int, req uint, value int) (err error) { | |||||
return ioctl(fd, req, uintptr(value)) | |||||
} | |||||
func ioctlSetWinsize(fd int, req uint, value *Winsize) (err error) { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func ioctlSetTermios(fd int, req uint, value *Termios) (err error) { | |||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | |||||
} | |||||
func IoctlSetTermio(fd int, req uint, value *Termio) (err error) { | func IoctlSetTermio(fd int, req uint, value *Termio) (err error) { | ||||
return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | return ioctl(fd, req, uintptr(unsafe.Pointer(value))) | ||||
} | } | ||||
func IoctlGetInt(fd int, req uint) (int, error) { | |||||
var value int | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return value, err | |||||
} | |||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { | |||||
var value Winsize | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) { | |||||
var value Termios | |||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | |||||
return &value, err | |||||
} | |||||
func IoctlGetTermio(fd int, req uint) (*Termio, error) { | func IoctlGetTermio(fd int, req uint) (*Termio, error) { | ||||
var value Termio | var value Termio | ||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) | err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0xb703 | |||||
NS_GET_OWNER_UID = 0xb704 | |||||
NS_GET_PARENT = 0xb702 | |||||
NS_GET_USERNS = 0xb701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0xb703 | |||||
NS_GET_OWNER_UID = 0xb704 | |||||
NS_GET_PARENT = 0xb702 | |||||
NS_GET_USERNS = 0xb701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0xb703 | |||||
NS_GET_OWNER_UID = 0xb704 | |||||
NS_GET_PARENT = 0xb702 | |||||
NS_GET_USERNS = 0xb701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0xb703 | |||||
NS_GET_OWNER_UID = 0xb704 | |||||
NS_GET_PARENT = 0xb702 | |||||
NS_GET_USERNS = 0xb701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80000000 | NOFLSH = 0x80000000 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80000000 | NOFLSH = 0x80000000 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0xb703 | |||||
NS_GET_OWNER_UID = 0xb704 | |||||
NS_GET_PARENT = 0xb702 | |||||
NS_GET_USERNS = 0xb701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0xb703 | |||||
NS_GET_OWNER_UID = 0xb704 | |||||
NS_GET_PARENT = 0xb702 | |||||
NS_GET_USERNS = 0xb701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
NLM_F_ROOT = 0x100 | NLM_F_ROOT = 0x100 | ||||
NOFLSH = 0x80 | NOFLSH = 0x80 | ||||
NSFS_MAGIC = 0x6e736673 | NSFS_MAGIC = 0x6e736673 | ||||
NS_GET_NSTYPE = 0x2000b703 | |||||
NS_GET_OWNER_UID = 0x2000b704 | |||||
NS_GET_PARENT = 0x2000b702 | |||||
NS_GET_USERNS = 0x2000b701 | |||||
OCFS2_SUPER_MAGIC = 0x7461636f | OCFS2_SUPER_MAGIC = 0x7461636f | ||||
OCRNL = 0x8 | OCRNL = 0x8 | ||||
OFDEL = 0x80 | OFDEL = 0x80 |
return 0, e | return 0, e | ||||
} | } | ||||
var t Token | var t Token | ||||
e = OpenProcessToken(p, TOKEN_QUERY, &t) | |||||
e = OpenProcessToken(p, TOKEN_QUERY|TOKEN_DUPLICATE, &t) | |||||
if e != nil { | if e != nil { | ||||
return 0, e | return 0, e | ||||
} | } |
//sys SetEvent(event Handle) (err error) = kernel32.SetEvent | //sys SetEvent(event Handle) (err error) = kernel32.SetEvent | ||||
//sys ResetEvent(event Handle) (err error) = kernel32.ResetEvent | //sys ResetEvent(event Handle) (err error) = kernel32.ResetEvent | ||||
//sys PulseEvent(event Handle) (err error) = kernel32.PulseEvent | //sys PulseEvent(event Handle) (err error) = kernel32.PulseEvent | ||||
//sys CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) = kernel32.CreateMutexW | |||||
//sys CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) = kernel32.CreateMutexExW | |||||
//sys OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) = kernel32.OpenMutexW | |||||
//sys ReleaseMutex(mutex Handle) (err error) = kernel32.ReleaseMutex | |||||
//sys SleepEx(milliseconds uint32, alertable bool) (ret uint32) = kernel32.SleepEx | //sys SleepEx(milliseconds uint32, alertable bool) (ret uint32) = kernel32.SleepEx | ||||
//sys CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) = kernel32.CreateJobObjectW | //sys CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) = kernel32.CreateJobObjectW | ||||
//sys AssignProcessToJobObject(job Handle, process Handle) (err error) = kernel32.AssignProcessToJobObject | //sys AssignProcessToJobObject(job Handle, process Handle) (err error) = kernel32.AssignProcessToJobObject |
REG_QWORD = REG_QWORD_LITTLE_ENDIAN | REG_QWORD = REG_QWORD_LITTLE_ENDIAN | ||||
) | ) | ||||
const ( | |||||
EVENT_MODIFY_STATE = 0x0002 | |||||
EVENT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3 | |||||
MUTANT_QUERY_STATE = 0x0001 | |||||
MUTANT_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | MUTANT_QUERY_STATE | |||||
SEMAPHORE_MODIFY_STATE = 0x0002 | |||||
SEMAPHORE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3 | |||||
TIMER_QUERY_STATE = 0x0001 | |||||
TIMER_MODIFY_STATE = 0x0002 | |||||
TIMER_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | TIMER_QUERY_STATE | TIMER_MODIFY_STATE | |||||
MUTEX_MODIFY_STATE = MUTANT_QUERY_STATE | |||||
MUTEX_ALL_ACCESS = MUTANT_ALL_ACCESS | |||||
CREATE_EVENT_MANUAL_RESET = 0x1 | |||||
CREATE_EVENT_INITIAL_SET = 0x2 | |||||
CREATE_MUTEX_INITIAL_OWNER = 0x1 | |||||
) | |||||
type AddrinfoW struct { | type AddrinfoW struct { | ||||
Flags int32 | Flags int32 | ||||
Family int32 | Family int32 |
procSetEvent = modkernel32.NewProc("SetEvent") | procSetEvent = modkernel32.NewProc("SetEvent") | ||||
procResetEvent = modkernel32.NewProc("ResetEvent") | procResetEvent = modkernel32.NewProc("ResetEvent") | ||||
procPulseEvent = modkernel32.NewProc("PulseEvent") | procPulseEvent = modkernel32.NewProc("PulseEvent") | ||||
procCreateMutexW = modkernel32.NewProc("CreateMutexW") | |||||
procCreateMutexExW = modkernel32.NewProc("CreateMutexExW") | |||||
procOpenMutexW = modkernel32.NewProc("OpenMutexW") | |||||
procReleaseMutex = modkernel32.NewProc("ReleaseMutex") | |||||
procSleepEx = modkernel32.NewProc("SleepEx") | procSleepEx = modkernel32.NewProc("SleepEx") | ||||
procCreateJobObjectW = modkernel32.NewProc("CreateJobObjectW") | procCreateJobObjectW = modkernel32.NewProc("CreateJobObjectW") | ||||
procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") | procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") | ||||
return | return | ||||
} | } | ||||
func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16) (handle Handle, err error) { | |||||
var _p0 uint32 | |||||
if initialOwner { | |||||
_p0 = 1 | |||||
} else { | |||||
_p0 = 0 | |||||
} | |||||
r0, _, e1 := syscall.Syscall(procCreateMutexW.Addr(), 3, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) | |||||
handle = Handle(r0) | |||||
if handle == 0 { | |||||
if e1 != 0 { | |||||
err = errnoErr(e1) | |||||
} else { | |||||
err = syscall.EINVAL | |||||
} | |||||
} | |||||
return | |||||
} | |||||
func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { | |||||
r0, _, e1 := syscall.Syscall6(procCreateMutexExW.Addr(), 4, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) | |||||
handle = Handle(r0) | |||||
if handle == 0 { | |||||
if e1 != 0 { | |||||
err = errnoErr(e1) | |||||
} else { | |||||
err = syscall.EINVAL | |||||
} | |||||
} | |||||
return | |||||
} | |||||
func OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle Handle, err error) { | |||||
var _p0 uint32 | |||||
if inheritHandle { | |||||
_p0 = 1 | |||||
} else { | |||||
_p0 = 0 | |||||
} | |||||
r0, _, e1 := syscall.Syscall(procOpenMutexW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) | |||||
handle = Handle(r0) | |||||
if handle == 0 { | |||||
if e1 != 0 { | |||||
err = errnoErr(e1) | |||||
} else { | |||||
err = syscall.EINVAL | |||||
} | |||||
} | |||||
return | |||||
} | |||||
func ReleaseMutex(mutex Handle) (err error) { | |||||
r1, _, e1 := syscall.Syscall(procReleaseMutex.Addr(), 1, uintptr(mutex), 0, 0) | |||||
if r1 == 0 { | |||||
if e1 != 0 { | |||||
err = errnoErr(e1) | |||||
} else { | |||||
err = syscall.EINVAL | |||||
} | |||||
} | |||||
return | |||||
} | |||||
func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { | func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { | ||||
var _p0 uint32 | var _p0 uint32 | ||||
if alertable { | if alertable { |
# golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 | # golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 | ||||
golang.org/x/oauth2 | golang.org/x/oauth2 | ||||
golang.org/x/oauth2/internal | golang.org/x/oauth2/internal | ||||
# golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456 | |||||
# golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 | |||||
golang.org/x/sys/windows | golang.org/x/sys/windows | ||||
golang.org/x/sys/windows/svc | golang.org/x/sys/windows/svc | ||||
golang.org/x/sys/cpu | golang.org/x/sys/cpu |