ran go mod vendor
This commit is contained in:
Родитель
169d7d7935
Коммит
3ed6949788
2
go.mod
2
go.mod
|
@ -36,5 +36,5 @@ require (
|
|||
k8s.io/apimachinery v0.18.2
|
||||
k8s.io/client-go v0.18.2
|
||||
sigs.k8s.io/controller-runtime v0.6.0
|
||||
software.sslmate.com/src/go-pkcs12 v0.0.0-20201102150903-66718f75db0e
|
||||
software.sslmate.com/src/go-pkcs12 v0.0.0-20201102150903-66718f75db0e // indirect
|
||||
)
|
||||
|
|
|
@ -1,15 +1,10 @@
|
|||
language: go
|
||||
go_import_path: github.com/pkg/errors
|
||||
go:
|
||||
- 1.4.x
|
||||
- 1.5.x
|
||||
- 1.6.x
|
||||
- 1.7.x
|
||||
- 1.8.x
|
||||
- 1.9.x
|
||||
- 1.10.x
|
||||
- 1.11.x
|
||||
- 1.12.x
|
||||
- 1.13.x
|
||||
- tip
|
||||
|
||||
script:
|
||||
- go test -v ./...
|
||||
- make check
|
||||
|
|
|
@ -41,11 +41,18 @@ default:
|
|||
|
||||
[Read the package documentation for more information](https://godoc.org/github.com/pkg/errors).
|
||||
|
||||
## Roadmap
|
||||
|
||||
With the upcoming [Go2 error proposals](https://go.googlesource.com/proposal/+/master/design/go2draft.md) this package is moving into maintenance mode. The roadmap for a 1.0 release is as follows:
|
||||
|
||||
- 0.9. Remove pre Go 1.9 and Go 1.10 support, address outstanding pull requests (if possible)
|
||||
- 1.0. Final release.
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome pull requests, bug fixes and issue reports. With that said, the bar for adding new symbols to this package is intentionally set high.
|
||||
Because of the Go2 errors changes, this package is not accepting proposals for new functionality. With that said, we welcome pull requests, bug fixes and issue reports.
|
||||
|
||||
Before proposing a change, please discuss your change by raising an issue.
|
||||
Before sending a PR, please discuss your change by raising an issue.
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
//
|
||||
// if err, ok := err.(stackTracer); ok {
|
||||
// for _, f := range err.StackTrace() {
|
||||
// fmt.Printf("%+s:%d", f)
|
||||
// fmt.Printf("%+s:%d\n", f, f)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
@ -159,6 +159,9 @@ type withStack struct {
|
|||
|
||||
func (w *withStack) Cause() error { return w.error }
|
||||
|
||||
// Unwrap provides compatibility for Go 1.13 error chains.
|
||||
func (w *withStack) Unwrap() error { return w.error }
|
||||
|
||||
func (w *withStack) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
case 'v':
|
||||
|
@ -241,6 +244,9 @@ type withMessage struct {
|
|||
func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
|
||||
func (w *withMessage) Cause() error { return w.cause }
|
||||
|
||||
// Unwrap provides compatibility for Go 1.13 error chains.
|
||||
func (w *withMessage) Unwrap() error { return w.cause }
|
||||
|
||||
func (w *withMessage) Format(s fmt.State, verb rune) {
|
||||
switch verb {
|
||||
case 'v':
|
||||
|
|
|
@ -5,10 +5,13 @@ import (
|
|||
"io"
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Frame represents a program counter inside a stack frame.
|
||||
// For historical reasons if Frame is interpreted as a uintptr
|
||||
// its value represents the program counter + 1.
|
||||
type Frame uintptr
|
||||
|
||||
// pc returns the program counter for this frame;
|
||||
|
@ -37,6 +40,15 @@ func (f Frame) line() int {
|
|||
return line
|
||||
}
|
||||
|
||||
// name returns the name of this function, if known.
|
||||
func (f Frame) name() string {
|
||||
fn := runtime.FuncForPC(f.pc())
|
||||
if fn == nil {
|
||||
return "unknown"
|
||||
}
|
||||
return fn.Name()
|
||||
}
|
||||
|
||||
// Format formats the frame according to the fmt.Formatter interface.
|
||||
//
|
||||
// %s source file
|
||||
|
@ -54,22 +66,16 @@ func (f Frame) Format(s fmt.State, verb rune) {
|
|||
case 's':
|
||||
switch {
|
||||
case s.Flag('+'):
|
||||
pc := f.pc()
|
||||
fn := runtime.FuncForPC(pc)
|
||||
if fn == nil {
|
||||
io.WriteString(s, "unknown")
|
||||
} else {
|
||||
file, _ := fn.FileLine(pc)
|
||||
fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file)
|
||||
}
|
||||
io.WriteString(s, f.name())
|
||||
io.WriteString(s, "\n\t")
|
||||
io.WriteString(s, f.file())
|
||||
default:
|
||||
io.WriteString(s, path.Base(f.file()))
|
||||
}
|
||||
case 'd':
|
||||
fmt.Fprintf(s, "%d", f.line())
|
||||
io.WriteString(s, strconv.Itoa(f.line()))
|
||||
case 'n':
|
||||
name := runtime.FuncForPC(f.pc()).Name()
|
||||
io.WriteString(s, funcname(name))
|
||||
io.WriteString(s, funcname(f.name()))
|
||||
case 'v':
|
||||
f.Format(s, 's')
|
||||
io.WriteString(s, ":")
|
||||
|
@ -77,6 +83,16 @@ func (f Frame) Format(s fmt.State, verb rune) {
|
|||
}
|
||||
}
|
||||
|
||||
// MarshalText formats a stacktrace Frame as a text string. The output is the
|
||||
// same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
|
||||
func (f Frame) MarshalText() ([]byte, error) {
|
||||
name := f.name()
|
||||
if name == "unknown" {
|
||||
return []byte(name), nil
|
||||
}
|
||||
return []byte(fmt.Sprintf("%s %s:%d", name, f.file(), f.line())), nil
|
||||
}
|
||||
|
||||
// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
|
||||
type StackTrace []Frame
|
||||
|
||||
|
@ -94,18 +110,32 @@ func (st StackTrace) Format(s fmt.State, verb rune) {
|
|||
switch {
|
||||
case s.Flag('+'):
|
||||
for _, f := range st {
|
||||
fmt.Fprintf(s, "\n%+v", f)
|
||||
io.WriteString(s, "\n")
|
||||
f.Format(s, verb)
|
||||
}
|
||||
case s.Flag('#'):
|
||||
fmt.Fprintf(s, "%#v", []Frame(st))
|
||||
default:
|
||||
fmt.Fprintf(s, "%v", []Frame(st))
|
||||
st.formatSlice(s, verb)
|
||||
}
|
||||
case 's':
|
||||
fmt.Fprintf(s, "%s", []Frame(st))
|
||||
st.formatSlice(s, verb)
|
||||
}
|
||||
}
|
||||
|
||||
// formatSlice will format this StackTrace into the given buffer as a slice of
|
||||
// Frame, only valid when called with '%s' or '%v'.
|
||||
func (st StackTrace) formatSlice(s fmt.State, verb rune) {
|
||||
io.WriteString(s, "[")
|
||||
for i, f := range st {
|
||||
if i > 0 {
|
||||
io.WriteString(s, " ")
|
||||
}
|
||||
f.Format(s, verb)
|
||||
}
|
||||
io.WriteString(s, "]")
|
||||
}
|
||||
|
||||
// stack represents a stack of program counters.
|
||||
type stack []uintptr
|
||||
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
// Copyright 2012 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 pbkdf2 implements the key derivation function PBKDF2 as defined in RFC
|
||||
2898 / PKCS #5 v2.0.
|
||||
|
||||
A key derivation function is useful when encrypting data based on a password
|
||||
or any other not-fully-random data. It uses a pseudorandom function to derive
|
||||
a secure encryption key based on the password.
|
||||
|
||||
While v2.0 of the standard defines only one pseudorandom function to use,
|
||||
HMAC-SHA1, the drafted v2.1 specification allows use of all five FIPS Approved
|
||||
Hash Functions SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 for HMAC. To
|
||||
choose, you can pass the `New` functions from the different SHA packages to
|
||||
pbkdf2.Key.
|
||||
*/
|
||||
package pbkdf2 // import "golang.org/x/crypto/pbkdf2"
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
"hash"
|
||||
)
|
||||
|
||||
// Key derives a key from the password, salt and iteration count, returning a
|
||||
// []byte of length keylen that can be used as cryptographic key. The key is
|
||||
// derived based on the method described as PBKDF2 with the HMAC variant using
|
||||
// the supplied hash function.
|
||||
//
|
||||
// For example, to use a HMAC-SHA-1 based PBKDF2 key derivation function, you
|
||||
// can get a derived key for e.g. AES-256 (which needs a 32-byte key) by
|
||||
// doing:
|
||||
//
|
||||
// dk := pbkdf2.Key([]byte("some password"), salt, 4096, 32, sha1.New)
|
||||
//
|
||||
// Remember to get a good random salt. At least 8 bytes is recommended by the
|
||||
// RFC.
|
||||
//
|
||||
// Using a higher iteration count will increase the cost of an exhaustive
|
||||
// search but will also make derivation proportionally slower.
|
||||
func Key(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte {
|
||||
prf := hmac.New(h, password)
|
||||
hashLen := prf.Size()
|
||||
numBlocks := (keyLen + hashLen - 1) / hashLen
|
||||
|
||||
var buf [4]byte
|
||||
dk := make([]byte, 0, numBlocks*hashLen)
|
||||
U := make([]byte, hashLen)
|
||||
for block := 1; block <= numBlocks; block++ {
|
||||
// N.B.: || means concatenation, ^ means XOR
|
||||
// for each block T_i = U_1 ^ U_2 ^ ... ^ U_iter
|
||||
// U_1 = PRF(password, salt || uint(i))
|
||||
prf.Reset()
|
||||
prf.Write(salt)
|
||||
buf[0] = byte(block >> 24)
|
||||
buf[1] = byte(block >> 16)
|
||||
buf[2] = byte(block >> 8)
|
||||
buf[3] = byte(block)
|
||||
prf.Write(buf[:4])
|
||||
dk = prf.Sum(dk)
|
||||
T := dk[len(dk)-hashLen:]
|
||||
copy(U, T)
|
||||
|
||||
// U_n = PRF(password, U_(n-1))
|
||||
for n := 2; n <= iter; n++ {
|
||||
prf.Reset()
|
||||
prf.Write(U)
|
||||
U = U[:0]
|
||||
U = prf.Sum(U)
|
||||
for x := range U {
|
||||
T[x] ^= U[x]
|
||||
}
|
||||
}
|
||||
}
|
||||
return dk[:keyLen]
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"unicode/utf16"
|
||||
)
|
||||
|
||||
// bmpString returns s encoded in UCS-2 with a zero terminator.
|
||||
func bmpString(s string) ([]byte, error) {
|
||||
// References:
|
||||
// https://tools.ietf.org/html/rfc7292#appendix-B.1
|
||||
// https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_Multilingual_Plane
|
||||
// - non-BMP characters are encoded in UTF 16 by using a surrogate pair of 16-bit codes
|
||||
// EncodeRune returns 0xfffd if the rune does not need special encoding
|
||||
// - the above RFC provides the info that BMPStrings are NULL terminated.
|
||||
|
||||
ret := make([]byte, 0, 2*len(s)+2)
|
||||
|
||||
for _, r := range s {
|
||||
if t, _ := utf16.EncodeRune(r); t != 0xfffd {
|
||||
return nil, errors.New("pkcs12: string contains characters that cannot be encoded in UCS-2")
|
||||
}
|
||||
ret = append(ret, byte(r/256), byte(r%256))
|
||||
}
|
||||
|
||||
return append(ret, 0, 0), nil
|
||||
}
|
||||
|
||||
func decodeBMPString(bmpString []byte) (string, error) {
|
||||
if len(bmpString)%2 != 0 {
|
||||
return "", errors.New("pkcs12: odd-length BMP string")
|
||||
}
|
||||
|
||||
// strip terminator if present
|
||||
if l := len(bmpString); l >= 2 && bmpString[l-1] == 0 && bmpString[l-2] == 0 {
|
||||
bmpString = bmpString[:l-2]
|
||||
}
|
||||
|
||||
s := make([]uint16, 0, len(bmpString)/2)
|
||||
for len(bmpString) > 0 {
|
||||
s = append(s, uint16(bmpString[0])<<8+uint16(bmpString[1]))
|
||||
bmpString = bmpString[2:]
|
||||
}
|
||||
|
||||
return string(utf16.Decode(s)), nil
|
||||
}
|
|
@ -1,131 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/cipher"
|
||||
"crypto/des"
|
||||
"crypto/x509/pkix"
|
||||
"encoding/asn1"
|
||||
"errors"
|
||||
|
||||
"golang.org/x/crypto/pkcs12/internal/rc2"
|
||||
)
|
||||
|
||||
var (
|
||||
oidPBEWithSHAAnd3KeyTripleDESCBC = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 12, 1, 3})
|
||||
oidPBEWithSHAAnd40BitRC2CBC = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 12, 1, 6})
|
||||
)
|
||||
|
||||
// pbeCipher is an abstraction of a PKCS#12 cipher.
|
||||
type pbeCipher interface {
|
||||
// create returns a cipher.Block given a key.
|
||||
create(key []byte) (cipher.Block, error)
|
||||
// deriveKey returns a key derived from the given password and salt.
|
||||
deriveKey(salt, password []byte, iterations int) []byte
|
||||
// deriveKey returns an IV derived from the given password and salt.
|
||||
deriveIV(salt, password []byte, iterations int) []byte
|
||||
}
|
||||
|
||||
type shaWithTripleDESCBC struct{}
|
||||
|
||||
func (shaWithTripleDESCBC) create(key []byte) (cipher.Block, error) {
|
||||
return des.NewTripleDESCipher(key)
|
||||
}
|
||||
|
||||
func (shaWithTripleDESCBC) deriveKey(salt, password []byte, iterations int) []byte {
|
||||
return pbkdf(sha1Sum, 20, 64, salt, password, iterations, 1, 24)
|
||||
}
|
||||
|
||||
func (shaWithTripleDESCBC) deriveIV(salt, password []byte, iterations int) []byte {
|
||||
return pbkdf(sha1Sum, 20, 64, salt, password, iterations, 2, 8)
|
||||
}
|
||||
|
||||
type shaWith40BitRC2CBC struct{}
|
||||
|
||||
func (shaWith40BitRC2CBC) create(key []byte) (cipher.Block, error) {
|
||||
return rc2.New(key, len(key)*8)
|
||||
}
|
||||
|
||||
func (shaWith40BitRC2CBC) deriveKey(salt, password []byte, iterations int) []byte {
|
||||
return pbkdf(sha1Sum, 20, 64, salt, password, iterations, 1, 5)
|
||||
}
|
||||
|
||||
func (shaWith40BitRC2CBC) deriveIV(salt, password []byte, iterations int) []byte {
|
||||
return pbkdf(sha1Sum, 20, 64, salt, password, iterations, 2, 8)
|
||||
}
|
||||
|
||||
type pbeParams struct {
|
||||
Salt []byte
|
||||
Iterations int
|
||||
}
|
||||
|
||||
func pbDecrypterFor(algorithm pkix.AlgorithmIdentifier, password []byte) (cipher.BlockMode, int, error) {
|
||||
var cipherType pbeCipher
|
||||
|
||||
switch {
|
||||
case algorithm.Algorithm.Equal(oidPBEWithSHAAnd3KeyTripleDESCBC):
|
||||
cipherType = shaWithTripleDESCBC{}
|
||||
case algorithm.Algorithm.Equal(oidPBEWithSHAAnd40BitRC2CBC):
|
||||
cipherType = shaWith40BitRC2CBC{}
|
||||
default:
|
||||
return nil, 0, NotImplementedError("algorithm " + algorithm.Algorithm.String() + " is not supported")
|
||||
}
|
||||
|
||||
var params pbeParams
|
||||
if err := unmarshal(algorithm.Parameters.FullBytes, ¶ms); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
key := cipherType.deriveKey(params.Salt, password, params.Iterations)
|
||||
iv := cipherType.deriveIV(params.Salt, password, params.Iterations)
|
||||
|
||||
block, err := cipherType.create(key)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
return cipher.NewCBCDecrypter(block, iv), block.BlockSize(), nil
|
||||
}
|
||||
|
||||
func pbDecrypt(info decryptable, password []byte) (decrypted []byte, err error) {
|
||||
cbc, blockSize, err := pbDecrypterFor(info.Algorithm(), password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
encrypted := info.Data()
|
||||
if len(encrypted) == 0 {
|
||||
return nil, errors.New("pkcs12: empty encrypted data")
|
||||
}
|
||||
if len(encrypted)%blockSize != 0 {
|
||||
return nil, errors.New("pkcs12: input is not a multiple of the block size")
|
||||
}
|
||||
decrypted = make([]byte, len(encrypted))
|
||||
cbc.CryptBlocks(decrypted, encrypted)
|
||||
|
||||
psLen := int(decrypted[len(decrypted)-1])
|
||||
if psLen == 0 || psLen > blockSize {
|
||||
return nil, ErrDecryption
|
||||
}
|
||||
|
||||
if len(decrypted) < psLen {
|
||||
return nil, ErrDecryption
|
||||
}
|
||||
ps := decrypted[len(decrypted)-psLen:]
|
||||
decrypted = decrypted[:len(decrypted)-psLen]
|
||||
if bytes.Compare(ps, bytes.Repeat([]byte{byte(psLen)}, psLen)) != 0 {
|
||||
return nil, ErrDecryption
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// decryptable abstracts an object that contains ciphertext.
|
||||
type decryptable interface {
|
||||
Algorithm() pkix.AlgorithmIdentifier
|
||||
Data() []byte
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12
|
||||
|
||||
import "errors"
|
||||
|
||||
var (
|
||||
// ErrDecryption represents a failure to decrypt the input.
|
||||
ErrDecryption = errors.New("pkcs12: decryption error, incorrect padding")
|
||||
|
||||
// ErrIncorrectPassword is returned when an incorrect password is detected.
|
||||
// Usually, P12/PFX data is signed to be able to verify the password.
|
||||
ErrIncorrectPassword = errors.New("pkcs12: decryption password incorrect")
|
||||
)
|
||||
|
||||
// NotImplementedError indicates that the input is not currently supported.
|
||||
type NotImplementedError string
|
||||
|
||||
func (e NotImplementedError) Error() string {
|
||||
return "pkcs12: " + string(e)
|
||||
}
|
|
@ -1,271 +0,0 @@
|
|||
// Copyright 2015 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 rc2 implements the RC2 cipher
|
||||
/*
|
||||
https://www.ietf.org/rfc/rfc2268.txt
|
||||
http://people.csail.mit.edu/rivest/pubs/KRRR98.pdf
|
||||
|
||||
This code is licensed under the MIT license.
|
||||
*/
|
||||
package rc2
|
||||
|
||||
import (
|
||||
"crypto/cipher"
|
||||
"encoding/binary"
|
||||
)
|
||||
|
||||
// The rc2 block size in bytes
|
||||
const BlockSize = 8
|
||||
|
||||
type rc2Cipher struct {
|
||||
k [64]uint16
|
||||
}
|
||||
|
||||
// New returns a new rc2 cipher with the given key and effective key length t1
|
||||
func New(key []byte, t1 int) (cipher.Block, error) {
|
||||
// TODO(dgryski): error checking for key length
|
||||
return &rc2Cipher{
|
||||
k: expandKey(key, t1),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (*rc2Cipher) BlockSize() int { return BlockSize }
|
||||
|
||||
var piTable = [256]byte{
|
||||
0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d,
|
||||
0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2,
|
||||
0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32,
|
||||
0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82,
|
||||
0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc,
|
||||
0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26,
|
||||
0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03,
|
||||
0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7,
|
||||
0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a,
|
||||
0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec,
|
||||
0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39,
|
||||
0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31,
|
||||
0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9,
|
||||
0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9,
|
||||
0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e,
|
||||
0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad,
|
||||
}
|
||||
|
||||
func expandKey(key []byte, t1 int) [64]uint16 {
|
||||
|
||||
l := make([]byte, 128)
|
||||
copy(l, key)
|
||||
|
||||
var t = len(key)
|
||||
var t8 = (t1 + 7) / 8
|
||||
var tm = byte(255 % uint(1<<(8+uint(t1)-8*uint(t8))))
|
||||
|
||||
for i := len(key); i < 128; i++ {
|
||||
l[i] = piTable[l[i-1]+l[uint8(i-t)]]
|
||||
}
|
||||
|
||||
l[128-t8] = piTable[l[128-t8]&tm]
|
||||
|
||||
for i := 127 - t8; i >= 0; i-- {
|
||||
l[i] = piTable[l[i+1]^l[i+t8]]
|
||||
}
|
||||
|
||||
var k [64]uint16
|
||||
|
||||
for i := range k {
|
||||
k[i] = uint16(l[2*i]) + uint16(l[2*i+1])*256
|
||||
}
|
||||
|
||||
return k
|
||||
}
|
||||
|
||||
func rotl16(x uint16, b uint) uint16 {
|
||||
return (x >> (16 - b)) | (x << b)
|
||||
}
|
||||
|
||||
func (c *rc2Cipher) Encrypt(dst, src []byte) {
|
||||
|
||||
r0 := binary.LittleEndian.Uint16(src[0:])
|
||||
r1 := binary.LittleEndian.Uint16(src[2:])
|
||||
r2 := binary.LittleEndian.Uint16(src[4:])
|
||||
r3 := binary.LittleEndian.Uint16(src[6:])
|
||||
|
||||
var j int
|
||||
|
||||
for j <= 16 {
|
||||
// mix r0
|
||||
r0 = r0 + c.k[j] + (r3 & r2) + ((^r3) & r1)
|
||||
r0 = rotl16(r0, 1)
|
||||
j++
|
||||
|
||||
// mix r1
|
||||
r1 = r1 + c.k[j] + (r0 & r3) + ((^r0) & r2)
|
||||
r1 = rotl16(r1, 2)
|
||||
j++
|
||||
|
||||
// mix r2
|
||||
r2 = r2 + c.k[j] + (r1 & r0) + ((^r1) & r3)
|
||||
r2 = rotl16(r2, 3)
|
||||
j++
|
||||
|
||||
// mix r3
|
||||
r3 = r3 + c.k[j] + (r2 & r1) + ((^r2) & r0)
|
||||
r3 = rotl16(r3, 5)
|
||||
j++
|
||||
|
||||
}
|
||||
|
||||
r0 = r0 + c.k[r3&63]
|
||||
r1 = r1 + c.k[r0&63]
|
||||
r2 = r2 + c.k[r1&63]
|
||||
r3 = r3 + c.k[r2&63]
|
||||
|
||||
for j <= 40 {
|
||||
// mix r0
|
||||
r0 = r0 + c.k[j] + (r3 & r2) + ((^r3) & r1)
|
||||
r0 = rotl16(r0, 1)
|
||||
j++
|
||||
|
||||
// mix r1
|
||||
r1 = r1 + c.k[j] + (r0 & r3) + ((^r0) & r2)
|
||||
r1 = rotl16(r1, 2)
|
||||
j++
|
||||
|
||||
// mix r2
|
||||
r2 = r2 + c.k[j] + (r1 & r0) + ((^r1) & r3)
|
||||
r2 = rotl16(r2, 3)
|
||||
j++
|
||||
|
||||
// mix r3
|
||||
r3 = r3 + c.k[j] + (r2 & r1) + ((^r2) & r0)
|
||||
r3 = rotl16(r3, 5)
|
||||
j++
|
||||
|
||||
}
|
||||
|
||||
r0 = r0 + c.k[r3&63]
|
||||
r1 = r1 + c.k[r0&63]
|
||||
r2 = r2 + c.k[r1&63]
|
||||
r3 = r3 + c.k[r2&63]
|
||||
|
||||
for j <= 60 {
|
||||
// mix r0
|
||||
r0 = r0 + c.k[j] + (r3 & r2) + ((^r3) & r1)
|
||||
r0 = rotl16(r0, 1)
|
||||
j++
|
||||
|
||||
// mix r1
|
||||
r1 = r1 + c.k[j] + (r0 & r3) + ((^r0) & r2)
|
||||
r1 = rotl16(r1, 2)
|
||||
j++
|
||||
|
||||
// mix r2
|
||||
r2 = r2 + c.k[j] + (r1 & r0) + ((^r1) & r3)
|
||||
r2 = rotl16(r2, 3)
|
||||
j++
|
||||
|
||||
// mix r3
|
||||
r3 = r3 + c.k[j] + (r2 & r1) + ((^r2) & r0)
|
||||
r3 = rotl16(r3, 5)
|
||||
j++
|
||||
}
|
||||
|
||||
binary.LittleEndian.PutUint16(dst[0:], r0)
|
||||
binary.LittleEndian.PutUint16(dst[2:], r1)
|
||||
binary.LittleEndian.PutUint16(dst[4:], r2)
|
||||
binary.LittleEndian.PutUint16(dst[6:], r3)
|
||||
}
|
||||
|
||||
func (c *rc2Cipher) Decrypt(dst, src []byte) {
|
||||
|
||||
r0 := binary.LittleEndian.Uint16(src[0:])
|
||||
r1 := binary.LittleEndian.Uint16(src[2:])
|
||||
r2 := binary.LittleEndian.Uint16(src[4:])
|
||||
r3 := binary.LittleEndian.Uint16(src[6:])
|
||||
|
||||
j := 63
|
||||
|
||||
for j >= 44 {
|
||||
// unmix r3
|
||||
r3 = rotl16(r3, 16-5)
|
||||
r3 = r3 - c.k[j] - (r2 & r1) - ((^r2) & r0)
|
||||
j--
|
||||
|
||||
// unmix r2
|
||||
r2 = rotl16(r2, 16-3)
|
||||
r2 = r2 - c.k[j] - (r1 & r0) - ((^r1) & r3)
|
||||
j--
|
||||
|
||||
// unmix r1
|
||||
r1 = rotl16(r1, 16-2)
|
||||
r1 = r1 - c.k[j] - (r0 & r3) - ((^r0) & r2)
|
||||
j--
|
||||
|
||||
// unmix r0
|
||||
r0 = rotl16(r0, 16-1)
|
||||
r0 = r0 - c.k[j] - (r3 & r2) - ((^r3) & r1)
|
||||
j--
|
||||
}
|
||||
|
||||
r3 = r3 - c.k[r2&63]
|
||||
r2 = r2 - c.k[r1&63]
|
||||
r1 = r1 - c.k[r0&63]
|
||||
r0 = r0 - c.k[r3&63]
|
||||
|
||||
for j >= 20 {
|
||||
// unmix r3
|
||||
r3 = rotl16(r3, 16-5)
|
||||
r3 = r3 - c.k[j] - (r2 & r1) - ((^r2) & r0)
|
||||
j--
|
||||
|
||||
// unmix r2
|
||||
r2 = rotl16(r2, 16-3)
|
||||
r2 = r2 - c.k[j] - (r1 & r0) - ((^r1) & r3)
|
||||
j--
|
||||
|
||||
// unmix r1
|
||||
r1 = rotl16(r1, 16-2)
|
||||
r1 = r1 - c.k[j] - (r0 & r3) - ((^r0) & r2)
|
||||
j--
|
||||
|
||||
// unmix r0
|
||||
r0 = rotl16(r0, 16-1)
|
||||
r0 = r0 - c.k[j] - (r3 & r2) - ((^r3) & r1)
|
||||
j--
|
||||
|
||||
}
|
||||
|
||||
r3 = r3 - c.k[r2&63]
|
||||
r2 = r2 - c.k[r1&63]
|
||||
r1 = r1 - c.k[r0&63]
|
||||
r0 = r0 - c.k[r3&63]
|
||||
|
||||
for j >= 0 {
|
||||
// unmix r3
|
||||
r3 = rotl16(r3, 16-5)
|
||||
r3 = r3 - c.k[j] - (r2 & r1) - ((^r2) & r0)
|
||||
j--
|
||||
|
||||
// unmix r2
|
||||
r2 = rotl16(r2, 16-3)
|
||||
r2 = r2 - c.k[j] - (r1 & r0) - ((^r1) & r3)
|
||||
j--
|
||||
|
||||
// unmix r1
|
||||
r1 = rotl16(r1, 16-2)
|
||||
r1 = r1 - c.k[j] - (r0 & r3) - ((^r0) & r2)
|
||||
j--
|
||||
|
||||
// unmix r0
|
||||
r0 = rotl16(r0, 16-1)
|
||||
r0 = r0 - c.k[j] - (r3 & r2) - ((^r3) & r1)
|
||||
j--
|
||||
|
||||
}
|
||||
|
||||
binary.LittleEndian.PutUint16(dst[0:], r0)
|
||||
binary.LittleEndian.PutUint16(dst[2:], r1)
|
||||
binary.LittleEndian.PutUint16(dst[4:], r2)
|
||||
binary.LittleEndian.PutUint16(dst[6:], r3)
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12
|
||||
|
||||
import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha1"
|
||||
"crypto/x509/pkix"
|
||||
"encoding/asn1"
|
||||
)
|
||||
|
||||
type macData struct {
|
||||
Mac digestInfo
|
||||
MacSalt []byte
|
||||
Iterations int `asn1:"optional,default:1"`
|
||||
}
|
||||
|
||||
// from PKCS#7:
|
||||
type digestInfo struct {
|
||||
Algorithm pkix.AlgorithmIdentifier
|
||||
Digest []byte
|
||||
}
|
||||
|
||||
var (
|
||||
oidSHA1 = asn1.ObjectIdentifier([]int{1, 3, 14, 3, 2, 26})
|
||||
)
|
||||
|
||||
func verifyMac(macData *macData, message, password []byte) error {
|
||||
if !macData.Mac.Algorithm.Algorithm.Equal(oidSHA1) {
|
||||
return NotImplementedError("unknown digest algorithm: " + macData.Mac.Algorithm.Algorithm.String())
|
||||
}
|
||||
|
||||
key := pbkdf(sha1Sum, 20, 64, macData.MacSalt, password, macData.Iterations, 3, 20)
|
||||
|
||||
mac := hmac.New(sha1.New, key)
|
||||
mac.Write(message)
|
||||
expectedMAC := mac.Sum(nil)
|
||||
|
||||
if !hmac.Equal(macData.Mac.Digest, expectedMAC) {
|
||||
return ErrIncorrectPassword
|
||||
}
|
||||
return nil
|
||||
}
|
|
@ -1,170 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha1"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
var (
|
||||
one = big.NewInt(1)
|
||||
)
|
||||
|
||||
// sha1Sum returns the SHA-1 hash of in.
|
||||
func sha1Sum(in []byte) []byte {
|
||||
sum := sha1.Sum(in)
|
||||
return sum[:]
|
||||
}
|
||||
|
||||
// fillWithRepeats returns v*ceiling(len(pattern) / v) bytes consisting of
|
||||
// repeats of pattern.
|
||||
func fillWithRepeats(pattern []byte, v int) []byte {
|
||||
if len(pattern) == 0 {
|
||||
return nil
|
||||
}
|
||||
outputLen := v * ((len(pattern) + v - 1) / v)
|
||||
return bytes.Repeat(pattern, (outputLen+len(pattern)-1)/len(pattern))[:outputLen]
|
||||
}
|
||||
|
||||
func pbkdf(hash func([]byte) []byte, u, v int, salt, password []byte, r int, ID byte, size int) (key []byte) {
|
||||
// implementation of https://tools.ietf.org/html/rfc7292#appendix-B.2 , RFC text verbatim in comments
|
||||
|
||||
// Let H be a hash function built around a compression function f:
|
||||
|
||||
// Z_2^u x Z_2^v -> Z_2^u
|
||||
|
||||
// (that is, H has a chaining variable and output of length u bits, and
|
||||
// the message input to the compression function of H is v bits). The
|
||||
// values for u and v are as follows:
|
||||
|
||||
// HASH FUNCTION VALUE u VALUE v
|
||||
// MD2, MD5 128 512
|
||||
// SHA-1 160 512
|
||||
// SHA-224 224 512
|
||||
// SHA-256 256 512
|
||||
// SHA-384 384 1024
|
||||
// SHA-512 512 1024
|
||||
// SHA-512/224 224 1024
|
||||
// SHA-512/256 256 1024
|
||||
|
||||
// Furthermore, let r be the iteration count.
|
||||
|
||||
// We assume here that u and v are both multiples of 8, as are the
|
||||
// lengths of the password and salt strings (which we denote by p and s,
|
||||
// respectively) and the number n of pseudorandom bits required. In
|
||||
// addition, u and v are of course non-zero.
|
||||
|
||||
// For information on security considerations for MD5 [19], see [25] and
|
||||
// [1], and on those for MD2, see [18].
|
||||
|
||||
// The following procedure can be used to produce pseudorandom bits for
|
||||
// a particular "purpose" that is identified by a byte called "ID".
|
||||
// This standard specifies 3 different values for the ID byte:
|
||||
|
||||
// 1. If ID=1, then the pseudorandom bits being produced are to be used
|
||||
// as key material for performing encryption or decryption.
|
||||
|
||||
// 2. If ID=2, then the pseudorandom bits being produced are to be used
|
||||
// as an IV (Initial Value) for encryption or decryption.
|
||||
|
||||
// 3. If ID=3, then the pseudorandom bits being produced are to be used
|
||||
// as an integrity key for MACing.
|
||||
|
||||
// 1. Construct a string, D (the "diversifier"), by concatenating v/8
|
||||
// copies of ID.
|
||||
var D []byte
|
||||
for i := 0; i < v; i++ {
|
||||
D = append(D, ID)
|
||||
}
|
||||
|
||||
// 2. Concatenate copies of the salt together to create a string S of
|
||||
// length v(ceiling(s/v)) bits (the final copy of the salt may be
|
||||
// truncated to create S). Note that if the salt is the empty
|
||||
// string, then so is S.
|
||||
|
||||
S := fillWithRepeats(salt, v)
|
||||
|
||||
// 3. Concatenate copies of the password together to create a string P
|
||||
// of length v(ceiling(p/v)) bits (the final copy of the password
|
||||
// may be truncated to create P). Note that if the password is the
|
||||
// empty string, then so is P.
|
||||
|
||||
P := fillWithRepeats(password, v)
|
||||
|
||||
// 4. Set I=S||P to be the concatenation of S and P.
|
||||
I := append(S, P...)
|
||||
|
||||
// 5. Set c=ceiling(n/u).
|
||||
c := (size + u - 1) / u
|
||||
|
||||
// 6. For i=1, 2, ..., c, do the following:
|
||||
A := make([]byte, c*20)
|
||||
var IjBuf []byte
|
||||
for i := 0; i < c; i++ {
|
||||
// A. Set A2=H^r(D||I). (i.e., the r-th hash of D||1,
|
||||
// H(H(H(... H(D||I))))
|
||||
Ai := hash(append(D, I...))
|
||||
for j := 1; j < r; j++ {
|
||||
Ai = hash(Ai)
|
||||
}
|
||||
copy(A[i*20:], Ai[:])
|
||||
|
||||
if i < c-1 { // skip on last iteration
|
||||
// B. Concatenate copies of Ai to create a string B of length v
|
||||
// bits (the final copy of Ai may be truncated to create B).
|
||||
var B []byte
|
||||
for len(B) < v {
|
||||
B = append(B, Ai[:]...)
|
||||
}
|
||||
B = B[:v]
|
||||
|
||||
// C. Treating I as a concatenation I_0, I_1, ..., I_(k-1) of v-bit
|
||||
// blocks, where k=ceiling(s/v)+ceiling(p/v), modify I by
|
||||
// setting I_j=(I_j+B+1) mod 2^v for each j.
|
||||
{
|
||||
Bbi := new(big.Int).SetBytes(B)
|
||||
Ij := new(big.Int)
|
||||
|
||||
for j := 0; j < len(I)/v; j++ {
|
||||
Ij.SetBytes(I[j*v : (j+1)*v])
|
||||
Ij.Add(Ij, Bbi)
|
||||
Ij.Add(Ij, one)
|
||||
Ijb := Ij.Bytes()
|
||||
// We expect Ijb to be exactly v bytes,
|
||||
// if it is longer or shorter we must
|
||||
// adjust it accordingly.
|
||||
if len(Ijb) > v {
|
||||
Ijb = Ijb[len(Ijb)-v:]
|
||||
}
|
||||
if len(Ijb) < v {
|
||||
if IjBuf == nil {
|
||||
IjBuf = make([]byte, v)
|
||||
}
|
||||
bytesShort := v - len(Ijb)
|
||||
for i := 0; i < bytesShort; i++ {
|
||||
IjBuf[i] = 0
|
||||
}
|
||||
copy(IjBuf[bytesShort:], Ijb)
|
||||
Ijb = IjBuf
|
||||
}
|
||||
copy(I[j*v:(j+1)*v], Ijb)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 7. Concatenate A_1, A_2, ..., A_c together to form a pseudorandom
|
||||
// bit string, A.
|
||||
|
||||
// 8. Use the first n bits of A as the output of this entire process.
|
||||
return A[:size]
|
||||
|
||||
// If the above process is being used to generate a DES key, the process
|
||||
// should be used to create 64 random bits, and the key's parity bits
|
||||
// should be set after the 64 bits have been produced. Similar concerns
|
||||
// hold for 2-key and 3-key triple-DES keys, for CDMF keys, and for any
|
||||
// similar keys with parity bits "built into them".
|
||||
}
|
|
@ -1,350 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12 implements some of PKCS#12.
|
||||
//
|
||||
// This implementation is distilled from https://tools.ietf.org/html/rfc7292
|
||||
// and referenced documents. It is intended for decoding P12/PFX-stored
|
||||
// certificates and keys for use with the crypto/tls package.
|
||||
//
|
||||
// This package is frozen. If it's missing functionality you need, consider
|
||||
// an alternative like software.sslmate.com/src/go-pkcs12.
|
||||
package pkcs12
|
||||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"crypto/rsa"
|
||||
"crypto/x509"
|
||||
"crypto/x509/pkix"
|
||||
"encoding/asn1"
|
||||
"encoding/hex"
|
||||
"encoding/pem"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var (
|
||||
oidDataContentType = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 7, 1})
|
||||
oidEncryptedDataContentType = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 7, 6})
|
||||
|
||||
oidFriendlyName = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 9, 20})
|
||||
oidLocalKeyID = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 9, 21})
|
||||
oidMicrosoftCSPName = asn1.ObjectIdentifier([]int{1, 3, 6, 1, 4, 1, 311, 17, 1})
|
||||
)
|
||||
|
||||
type pfxPdu struct {
|
||||
Version int
|
||||
AuthSafe contentInfo
|
||||
MacData macData `asn1:"optional"`
|
||||
}
|
||||
|
||||
type contentInfo struct {
|
||||
ContentType asn1.ObjectIdentifier
|
||||
Content asn1.RawValue `asn1:"tag:0,explicit,optional"`
|
||||
}
|
||||
|
||||
type encryptedData struct {
|
||||
Version int
|
||||
EncryptedContentInfo encryptedContentInfo
|
||||
}
|
||||
|
||||
type encryptedContentInfo struct {
|
||||
ContentType asn1.ObjectIdentifier
|
||||
ContentEncryptionAlgorithm pkix.AlgorithmIdentifier
|
||||
EncryptedContent []byte `asn1:"tag:0,optional"`
|
||||
}
|
||||
|
||||
func (i encryptedContentInfo) Algorithm() pkix.AlgorithmIdentifier {
|
||||
return i.ContentEncryptionAlgorithm
|
||||
}
|
||||
|
||||
func (i encryptedContentInfo) Data() []byte { return i.EncryptedContent }
|
||||
|
||||
type safeBag struct {
|
||||
Id asn1.ObjectIdentifier
|
||||
Value asn1.RawValue `asn1:"tag:0,explicit"`
|
||||
Attributes []pkcs12Attribute `asn1:"set,optional"`
|
||||
}
|
||||
|
||||
type pkcs12Attribute struct {
|
||||
Id asn1.ObjectIdentifier
|
||||
Value asn1.RawValue `asn1:"set"`
|
||||
}
|
||||
|
||||
type encryptedPrivateKeyInfo struct {
|
||||
AlgorithmIdentifier pkix.AlgorithmIdentifier
|
||||
EncryptedData []byte
|
||||
}
|
||||
|
||||
func (i encryptedPrivateKeyInfo) Algorithm() pkix.AlgorithmIdentifier {
|
||||
return i.AlgorithmIdentifier
|
||||
}
|
||||
|
||||
func (i encryptedPrivateKeyInfo) Data() []byte {
|
||||
return i.EncryptedData
|
||||
}
|
||||
|
||||
// PEM block types
|
||||
const (
|
||||
certificateType = "CERTIFICATE"
|
||||
privateKeyType = "PRIVATE KEY"
|
||||
)
|
||||
|
||||
// unmarshal calls asn1.Unmarshal, but also returns an error if there is any
|
||||
// trailing data after unmarshaling.
|
||||
func unmarshal(in []byte, out interface{}) error {
|
||||
trailing, err := asn1.Unmarshal(in, out)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if len(trailing) != 0 {
|
||||
return errors.New("pkcs12: trailing data found")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ToPEM converts all "safe bags" contained in pfxData to PEM blocks.
|
||||
func ToPEM(pfxData []byte, password string) ([]*pem.Block, error) {
|
||||
encodedPassword, err := bmpString(password)
|
||||
if err != nil {
|
||||
return nil, ErrIncorrectPassword
|
||||
}
|
||||
|
||||
bags, encodedPassword, err := getSafeContents(pfxData, encodedPassword)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
blocks := make([]*pem.Block, 0, len(bags))
|
||||
for _, bag := range bags {
|
||||
block, err := convertBag(&bag, encodedPassword)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
blocks = append(blocks, block)
|
||||
}
|
||||
|
||||
return blocks, nil
|
||||
}
|
||||
|
||||
func convertBag(bag *safeBag, password []byte) (*pem.Block, error) {
|
||||
block := &pem.Block{
|
||||
Headers: make(map[string]string),
|
||||
}
|
||||
|
||||
for _, attribute := range bag.Attributes {
|
||||
k, v, err := convertAttribute(&attribute)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
block.Headers[k] = v
|
||||
}
|
||||
|
||||
switch {
|
||||
case bag.Id.Equal(oidCertBag):
|
||||
block.Type = certificateType
|
||||
certsData, err := decodeCertBag(bag.Value.Bytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
block.Bytes = certsData
|
||||
case bag.Id.Equal(oidPKCS8ShroundedKeyBag):
|
||||
block.Type = privateKeyType
|
||||
|
||||
key, err := decodePkcs8ShroudedKeyBag(bag.Value.Bytes, password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch key := key.(type) {
|
||||
case *rsa.PrivateKey:
|
||||
block.Bytes = x509.MarshalPKCS1PrivateKey(key)
|
||||
case *ecdsa.PrivateKey:
|
||||
block.Bytes, err = x509.MarshalECPrivateKey(key)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
default:
|
||||
return nil, errors.New("found unknown private key type in PKCS#8 wrapping")
|
||||
}
|
||||
default:
|
||||
return nil, errors.New("don't know how to convert a safe bag of type " + bag.Id.String())
|
||||
}
|
||||
return block, nil
|
||||
}
|
||||
|
||||
func convertAttribute(attribute *pkcs12Attribute) (key, value string, err error) {
|
||||
isString := false
|
||||
|
||||
switch {
|
||||
case attribute.Id.Equal(oidFriendlyName):
|
||||
key = "friendlyName"
|
||||
isString = true
|
||||
case attribute.Id.Equal(oidLocalKeyID):
|
||||
key = "localKeyId"
|
||||
case attribute.Id.Equal(oidMicrosoftCSPName):
|
||||
// This key is chosen to match OpenSSL.
|
||||
key = "Microsoft CSP Name"
|
||||
isString = true
|
||||
default:
|
||||
return "", "", errors.New("pkcs12: unknown attribute with OID " + attribute.Id.String())
|
||||
}
|
||||
|
||||
if isString {
|
||||
if err := unmarshal(attribute.Value.Bytes, &attribute.Value); err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
if value, err = decodeBMPString(attribute.Value.Bytes); err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
} else {
|
||||
var id []byte
|
||||
if err := unmarshal(attribute.Value.Bytes, &id); err != nil {
|
||||
return "", "", err
|
||||
}
|
||||
value = hex.EncodeToString(id)
|
||||
}
|
||||
|
||||
return key, value, nil
|
||||
}
|
||||
|
||||
// Decode extracts a certificate and private key from pfxData. This function
|
||||
// assumes that there is only one certificate and only one private key in the
|
||||
// pfxData; if there are more use ToPEM instead.
|
||||
func Decode(pfxData []byte, password string) (privateKey interface{}, certificate *x509.Certificate, err error) {
|
||||
encodedPassword, err := bmpString(password)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
bags, encodedPassword, err := getSafeContents(pfxData, encodedPassword)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if len(bags) != 2 {
|
||||
err = errors.New("pkcs12: expected exactly two safe bags in the PFX PDU")
|
||||
return
|
||||
}
|
||||
|
||||
for _, bag := range bags {
|
||||
switch {
|
||||
case bag.Id.Equal(oidCertBag):
|
||||
if certificate != nil {
|
||||
err = errors.New("pkcs12: expected exactly one certificate bag")
|
||||
}
|
||||
|
||||
certsData, err := decodeCertBag(bag.Value.Bytes)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
certs, err := x509.ParseCertificates(certsData)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if len(certs) != 1 {
|
||||
err = errors.New("pkcs12: expected exactly one certificate in the certBag")
|
||||
return nil, nil, err
|
||||
}
|
||||
certificate = certs[0]
|
||||
|
||||
case bag.Id.Equal(oidPKCS8ShroundedKeyBag):
|
||||
if privateKey != nil {
|
||||
err = errors.New("pkcs12: expected exactly one key bag")
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if privateKey, err = decodePkcs8ShroudedKeyBag(bag.Value.Bytes, encodedPassword); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if certificate == nil {
|
||||
return nil, nil, errors.New("pkcs12: certificate missing")
|
||||
}
|
||||
if privateKey == nil {
|
||||
return nil, nil, errors.New("pkcs12: private key missing")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
func getSafeContents(p12Data, password []byte) (bags []safeBag, updatedPassword []byte, err error) {
|
||||
pfx := new(pfxPdu)
|
||||
if err := unmarshal(p12Data, pfx); err != nil {
|
||||
return nil, nil, errors.New("pkcs12: error reading P12 data: " + err.Error())
|
||||
}
|
||||
|
||||
if pfx.Version != 3 {
|
||||
return nil, nil, NotImplementedError("can only decode v3 PFX PDU's")
|
||||
}
|
||||
|
||||
if !pfx.AuthSafe.ContentType.Equal(oidDataContentType) {
|
||||
return nil, nil, NotImplementedError("only password-protected PFX is implemented")
|
||||
}
|
||||
|
||||
// unmarshal the explicit bytes in the content for type 'data'
|
||||
if err := unmarshal(pfx.AuthSafe.Content.Bytes, &pfx.AuthSafe.Content); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if len(pfx.MacData.Mac.Algorithm.Algorithm) == 0 {
|
||||
return nil, nil, errors.New("pkcs12: no MAC in data")
|
||||
}
|
||||
|
||||
if err := verifyMac(&pfx.MacData, pfx.AuthSafe.Content.Bytes, password); err != nil {
|
||||
if err == ErrIncorrectPassword && len(password) == 2 && password[0] == 0 && password[1] == 0 {
|
||||
// some implementations use an empty byte array
|
||||
// for the empty string password try one more
|
||||
// time with empty-empty password
|
||||
password = nil
|
||||
err = verifyMac(&pfx.MacData, pfx.AuthSafe.Content.Bytes, password)
|
||||
}
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
}
|
||||
|
||||
var authenticatedSafe []contentInfo
|
||||
if err := unmarshal(pfx.AuthSafe.Content.Bytes, &authenticatedSafe); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if len(authenticatedSafe) != 2 {
|
||||
return nil, nil, NotImplementedError("expected exactly two items in the authenticated safe")
|
||||
}
|
||||
|
||||
for _, ci := range authenticatedSafe {
|
||||
var data []byte
|
||||
|
||||
switch {
|
||||
case ci.ContentType.Equal(oidDataContentType):
|
||||
if err := unmarshal(ci.Content.Bytes, &data); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
case ci.ContentType.Equal(oidEncryptedDataContentType):
|
||||
var encryptedData encryptedData
|
||||
if err := unmarshal(ci.Content.Bytes, &encryptedData); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
if encryptedData.Version != 0 {
|
||||
return nil, nil, NotImplementedError("only version 0 of EncryptedData is supported")
|
||||
}
|
||||
if data, err = pbDecrypt(encryptedData.EncryptedContentInfo, password); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
default:
|
||||
return nil, nil, NotImplementedError("only data and encryptedData content types are supported in authenticated safe")
|
||||
}
|
||||
|
||||
var safeContents []safeBag
|
||||
if err := unmarshal(data, &safeContents); err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
bags = append(bags, safeContents...)
|
||||
}
|
||||
|
||||
return bags, password, nil
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
// Copyright 2015 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 pkcs12
|
||||
|
||||
import (
|
||||
"crypto/x509"
|
||||
"encoding/asn1"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var (
|
||||
// see https://tools.ietf.org/html/rfc7292#appendix-D
|
||||
oidCertTypeX509Certificate = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 9, 22, 1})
|
||||
oidPKCS8ShroundedKeyBag = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 12, 10, 1, 2})
|
||||
oidCertBag = asn1.ObjectIdentifier([]int{1, 2, 840, 113549, 1, 12, 10, 1, 3})
|
||||
)
|
||||
|
||||
type certBag struct {
|
||||
Id asn1.ObjectIdentifier
|
||||
Data []byte `asn1:"tag:0,explicit"`
|
||||
}
|
||||
|
||||
func decodePkcs8ShroudedKeyBag(asn1Data, password []byte) (privateKey interface{}, err error) {
|
||||
pkinfo := new(encryptedPrivateKeyInfo)
|
||||
if err = unmarshal(asn1Data, pkinfo); err != nil {
|
||||
return nil, errors.New("pkcs12: error decoding PKCS#8 shrouded key bag: " + err.Error())
|
||||
}
|
||||
|
||||
pkData, err := pbDecrypt(pkinfo, password)
|
||||
if err != nil {
|
||||
return nil, errors.New("pkcs12: error decrypting PKCS#8 shrouded key bag: " + err.Error())
|
||||
}
|
||||
|
||||
ret := new(asn1.RawValue)
|
||||
if err = unmarshal(pkData, ret); err != nil {
|
||||
return nil, errors.New("pkcs12: error unmarshaling decrypted private key: " + err.Error())
|
||||
}
|
||||
|
||||
if privateKey, err = x509.ParsePKCS8PrivateKey(pkData); err != nil {
|
||||
return nil, errors.New("pkcs12: error parsing PKCS#8 private key: " + err.Error())
|
||||
}
|
||||
|
||||
return privateKey, nil
|
||||
}
|
||||
|
||||
func decodeCertBag(asn1Data []byte) (x509Certificates []byte, err error) {
|
||||
bag := new(certBag)
|
||||
if err := unmarshal(asn1Data, bag); err != nil {
|
||||
return nil, errors.New("pkcs12: error decoding cert bag: " + err.Error())
|
||||
}
|
||||
if !bag.Id.Equal(oidCertTypeX509Certificate) {
|
||||
return nil, NotImplementedError("only X509 certificates are supported")
|
||||
}
|
||||
return bag.Data, nil
|
||||
}
|
|
@ -89,7 +89,7 @@ constants.
|
|||
|
||||
Adding new syscall numbers is mostly done by running the build on a sufficiently
|
||||
new installation of the target OS (or updating the source checkouts for the
|
||||
new build system). However, depending on the OS, you make need to update the
|
||||
new build system). However, depending on the OS, you may need to update the
|
||||
parsing in mksysnum.
|
||||
|
||||
### mksyscall.go
|
||||
|
@ -149,10 +149,21 @@ To add a constant, add the header that includes it to the appropriate variable.
|
|||
Then, edit the regex (if necessary) to match the desired constant. Avoid making
|
||||
the regex too broad to avoid matching unintended constants.
|
||||
|
||||
### mkmerge.go
|
||||
|
||||
This program is used to extract duplicate const, func, and type declarations
|
||||
from the generated architecture-specific files listed below, and merge these
|
||||
into a common file for each OS.
|
||||
|
||||
The merge is performed in the following steps:
|
||||
1. Construct the set of common code that is idential in all architecture-specific files.
|
||||
2. Write this common code to the merged file.
|
||||
3. Remove the common code from all architecture-specific files.
|
||||
|
||||
|
||||
## Generated files
|
||||
|
||||
### `zerror_${GOOS}_${GOARCH}.go`
|
||||
### `zerrors_${GOOS}_${GOARCH}.go`
|
||||
|
||||
A file containing all of the system's generated error numbers, error strings,
|
||||
signal numbers, and constants. Generated by `mkerrors.sh` (see above).
|
||||
|
|
|
@ -23,10 +23,6 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
|
|||
MOV a1+8(FP), A0
|
||||
MOV a2+16(FP), A1
|
||||
MOV a3+24(FP), A2
|
||||
MOV $0, A3
|
||||
MOV $0, A4
|
||||
MOV $0, A5
|
||||
MOV $0, A6
|
||||
MOV trap+0(FP), A7 // syscall entry
|
||||
ECALL
|
||||
MOV A0, r1+32(FP) // r1
|
||||
|
@ -44,9 +40,6 @@ TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
|
|||
MOV a1+8(FP), A0
|
||||
MOV a2+16(FP), A1
|
||||
MOV a3+24(FP), A2
|
||||
MOV ZERO, A3
|
||||
MOV ZERO, A4
|
||||
MOV ZERO, A5
|
||||
MOV trap+0(FP), A7 // syscall entry
|
||||
ECALL
|
||||
MOV A0, r1+32(FP)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
package unix
|
||||
|
||||
const (
|
||||
DLT_HHDLC = 0x79
|
||||
IFF_SMART = 0x20
|
||||
IFT_1822 = 0x2
|
||||
IFT_A12MPPSWITCH = 0x82
|
||||
|
@ -210,13 +211,18 @@ const (
|
|||
IFT_XETHER = 0x1a
|
||||
IPPROTO_MAXID = 0x34
|
||||
IPV6_FAITH = 0x1d
|
||||
IPV6_MIN_MEMBERSHIPS = 0x1f
|
||||
IP_FAITH = 0x16
|
||||
IP_MAX_SOURCE_FILTER = 0x400
|
||||
IP_MIN_MEMBERSHIPS = 0x1f
|
||||
MAP_NORESERVE = 0x40
|
||||
MAP_RENAME = 0x20
|
||||
NET_RT_MAXID = 0x6
|
||||
RTF_PRCLONING = 0x10000
|
||||
RTM_OLDADD = 0x9
|
||||
RTM_OLDDEL = 0xa
|
||||
RT_CACHING_CONTEXT = 0x1
|
||||
RT_NORTREF = 0x2
|
||||
SIOCADDRT = 0x8030720a
|
||||
SIOCALIFADDR = 0x8118691b
|
||||
SIOCDELRT = 0x8030720b
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
package unix
|
||||
|
||||
const (
|
||||
DLT_HHDLC = 0x79
|
||||
IFF_SMART = 0x20
|
||||
IFT_1822 = 0x2
|
||||
IFT_A12MPPSWITCH = 0x82
|
||||
|
@ -210,13 +211,18 @@ const (
|
|||
IFT_XETHER = 0x1a
|
||||
IPPROTO_MAXID = 0x34
|
||||
IPV6_FAITH = 0x1d
|
||||
IPV6_MIN_MEMBERSHIPS = 0x1f
|
||||
IP_FAITH = 0x16
|
||||
IP_MAX_SOURCE_FILTER = 0x400
|
||||
IP_MIN_MEMBERSHIPS = 0x1f
|
||||
MAP_NORESERVE = 0x40
|
||||
MAP_RENAME = 0x20
|
||||
NET_RT_MAXID = 0x6
|
||||
RTF_PRCLONING = 0x10000
|
||||
RTM_OLDADD = 0x9
|
||||
RTM_OLDDEL = 0xa
|
||||
RT_CACHING_CONTEXT = 0x1
|
||||
RT_NORTREF = 0x2
|
||||
SIOCADDRT = 0x8040720a
|
||||
SIOCALIFADDR = 0x8118691b
|
||||
SIOCDELRT = 0x8040720b
|
||||
|
|
|
@ -9,12 +9,11 @@ package unix
|
|||
import "unsafe"
|
||||
|
||||
// fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux
|
||||
// systems by flock_linux_32bit.go to be SYS_FCNTL64.
|
||||
// systems by fcntl_linux_32bit.go to be SYS_FCNTL64.
|
||||
var fcntl64Syscall uintptr = SYS_FCNTL
|
||||
|
||||
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
||||
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
||||
valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg))
|
||||
func fcntl(fd int, cmd, arg int) (int, error) {
|
||||
valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
var err error
|
||||
if errno != 0 {
|
||||
err = errno
|
||||
|
@ -22,6 +21,11 @@ func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
|||
return int(valptr), err
|
||||
}
|
||||
|
||||
// FcntlInt performs a fcntl syscall on fd with the provided command and argument.
|
||||
func FcntlInt(fd uintptr, cmd, arg int) (int, error) {
|
||||
return fcntl(int(fd), cmd, arg)
|
||||
}
|
||||
|
||||
// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command.
|
||||
func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error {
|
||||
_, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk)))
|
||||
|
|
|
@ -20,6 +20,15 @@ func IoctlSetInt(fd int, req uint, value int) error {
|
|||
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.
|
||||
//
|
||||
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
||||
|
|
|
@ -50,7 +50,7 @@ if [[ "$GOOS" = "linux" ]]; then
|
|||
# Use the Docker-based build system
|
||||
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
|
||||
$cmd docker build --tag generate:$GOOS $GOOS
|
||||
$cmd docker run --interactive --tty --volume $(dirname "$(readlink -f "$0")"):/build generate:$GOOS
|
||||
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")" && /bin/pwd):/build generate:$GOOS
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -73,26 +73,22 @@ aix_ppc64)
|
|||
darwin_386)
|
||||
mkerrors="$mkerrors -m32"
|
||||
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"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
darwin_amd64)
|
||||
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"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
darwin_arm)
|
||||
mkerrors="$mkerrors"
|
||||
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"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
darwin_arm64)
|
||||
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"
|
||||
mkasm="go run mkasm_darwin.go"
|
||||
;;
|
||||
|
@ -124,7 +120,7 @@ freebsd_arm)
|
|||
freebsd_arm64)
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'"
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
|
||||
;;
|
||||
netbsd_386)
|
||||
mkerrors="$mkerrors -m32"
|
||||
|
@ -184,12 +180,27 @@ openbsd_arm64)
|
|||
# API consistent across platforms.
|
||||
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)
|
||||
mksyscall="go run mksyscall_solaris.go"
|
||||
mkerrors="$mkerrors -m64"
|
||||
mksysnum=
|
||||
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
|
||||
;;
|
||||
illumos_amd64)
|
||||
mksyscall="go run mksyscall_solaris.go"
|
||||
mkerrors=
|
||||
mksysnum=
|
||||
mktypes=
|
||||
;;
|
||||
*)
|
||||
echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2
|
||||
exit 1
|
||||
|
@ -211,12 +222,15 @@ esac
|
|||
# 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 " ;
|
||||
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
|
||||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
|
||||
# 1.13 and later, syscalls via libSystem (including syscallPtr)
|
||||
echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go";
|
||||
elif [ "$GOOS" == "illumos" ]; then
|
||||
# illumos code generation requires a --illumos switch
|
||||
echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go";
|
||||
# illumos implies solaris, so solaris code generation is also required
|
||||
echo "$mksyscall -tags solaris,$GOARCH syscall_solaris.go syscall_solaris_$GOARCH.go |gofmt >zsyscall_solaris_$GOARCH.go";
|
||||
else
|
||||
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
|
||||
fi
|
||||
|
|
|
@ -105,7 +105,9 @@ includes_FreeBSD='
|
|||
#include <sys/capsicum.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/disk.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
|
@ -186,17 +188,24 @@ struct ltchars {
|
|||
#include <sys/select.h>
|
||||
#include <sys/signalfd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/timerfd.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/xattr.h>
|
||||
#include <linux/bpf.h>
|
||||
#include <linux/can.h>
|
||||
#include <linux/can/error.h>
|
||||
#include <linux/can/raw.h>
|
||||
#include <linux/capability.h>
|
||||
#include <linux/cryptouser.h>
|
||||
#include <linux/devlink.h>
|
||||
#include <linux/dm-ioctl.h>
|
||||
#include <linux/errqueue.h>
|
||||
#include <linux/falloc.h>
|
||||
#include <linux/fanotify.h>
|
||||
#include <linux/filter.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/fscrypt.h>
|
||||
#include <linux/fsverity.h>
|
||||
#include <linux/genetlink.h>
|
||||
#include <linux/hdreg.h>
|
||||
#include <linux/icmpv6.h>
|
||||
|
@ -278,6 +287,11 @@ struct ltchars {
|
|||
// for the tipc_subscr timeout __u32 field.
|
||||
#undef TIPC_WAIT_FOREVER
|
||||
#define TIPC_WAIT_FOREVER 0xffffffff
|
||||
|
||||
// Copied from linux/l2tp.h
|
||||
// Including linux/l2tp.h here causes conflicts between linux/in.h
|
||||
// and netinet/in.h included via net/route.h above.
|
||||
#define IPPROTO_L2TP 115
|
||||
'
|
||||
|
||||
includes_NetBSD='
|
||||
|
@ -287,6 +301,7 @@ includes_NetBSD='
|
|||
#include <sys/extattr.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
|
@ -315,6 +330,7 @@ includes_OpenBSD='
|
|||
#include <sys/mman.h>
|
||||
#include <sys/mount.h>
|
||||
#include <sys/select.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/stat.h>
|
||||
|
@ -471,12 +487,13 @@ ccflags="$@"
|
|||
$2 ~ /^(MS|MNT|UMOUNT)_/ ||
|
||||
$2 ~ /^NS_GET_/ ||
|
||||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
|
||||
$2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT)_/ ||
|
||||
$2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|TFD)_/ ||
|
||||
$2 ~ /^KEXEC_/ ||
|
||||
$2 ~ /^LINUX_REBOOT_CMD_/ ||
|
||||
$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
|
||||
$2 ~ /^MODULE_INIT_/ ||
|
||||
$2 !~ "NLA_TYPE_MASK" &&
|
||||
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
|
||||
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
|
||||
$2 ~ /^SIOC/ ||
|
||||
$2 ~ /^TIOC/ ||
|
||||
|
@ -484,8 +501,9 @@ ccflags="$@"
|
|||
$2 ~ /^TCSET/ ||
|
||||
$2 ~ /^TC(FLSH|SBRKP?|XONC)$/ ||
|
||||
$2 !~ "RTF_BITS" &&
|
||||
$2 ~ /^(IFF|IFT|NET_RT|RTM|RTF|RTV|RTA|RTAX)_/ ||
|
||||
$2 ~ /^(IFF|IFT|NET_RT|RTM(GRP)?|RTF|RTV|RTA|RTAX)_/ ||
|
||||
$2 ~ /^BIOC/ ||
|
||||
$2 ~ /^DIOC/ ||
|
||||
$2 ~ /^RUSAGE_(SELF|CHILDREN|THREAD)/ ||
|
||||
$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
|
||||
$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
|
||||
|
@ -495,8 +513,14 @@ ccflags="$@"
|
|||
$2 ~ /^(CLOCK|TIMER)_/ ||
|
||||
$2 ~ /^CAN_/ ||
|
||||
$2 ~ /^CAP_/ ||
|
||||
$2 ~ /^CP_/ ||
|
||||
$2 ~ /^CPUSTATES$/ ||
|
||||
$2 ~ /^ALG_/ ||
|
||||
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE|IOC_(GET|SET)_ENCRYPTION)/ ||
|
||||
$2 ~ /^FS_(POLICY_FLAGS|KEY_DESC|ENCRYPTION_MODE|[A-Z0-9_]+_KEY_SIZE)/ ||
|
||||
$2 ~ /^FS_IOC_.*(ENCRYPTION|VERITY|[GS]ETFLAGS)/ ||
|
||||
$2 ~ /^FS_VERITY_/ ||
|
||||
$2 ~ /^FSCRYPT_/ ||
|
||||
$2 ~ /^DM_/ ||
|
||||
$2 ~ /^GRND_/ ||
|
||||
$2 ~ /^RND/ ||
|
||||
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
||||
|
@ -523,6 +547,7 @@ ccflags="$@"
|
|||
$2 ~ /^WDIOC_/ ||
|
||||
$2 ~ /^NFN/ ||
|
||||
$2 ~ /^XDP_/ ||
|
||||
$2 ~ /^RWF_/ ||
|
||||
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
||||
$2 ~ /^CRYPTO_/ ||
|
||||
$2 ~ /^TIPC_/ ||
|
||||
|
|
|
@ -510,6 +510,40 @@ func SysctlRaw(name string, args ...int) ([]byte, error) {
|
|||
return buf[:n], nil
|
||||
}
|
||||
|
||||
func SysctlClockinfo(name string) (*Clockinfo, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
n := uintptr(SizeofClockinfo)
|
||||
var ci Clockinfo
|
||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n != SizeofClockinfo {
|
||||
return nil, EIO
|
||||
}
|
||||
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)
|
||||
|
||||
func Utimes(path string, tv []Timeval) error {
|
||||
|
@ -577,8 +611,6 @@ func Futimes(fd int, tv []Timeval) error {
|
|||
return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0])))
|
||||
}
|
||||
|
||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
|
||||
package unix
|
||||
|
||||
import "unsafe"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
|
||||
//sys closedir(dir uintptr) (err error)
|
||||
//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
|
||||
|
@ -71,6 +75,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|||
cnt++
|
||||
continue
|
||||
}
|
||||
|
||||
reclen := int(entry.Reclen)
|
||||
if reclen > len(buf) {
|
||||
// Not enough room. Return for now.
|
||||
|
@ -79,13 +84,15 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
|||
// restarting is O(n^2) in the length of the directory. Oh well.
|
||||
break
|
||||
}
|
||||
|
||||
// Copy entry into return buffer.
|
||||
s := struct {
|
||||
ptr unsafe.Pointer
|
||||
siz int
|
||||
cap int
|
||||
}{ptr: unsafe.Pointer(&entry), siz: reclen, cap: reclen}
|
||||
copy(buf, *(*[]byte)(unsafe.Pointer(&s)))
|
||||
var s []byte
|
||||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&s))
|
||||
hdr.Data = unsafe.Pointer(&entry)
|
||||
hdr.Cap = reclen
|
||||
hdr.Len = reclen
|
||||
copy(buf, s)
|
||||
|
||||
buf = buf[reclen:]
|
||||
n += reclen
|
||||
cnt++
|
||||
|
|
|
@ -155,23 +155,6 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
|
|||
|
||||
//sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
|
||||
|
||||
func SysctlClockinfo(name string) (*Clockinfo, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
n := uintptr(SizeofClockinfo)
|
||||
var ci Clockinfo
|
||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n != SizeofClockinfo {
|
||||
return nil, EIO
|
||||
}
|
||||
return &ci, nil
|
||||
}
|
||||
|
||||
//sysnb pipe() (r int, w int, err error)
|
||||
|
||||
func Pipe(p []int) (err error) {
|
||||
|
@ -333,6 +316,8 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
|
|||
* Wrapped
|
||||
*/
|
||||
|
||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||
|
||||
//sys kill(pid int, signum int, posix int) (err error)
|
||||
|
||||
func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) }
|
||||
|
@ -438,6 +423,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
|
||||
//sysnb Getrusage(who int, rusage *Rusage) (err error)
|
||||
//sysnb Getsid(pid int) (sid int, err error)
|
||||
//sysnb Gettimeofday(tp *Timeval) (err error)
|
||||
//sysnb Getuid() (uid int)
|
||||
//sysnb Issetugid() (tainted bool)
|
||||
//sys Kqueue() (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
|
|
@ -20,17 +20,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|||
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) (err error) {
|
||||
// The tv passed to gettimeofday must be non-nil
|
||||
// but is otherwise unused. The answers come back
|
||||
// in the two registers.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
tv.Sec = int32(sec)
|
||||
tv.Usec = int32(usec)
|
||||
return err
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint32(fd)
|
||||
k.Filter = int16(mode)
|
||||
|
@ -55,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)
|
||||
|
||||
// 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 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
|
||||
|
|
|
@ -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
|
|
@ -20,17 +20,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|||
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) (err error) {
|
||||
// The tv passed to gettimeofday must be non-nil
|
||||
// but is otherwise unused. The answers come back
|
||||
// in the two registers.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
tv.Sec = sec
|
||||
tv.Usec = usec
|
||||
return err
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint64(fd)
|
||||
k.Filter = int16(mode)
|
||||
|
@ -55,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)
|
||||
|
||||
// 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 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
|
||||
|
|
|
@ -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,386,!go1.12
|
||||
|
||||
package unix
|
||||
|
||||
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
|
||||
return 0, ENOSYS
|
||||
}
|
|
@ -20,17 +20,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|||
return Timeval{Sec: int32(sec), Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int32, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) (err error) {
|
||||
// The tv passed to gettimeofday must be non-nil
|
||||
// but is otherwise unused. The answers come back
|
||||
// in the two registers.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
tv.Sec = int32(sec)
|
||||
tv.Usec = int32(usec)
|
||||
return err
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint32(fd)
|
||||
k.Filter = int16(mode)
|
||||
|
@ -55,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
|
||||
|
||||
// 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 Fstatat(fd int, path string, stat *Stat_t, flags int) (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
|
||||
}
|
|
@ -22,17 +22,6 @@ func setTimeval(sec, usec int64) Timeval {
|
|||
return Timeval{Sec: sec, Usec: int32(usec)}
|
||||
}
|
||||
|
||||
//sysnb gettimeofday(tp *Timeval) (sec int64, usec int32, err error)
|
||||
func Gettimeofday(tv *Timeval) (err error) {
|
||||
// The tv passed to gettimeofday must be non-nil
|
||||
// but is otherwise unused. The answers come back
|
||||
// in the two registers.
|
||||
sec, usec, err := gettimeofday(tv)
|
||||
tv.Sec = sec
|
||||
tv.Usec = usec
|
||||
return err
|
||||
}
|
||||
|
||||
func SetKevent(k *Kevent_t, fd, mode, flags int) {
|
||||
k.Ident = uint64(fd)
|
||||
k.Filter = int16(mode)
|
||||
|
@ -57,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
|
||||
|
||||
// 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 Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
|
||||
//sys Fstatfs(fd int, stat *Statfs_t) (err error)
|
||||
|
|
|
@ -521,20 +521,10 @@ func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) {
|
|||
return ptrace(PTRACE_GETFPREGS, pid, uintptr(unsafe.Pointer(fpregsout)), 0)
|
||||
}
|
||||
|
||||
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
|
||||
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
|
||||
}
|
||||
|
||||
func PtraceGetRegs(pid int, regsout *Reg) (err error) {
|
||||
return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0)
|
||||
}
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint(countin)}
|
||||
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
||||
func PtraceLwpEvents(pid int, enable int) (err error) {
|
||||
return ptrace(PTRACE_LWPEVENTS, pid, 0, enable)
|
||||
}
|
||||
|
|
|
@ -54,3 +54,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
}
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
|
||||
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
|
||||
}
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
|
||||
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -54,3 +54,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
}
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
|
||||
return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
|
||||
}
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -54,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
}
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
|
||||
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -54,3 +54,9 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
}
|
||||
|
||||
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
|
||||
ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
|
||||
err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
|
||||
return int(ioDesc.Len), err
|
||||
}
|
||||
|
|
|
@ -82,21 +82,18 @@ func IoctlRetInt(fd int, req uint) (int, error) {
|
|||
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 {
|
||||
err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
|
||||
runtime.KeepAlive(value)
|
||||
return err
|
||||
}
|
||||
|
||||
func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error {
|
||||
err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value)))
|
||||
runtime.KeepAlive(value)
|
||||
return err
|
||||
}
|
||||
|
||||
func IoctlGetUint32(fd int, req uint) (uint32, error) {
|
||||
var value uint32
|
||||
err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
|
||||
|
@ -109,6 +106,12 @@ func IoctlGetRTCTime(fd int) (*RTCTime, error) {
|
|||
return &value, err
|
||||
}
|
||||
|
||||
func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
|
||||
var value RTCWkAlrm
|
||||
err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value)))
|
||||
return &value, err
|
||||
}
|
||||
|
||||
//sys Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error)
|
||||
|
||||
func Link(oldpath string, newpath string) (err error) {
|
||||
|
@ -839,6 +842,69 @@ func (sa *SockaddrTIPC) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
|||
return unsafe.Pointer(&sa.raw), SizeofSockaddrTIPC, nil
|
||||
}
|
||||
|
||||
// SockaddrL2TPIP implements the Sockaddr interface for IPPROTO_L2TP/AF_INET sockets.
|
||||
type SockaddrL2TPIP struct {
|
||||
Addr [4]byte
|
||||
ConnId uint32
|
||||
raw RawSockaddrL2TPIP
|
||||
}
|
||||
|
||||
func (sa *SockaddrL2TPIP) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
sa.raw.Family = AF_INET
|
||||
sa.raw.Conn_id = sa.ConnId
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.raw.Addr[i] = sa.Addr[i]
|
||||
}
|
||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrL2TPIP, nil
|
||||
}
|
||||
|
||||
// SockaddrL2TPIP6 implements the Sockaddr interface for IPPROTO_L2TP/AF_INET6 sockets.
|
||||
type SockaddrL2TPIP6 struct {
|
||||
Addr [16]byte
|
||||
ZoneId uint32
|
||||
ConnId uint32
|
||||
raw RawSockaddrL2TPIP6
|
||||
}
|
||||
|
||||
func (sa *SockaddrL2TPIP6) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||
sa.raw.Family = AF_INET6
|
||||
sa.raw.Conn_id = sa.ConnId
|
||||
sa.raw.Scope_id = sa.ZoneId
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.raw.Addr[i] = sa.Addr[i]
|
||||
}
|
||||
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) {
|
||||
switch rsa.Addr.Family {
|
||||
case AF_NETLINK:
|
||||
|
@ -889,25 +955,58 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
|||
return sa, nil
|
||||
|
||||
case AF_INET:
|
||||
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
|
||||
sa := new(SockaddrInet4)
|
||||
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
|
||||
sa.Port = int(p[0])<<8 + int(p[1])
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.Addr[i] = pp.Addr[i]
|
||||
proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch proto {
|
||||
case IPPROTO_L2TP:
|
||||
pp := (*RawSockaddrL2TPIP)(unsafe.Pointer(rsa))
|
||||
sa := new(SockaddrL2TPIP)
|
||||
sa.ConnId = pp.Conn_id
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.Addr[i] = pp.Addr[i]
|
||||
}
|
||||
return sa, nil
|
||||
default:
|
||||
pp := (*RawSockaddrInet4)(unsafe.Pointer(rsa))
|
||||
sa := new(SockaddrInet4)
|
||||
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
|
||||
sa.Port = int(p[0])<<8 + int(p[1])
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.Addr[i] = pp.Addr[i]
|
||||
}
|
||||
return sa, nil
|
||||
}
|
||||
return sa, nil
|
||||
|
||||
case AF_INET6:
|
||||
pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
|
||||
sa := new(SockaddrInet6)
|
||||
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
|
||||
sa.Port = int(p[0])<<8 + int(p[1])
|
||||
sa.ZoneId = pp.Scope_id
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.Addr[i] = pp.Addr[i]
|
||||
proto, err := GetsockoptInt(fd, SOL_SOCKET, SO_PROTOCOL)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
switch proto {
|
||||
case IPPROTO_L2TP:
|
||||
pp := (*RawSockaddrL2TPIP6)(unsafe.Pointer(rsa))
|
||||
sa := new(SockaddrL2TPIP6)
|
||||
sa.ConnId = pp.Conn_id
|
||||
sa.ZoneId = pp.Scope_id
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.Addr[i] = pp.Addr[i]
|
||||
}
|
||||
return sa, nil
|
||||
default:
|
||||
pp := (*RawSockaddrInet6)(unsafe.Pointer(rsa))
|
||||
sa := new(SockaddrInet6)
|
||||
p := (*[2]byte)(unsafe.Pointer(&pp.Port))
|
||||
sa.Port = int(p[0])<<8 + int(p[1])
|
||||
sa.ZoneId = pp.Scope_id
|
||||
for i := 0; i < len(sa.Addr); i++ {
|
||||
sa.Addr[i] = pp.Addr[i]
|
||||
}
|
||||
return sa, nil
|
||||
}
|
||||
return sa, nil
|
||||
|
||||
case AF_VSOCK:
|
||||
pp := (*RawSockaddrVM)(unsafe.Pointer(rsa))
|
||||
|
@ -986,6 +1085,38 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
|
|||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
@ -1555,8 +1686,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Acct(path string) (err error)
|
||||
//sys AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error)
|
||||
//sys Adjtimex(buf *Timex) (state int, err error)
|
||||
//sys Capget(hdr *CapUserHeader, data *CapUserData) (err error)
|
||||
//sys Capset(hdr *CapUserHeader, data *CapUserData) (err error)
|
||||
//sysnb Capget(hdr *CapUserHeader, data *CapUserData) (err error)
|
||||
//sysnb Capset(hdr *CapUserHeader, data *CapUserData) (err error)
|
||||
//sys Chdir(path string) (err error)
|
||||
//sys Chroot(path string) (err error)
|
||||
//sys ClockGetres(clockid int32, res *Timespec) (err error)
|
||||
|
@ -1566,6 +1697,15 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
|
||||
//sys DeleteModule(name string, flags int) (err error)
|
||||
//sys Dup(oldfd int) (fd int, err error)
|
||||
|
||||
func Dup2(oldfd, newfd int) error {
|
||||
// Android O and newer blocks dup2; riscv and arm64 don't implement dup2.
|
||||
if runtime.GOOS == "android" || runtime.GOARCH == "riscv64" || runtime.GOARCH == "arm64" {
|
||||
return Dup3(oldfd, newfd, 0)
|
||||
}
|
||||
return dup2(oldfd, newfd)
|
||||
}
|
||||
|
||||
//sys Dup3(oldfd int, newfd int, flags int) (err error)
|
||||
//sysnb EpollCreate1(flag int) (fd int, err error)
|
||||
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
|
||||
|
@ -1575,7 +1715,6 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Fchdir(fd int) (err error)
|
||||
//sys Fchmod(fd int, mode uint32) (err error)
|
||||
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
|
||||
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
|
||||
//sys Fdatasync(fd int) (err error)
|
||||
//sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error)
|
||||
//sys FinitModule(fd int, params string, flags int) (err error)
|
||||
|
@ -1631,6 +1770,17 @@ func Getpgrp() (pid int) {
|
|||
//sysnb Settimeofday(tv *Timeval) (err error)
|
||||
//sys Setns(fd int, nstype int) (err error)
|
||||
|
||||
// PrctlRetInt performs a prctl operation specified by option and further
|
||||
// optional arguments arg2 through arg5 depending on option. It returns a
|
||||
// non-negative integer that is returned by the prctl syscall.
|
||||
func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (int, error) {
|
||||
ret, _, err := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
|
||||
if err != 0 {
|
||||
return 0, err
|
||||
}
|
||||
return int(ret), nil
|
||||
}
|
||||
|
||||
// issue 1435.
|
||||
// On linux Setuid and Setgid only affects the current thread, not the process.
|
||||
// This does not match what most callers expect so we must return an error
|
||||
|
@ -1644,6 +1794,30 @@ func Setgid(uid int) (err error) {
|
|||
return EOPNOTSUPP
|
||||
}
|
||||
|
||||
// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set.
|
||||
// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability.
|
||||
// If the call fails due to other reasons, current fsgid will be returned.
|
||||
func SetfsgidRetGid(gid int) (int, error) {
|
||||
return setfsgid(gid)
|
||||
}
|
||||
|
||||
// SetfsuidRetUid sets fsuid for current thread and returns previous fsuid set.
|
||||
// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability
|
||||
// If the call fails due to other reasons, current fsuid will be returned.
|
||||
func SetfsuidRetUid(uid int) (int, error) {
|
||||
return setfsuid(uid)
|
||||
}
|
||||
|
||||
func Setfsgid(gid int) error {
|
||||
_, err := setfsgid(gid)
|
||||
return err
|
||||
}
|
||||
|
||||
func Setfsuid(uid int) error {
|
||||
_, err := setfsuid(uid)
|
||||
return err
|
||||
}
|
||||
|
||||
func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
|
||||
return signalfd(fd, sigmask, _C__NSIG/8, flags)
|
||||
}
|
||||
|
@ -1656,6 +1830,9 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
|
|||
//sys Syncfs(fd int) (err error)
|
||||
//sysnb Sysinfo(info *Sysinfo_t) (err error)
|
||||
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
|
||||
//sysnb TimerfdCreate(clockid int, flags int) (fd int, err error)
|
||||
//sysnb TimerfdGettime(fd int, currValue *ItimerSpec) (err error)
|
||||
//sysnb TimerfdSettime(fd int, flags int, newValue *ItimerSpec, oldValue *ItimerSpec) (err error)
|
||||
//sysnb Tgkill(tgid int, tid int, sig syscall.Signal) (err error)
|
||||
//sysnb Times(tms *Tms) (ticks uintptr, err error)
|
||||
//sysnb Umask(mask int) (oldmask int)
|
||||
|
@ -1666,6 +1843,123 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
|
|||
//sys exitThread(code int) (err error) = SYS_EXIT
|
||||
//sys readlen(fd int, p *byte, np int) (n int, err error) = SYS_READ
|
||||
//sys writelen(fd int, p *byte, np int) (n int, err error) = SYS_WRITE
|
||||
//sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV
|
||||
//sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV
|
||||
//sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV
|
||||
//sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV
|
||||
//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2
|
||||
//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2
|
||||
|
||||
func bytes2iovec(bs [][]byte) []Iovec {
|
||||
iovecs := make([]Iovec, len(bs))
|
||||
for i, b := range bs {
|
||||
iovecs[i].SetLen(len(b))
|
||||
if len(b) > 0 {
|
||||
iovecs[i].Base = &b[0]
|
||||
} else {
|
||||
iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero))
|
||||
}
|
||||
}
|
||||
return iovecs
|
||||
}
|
||||
|
||||
// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit
|
||||
// systems, hi will always be 0. On 32-bit systems, offs will be split in half.
|
||||
// preadv/pwritev chose this calling convention so they don't need to add a
|
||||
// padding-register for alignment on ARM.
|
||||
func offs2lohi(offs int64) (lo, hi uintptr) {
|
||||
return uintptr(offs), uintptr(uint64(offs) >> SizeofLong)
|
||||
}
|
||||
|
||||
func Readv(fd int, iovs [][]byte) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
n, err = readv(fd, iovecs)
|
||||
readvRacedetect(iovecs, n, err)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
lo, hi := offs2lohi(offset)
|
||||
n, err = preadv(fd, iovecs, lo, hi)
|
||||
readvRacedetect(iovecs, n, err)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
lo, hi := offs2lohi(offset)
|
||||
n, err = preadv2(fd, iovecs, lo, hi, flags)
|
||||
readvRacedetect(iovecs, n, err)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func readvRacedetect(iovecs []Iovec, n int, err error) {
|
||||
if !raceenabled {
|
||||
return
|
||||
}
|
||||
for i := 0; n > 0 && i < len(iovecs); i++ {
|
||||
m := int(iovecs[i].Len)
|
||||
if m > n {
|
||||
m = n
|
||||
}
|
||||
n -= m
|
||||
if m > 0 {
|
||||
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
raceAcquire(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
}
|
||||
|
||||
func Writev(fd int, iovs [][]byte) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
if raceenabled {
|
||||
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
n, err = writev(fd, iovecs)
|
||||
writevRacedetect(iovecs, n)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
if raceenabled {
|
||||
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
lo, hi := offs2lohi(offset)
|
||||
n, err = pwritev(fd, iovecs, lo, hi)
|
||||
writevRacedetect(iovecs, n)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
|
||||
iovecs := bytes2iovec(iovs)
|
||||
if raceenabled {
|
||||
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
||||
}
|
||||
lo, hi := offs2lohi(offset)
|
||||
n, err = pwritev2(fd, iovecs, lo, hi, flags)
|
||||
writevRacedetect(iovecs, n)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func writevRacedetect(iovecs []Iovec, n int) {
|
||||
if !raceenabled {
|
||||
return
|
||||
}
|
||||
for i := 0; n > 0 && i < len(iovecs); i++ {
|
||||
m := int(iovecs[i].Len)
|
||||
if m > n {
|
||||
m = n
|
||||
}
|
||||
n -= m
|
||||
if m > 0 {
|
||||
raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mmap varies by architecture; see syscall_linux_*.go.
|
||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||
|
@ -1708,11 +2002,30 @@ func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
|||
return int(n), nil
|
||||
}
|
||||
|
||||
func isGroupMember(gid int) bool {
|
||||
groups, err := Getgroups()
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
|
||||
for _, g := range groups {
|
||||
if g == gid {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
//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) {
|
||||
if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
|
||||
return EINVAL
|
||||
if flags == 0 {
|
||||
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.
|
||||
|
@ -1721,8 +2034,8 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|||
// Because people naturally expect syscall.Faccessat to act
|
||||
// like C faccessat, we do the same.
|
||||
|
||||
if flags == 0 {
|
||||
return faccessat(dirfd, path, mode)
|
||||
if flags & ^(AT_SYMLINK_NOFOLLOW|AT_EACCESS) != 0 {
|
||||
return EINVAL
|
||||
}
|
||||
|
||||
var st Stat_t
|
||||
|
@ -1765,7 +2078,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
|
|||
gid = Getgid()
|
||||
}
|
||||
|
||||
if uint32(gid) == st.Gid {
|
||||
if uint32(gid) == st.Gid || isGroupMember(gid) {
|
||||
fmode = (st.Mode >> 3) & 7
|
||||
} else {
|
||||
fmode = st.Mode & 7
|
||||
|
@ -1866,6 +2179,18 @@ func Klogset(typ int, arg int) (err error) {
|
|||
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
|
||||
*/
|
||||
|
@ -1960,7 +2285,6 @@ func Klogset(typ int, arg int) (err error) {
|
|||
// TimerGetoverrun
|
||||
// TimerGettime
|
||||
// TimerSettime
|
||||
// Timerfd
|
||||
// Tkill (obsolete)
|
||||
// Tuxcall
|
||||
// Umount2
|
||||
|
|
|
@ -49,7 +49,7 @@ func Pipe2(p []int, flags int) (err error) {
|
|||
|
||||
// 64-bit file system and 32-bit uid calls
|
||||
// (386 default is 32-bit file system and 16-bit uid).
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64
|
||||
|
@ -70,8 +70,8 @@ func Pipe2(p []int, flags int) (err error) {
|
|||
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
|
||||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||
//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
|
||||
//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32
|
||||
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32
|
||||
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32
|
||||
//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
package unix
|
||||
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||
|
@ -55,8 +55,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
}
|
||||
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
package unix
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
|
@ -49,10 +48,6 @@ func Pipe2(p []int, flags int) (err error) {
|
|||
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) {
|
||||
newoffset, errno := seek(fd, offset, whence)
|
||||
if errno != 0 {
|
||||
|
@ -80,7 +75,7 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||
|
||||
// 64-bit file system and 32-bit uid calls
|
||||
// (16-bit uid calls are not always supported in newer kernels)
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32
|
||||
|
@ -98,8 +93,8 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
|||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||
//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32
|
||||
//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32
|
||||
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32
|
||||
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32
|
||||
//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
|
||||
|
|
|
@ -25,7 +25,7 @@ func EpollCreate(size int) (fd int, err error) {
|
|||
//sysnb Getegid() (egid int)
|
||||
//sysnb Geteuid() (euid int)
|
||||
//sysnb Getgid() (gid int)
|
||||
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb getrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Getuid() (uid int)
|
||||
//sys Listen(s int, n int) (err error)
|
||||
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
|
||||
|
@ -42,12 +42,12 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
}
|
||||
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb setrlimit(resource int, rlim *Rlimit) (err error)
|
||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||
//sys Shutdown(fd int, how int) (err error)
|
||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||
|
@ -168,6 +168,24 @@ func Pipe2(p []int, flags int) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// Getrlimit prefers the prlimit64 system call. See issue 38604.
|
||||
func Getrlimit(resource int, rlim *Rlimit) error {
|
||||
err := prlimit(0, resource, nil, rlim)
|
||||
if err != ENOSYS {
|
||||
return err
|
||||
}
|
||||
return getrlimit(resource, rlim)
|
||||
}
|
||||
|
||||
// Setrlimit prefers the prlimit64 system call. See issue 38604.
|
||||
func Setrlimit(resource int, rlim *Rlimit) error {
|
||||
err := prlimit(0, resource, rlim, nil)
|
||||
if err != ENOSYS {
|
||||
return err
|
||||
}
|
||||
return setrlimit(resource, rlim)
|
||||
}
|
||||
|
||||
func (r *PtraceRegs) PC() uint64 { return r.Pc }
|
||||
|
||||
func (r *PtraceRegs) SetPC(pc uint64) { r.Pc = pc }
|
||||
|
@ -192,9 +210,9 @@ func InotifyInit() (fd int, err error) {
|
|||
return InotifyInit1(0)
|
||||
}
|
||||
|
||||
func Dup2(oldfd int, newfd int) (err error) {
|
||||
return Dup3(oldfd, newfd, 0)
|
||||
}
|
||||
// dup2 exists because func Dup3 in syscall_linux.go references
|
||||
// it in an unreachable path. dup2 isn't available on arm64.
|
||||
func dup2(oldfd int, newfd int) error
|
||||
|
||||
func Pause() error {
|
||||
_, err := ppoll(nil, 0, nil, nil)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
package unix
|
||||
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||
|
@ -36,8 +36,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
}
|
||||
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
@ -216,6 +216,10 @@ func (cmsg *Cmsghdr) SetLen(length int) {
|
|||
cmsg.Len = uint64(length)
|
||||
}
|
||||
|
||||
func InotifyInit() (fd int, err error) {
|
||||
return InotifyInit1(0)
|
||||
}
|
||||
|
||||
//sys poll(fds *PollFd, nfds int, timeout int) (n int, err error)
|
||||
|
||||
func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||
|
|
|
@ -14,7 +14,7 @@ import (
|
|||
|
||||
func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
||||
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||
|
@ -31,8 +31,8 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
|||
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
|
||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
package unix
|
||||
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||
|
@ -34,8 +34,8 @@ package unix
|
|||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
|
|
@ -41,8 +41,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
|||
}
|
||||
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
@ -191,10 +191,6 @@ func InotifyInit() (fd int, err error) {
|
|||
return InotifyInit1(0)
|
||||
}
|
||||
|
||||
func Dup2(oldfd int, newfd int) (err error) {
|
||||
return Dup3(oldfd, newfd, 0)
|
||||
}
|
||||
|
||||
func Pause() error {
|
||||
_, err := ppoll(nil, 0, nil, nil)
|
||||
return err
|
||||
|
@ -228,3 +224,7 @@ func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error
|
|||
}
|
||||
return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
|
||||
}
|
||||
|
||||
// dup2 exists because func Dup3 in syscall_linux.go references
|
||||
// it in an unreachable path. dup2 isn't available on arm64.
|
||||
func dup2(oldfd int, newfd int) error
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sysnb EpollCreate(size int) (fd int, err error)
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||
|
@ -34,8 +34,8 @@ import (
|
|||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
|
|
@ -8,7 +8,7 @@ package unix
|
|||
|
||||
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error)
|
||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
|
||||
//sys Dup2(oldfd int, newfd int) (err error)
|
||||
//sys dup2(oldfd int, newfd int) (err error)
|
||||
//sys Fchown(fd int, uid int, gid int) (err error)
|
||||
//sys Fstat(fd int, stat *Stat_t) (err error)
|
||||
//sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64
|
||||
|
@ -30,8 +30,8 @@ package unix
|
|||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
|
||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||
//sys Setfsgid(gid int) (err error)
|
||||
//sys Setfsuid(uid int) (err error)
|
||||
//sys setfsgid(gid int) (prev int, err error)
|
||||
//sys setfsuid(uid int) (prev int, err error)
|
||||
//sysnb Setregid(rgid int, egid int) (err error)
|
||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||
|
|
|
@ -106,23 +106,6 @@ func direntNamlen(buf []byte) (uint64, bool) {
|
|||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||
}
|
||||
|
||||
func SysctlClockinfo(name string) (*Clockinfo, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
n := uintptr(SizeofClockinfo)
|
||||
var ci Clockinfo
|
||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n != SizeofClockinfo {
|
||||
return nil, EIO
|
||||
}
|
||||
return &ci, nil
|
||||
}
|
||||
|
||||
//sysnb pipe() (fd1 int, fd2 int, err error)
|
||||
func Pipe(p []int) (err error) {
|
||||
if len(p) != 2 {
|
||||
|
@ -249,6 +232,14 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
return sendfile(outfd, infd, offset, count)
|
||||
}
|
||||
|
||||
func Fstatvfs(fd int, buf *Statvfs_t) (err error) {
|
||||
return Fstatvfs1(fd, buf, ST_WAIT)
|
||||
}
|
||||
|
||||
func Statvfs(path string, buf *Statvfs_t) (err error) {
|
||||
return Statvfs1(path, buf, ST_WAIT)
|
||||
}
|
||||
|
||||
/*
|
||||
* Exposed directly
|
||||
*/
|
||||
|
@ -262,6 +253,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Close(fd int) (err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
//sys Dup2(from int, to int) (err error)
|
||||
//sys Dup3(from int, to int, flags int) (err error)
|
||||
//sys Exit(code int)
|
||||
//sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
|
||||
//sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error)
|
||||
|
@ -287,6 +279,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sys Fpathconf(fd int, name int) (val int, 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 Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) = SYS_FSTATVFS1
|
||||
//sys Fsync(fd int) (err error)
|
||||
//sys Ftruncate(fd int, length int64) (err error)
|
||||
//sysnb Getegid() (egid int)
|
||||
|
@ -343,6 +336,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
|||
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||
//sysnb Setuid(uid int) (err error)
|
||||
//sys Stat(path string, stat *Stat_t) (err error)
|
||||
//sys Statvfs1(path string, buf *Statvfs_t, flags int) (err error) = SYS_STATVFS1
|
||||
//sys Symlink(path string, link string) (err error)
|
||||
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
|
||||
//sys Sync() (err error)
|
||||
|
|
|
@ -55,23 +55,6 @@ func direntNamlen(buf []byte) (uint64, bool) {
|
|||
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
|
||||
}
|
||||
|
||||
func SysctlClockinfo(name string) (*Clockinfo, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
n := uintptr(SizeofClockinfo)
|
||||
var ci Clockinfo
|
||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if n != SizeofClockinfo {
|
||||
return nil, EIO
|
||||
}
|
||||
return &ci, nil
|
||||
}
|
||||
|
||||
func SysctlUvmexp(name string) (*Uvmexp, error) {
|
||||
mib, err := sysctlmib(name)
|
||||
if err != nil {
|
||||
|
@ -89,16 +72,20 @@ func SysctlUvmexp(name string) (*Uvmexp, error) {
|
|||
return &u, nil
|
||||
}
|
||||
|
||||
//sysnb pipe(p *[2]_C_int) (err error)
|
||||
func Pipe(p []int) (err error) {
|
||||
return Pipe2(p, 0)
|
||||
}
|
||||
|
||||
//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 = pipe(&pp)
|
||||
err := pipe2(&pp, flags)
|
||||
p[0] = int(pp[0])
|
||||
p[1] = int(pp[1])
|
||||
return
|
||||
return err
|
||||
}
|
||||
|
||||
//sys Getdents(fd int, buf []byte) (n int, err error)
|
||||
|
@ -248,6 +235,7 @@ func Uname(uname *Utsname) error {
|
|||
//sys Close(fd int) (err error)
|
||||
//sys Dup(fd int) (nfd int, err error)
|
||||
//sys Dup2(from int, to int) (err error)
|
||||
//sys Dup3(from int, to int, flags int) (err error)
|
||||
//sys Exit(code int)
|
||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//sys Fchdir(fd int) (err error)
|
||||
|
@ -352,7 +340,6 @@ func Uname(uname *Utsname) error {
|
|||
// clock_settime
|
||||
// closefrom
|
||||
// execve
|
||||
// fcntl
|
||||
// fhopen
|
||||
// fhstat
|
||||
// fhstatfs
|
||||
|
|
|
@ -12,6 +12,8 @@ import (
|
|||
"sync"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
|
||||
"golang.org/x/sys/internal/unsafeheader"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -76,7 +78,7 @@ func SignalName(s syscall.Signal) string {
|
|||
// The signal name should start with "SIG".
|
||||
func SignalNum(s string) syscall.Signal {
|
||||
signalNameMapOnce.Do(func() {
|
||||
signalNameMap = make(map[string]syscall.Signal)
|
||||
signalNameMap = make(map[string]syscall.Signal, len(signalList))
|
||||
for _, signal := range signalList {
|
||||
signalNameMap[signal.name] = signal.num
|
||||
}
|
||||
|
@ -113,15 +115,12 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d
|
|||
return nil, errno
|
||||
}
|
||||
|
||||
// Slice memory layout
|
||||
var sl = struct {
|
||||
addr uintptr
|
||||
len int
|
||||
cap int
|
||||
}{addr, length, length}
|
||||
|
||||
// Use unsafe to turn sl into a []byte.
|
||||
b := *(*[]byte)(unsafe.Pointer(&sl))
|
||||
// Use unsafe to convert addr into a []byte.
|
||||
var b []byte
|
||||
hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b))
|
||||
hdr.Data = unsafe.Pointer(addr)
|
||||
hdr.Cap = length
|
||||
hdr.Len = length
|
||||
|
||||
// Register mapping in m and return it.
|
||||
p := &b[cap(b)-1]
|
||||
|
|
|
@ -339,6 +339,12 @@ const (
|
|||
CLOCK_UPTIME_FAST = 0x8
|
||||
CLOCK_UPTIME_PRECISE = 0x7
|
||||
CLOCK_VIRTUAL = 0x1
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
|
@ -355,6 +361,22 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0x18
|
||||
CTL_NET = 0x4
|
||||
DIOCGATTR = 0xc144648e
|
||||
DIOCGDELETE = 0x80106488
|
||||
DIOCGFLUSH = 0x20006487
|
||||
DIOCGFRONTSTUFF = 0x40086486
|
||||
DIOCGFWHEADS = 0x40046483
|
||||
DIOCGFWSECTORS = 0x40046482
|
||||
DIOCGIDENT = 0x41006489
|
||||
DIOCGMEDIASIZE = 0x40086481
|
||||
DIOCGPHYSPATH = 0x4400648d
|
||||
DIOCGPROVIDERNAME = 0x4400648a
|
||||
DIOCGSECTORSIZE = 0x40046480
|
||||
DIOCGSTRIPEOFFSET = 0x4008648c
|
||||
DIOCGSTRIPESIZE = 0x4008648b
|
||||
DIOCSKERNELDUMP = 0x804c6490
|
||||
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
|
||||
DIOCZONECMD = 0xc06c648f
|
||||
DLT_A429 = 0xb8
|
||||
DLT_A653_ICM = 0xb9
|
||||
DLT_AIRONET_HEADER = 0x78
|
||||
|
@ -379,11 +401,14 @@ const (
|
|||
DLT_CHAOS = 0x5
|
||||
DLT_CHDLC = 0x68
|
||||
DLT_CISCO_IOS = 0x76
|
||||
DLT_CLASS_NETBSD_RAWAF = 0x2240000
|
||||
DLT_C_HDLC = 0x68
|
||||
DLT_C_HDLC_WITH_DIR = 0xcd
|
||||
DLT_DBUS = 0xe7
|
||||
DLT_DECT = 0xdd
|
||||
DLT_DISPLAYPORT_AUX = 0x113
|
||||
DLT_DOCSIS = 0x8f
|
||||
DLT_DOCSIS31_XRA31 = 0x111
|
||||
DLT_DVB_CI = 0xeb
|
||||
DLT_ECONET = 0x73
|
||||
DLT_EN10MB = 0x1
|
||||
|
@ -393,6 +418,7 @@ const (
|
|||
DLT_ERF = 0xc5
|
||||
DLT_ERF_ETH = 0xaf
|
||||
DLT_ERF_POS = 0xb0
|
||||
DLT_ETHERNET_MPACKET = 0x112
|
||||
DLT_FC_2 = 0xe0
|
||||
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
|
||||
DLT_FDDI = 0xa
|
||||
|
@ -406,7 +432,6 @@ const (
|
|||
DLT_GPRS_LLC = 0xa9
|
||||
DLT_GSMTAP_ABIS = 0xda
|
||||
DLT_GSMTAP_UM = 0xd9
|
||||
DLT_HHDLC = 0x79
|
||||
DLT_IBM_SN = 0x92
|
||||
DLT_IBM_SP = 0x91
|
||||
DLT_IEEE802 = 0x6
|
||||
|
@ -429,6 +454,7 @@ const (
|
|||
DLT_IPV4 = 0xe4
|
||||
DLT_IPV6 = 0xe5
|
||||
DLT_IP_OVER_FC = 0x7a
|
||||
DLT_ISO_14443 = 0x108
|
||||
DLT_JUNIPER_ATM1 = 0x89
|
||||
DLT_JUNIPER_ATM2 = 0x87
|
||||
DLT_JUNIPER_ATM_CEMIC = 0xee
|
||||
|
@ -461,8 +487,9 @@ const (
|
|||
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
|
||||
DLT_LINUX_SLL = 0x71
|
||||
DLT_LOOP = 0x6c
|
||||
DLT_LORATAP = 0x10e
|
||||
DLT_LTALK = 0x72
|
||||
DLT_MATCHING_MAX = 0x104
|
||||
DLT_MATCHING_MAX = 0x113
|
||||
DLT_MATCHING_MIN = 0x68
|
||||
DLT_MFR = 0xb6
|
||||
DLT_MOST = 0xd3
|
||||
|
@ -478,14 +505,16 @@ const (
|
|||
DLT_NFC_LLCP = 0xf5
|
||||
DLT_NFLOG = 0xef
|
||||
DLT_NG40 = 0xf4
|
||||
DLT_NORDIC_BLE = 0x110
|
||||
DLT_NULL = 0x0
|
||||
DLT_OPENFLOW = 0x10b
|
||||
DLT_PCI_EXP = 0x7d
|
||||
DLT_PFLOG = 0x75
|
||||
DLT_PFSYNC = 0x79
|
||||
DLT_PKTAP = 0x102
|
||||
DLT_PPI = 0xc0
|
||||
DLT_PPP = 0x9
|
||||
DLT_PPP_BSDOS = 0x10
|
||||
DLT_PPP_BSDOS = 0xe
|
||||
DLT_PPP_ETHER = 0x33
|
||||
DLT_PPP_PPPD = 0xa6
|
||||
DLT_PPP_SERIAL = 0x32
|
||||
|
@ -496,19 +525,25 @@ const (
|
|||
DLT_PRONET = 0x4
|
||||
DLT_RAIF1 = 0xc6
|
||||
DLT_RAW = 0xc
|
||||
DLT_RDS = 0x109
|
||||
DLT_REDBACK_SMARTEDGE = 0x20
|
||||
DLT_RIO = 0x7c
|
||||
DLT_RTAC_SERIAL = 0xfa
|
||||
DLT_SCCP = 0x8e
|
||||
DLT_SCTP = 0xf8
|
||||
DLT_SDLC = 0x10c
|
||||
DLT_SITA = 0xc4
|
||||
DLT_SLIP = 0x8
|
||||
DLT_SLIP_BSDOS = 0xf
|
||||
DLT_SLIP_BSDOS = 0xd
|
||||
DLT_STANAG_5066_D_PDU = 0xed
|
||||
DLT_SUNATM = 0x7b
|
||||
DLT_SYMANTEC_FIREWALL = 0x63
|
||||
DLT_TI_LLN_SNIFFER = 0x10d
|
||||
DLT_TZSP = 0x80
|
||||
DLT_USB = 0xba
|
||||
DLT_USBPCAP = 0xf9
|
||||
DLT_USB_DARWIN = 0x10a
|
||||
DLT_USB_FREEBSD = 0xba
|
||||
DLT_USB_LINUX = 0xbd
|
||||
DLT_USB_LINUX_MMAPPED = 0xdc
|
||||
DLT_USER0 = 0x93
|
||||
|
@ -527,10 +562,14 @@ const (
|
|||
DLT_USER7 = 0x9a
|
||||
DLT_USER8 = 0x9b
|
||||
DLT_USER9 = 0x9c
|
||||
DLT_VSOCK = 0x10f
|
||||
DLT_WATTSTOPPER_DLM = 0x107
|
||||
DLT_WIHART = 0xdf
|
||||
DLT_WIRESHARK_UPPER_PDU = 0xfc
|
||||
DLT_X2E_SERIAL = 0xd5
|
||||
DLT_X2E_XORAYA = 0xd6
|
||||
DLT_ZWAVE_R1_R2 = 0x105
|
||||
DLT_ZWAVE_R3 = 0x106
|
||||
DT_BLK = 0x6
|
||||
DT_CHR = 0x2
|
||||
DT_DIR = 0x4
|
||||
|
@ -548,6 +587,7 @@ const (
|
|||
ECHONL = 0x10
|
||||
ECHOPRT = 0x20
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_EMPTY = -0xd
|
||||
EVFILT_FS = -0x9
|
||||
EVFILT_LIO = -0xa
|
||||
EVFILT_PROC = -0x5
|
||||
|
@ -555,11 +595,12 @@ const (
|
|||
EVFILT_READ = -0x1
|
||||
EVFILT_SENDFILE = -0xc
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0xc
|
||||
EVFILT_SYSCOUNT = 0xd
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xb
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
EVNAMEMAP_NAME_SIZE = 0x40
|
||||
EV_ADD = 0x1
|
||||
EV_CLEAR = 0x20
|
||||
EV_DELETE = 0x2
|
||||
|
@ -576,6 +617,7 @@ const (
|
|||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EXTA = 0x4b00
|
||||
EXTATTR_MAXNAMELEN = 0xff
|
||||
EXTATTR_NAMESPACE_EMPTY = 0x0
|
||||
EXTATTR_NAMESPACE_SYSTEM = 0x2
|
||||
EXTATTR_NAMESPACE_USER = 0x1
|
||||
|
@ -617,6 +659,7 @@ const (
|
|||
IEXTEN = 0x400
|
||||
IFAN_ARRIVAL = 0x0
|
||||
IFAN_DEPARTURE = 0x1
|
||||
IFCAP_WOL_MAGIC = 0x2000
|
||||
IFF_ALLMULTI = 0x200
|
||||
IFF_ALTPHYS = 0x4000
|
||||
IFF_BROADCAST = 0x2
|
||||
|
@ -633,6 +676,7 @@ const (
|
|||
IFF_MONITOR = 0x40000
|
||||
IFF_MULTICAST = 0x8000
|
||||
IFF_NOARP = 0x80
|
||||
IFF_NOGROUP = 0x800000
|
||||
IFF_OACTIVE = 0x400
|
||||
IFF_POINTOPOINT = 0x10
|
||||
IFF_PPROMISC = 0x20000
|
||||
|
@ -807,6 +851,7 @@ const (
|
|||
IPV6_DSTOPTS = 0x32
|
||||
IPV6_FLOWID = 0x43
|
||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||
IPV6_FLOWLABEL_LEN = 0x14
|
||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||
IPV6_FLOWTYPE = 0x44
|
||||
IPV6_FRAGTTL = 0x78
|
||||
|
@ -827,13 +872,13 @@ const (
|
|||
IPV6_MAX_GROUP_SRC_FILTER = 0x200
|
||||
IPV6_MAX_MEMBERSHIPS = 0xfff
|
||||
IPV6_MAX_SOCK_SRC_FILTER = 0x80
|
||||
IPV6_MIN_MEMBERSHIPS = 0x1f
|
||||
IPV6_MMTU = 0x500
|
||||
IPV6_MSFILTER = 0x4a
|
||||
IPV6_MULTICAST_HOPS = 0xa
|
||||
IPV6_MULTICAST_IF = 0x9
|
||||
IPV6_MULTICAST_LOOP = 0xb
|
||||
IPV6_NEXTHOP = 0x30
|
||||
IPV6_ORIGDSTADDR = 0x48
|
||||
IPV6_PATHMTU = 0x2c
|
||||
IPV6_PKTINFO = 0x2e
|
||||
IPV6_PORTRANGE = 0xe
|
||||
|
@ -845,6 +890,7 @@ const (
|
|||
IPV6_RECVFLOWID = 0x46
|
||||
IPV6_RECVHOPLIMIT = 0x25
|
||||
IPV6_RECVHOPOPTS = 0x27
|
||||
IPV6_RECVORIGDSTADDR = 0x48
|
||||
IPV6_RECVPATHMTU = 0x2b
|
||||
IPV6_RECVPKTINFO = 0x24
|
||||
IPV6_RECVRSSBUCKETID = 0x47
|
||||
|
@ -905,10 +951,8 @@ const (
|
|||
IP_MAX_MEMBERSHIPS = 0xfff
|
||||
IP_MAX_SOCK_MUTE_FILTER = 0x80
|
||||
IP_MAX_SOCK_SRC_FILTER = 0x80
|
||||
IP_MAX_SOURCE_FILTER = 0x400
|
||||
IP_MF = 0x2000
|
||||
IP_MINTTL = 0x42
|
||||
IP_MIN_MEMBERSHIPS = 0x1f
|
||||
IP_MSFILTER = 0x4a
|
||||
IP_MSS = 0x240
|
||||
IP_MULTICAST_IF = 0x9
|
||||
|
@ -918,6 +962,7 @@ const (
|
|||
IP_OFFMASK = 0x1fff
|
||||
IP_ONESBCAST = 0x17
|
||||
IP_OPTIONS = 0x1
|
||||
IP_ORIGDSTADDR = 0x1b
|
||||
IP_PORTRANGE = 0x13
|
||||
IP_PORTRANGE_DEFAULT = 0x0
|
||||
IP_PORTRANGE_HIGH = 0x1
|
||||
|
@ -926,6 +971,7 @@ const (
|
|||
IP_RECVFLOWID = 0x5d
|
||||
IP_RECVIF = 0x14
|
||||
IP_RECVOPTS = 0x5
|
||||
IP_RECVORIGDSTADDR = 0x1b
|
||||
IP_RECVRETOPTS = 0x6
|
||||
IP_RECVRSSBUCKETID = 0x5e
|
||||
IP_RECVTOS = 0x44
|
||||
|
@ -975,6 +1021,7 @@ const (
|
|||
MAP_EXCL = 0x4000
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
MAP_GUARD = 0x2000
|
||||
MAP_HASSEMAPHORE = 0x200
|
||||
MAP_NOCORE = 0x20000
|
||||
MAP_NOSYNC = 0x800
|
||||
|
@ -986,6 +1033,15 @@ const (
|
|||
MAP_RESERVED0100 = 0x100
|
||||
MAP_SHARED = 0x1
|
||||
MAP_STACK = 0x400
|
||||
MCAST_BLOCK_SOURCE = 0x54
|
||||
MCAST_EXCLUDE = 0x2
|
||||
MCAST_INCLUDE = 0x1
|
||||
MCAST_JOIN_GROUP = 0x50
|
||||
MCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
MCAST_LEAVE_GROUP = 0x51
|
||||
MCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
MCAST_UNBLOCK_SOURCE = 0x55
|
||||
MCAST_UNDEFINED = 0x0
|
||||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MNT_ACLS = 0x8000000
|
||||
|
@ -1026,10 +1082,12 @@ const (
|
|||
MNT_SUSPEND = 0x4
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNTRUSTED = 0x800000000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_UPDATEMASK = 0x2d8d0807e
|
||||
MNT_UPDATEMASK = 0xad8d0807e
|
||||
MNT_USER = 0x8000
|
||||
MNT_VISFLAGMASK = 0x3fef0ffff
|
||||
MNT_VERIFIED = 0x400000000
|
||||
MNT_VISFLAGMASK = 0xffef0ffff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CMSG_CLOEXEC = 0x40000
|
||||
MSG_COMPAT = 0x8000
|
||||
|
@ -1058,6 +1116,7 @@ const (
|
|||
NFDBITS = 0x20
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSTIME = 0x10
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_CHILD = 0x4
|
||||
NOTE_CLOSE = 0x100
|
||||
|
@ -1212,7 +1271,6 @@ const (
|
|||
RTV_WEIGHT = 0x100
|
||||
RT_ALL_FIBS = -0x1
|
||||
RT_BLACKHOLE = 0x40
|
||||
RT_CACHING_CONTEXT = 0x1
|
||||
RT_DEFAULT_FIB = 0x0
|
||||
RT_HAS_GW = 0x80
|
||||
RT_HAS_HEADER = 0x10
|
||||
|
@ -1222,15 +1280,17 @@ const (
|
|||
RT_LLE_CACHE = 0x100
|
||||
RT_MAY_LOOP = 0x8
|
||||
RT_MAY_LOOP_BIT = 0x3
|
||||
RT_NORTREF = 0x2
|
||||
RT_REJECT = 0x20
|
||||
RUSAGE_CHILDREN = -0x1
|
||||
RUSAGE_SELF = 0x0
|
||||
RUSAGE_THREAD = 0x1
|
||||
SCM_BINTIME = 0x4
|
||||
SCM_CREDS = 0x3
|
||||
SCM_MONOTONIC = 0x6
|
||||
SCM_REALTIME = 0x5
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIME_INFO = 0x7
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
@ -1246,6 +1306,7 @@ const (
|
|||
SIOCGETSGCNT = 0xc0147210
|
||||
SIOCGETVIFCNT = 0xc014720f
|
||||
SIOCGHIWAT = 0x40047301
|
||||
SIOCGHWADDR = 0xc020693e
|
||||
SIOCGI2C = 0xc020693d
|
||||
SIOCGIFADDR = 0xc0206921
|
||||
SIOCGIFBRDADDR = 0xc0206923
|
||||
|
@ -1267,8 +1328,11 @@ const (
|
|||
SIOCGIFPDSTADDR = 0xc0206948
|
||||
SIOCGIFPHYS = 0xc0206935
|
||||
SIOCGIFPSRCADDR = 0xc0206947
|
||||
SIOCGIFRSSHASH = 0xc0186997
|
||||
SIOCGIFRSSKEY = 0xc0946996
|
||||
SIOCGIFSTATUS = 0xc331693b
|
||||
SIOCGIFXMEDIA = 0xc028698b
|
||||
SIOCGLANPCP = 0xc0206998
|
||||
SIOCGLOWAT = 0x40047303
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGPRIVATE_0 = 0xc0206950
|
||||
|
@ -1299,6 +1363,7 @@ const (
|
|||
SIOCSIFPHYS = 0x80206936
|
||||
SIOCSIFRVNET = 0xc020695b
|
||||
SIOCSIFVNET = 0xc020695a
|
||||
SIOCSLANPCP = 0x80206999
|
||||
SIOCSLOWAT = 0x80047302
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSTUNFIB = 0x8020695f
|
||||
|
@ -1317,6 +1382,7 @@ const (
|
|||
SO_BINTIME = 0x2000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1019
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1325,6 +1391,7 @@ const (
|
|||
SO_LISTENINCQLEN = 0x1013
|
||||
SO_LISTENQLEN = 0x1012
|
||||
SO_LISTENQLIMIT = 0x1011
|
||||
SO_MAX_PACING_RATE = 0x1018
|
||||
SO_NOSIGPIPE = 0x800
|
||||
SO_NO_DDP = 0x8000
|
||||
SO_NO_OFFLOAD = 0x4000
|
||||
|
@ -1337,11 +1404,19 @@ const (
|
|||
SO_RCVTIMEO = 0x1006
|
||||
SO_REUSEADDR = 0x4
|
||||
SO_REUSEPORT = 0x200
|
||||
SO_REUSEPORT_LB = 0x10000
|
||||
SO_SETFIB = 0x1014
|
||||
SO_SNDBUF = 0x1001
|
||||
SO_SNDLOWAT = 0x1003
|
||||
SO_SNDTIMEO = 0x1005
|
||||
SO_TIMESTAMP = 0x400
|
||||
SO_TS_BINTIME = 0x1
|
||||
SO_TS_CLOCK = 0x1017
|
||||
SO_TS_CLOCK_MAX = 0x3
|
||||
SO_TS_DEFAULT = 0x0
|
||||
SO_TS_MONOTONIC = 0x3
|
||||
SO_TS_REALTIME = 0x2
|
||||
SO_TS_REALTIME_MICRO = 0x0
|
||||
SO_TYPE = 0x1008
|
||||
SO_USELOOPBACK = 0x40
|
||||
SO_USER_COOKIE = 0x1015
|
||||
|
@ -1385,10 +1460,45 @@ const (
|
|||
TCOFLUSH = 0x2
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCP_BBR_ACK_COMP_ALG = 0x448
|
||||
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
|
||||
TCP_BBR_DRAIN_PG = 0x42e
|
||||
TCP_BBR_EXTRA_GAIN = 0x449
|
||||
TCP_BBR_IWINTSO = 0x42b
|
||||
TCP_BBR_LOWGAIN_FD = 0x436
|
||||
TCP_BBR_LOWGAIN_HALF = 0x435
|
||||
TCP_BBR_LOWGAIN_THRESH = 0x434
|
||||
TCP_BBR_MAX_RTO = 0x439
|
||||
TCP_BBR_MIN_RTO = 0x438
|
||||
TCP_BBR_ONE_RETRAN = 0x431
|
||||
TCP_BBR_PACE_CROSS = 0x442
|
||||
TCP_BBR_PACE_DEL_TAR = 0x43f
|
||||
TCP_BBR_PACE_PER_SEC = 0x43e
|
||||
TCP_BBR_PACE_SEG_MAX = 0x440
|
||||
TCP_BBR_PACE_SEG_MIN = 0x441
|
||||
TCP_BBR_PROBE_RTT_GAIN = 0x44d
|
||||
TCP_BBR_PROBE_RTT_INT = 0x430
|
||||
TCP_BBR_PROBE_RTT_LEN = 0x44e
|
||||
TCP_BBR_RACK_RTT_USE = 0x44a
|
||||
TCP_BBR_RECFORCE = 0x42c
|
||||
TCP_BBR_REC_OVER_HPTS = 0x43a
|
||||
TCP_BBR_RETRAN_WTSO = 0x44b
|
||||
TCP_BBR_RWND_IS_APP = 0x42f
|
||||
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
|
||||
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
|
||||
TCP_BBR_STARTUP_PG = 0x42d
|
||||
TCP_BBR_UNLIMITED = 0x43b
|
||||
TCP_BBR_USEDEL_RATE = 0x437
|
||||
TCP_BBR_USE_LOWGAIN = 0x433
|
||||
TCP_CA_NAME_MAX = 0x10
|
||||
TCP_CCALGOOPT = 0x41
|
||||
TCP_CONGESTION = 0x40
|
||||
TCP_DATA_AFTER_CLOSE = 0x44c
|
||||
TCP_DELACK = 0x48
|
||||
TCP_FASTOPEN = 0x401
|
||||
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
|
||||
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
|
||||
TCP_FASTOPEN_PSK_LEN = 0x10
|
||||
TCP_FUNCTION_BLK = 0x2000
|
||||
TCP_FUNCTION_NAME_LEN_MAX = 0x20
|
||||
TCP_INFO = 0x20
|
||||
|
@ -1396,6 +1506,12 @@ const (
|
|||
TCP_KEEPIDLE = 0x100
|
||||
TCP_KEEPINIT = 0x80
|
||||
TCP_KEEPINTVL = 0x200
|
||||
TCP_LOG = 0x22
|
||||
TCP_LOGBUF = 0x23
|
||||
TCP_LOGDUMP = 0x25
|
||||
TCP_LOGDUMPID = 0x26
|
||||
TCP_LOGID = 0x24
|
||||
TCP_LOG_ID_LEN = 0x40
|
||||
TCP_MAXBURST = 0x4
|
||||
TCP_MAXHLEN = 0x3c
|
||||
TCP_MAXOLEN = 0x28
|
||||
|
@ -1411,8 +1527,30 @@ const (
|
|||
TCP_NOPUSH = 0x4
|
||||
TCP_PCAP_IN = 0x1000
|
||||
TCP_PCAP_OUT = 0x800
|
||||
TCP_RACK_EARLY_RECOV = 0x423
|
||||
TCP_RACK_EARLY_SEG = 0x424
|
||||
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
|
||||
TCP_RACK_MIN_PACE = 0x445
|
||||
TCP_RACK_MIN_PACE_SEG = 0x446
|
||||
TCP_RACK_MIN_TO = 0x422
|
||||
TCP_RACK_PACE_ALWAYS = 0x41f
|
||||
TCP_RACK_PACE_MAX_SEG = 0x41e
|
||||
TCP_RACK_PACE_REDUCE = 0x41d
|
||||
TCP_RACK_PKT_DELAY = 0x428
|
||||
TCP_RACK_PROP = 0x41b
|
||||
TCP_RACK_PROP_RATE = 0x420
|
||||
TCP_RACK_PRR_SENDALOT = 0x421
|
||||
TCP_RACK_REORD_FADE = 0x426
|
||||
TCP_RACK_REORD_THRESH = 0x425
|
||||
TCP_RACK_SESS_CWV = 0x42a
|
||||
TCP_RACK_TLP_INC_VAR = 0x429
|
||||
TCP_RACK_TLP_REDUCE = 0x41c
|
||||
TCP_RACK_TLP_THRESH = 0x427
|
||||
TCP_RACK_TLP_USE = 0x447
|
||||
TCP_VENDOR = 0x80000000
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
TIMER_RELTIME = 0x0
|
||||
TIOCCBRK = 0x2000747a
|
||||
TIOCCDTR = 0x20007478
|
||||
TIOCCONS = 0x80047462
|
||||
|
@ -1476,6 +1614,8 @@ const (
|
|||
TIOCTIMESTAMP = 0x40087459
|
||||
TIOCUCNTL = 0x80047466
|
||||
TOSTOP = 0x400000
|
||||
UTIME_NOW = -0x1
|
||||
UTIME_OMIT = -0x2
|
||||
VDISCARD = 0xf
|
||||
VDSUSP = 0xb
|
||||
VEOF = 0x0
|
||||
|
@ -1487,6 +1627,8 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_BCACHE_SIZE_MAX = 0x70e0000
|
||||
VM_SWZONE_SIZE_MAX = 0x2280000
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
|
|
@ -339,6 +339,12 @@ const (
|
|||
CLOCK_UPTIME_FAST = 0x8
|
||||
CLOCK_UPTIME_PRECISE = 0x7
|
||||
CLOCK_VIRTUAL = 0x1
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
|
@ -355,6 +361,22 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0x18
|
||||
CTL_NET = 0x4
|
||||
DIOCGATTR = 0xc148648e
|
||||
DIOCGDELETE = 0x80106488
|
||||
DIOCGFLUSH = 0x20006487
|
||||
DIOCGFRONTSTUFF = 0x40086486
|
||||
DIOCGFWHEADS = 0x40046483
|
||||
DIOCGFWSECTORS = 0x40046482
|
||||
DIOCGIDENT = 0x41006489
|
||||
DIOCGMEDIASIZE = 0x40086481
|
||||
DIOCGPHYSPATH = 0x4400648d
|
||||
DIOCGPROVIDERNAME = 0x4400648a
|
||||
DIOCGSECTORSIZE = 0x40046480
|
||||
DIOCGSTRIPEOFFSET = 0x4008648c
|
||||
DIOCGSTRIPESIZE = 0x4008648b
|
||||
DIOCSKERNELDUMP = 0x80506490
|
||||
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
|
||||
DIOCZONECMD = 0xc080648f
|
||||
DLT_A429 = 0xb8
|
||||
DLT_A653_ICM = 0xb9
|
||||
DLT_AIRONET_HEADER = 0x78
|
||||
|
@ -379,11 +401,14 @@ const (
|
|||
DLT_CHAOS = 0x5
|
||||
DLT_CHDLC = 0x68
|
||||
DLT_CISCO_IOS = 0x76
|
||||
DLT_CLASS_NETBSD_RAWAF = 0x2240000
|
||||
DLT_C_HDLC = 0x68
|
||||
DLT_C_HDLC_WITH_DIR = 0xcd
|
||||
DLT_DBUS = 0xe7
|
||||
DLT_DECT = 0xdd
|
||||
DLT_DISPLAYPORT_AUX = 0x113
|
||||
DLT_DOCSIS = 0x8f
|
||||
DLT_DOCSIS31_XRA31 = 0x111
|
||||
DLT_DVB_CI = 0xeb
|
||||
DLT_ECONET = 0x73
|
||||
DLT_EN10MB = 0x1
|
||||
|
@ -393,6 +418,7 @@ const (
|
|||
DLT_ERF = 0xc5
|
||||
DLT_ERF_ETH = 0xaf
|
||||
DLT_ERF_POS = 0xb0
|
||||
DLT_ETHERNET_MPACKET = 0x112
|
||||
DLT_FC_2 = 0xe0
|
||||
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
|
||||
DLT_FDDI = 0xa
|
||||
|
@ -406,7 +432,6 @@ const (
|
|||
DLT_GPRS_LLC = 0xa9
|
||||
DLT_GSMTAP_ABIS = 0xda
|
||||
DLT_GSMTAP_UM = 0xd9
|
||||
DLT_HHDLC = 0x79
|
||||
DLT_IBM_SN = 0x92
|
||||
DLT_IBM_SP = 0x91
|
||||
DLT_IEEE802 = 0x6
|
||||
|
@ -429,6 +454,7 @@ const (
|
|||
DLT_IPV4 = 0xe4
|
||||
DLT_IPV6 = 0xe5
|
||||
DLT_IP_OVER_FC = 0x7a
|
||||
DLT_ISO_14443 = 0x108
|
||||
DLT_JUNIPER_ATM1 = 0x89
|
||||
DLT_JUNIPER_ATM2 = 0x87
|
||||
DLT_JUNIPER_ATM_CEMIC = 0xee
|
||||
|
@ -461,8 +487,9 @@ const (
|
|||
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
|
||||
DLT_LINUX_SLL = 0x71
|
||||
DLT_LOOP = 0x6c
|
||||
DLT_LORATAP = 0x10e
|
||||
DLT_LTALK = 0x72
|
||||
DLT_MATCHING_MAX = 0x104
|
||||
DLT_MATCHING_MAX = 0x113
|
||||
DLT_MATCHING_MIN = 0x68
|
||||
DLT_MFR = 0xb6
|
||||
DLT_MOST = 0xd3
|
||||
|
@ -478,14 +505,16 @@ const (
|
|||
DLT_NFC_LLCP = 0xf5
|
||||
DLT_NFLOG = 0xef
|
||||
DLT_NG40 = 0xf4
|
||||
DLT_NORDIC_BLE = 0x110
|
||||
DLT_NULL = 0x0
|
||||
DLT_OPENFLOW = 0x10b
|
||||
DLT_PCI_EXP = 0x7d
|
||||
DLT_PFLOG = 0x75
|
||||
DLT_PFSYNC = 0x79
|
||||
DLT_PKTAP = 0x102
|
||||
DLT_PPI = 0xc0
|
||||
DLT_PPP = 0x9
|
||||
DLT_PPP_BSDOS = 0x10
|
||||
DLT_PPP_BSDOS = 0xe
|
||||
DLT_PPP_ETHER = 0x33
|
||||
DLT_PPP_PPPD = 0xa6
|
||||
DLT_PPP_SERIAL = 0x32
|
||||
|
@ -496,19 +525,25 @@ const (
|
|||
DLT_PRONET = 0x4
|
||||
DLT_RAIF1 = 0xc6
|
||||
DLT_RAW = 0xc
|
||||
DLT_RDS = 0x109
|
||||
DLT_REDBACK_SMARTEDGE = 0x20
|
||||
DLT_RIO = 0x7c
|
||||
DLT_RTAC_SERIAL = 0xfa
|
||||
DLT_SCCP = 0x8e
|
||||
DLT_SCTP = 0xf8
|
||||
DLT_SDLC = 0x10c
|
||||
DLT_SITA = 0xc4
|
||||
DLT_SLIP = 0x8
|
||||
DLT_SLIP_BSDOS = 0xf
|
||||
DLT_SLIP_BSDOS = 0xd
|
||||
DLT_STANAG_5066_D_PDU = 0xed
|
||||
DLT_SUNATM = 0x7b
|
||||
DLT_SYMANTEC_FIREWALL = 0x63
|
||||
DLT_TI_LLN_SNIFFER = 0x10d
|
||||
DLT_TZSP = 0x80
|
||||
DLT_USB = 0xba
|
||||
DLT_USBPCAP = 0xf9
|
||||
DLT_USB_DARWIN = 0x10a
|
||||
DLT_USB_FREEBSD = 0xba
|
||||
DLT_USB_LINUX = 0xbd
|
||||
DLT_USB_LINUX_MMAPPED = 0xdc
|
||||
DLT_USER0 = 0x93
|
||||
|
@ -527,10 +562,14 @@ const (
|
|||
DLT_USER7 = 0x9a
|
||||
DLT_USER8 = 0x9b
|
||||
DLT_USER9 = 0x9c
|
||||
DLT_VSOCK = 0x10f
|
||||
DLT_WATTSTOPPER_DLM = 0x107
|
||||
DLT_WIHART = 0xdf
|
||||
DLT_WIRESHARK_UPPER_PDU = 0xfc
|
||||
DLT_X2E_SERIAL = 0xd5
|
||||
DLT_X2E_XORAYA = 0xd6
|
||||
DLT_ZWAVE_R1_R2 = 0x105
|
||||
DLT_ZWAVE_R3 = 0x106
|
||||
DT_BLK = 0x6
|
||||
DT_CHR = 0x2
|
||||
DT_DIR = 0x4
|
||||
|
@ -548,6 +587,7 @@ const (
|
|||
ECHONL = 0x10
|
||||
ECHOPRT = 0x20
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_EMPTY = -0xd
|
||||
EVFILT_FS = -0x9
|
||||
EVFILT_LIO = -0xa
|
||||
EVFILT_PROC = -0x5
|
||||
|
@ -555,11 +595,12 @@ const (
|
|||
EVFILT_READ = -0x1
|
||||
EVFILT_SENDFILE = -0xc
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0xc
|
||||
EVFILT_SYSCOUNT = 0xd
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xb
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
EVNAMEMAP_NAME_SIZE = 0x40
|
||||
EV_ADD = 0x1
|
||||
EV_CLEAR = 0x20
|
||||
EV_DELETE = 0x2
|
||||
|
@ -576,6 +617,7 @@ const (
|
|||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EXTA = 0x4b00
|
||||
EXTATTR_MAXNAMELEN = 0xff
|
||||
EXTATTR_NAMESPACE_EMPTY = 0x0
|
||||
EXTATTR_NAMESPACE_SYSTEM = 0x2
|
||||
EXTATTR_NAMESPACE_USER = 0x1
|
||||
|
@ -617,6 +659,7 @@ const (
|
|||
IEXTEN = 0x400
|
||||
IFAN_ARRIVAL = 0x0
|
||||
IFAN_DEPARTURE = 0x1
|
||||
IFCAP_WOL_MAGIC = 0x2000
|
||||
IFF_ALLMULTI = 0x200
|
||||
IFF_ALTPHYS = 0x4000
|
||||
IFF_BROADCAST = 0x2
|
||||
|
@ -633,6 +676,7 @@ const (
|
|||
IFF_MONITOR = 0x40000
|
||||
IFF_MULTICAST = 0x8000
|
||||
IFF_NOARP = 0x80
|
||||
IFF_NOGROUP = 0x800000
|
||||
IFF_OACTIVE = 0x400
|
||||
IFF_POINTOPOINT = 0x10
|
||||
IFF_PPROMISC = 0x20000
|
||||
|
@ -807,6 +851,7 @@ const (
|
|||
IPV6_DSTOPTS = 0x32
|
||||
IPV6_FLOWID = 0x43
|
||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||
IPV6_FLOWLABEL_LEN = 0x14
|
||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||
IPV6_FLOWTYPE = 0x44
|
||||
IPV6_FRAGTTL = 0x78
|
||||
|
@ -827,13 +872,13 @@ const (
|
|||
IPV6_MAX_GROUP_SRC_FILTER = 0x200
|
||||
IPV6_MAX_MEMBERSHIPS = 0xfff
|
||||
IPV6_MAX_SOCK_SRC_FILTER = 0x80
|
||||
IPV6_MIN_MEMBERSHIPS = 0x1f
|
||||
IPV6_MMTU = 0x500
|
||||
IPV6_MSFILTER = 0x4a
|
||||
IPV6_MULTICAST_HOPS = 0xa
|
||||
IPV6_MULTICAST_IF = 0x9
|
||||
IPV6_MULTICAST_LOOP = 0xb
|
||||
IPV6_NEXTHOP = 0x30
|
||||
IPV6_ORIGDSTADDR = 0x48
|
||||
IPV6_PATHMTU = 0x2c
|
||||
IPV6_PKTINFO = 0x2e
|
||||
IPV6_PORTRANGE = 0xe
|
||||
|
@ -845,6 +890,7 @@ const (
|
|||
IPV6_RECVFLOWID = 0x46
|
||||
IPV6_RECVHOPLIMIT = 0x25
|
||||
IPV6_RECVHOPOPTS = 0x27
|
||||
IPV6_RECVORIGDSTADDR = 0x48
|
||||
IPV6_RECVPATHMTU = 0x2b
|
||||
IPV6_RECVPKTINFO = 0x24
|
||||
IPV6_RECVRSSBUCKETID = 0x47
|
||||
|
@ -905,10 +951,8 @@ const (
|
|||
IP_MAX_MEMBERSHIPS = 0xfff
|
||||
IP_MAX_SOCK_MUTE_FILTER = 0x80
|
||||
IP_MAX_SOCK_SRC_FILTER = 0x80
|
||||
IP_MAX_SOURCE_FILTER = 0x400
|
||||
IP_MF = 0x2000
|
||||
IP_MINTTL = 0x42
|
||||
IP_MIN_MEMBERSHIPS = 0x1f
|
||||
IP_MSFILTER = 0x4a
|
||||
IP_MSS = 0x240
|
||||
IP_MULTICAST_IF = 0x9
|
||||
|
@ -918,6 +962,7 @@ const (
|
|||
IP_OFFMASK = 0x1fff
|
||||
IP_ONESBCAST = 0x17
|
||||
IP_OPTIONS = 0x1
|
||||
IP_ORIGDSTADDR = 0x1b
|
||||
IP_PORTRANGE = 0x13
|
||||
IP_PORTRANGE_DEFAULT = 0x0
|
||||
IP_PORTRANGE_HIGH = 0x1
|
||||
|
@ -926,6 +971,7 @@ const (
|
|||
IP_RECVFLOWID = 0x5d
|
||||
IP_RECVIF = 0x14
|
||||
IP_RECVOPTS = 0x5
|
||||
IP_RECVORIGDSTADDR = 0x1b
|
||||
IP_RECVRETOPTS = 0x6
|
||||
IP_RECVRSSBUCKETID = 0x5e
|
||||
IP_RECVTOS = 0x44
|
||||
|
@ -976,6 +1022,7 @@ const (
|
|||
MAP_EXCL = 0x4000
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
MAP_GUARD = 0x2000
|
||||
MAP_HASSEMAPHORE = 0x200
|
||||
MAP_NOCORE = 0x20000
|
||||
MAP_NOSYNC = 0x800
|
||||
|
@ -987,6 +1034,15 @@ const (
|
|||
MAP_RESERVED0100 = 0x100
|
||||
MAP_SHARED = 0x1
|
||||
MAP_STACK = 0x400
|
||||
MCAST_BLOCK_SOURCE = 0x54
|
||||
MCAST_EXCLUDE = 0x2
|
||||
MCAST_INCLUDE = 0x1
|
||||
MCAST_JOIN_GROUP = 0x50
|
||||
MCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
MCAST_LEAVE_GROUP = 0x51
|
||||
MCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
MCAST_UNBLOCK_SOURCE = 0x55
|
||||
MCAST_UNDEFINED = 0x0
|
||||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MNT_ACLS = 0x8000000
|
||||
|
@ -1027,10 +1083,12 @@ const (
|
|||
MNT_SUSPEND = 0x4
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNTRUSTED = 0x800000000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_UPDATEMASK = 0x2d8d0807e
|
||||
MNT_UPDATEMASK = 0xad8d0807e
|
||||
MNT_USER = 0x8000
|
||||
MNT_VISFLAGMASK = 0x3fef0ffff
|
||||
MNT_VERIFIED = 0x400000000
|
||||
MNT_VISFLAGMASK = 0xffef0ffff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CMSG_CLOEXEC = 0x40000
|
||||
MSG_COMPAT = 0x8000
|
||||
|
@ -1059,6 +1117,7 @@ const (
|
|||
NFDBITS = 0x40
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSTIME = 0x10
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_CHILD = 0x4
|
||||
NOTE_CLOSE = 0x100
|
||||
|
@ -1213,7 +1272,6 @@ const (
|
|||
RTV_WEIGHT = 0x100
|
||||
RT_ALL_FIBS = -0x1
|
||||
RT_BLACKHOLE = 0x40
|
||||
RT_CACHING_CONTEXT = 0x1
|
||||
RT_DEFAULT_FIB = 0x0
|
||||
RT_HAS_GW = 0x80
|
||||
RT_HAS_HEADER = 0x10
|
||||
|
@ -1223,15 +1281,17 @@ const (
|
|||
RT_LLE_CACHE = 0x100
|
||||
RT_MAY_LOOP = 0x8
|
||||
RT_MAY_LOOP_BIT = 0x3
|
||||
RT_NORTREF = 0x2
|
||||
RT_REJECT = 0x20
|
||||
RUSAGE_CHILDREN = -0x1
|
||||
RUSAGE_SELF = 0x0
|
||||
RUSAGE_THREAD = 0x1
|
||||
SCM_BINTIME = 0x4
|
||||
SCM_CREDS = 0x3
|
||||
SCM_MONOTONIC = 0x6
|
||||
SCM_REALTIME = 0x5
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIME_INFO = 0x7
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
@ -1247,6 +1307,7 @@ const (
|
|||
SIOCGETSGCNT = 0xc0207210
|
||||
SIOCGETVIFCNT = 0xc028720f
|
||||
SIOCGHIWAT = 0x40047301
|
||||
SIOCGHWADDR = 0xc020693e
|
||||
SIOCGI2C = 0xc020693d
|
||||
SIOCGIFADDR = 0xc0206921
|
||||
SIOCGIFBRDADDR = 0xc0206923
|
||||
|
@ -1268,8 +1329,11 @@ const (
|
|||
SIOCGIFPDSTADDR = 0xc0206948
|
||||
SIOCGIFPHYS = 0xc0206935
|
||||
SIOCGIFPSRCADDR = 0xc0206947
|
||||
SIOCGIFRSSHASH = 0xc0186997
|
||||
SIOCGIFRSSKEY = 0xc0946996
|
||||
SIOCGIFSTATUS = 0xc331693b
|
||||
SIOCGIFXMEDIA = 0xc030698b
|
||||
SIOCGLANPCP = 0xc0206998
|
||||
SIOCGLOWAT = 0x40047303
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGPRIVATE_0 = 0xc0206950
|
||||
|
@ -1300,6 +1364,7 @@ const (
|
|||
SIOCSIFPHYS = 0x80206936
|
||||
SIOCSIFRVNET = 0xc020695b
|
||||
SIOCSIFVNET = 0xc020695a
|
||||
SIOCSLANPCP = 0x80206999
|
||||
SIOCSLOWAT = 0x80047302
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSTUNFIB = 0x8020695f
|
||||
|
@ -1318,6 +1383,7 @@ const (
|
|||
SO_BINTIME = 0x2000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1019
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1326,6 +1392,7 @@ const (
|
|||
SO_LISTENINCQLEN = 0x1013
|
||||
SO_LISTENQLEN = 0x1012
|
||||
SO_LISTENQLIMIT = 0x1011
|
||||
SO_MAX_PACING_RATE = 0x1018
|
||||
SO_NOSIGPIPE = 0x800
|
||||
SO_NO_DDP = 0x8000
|
||||
SO_NO_OFFLOAD = 0x4000
|
||||
|
@ -1338,11 +1405,19 @@ const (
|
|||
SO_RCVTIMEO = 0x1006
|
||||
SO_REUSEADDR = 0x4
|
||||
SO_REUSEPORT = 0x200
|
||||
SO_REUSEPORT_LB = 0x10000
|
||||
SO_SETFIB = 0x1014
|
||||
SO_SNDBUF = 0x1001
|
||||
SO_SNDLOWAT = 0x1003
|
||||
SO_SNDTIMEO = 0x1005
|
||||
SO_TIMESTAMP = 0x400
|
||||
SO_TS_BINTIME = 0x1
|
||||
SO_TS_CLOCK = 0x1017
|
||||
SO_TS_CLOCK_MAX = 0x3
|
||||
SO_TS_DEFAULT = 0x0
|
||||
SO_TS_MONOTONIC = 0x3
|
||||
SO_TS_REALTIME = 0x2
|
||||
SO_TS_REALTIME_MICRO = 0x0
|
||||
SO_TYPE = 0x1008
|
||||
SO_USELOOPBACK = 0x40
|
||||
SO_USER_COOKIE = 0x1015
|
||||
|
@ -1386,10 +1461,45 @@ const (
|
|||
TCOFLUSH = 0x2
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCP_BBR_ACK_COMP_ALG = 0x448
|
||||
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
|
||||
TCP_BBR_DRAIN_PG = 0x42e
|
||||
TCP_BBR_EXTRA_GAIN = 0x449
|
||||
TCP_BBR_IWINTSO = 0x42b
|
||||
TCP_BBR_LOWGAIN_FD = 0x436
|
||||
TCP_BBR_LOWGAIN_HALF = 0x435
|
||||
TCP_BBR_LOWGAIN_THRESH = 0x434
|
||||
TCP_BBR_MAX_RTO = 0x439
|
||||
TCP_BBR_MIN_RTO = 0x438
|
||||
TCP_BBR_ONE_RETRAN = 0x431
|
||||
TCP_BBR_PACE_CROSS = 0x442
|
||||
TCP_BBR_PACE_DEL_TAR = 0x43f
|
||||
TCP_BBR_PACE_PER_SEC = 0x43e
|
||||
TCP_BBR_PACE_SEG_MAX = 0x440
|
||||
TCP_BBR_PACE_SEG_MIN = 0x441
|
||||
TCP_BBR_PROBE_RTT_GAIN = 0x44d
|
||||
TCP_BBR_PROBE_RTT_INT = 0x430
|
||||
TCP_BBR_PROBE_RTT_LEN = 0x44e
|
||||
TCP_BBR_RACK_RTT_USE = 0x44a
|
||||
TCP_BBR_RECFORCE = 0x42c
|
||||
TCP_BBR_REC_OVER_HPTS = 0x43a
|
||||
TCP_BBR_RETRAN_WTSO = 0x44b
|
||||
TCP_BBR_RWND_IS_APP = 0x42f
|
||||
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
|
||||
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
|
||||
TCP_BBR_STARTUP_PG = 0x42d
|
||||
TCP_BBR_UNLIMITED = 0x43b
|
||||
TCP_BBR_USEDEL_RATE = 0x437
|
||||
TCP_BBR_USE_LOWGAIN = 0x433
|
||||
TCP_CA_NAME_MAX = 0x10
|
||||
TCP_CCALGOOPT = 0x41
|
||||
TCP_CONGESTION = 0x40
|
||||
TCP_DATA_AFTER_CLOSE = 0x44c
|
||||
TCP_DELACK = 0x48
|
||||
TCP_FASTOPEN = 0x401
|
||||
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
|
||||
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
|
||||
TCP_FASTOPEN_PSK_LEN = 0x10
|
||||
TCP_FUNCTION_BLK = 0x2000
|
||||
TCP_FUNCTION_NAME_LEN_MAX = 0x20
|
||||
TCP_INFO = 0x20
|
||||
|
@ -1397,6 +1507,12 @@ const (
|
|||
TCP_KEEPIDLE = 0x100
|
||||
TCP_KEEPINIT = 0x80
|
||||
TCP_KEEPINTVL = 0x200
|
||||
TCP_LOG = 0x22
|
||||
TCP_LOGBUF = 0x23
|
||||
TCP_LOGDUMP = 0x25
|
||||
TCP_LOGDUMPID = 0x26
|
||||
TCP_LOGID = 0x24
|
||||
TCP_LOG_ID_LEN = 0x40
|
||||
TCP_MAXBURST = 0x4
|
||||
TCP_MAXHLEN = 0x3c
|
||||
TCP_MAXOLEN = 0x28
|
||||
|
@ -1412,8 +1528,30 @@ const (
|
|||
TCP_NOPUSH = 0x4
|
||||
TCP_PCAP_IN = 0x1000
|
||||
TCP_PCAP_OUT = 0x800
|
||||
TCP_RACK_EARLY_RECOV = 0x423
|
||||
TCP_RACK_EARLY_SEG = 0x424
|
||||
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
|
||||
TCP_RACK_MIN_PACE = 0x445
|
||||
TCP_RACK_MIN_PACE_SEG = 0x446
|
||||
TCP_RACK_MIN_TO = 0x422
|
||||
TCP_RACK_PACE_ALWAYS = 0x41f
|
||||
TCP_RACK_PACE_MAX_SEG = 0x41e
|
||||
TCP_RACK_PACE_REDUCE = 0x41d
|
||||
TCP_RACK_PKT_DELAY = 0x428
|
||||
TCP_RACK_PROP = 0x41b
|
||||
TCP_RACK_PROP_RATE = 0x420
|
||||
TCP_RACK_PRR_SENDALOT = 0x421
|
||||
TCP_RACK_REORD_FADE = 0x426
|
||||
TCP_RACK_REORD_THRESH = 0x425
|
||||
TCP_RACK_SESS_CWV = 0x42a
|
||||
TCP_RACK_TLP_INC_VAR = 0x429
|
||||
TCP_RACK_TLP_REDUCE = 0x41c
|
||||
TCP_RACK_TLP_THRESH = 0x427
|
||||
TCP_RACK_TLP_USE = 0x447
|
||||
TCP_VENDOR = 0x80000000
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
TIMER_RELTIME = 0x0
|
||||
TIOCCBRK = 0x2000747a
|
||||
TIOCCDTR = 0x20007478
|
||||
TIOCCONS = 0x80047462
|
||||
|
@ -1477,6 +1615,8 @@ const (
|
|||
TIOCTIMESTAMP = 0x40107459
|
||||
TIOCUCNTL = 0x80047466
|
||||
TOSTOP = 0x400000
|
||||
UTIME_NOW = -0x1
|
||||
UTIME_OMIT = -0x2
|
||||
VDISCARD = 0xf
|
||||
VDSUSP = 0xb
|
||||
VEOF = 0x0
|
||||
|
|
|
@ -339,6 +339,12 @@ const (
|
|||
CLOCK_UPTIME_FAST = 0x8
|
||||
CLOCK_UPTIME_PRECISE = 0x7
|
||||
CLOCK_VIRTUAL = 0x1
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
|
@ -355,6 +361,22 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0x18
|
||||
CTL_NET = 0x4
|
||||
DIOCGATTR = 0xc144648e
|
||||
DIOCGDELETE = 0x80106488
|
||||
DIOCGFLUSH = 0x20006487
|
||||
DIOCGFRONTSTUFF = 0x40086486
|
||||
DIOCGFWHEADS = 0x40046483
|
||||
DIOCGFWSECTORS = 0x40046482
|
||||
DIOCGIDENT = 0x41006489
|
||||
DIOCGMEDIASIZE = 0x40086481
|
||||
DIOCGPHYSPATH = 0x4400648d
|
||||
DIOCGPROVIDERNAME = 0x4400648a
|
||||
DIOCGSECTORSIZE = 0x40046480
|
||||
DIOCGSTRIPEOFFSET = 0x4008648c
|
||||
DIOCGSTRIPESIZE = 0x4008648b
|
||||
DIOCSKERNELDUMP = 0x804c6490
|
||||
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
|
||||
DIOCZONECMD = 0xc06c648f
|
||||
DLT_A429 = 0xb8
|
||||
DLT_A653_ICM = 0xb9
|
||||
DLT_AIRONET_HEADER = 0x78
|
||||
|
|
|
@ -339,6 +339,12 @@ const (
|
|||
CLOCK_UPTIME_FAST = 0x8
|
||||
CLOCK_UPTIME_PRECISE = 0x7
|
||||
CLOCK_VIRTUAL = 0x1
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x30000
|
||||
CS5 = 0x0
|
||||
|
@ -355,6 +361,22 @@ const (
|
|||
CTL_KERN = 0x1
|
||||
CTL_MAXNAME = 0x18
|
||||
CTL_NET = 0x4
|
||||
DIOCGATTR = 0xc148648e
|
||||
DIOCGDELETE = 0x80106488
|
||||
DIOCGFLUSH = 0x20006487
|
||||
DIOCGFRONTSTUFF = 0x40086486
|
||||
DIOCGFWHEADS = 0x40046483
|
||||
DIOCGFWSECTORS = 0x40046482
|
||||
DIOCGIDENT = 0x41006489
|
||||
DIOCGMEDIASIZE = 0x40086481
|
||||
DIOCGPHYSPATH = 0x4400648d
|
||||
DIOCGPROVIDERNAME = 0x4400648a
|
||||
DIOCGSECTORSIZE = 0x40046480
|
||||
DIOCGSTRIPEOFFSET = 0x4008648c
|
||||
DIOCGSTRIPESIZE = 0x4008648b
|
||||
DIOCSKERNELDUMP = 0x80506490
|
||||
DIOCSKERNELDUMP_FREEBSD11 = 0x80046485
|
||||
DIOCZONECMD = 0xc080648f
|
||||
DLT_A429 = 0xb8
|
||||
DLT_A653_ICM = 0xb9
|
||||
DLT_AIRONET_HEADER = 0x78
|
||||
|
@ -379,11 +401,14 @@ const (
|
|||
DLT_CHAOS = 0x5
|
||||
DLT_CHDLC = 0x68
|
||||
DLT_CISCO_IOS = 0x76
|
||||
DLT_CLASS_NETBSD_RAWAF = 0x2240000
|
||||
DLT_C_HDLC = 0x68
|
||||
DLT_C_HDLC_WITH_DIR = 0xcd
|
||||
DLT_DBUS = 0xe7
|
||||
DLT_DECT = 0xdd
|
||||
DLT_DISPLAYPORT_AUX = 0x113
|
||||
DLT_DOCSIS = 0x8f
|
||||
DLT_DOCSIS31_XRA31 = 0x111
|
||||
DLT_DVB_CI = 0xeb
|
||||
DLT_ECONET = 0x73
|
||||
DLT_EN10MB = 0x1
|
||||
|
@ -393,6 +418,7 @@ const (
|
|||
DLT_ERF = 0xc5
|
||||
DLT_ERF_ETH = 0xaf
|
||||
DLT_ERF_POS = 0xb0
|
||||
DLT_ETHERNET_MPACKET = 0x112
|
||||
DLT_FC_2 = 0xe0
|
||||
DLT_FC_2_WITH_FRAME_DELIMS = 0xe1
|
||||
DLT_FDDI = 0xa
|
||||
|
@ -406,7 +432,6 @@ const (
|
|||
DLT_GPRS_LLC = 0xa9
|
||||
DLT_GSMTAP_ABIS = 0xda
|
||||
DLT_GSMTAP_UM = 0xd9
|
||||
DLT_HHDLC = 0x79
|
||||
DLT_IBM_SN = 0x92
|
||||
DLT_IBM_SP = 0x91
|
||||
DLT_IEEE802 = 0x6
|
||||
|
@ -429,6 +454,7 @@ const (
|
|||
DLT_IPV4 = 0xe4
|
||||
DLT_IPV6 = 0xe5
|
||||
DLT_IP_OVER_FC = 0x7a
|
||||
DLT_ISO_14443 = 0x108
|
||||
DLT_JUNIPER_ATM1 = 0x89
|
||||
DLT_JUNIPER_ATM2 = 0x87
|
||||
DLT_JUNIPER_ATM_CEMIC = 0xee
|
||||
|
@ -461,8 +487,9 @@ const (
|
|||
DLT_LINUX_PPP_WITHDIRECTION = 0xa6
|
||||
DLT_LINUX_SLL = 0x71
|
||||
DLT_LOOP = 0x6c
|
||||
DLT_LORATAP = 0x10e
|
||||
DLT_LTALK = 0x72
|
||||
DLT_MATCHING_MAX = 0x104
|
||||
DLT_MATCHING_MAX = 0x113
|
||||
DLT_MATCHING_MIN = 0x68
|
||||
DLT_MFR = 0xb6
|
||||
DLT_MOST = 0xd3
|
||||
|
@ -478,14 +505,16 @@ const (
|
|||
DLT_NFC_LLCP = 0xf5
|
||||
DLT_NFLOG = 0xef
|
||||
DLT_NG40 = 0xf4
|
||||
DLT_NORDIC_BLE = 0x110
|
||||
DLT_NULL = 0x0
|
||||
DLT_OPENFLOW = 0x10b
|
||||
DLT_PCI_EXP = 0x7d
|
||||
DLT_PFLOG = 0x75
|
||||
DLT_PFSYNC = 0x79
|
||||
DLT_PKTAP = 0x102
|
||||
DLT_PPI = 0xc0
|
||||
DLT_PPP = 0x9
|
||||
DLT_PPP_BSDOS = 0x10
|
||||
DLT_PPP_BSDOS = 0xe
|
||||
DLT_PPP_ETHER = 0x33
|
||||
DLT_PPP_PPPD = 0xa6
|
||||
DLT_PPP_SERIAL = 0x32
|
||||
|
@ -496,19 +525,25 @@ const (
|
|||
DLT_PRONET = 0x4
|
||||
DLT_RAIF1 = 0xc6
|
||||
DLT_RAW = 0xc
|
||||
DLT_RDS = 0x109
|
||||
DLT_REDBACK_SMARTEDGE = 0x20
|
||||
DLT_RIO = 0x7c
|
||||
DLT_RTAC_SERIAL = 0xfa
|
||||
DLT_SCCP = 0x8e
|
||||
DLT_SCTP = 0xf8
|
||||
DLT_SDLC = 0x10c
|
||||
DLT_SITA = 0xc4
|
||||
DLT_SLIP = 0x8
|
||||
DLT_SLIP_BSDOS = 0xf
|
||||
DLT_SLIP_BSDOS = 0xd
|
||||
DLT_STANAG_5066_D_PDU = 0xed
|
||||
DLT_SUNATM = 0x7b
|
||||
DLT_SYMANTEC_FIREWALL = 0x63
|
||||
DLT_TI_LLN_SNIFFER = 0x10d
|
||||
DLT_TZSP = 0x80
|
||||
DLT_USB = 0xba
|
||||
DLT_USBPCAP = 0xf9
|
||||
DLT_USB_DARWIN = 0x10a
|
||||
DLT_USB_FREEBSD = 0xba
|
||||
DLT_USB_LINUX = 0xbd
|
||||
DLT_USB_LINUX_MMAPPED = 0xdc
|
||||
DLT_USER0 = 0x93
|
||||
|
@ -527,10 +562,14 @@ const (
|
|||
DLT_USER7 = 0x9a
|
||||
DLT_USER8 = 0x9b
|
||||
DLT_USER9 = 0x9c
|
||||
DLT_VSOCK = 0x10f
|
||||
DLT_WATTSTOPPER_DLM = 0x107
|
||||
DLT_WIHART = 0xdf
|
||||
DLT_WIRESHARK_UPPER_PDU = 0xfc
|
||||
DLT_X2E_SERIAL = 0xd5
|
||||
DLT_X2E_XORAYA = 0xd6
|
||||
DLT_ZWAVE_R1_R2 = 0x105
|
||||
DLT_ZWAVE_R3 = 0x106
|
||||
DT_BLK = 0x6
|
||||
DT_CHR = 0x2
|
||||
DT_DIR = 0x4
|
||||
|
@ -548,6 +587,7 @@ const (
|
|||
ECHONL = 0x10
|
||||
ECHOPRT = 0x20
|
||||
EVFILT_AIO = -0x3
|
||||
EVFILT_EMPTY = -0xd
|
||||
EVFILT_FS = -0x9
|
||||
EVFILT_LIO = -0xa
|
||||
EVFILT_PROC = -0x5
|
||||
|
@ -555,11 +595,12 @@ const (
|
|||
EVFILT_READ = -0x1
|
||||
EVFILT_SENDFILE = -0xc
|
||||
EVFILT_SIGNAL = -0x6
|
||||
EVFILT_SYSCOUNT = 0xc
|
||||
EVFILT_SYSCOUNT = 0xd
|
||||
EVFILT_TIMER = -0x7
|
||||
EVFILT_USER = -0xb
|
||||
EVFILT_VNODE = -0x4
|
||||
EVFILT_WRITE = -0x2
|
||||
EVNAMEMAP_NAME_SIZE = 0x40
|
||||
EV_ADD = 0x1
|
||||
EV_CLEAR = 0x20
|
||||
EV_DELETE = 0x2
|
||||
|
@ -576,6 +617,7 @@ const (
|
|||
EV_RECEIPT = 0x40
|
||||
EV_SYSFLAGS = 0xf000
|
||||
EXTA = 0x4b00
|
||||
EXTATTR_MAXNAMELEN = 0xff
|
||||
EXTATTR_NAMESPACE_EMPTY = 0x0
|
||||
EXTATTR_NAMESPACE_SYSTEM = 0x2
|
||||
EXTATTR_NAMESPACE_USER = 0x1
|
||||
|
@ -617,6 +659,7 @@ const (
|
|||
IEXTEN = 0x400
|
||||
IFAN_ARRIVAL = 0x0
|
||||
IFAN_DEPARTURE = 0x1
|
||||
IFCAP_WOL_MAGIC = 0x2000
|
||||
IFF_ALLMULTI = 0x200
|
||||
IFF_ALTPHYS = 0x4000
|
||||
IFF_BROADCAST = 0x2
|
||||
|
@ -633,6 +676,7 @@ const (
|
|||
IFF_MONITOR = 0x40000
|
||||
IFF_MULTICAST = 0x8000
|
||||
IFF_NOARP = 0x80
|
||||
IFF_NOGROUP = 0x800000
|
||||
IFF_OACTIVE = 0x400
|
||||
IFF_POINTOPOINT = 0x10
|
||||
IFF_PPROMISC = 0x20000
|
||||
|
@ -807,6 +851,7 @@ const (
|
|||
IPV6_DSTOPTS = 0x32
|
||||
IPV6_FLOWID = 0x43
|
||||
IPV6_FLOWINFO_MASK = 0xffffff0f
|
||||
IPV6_FLOWLABEL_LEN = 0x14
|
||||
IPV6_FLOWLABEL_MASK = 0xffff0f00
|
||||
IPV6_FLOWTYPE = 0x44
|
||||
IPV6_FRAGTTL = 0x78
|
||||
|
@ -827,13 +872,13 @@ const (
|
|||
IPV6_MAX_GROUP_SRC_FILTER = 0x200
|
||||
IPV6_MAX_MEMBERSHIPS = 0xfff
|
||||
IPV6_MAX_SOCK_SRC_FILTER = 0x80
|
||||
IPV6_MIN_MEMBERSHIPS = 0x1f
|
||||
IPV6_MMTU = 0x500
|
||||
IPV6_MSFILTER = 0x4a
|
||||
IPV6_MULTICAST_HOPS = 0xa
|
||||
IPV6_MULTICAST_IF = 0x9
|
||||
IPV6_MULTICAST_LOOP = 0xb
|
||||
IPV6_NEXTHOP = 0x30
|
||||
IPV6_ORIGDSTADDR = 0x48
|
||||
IPV6_PATHMTU = 0x2c
|
||||
IPV6_PKTINFO = 0x2e
|
||||
IPV6_PORTRANGE = 0xe
|
||||
|
@ -845,6 +890,7 @@ const (
|
|||
IPV6_RECVFLOWID = 0x46
|
||||
IPV6_RECVHOPLIMIT = 0x25
|
||||
IPV6_RECVHOPOPTS = 0x27
|
||||
IPV6_RECVORIGDSTADDR = 0x48
|
||||
IPV6_RECVPATHMTU = 0x2b
|
||||
IPV6_RECVPKTINFO = 0x24
|
||||
IPV6_RECVRSSBUCKETID = 0x47
|
||||
|
@ -905,10 +951,8 @@ const (
|
|||
IP_MAX_MEMBERSHIPS = 0xfff
|
||||
IP_MAX_SOCK_MUTE_FILTER = 0x80
|
||||
IP_MAX_SOCK_SRC_FILTER = 0x80
|
||||
IP_MAX_SOURCE_FILTER = 0x400
|
||||
IP_MF = 0x2000
|
||||
IP_MINTTL = 0x42
|
||||
IP_MIN_MEMBERSHIPS = 0x1f
|
||||
IP_MSFILTER = 0x4a
|
||||
IP_MSS = 0x240
|
||||
IP_MULTICAST_IF = 0x9
|
||||
|
@ -918,6 +962,7 @@ const (
|
|||
IP_OFFMASK = 0x1fff
|
||||
IP_ONESBCAST = 0x17
|
||||
IP_OPTIONS = 0x1
|
||||
IP_ORIGDSTADDR = 0x1b
|
||||
IP_PORTRANGE = 0x13
|
||||
IP_PORTRANGE_DEFAULT = 0x0
|
||||
IP_PORTRANGE_HIGH = 0x1
|
||||
|
@ -926,6 +971,7 @@ const (
|
|||
IP_RECVFLOWID = 0x5d
|
||||
IP_RECVIF = 0x14
|
||||
IP_RECVOPTS = 0x5
|
||||
IP_RECVORIGDSTADDR = 0x1b
|
||||
IP_RECVRETOPTS = 0x6
|
||||
IP_RECVRSSBUCKETID = 0x5e
|
||||
IP_RECVTOS = 0x44
|
||||
|
@ -976,6 +1022,7 @@ const (
|
|||
MAP_EXCL = 0x4000
|
||||
MAP_FILE = 0x0
|
||||
MAP_FIXED = 0x10
|
||||
MAP_GUARD = 0x2000
|
||||
MAP_HASSEMAPHORE = 0x200
|
||||
MAP_NOCORE = 0x20000
|
||||
MAP_NOSYNC = 0x800
|
||||
|
@ -987,6 +1034,15 @@ const (
|
|||
MAP_RESERVED0100 = 0x100
|
||||
MAP_SHARED = 0x1
|
||||
MAP_STACK = 0x400
|
||||
MCAST_BLOCK_SOURCE = 0x54
|
||||
MCAST_EXCLUDE = 0x2
|
||||
MCAST_INCLUDE = 0x1
|
||||
MCAST_JOIN_GROUP = 0x50
|
||||
MCAST_JOIN_SOURCE_GROUP = 0x52
|
||||
MCAST_LEAVE_GROUP = 0x51
|
||||
MCAST_LEAVE_SOURCE_GROUP = 0x53
|
||||
MCAST_UNBLOCK_SOURCE = 0x55
|
||||
MCAST_UNDEFINED = 0x0
|
||||
MCL_CURRENT = 0x1
|
||||
MCL_FUTURE = 0x2
|
||||
MNT_ACLS = 0x8000000
|
||||
|
@ -1027,10 +1083,12 @@ const (
|
|||
MNT_SUSPEND = 0x4
|
||||
MNT_SYNCHRONOUS = 0x2
|
||||
MNT_UNION = 0x20
|
||||
MNT_UNTRUSTED = 0x800000000
|
||||
MNT_UPDATE = 0x10000
|
||||
MNT_UPDATEMASK = 0x2d8d0807e
|
||||
MNT_UPDATEMASK = 0xad8d0807e
|
||||
MNT_USER = 0x8000
|
||||
MNT_VISFLAGMASK = 0x3fef0ffff
|
||||
MNT_VERIFIED = 0x400000000
|
||||
MNT_VISFLAGMASK = 0xffef0ffff
|
||||
MNT_WAIT = 0x1
|
||||
MSG_CMSG_CLOEXEC = 0x40000
|
||||
MSG_COMPAT = 0x8000
|
||||
|
@ -1059,6 +1117,7 @@ const (
|
|||
NFDBITS = 0x40
|
||||
NOFLSH = 0x80000000
|
||||
NOKERNINFO = 0x2000000
|
||||
NOTE_ABSTIME = 0x10
|
||||
NOTE_ATTRIB = 0x8
|
||||
NOTE_CHILD = 0x4
|
||||
NOTE_CLOSE = 0x100
|
||||
|
@ -1213,7 +1272,6 @@ const (
|
|||
RTV_WEIGHT = 0x100
|
||||
RT_ALL_FIBS = -0x1
|
||||
RT_BLACKHOLE = 0x40
|
||||
RT_CACHING_CONTEXT = 0x1
|
||||
RT_DEFAULT_FIB = 0x0
|
||||
RT_HAS_GW = 0x80
|
||||
RT_HAS_HEADER = 0x10
|
||||
|
@ -1223,15 +1281,17 @@ const (
|
|||
RT_LLE_CACHE = 0x100
|
||||
RT_MAY_LOOP = 0x8
|
||||
RT_MAY_LOOP_BIT = 0x3
|
||||
RT_NORTREF = 0x2
|
||||
RT_REJECT = 0x20
|
||||
RUSAGE_CHILDREN = -0x1
|
||||
RUSAGE_SELF = 0x0
|
||||
RUSAGE_THREAD = 0x1
|
||||
SCM_BINTIME = 0x4
|
||||
SCM_CREDS = 0x3
|
||||
SCM_MONOTONIC = 0x6
|
||||
SCM_REALTIME = 0x5
|
||||
SCM_RIGHTS = 0x1
|
||||
SCM_TIMESTAMP = 0x2
|
||||
SCM_TIME_INFO = 0x7
|
||||
SHUT_RD = 0x0
|
||||
SHUT_RDWR = 0x2
|
||||
SHUT_WR = 0x1
|
||||
|
@ -1247,6 +1307,7 @@ const (
|
|||
SIOCGETSGCNT = 0xc0207210
|
||||
SIOCGETVIFCNT = 0xc028720f
|
||||
SIOCGHIWAT = 0x40047301
|
||||
SIOCGHWADDR = 0xc020693e
|
||||
SIOCGI2C = 0xc020693d
|
||||
SIOCGIFADDR = 0xc0206921
|
||||
SIOCGIFBRDADDR = 0xc0206923
|
||||
|
@ -1268,8 +1329,11 @@ const (
|
|||
SIOCGIFPDSTADDR = 0xc0206948
|
||||
SIOCGIFPHYS = 0xc0206935
|
||||
SIOCGIFPSRCADDR = 0xc0206947
|
||||
SIOCGIFRSSHASH = 0xc0186997
|
||||
SIOCGIFRSSKEY = 0xc0946996
|
||||
SIOCGIFSTATUS = 0xc331693b
|
||||
SIOCGIFXMEDIA = 0xc030698b
|
||||
SIOCGLANPCP = 0xc0206998
|
||||
SIOCGLOWAT = 0x40047303
|
||||
SIOCGPGRP = 0x40047309
|
||||
SIOCGPRIVATE_0 = 0xc0206950
|
||||
|
@ -1300,6 +1364,7 @@ const (
|
|||
SIOCSIFPHYS = 0x80206936
|
||||
SIOCSIFRVNET = 0xc020695b
|
||||
SIOCSIFVNET = 0xc020695a
|
||||
SIOCSLANPCP = 0x80206999
|
||||
SIOCSLOWAT = 0x80047302
|
||||
SIOCSPGRP = 0x80047308
|
||||
SIOCSTUNFIB = 0x8020695f
|
||||
|
@ -1318,6 +1383,7 @@ const (
|
|||
SO_BINTIME = 0x2000
|
||||
SO_BROADCAST = 0x20
|
||||
SO_DEBUG = 0x1
|
||||
SO_DOMAIN = 0x1019
|
||||
SO_DONTROUTE = 0x10
|
||||
SO_ERROR = 0x1007
|
||||
SO_KEEPALIVE = 0x8
|
||||
|
@ -1326,6 +1392,7 @@ const (
|
|||
SO_LISTENINCQLEN = 0x1013
|
||||
SO_LISTENQLEN = 0x1012
|
||||
SO_LISTENQLIMIT = 0x1011
|
||||
SO_MAX_PACING_RATE = 0x1018
|
||||
SO_NOSIGPIPE = 0x800
|
||||
SO_NO_DDP = 0x8000
|
||||
SO_NO_OFFLOAD = 0x4000
|
||||
|
@ -1338,11 +1405,19 @@ const (
|
|||
SO_RCVTIMEO = 0x1006
|
||||
SO_REUSEADDR = 0x4
|
||||
SO_REUSEPORT = 0x200
|
||||
SO_REUSEPORT_LB = 0x10000
|
||||
SO_SETFIB = 0x1014
|
||||
SO_SNDBUF = 0x1001
|
||||
SO_SNDLOWAT = 0x1003
|
||||
SO_SNDTIMEO = 0x1005
|
||||
SO_TIMESTAMP = 0x400
|
||||
SO_TS_BINTIME = 0x1
|
||||
SO_TS_CLOCK = 0x1017
|
||||
SO_TS_CLOCK_MAX = 0x3
|
||||
SO_TS_DEFAULT = 0x0
|
||||
SO_TS_MONOTONIC = 0x3
|
||||
SO_TS_REALTIME = 0x2
|
||||
SO_TS_REALTIME_MICRO = 0x0
|
||||
SO_TYPE = 0x1008
|
||||
SO_USELOOPBACK = 0x40
|
||||
SO_USER_COOKIE = 0x1015
|
||||
|
@ -1386,10 +1461,45 @@ const (
|
|||
TCOFLUSH = 0x2
|
||||
TCOOFF = 0x1
|
||||
TCOON = 0x2
|
||||
TCP_BBR_ACK_COMP_ALG = 0x448
|
||||
TCP_BBR_DRAIN_INC_EXTRA = 0x43c
|
||||
TCP_BBR_DRAIN_PG = 0x42e
|
||||
TCP_BBR_EXTRA_GAIN = 0x449
|
||||
TCP_BBR_IWINTSO = 0x42b
|
||||
TCP_BBR_LOWGAIN_FD = 0x436
|
||||
TCP_BBR_LOWGAIN_HALF = 0x435
|
||||
TCP_BBR_LOWGAIN_THRESH = 0x434
|
||||
TCP_BBR_MAX_RTO = 0x439
|
||||
TCP_BBR_MIN_RTO = 0x438
|
||||
TCP_BBR_ONE_RETRAN = 0x431
|
||||
TCP_BBR_PACE_CROSS = 0x442
|
||||
TCP_BBR_PACE_DEL_TAR = 0x43f
|
||||
TCP_BBR_PACE_PER_SEC = 0x43e
|
||||
TCP_BBR_PACE_SEG_MAX = 0x440
|
||||
TCP_BBR_PACE_SEG_MIN = 0x441
|
||||
TCP_BBR_PROBE_RTT_GAIN = 0x44d
|
||||
TCP_BBR_PROBE_RTT_INT = 0x430
|
||||
TCP_BBR_PROBE_RTT_LEN = 0x44e
|
||||
TCP_BBR_RACK_RTT_USE = 0x44a
|
||||
TCP_BBR_RECFORCE = 0x42c
|
||||
TCP_BBR_REC_OVER_HPTS = 0x43a
|
||||
TCP_BBR_RETRAN_WTSO = 0x44b
|
||||
TCP_BBR_RWND_IS_APP = 0x42f
|
||||
TCP_BBR_STARTUP_EXIT_EPOCH = 0x43d
|
||||
TCP_BBR_STARTUP_LOSS_EXIT = 0x432
|
||||
TCP_BBR_STARTUP_PG = 0x42d
|
||||
TCP_BBR_UNLIMITED = 0x43b
|
||||
TCP_BBR_USEDEL_RATE = 0x437
|
||||
TCP_BBR_USE_LOWGAIN = 0x433
|
||||
TCP_CA_NAME_MAX = 0x10
|
||||
TCP_CCALGOOPT = 0x41
|
||||
TCP_CONGESTION = 0x40
|
||||
TCP_DATA_AFTER_CLOSE = 0x44c
|
||||
TCP_DELACK = 0x48
|
||||
TCP_FASTOPEN = 0x401
|
||||
TCP_FASTOPEN_MAX_COOKIE_LEN = 0x10
|
||||
TCP_FASTOPEN_MIN_COOKIE_LEN = 0x4
|
||||
TCP_FASTOPEN_PSK_LEN = 0x10
|
||||
TCP_FUNCTION_BLK = 0x2000
|
||||
TCP_FUNCTION_NAME_LEN_MAX = 0x20
|
||||
TCP_INFO = 0x20
|
||||
|
@ -1397,6 +1507,12 @@ const (
|
|||
TCP_KEEPIDLE = 0x100
|
||||
TCP_KEEPINIT = 0x80
|
||||
TCP_KEEPINTVL = 0x200
|
||||
TCP_LOG = 0x22
|
||||
TCP_LOGBUF = 0x23
|
||||
TCP_LOGDUMP = 0x25
|
||||
TCP_LOGDUMPID = 0x26
|
||||
TCP_LOGID = 0x24
|
||||
TCP_LOG_ID_LEN = 0x40
|
||||
TCP_MAXBURST = 0x4
|
||||
TCP_MAXHLEN = 0x3c
|
||||
TCP_MAXOLEN = 0x28
|
||||
|
@ -1412,8 +1528,30 @@ const (
|
|||
TCP_NOPUSH = 0x4
|
||||
TCP_PCAP_IN = 0x1000
|
||||
TCP_PCAP_OUT = 0x800
|
||||
TCP_RACK_EARLY_RECOV = 0x423
|
||||
TCP_RACK_EARLY_SEG = 0x424
|
||||
TCP_RACK_IDLE_REDUCE_HIGH = 0x444
|
||||
TCP_RACK_MIN_PACE = 0x445
|
||||
TCP_RACK_MIN_PACE_SEG = 0x446
|
||||
TCP_RACK_MIN_TO = 0x422
|
||||
TCP_RACK_PACE_ALWAYS = 0x41f
|
||||
TCP_RACK_PACE_MAX_SEG = 0x41e
|
||||
TCP_RACK_PACE_REDUCE = 0x41d
|
||||
TCP_RACK_PKT_DELAY = 0x428
|
||||
TCP_RACK_PROP = 0x41b
|
||||
TCP_RACK_PROP_RATE = 0x420
|
||||
TCP_RACK_PRR_SENDALOT = 0x421
|
||||
TCP_RACK_REORD_FADE = 0x426
|
||||
TCP_RACK_REORD_THRESH = 0x425
|
||||
TCP_RACK_SESS_CWV = 0x42a
|
||||
TCP_RACK_TLP_INC_VAR = 0x429
|
||||
TCP_RACK_TLP_REDUCE = 0x41c
|
||||
TCP_RACK_TLP_THRESH = 0x427
|
||||
TCP_RACK_TLP_USE = 0x447
|
||||
TCP_VENDOR = 0x80000000
|
||||
TCSAFLUSH = 0x2
|
||||
TIMER_ABSTIME = 0x1
|
||||
TIMER_RELTIME = 0x0
|
||||
TIOCCBRK = 0x2000747a
|
||||
TIOCCDTR = 0x20007478
|
||||
TIOCCONS = 0x80047462
|
||||
|
@ -1477,6 +1615,8 @@ const (
|
|||
TIOCTIMESTAMP = 0x40107459
|
||||
TIOCUCNTL = 0x80047466
|
||||
TOSTOP = 0x400000
|
||||
UTIME_NOW = -0x1
|
||||
UTIME_OMIT = -0x2
|
||||
VDISCARD = 0xf
|
||||
VDSUSP = 0xb
|
||||
VEOF = 0x0
|
||||
|
@ -1488,6 +1628,7 @@ const (
|
|||
VKILL = 0x5
|
||||
VLNEXT = 0xe
|
||||
VMIN = 0x10
|
||||
VM_BCACHE_SIZE_MAX = 0x19000000
|
||||
VQUIT = 0x9
|
||||
VREPRINT = 0x6
|
||||
VSTART = 0xc
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -158,6 +158,12 @@ const (
|
|||
CLONE_SIGHAND = 0x800
|
||||
CLONE_VFORK = 0x4000
|
||||
CLONE_VM = 0x100
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x10000
|
||||
CS5 = 0x0
|
||||
|
|
|
@ -158,6 +158,12 @@ const (
|
|||
CLONE_SIGHAND = 0x800
|
||||
CLONE_VFORK = 0x4000
|
||||
CLONE_VM = 0x100
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x10000
|
||||
CS5 = 0x0
|
||||
|
|
|
@ -150,6 +150,12 @@ const (
|
|||
BRKINT = 0x2
|
||||
CFLUSH = 0xf
|
||||
CLOCAL = 0x8000
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x10000
|
||||
CS5 = 0x0
|
||||
|
|
|
@ -158,6 +158,12 @@ const (
|
|||
CLONE_SIGHAND = 0x800
|
||||
CLONE_VFORK = 0x4000
|
||||
CLONE_VM = 0x100
|
||||
CPUSTATES = 0x5
|
||||
CP_IDLE = 0x4
|
||||
CP_INTR = 0x3
|
||||
CP_NICE = 0x1
|
||||
CP_SYS = 0x2
|
||||
CP_USER = 0x0
|
||||
CREAD = 0x800
|
||||
CRTSCTS = 0x10000
|
||||
CS5 = 0x0
|
||||
|
|
|
@ -146,6 +146,13 @@ const (
|
|||
BRKINT = 0x2
|
||||
CFLUSH = 0xf
|
||||
CLOCAL = 0x8000
|
||||
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
|
||||
|
|
|
@ -153,6 +153,13 @@ const (
|
|||
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
|
||||
|
|
|
@ -146,6 +146,13 @@ const (
|
|||
BRKINT = 0x2
|
||||
CFLUSH = 0xf
|
||||
CLOCAL = 0x8000
|
||||
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
|
||||
|
|
|
@ -156,6 +156,13 @@ const (
|
|||
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
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
// Code generated by linux/mkall.go generatePtracePair(386, amd64). DO NOT EDIT.
|
||||
|
||||
// +build linux
|
||||
// +build 386 amd64
|
||||
|
||||
package unix
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// PtraceRegs386 is the registers used by 386 binaries.
|
||||
type PtraceRegs386 struct {
|
||||
Ebx int32
|
||||
Ecx int32
|
||||
Edx int32
|
||||
Esi int32
|
||||
Edi int32
|
||||
Ebp int32
|
||||
Eax int32
|
||||
Xds int32
|
||||
Xes int32
|
||||
Xfs int32
|
||||
Xgs int32
|
||||
Orig_eax int32
|
||||
Eip int32
|
||||
Xcs int32
|
||||
Eflags int32
|
||||
Esp int32
|
||||
Xss int32
|
||||
}
|
||||
|
||||
// PtraceGetRegs386 fetches the registers used by 386 binaries.
|
||||
func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegs386 sets the registers used by 386 binaries.
|
||||
func PtraceSetRegs386(pid int, regs *PtraceRegs386) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
||||
|
||||
// PtraceRegsAmd64 is the registers used by amd64 binaries.
|
||||
type PtraceRegsAmd64 struct {
|
||||
R15 uint64
|
||||
R14 uint64
|
||||
R13 uint64
|
||||
R12 uint64
|
||||
Rbp uint64
|
||||
Rbx uint64
|
||||
R11 uint64
|
||||
R10 uint64
|
||||
R9 uint64
|
||||
R8 uint64
|
||||
Rax uint64
|
||||
Rcx uint64
|
||||
Rdx uint64
|
||||
Rsi uint64
|
||||
Rdi uint64
|
||||
Orig_rax uint64
|
||||
Rip uint64
|
||||
Cs uint64
|
||||
Eflags uint64
|
||||
Rsp uint64
|
||||
Ss uint64
|
||||
Fs_base uint64
|
||||
Gs_base uint64
|
||||
Ds uint64
|
||||
Es uint64
|
||||
Fs uint64
|
||||
Gs uint64
|
||||
}
|
||||
|
||||
// PtraceGetRegsAmd64 fetches the registers used by amd64 binaries.
|
||||
func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsAmd64 sets the registers used by amd64 binaries.
|
||||
func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
// Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT.
|
||||
|
||||
// +build linux
|
||||
// +build arm arm64
|
||||
|
||||
package unix
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// PtraceRegsArm is the registers used by arm binaries.
|
||||
type PtraceRegsArm struct {
|
||||
Uregs [18]uint32
|
||||
}
|
||||
|
||||
// PtraceGetRegsArm fetches the registers used by arm binaries.
|
||||
func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsArm sets the registers used by arm binaries.
|
||||
func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
||||
|
||||
// PtraceRegsArm64 is the registers used by arm64 binaries.
|
||||
type PtraceRegsArm64 struct {
|
||||
Regs [31]uint64
|
||||
Sp uint64
|
||||
Pc uint64
|
||||
Pstate uint64
|
||||
}
|
||||
|
||||
// PtraceGetRegsArm64 fetches the registers used by arm64 binaries.
|
||||
func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsArm64 sets the registers used by arm64 binaries.
|
||||
func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
// Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT.
|
||||
|
||||
// +build linux
|
||||
// +build mips mips64
|
||||
|
||||
package unix
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// PtraceRegsMips is the registers used by mips binaries.
|
||||
type PtraceRegsMips struct {
|
||||
Regs [32]uint64
|
||||
Lo uint64
|
||||
Hi uint64
|
||||
Epc uint64
|
||||
Badvaddr uint64
|
||||
Status uint64
|
||||
Cause uint64
|
||||
}
|
||||
|
||||
// PtraceGetRegsMips fetches the registers used by mips binaries.
|
||||
func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsMips sets the registers used by mips binaries.
|
||||
func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
||||
|
||||
// PtraceRegsMips64 is the registers used by mips64 binaries.
|
||||
type PtraceRegsMips64 struct {
|
||||
Regs [32]uint64
|
||||
Lo uint64
|
||||
Hi uint64
|
||||
Epc uint64
|
||||
Badvaddr uint64
|
||||
Status uint64
|
||||
Cause uint64
|
||||
}
|
||||
|
||||
// PtraceGetRegsMips64 fetches the registers used by mips64 binaries.
|
||||
func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsMips64 sets the registers used by mips64 binaries.
|
||||
func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
// Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT.
|
||||
|
||||
// +build linux
|
||||
// +build mipsle mips64le
|
||||
|
||||
package unix
|
||||
|
||||
import "unsafe"
|
||||
|
||||
// PtraceRegsMipsle is the registers used by mipsle binaries.
|
||||
type PtraceRegsMipsle struct {
|
||||
Regs [32]uint64
|
||||
Lo uint64
|
||||
Hi uint64
|
||||
Epc uint64
|
||||
Badvaddr uint64
|
||||
Status uint64
|
||||
Cause uint64
|
||||
}
|
||||
|
||||
// PtraceGetRegsMipsle fetches the registers used by mipsle binaries.
|
||||
func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsMipsle sets the registers used by mipsle binaries.
|
||||
func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
||||
|
||||
// PtraceRegsMips64le is the registers used by mips64le binaries.
|
||||
type PtraceRegsMips64le struct {
|
||||
Regs [32]uint64
|
||||
Lo uint64
|
||||
Hi uint64
|
||||
Epc uint64
|
||||
Badvaddr uint64
|
||||
Status uint64
|
||||
Cause uint64
|
||||
}
|
||||
|
||||
// PtraceGetRegsMips64le fetches the registers used by mips64le binaries.
|
||||
func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error {
|
||||
return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout)))
|
||||
}
|
||||
|
||||
// PtraceSetRegsMips64le sets the registers used by mips64le binaries.
|
||||
func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error {
|
||||
return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs)))
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -339,22 +339,6 @@ func libc_futimes_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
||||
n = int(r0)
|
||||
|
@ -727,6 +711,22 @@ func libc_setattrlist_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
|
||||
if e1 != 0 {
|
||||
|
@ -1376,6 +1376,21 @@ func libc_getsid_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Gettimeofday(tp *Timeval) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getuid() (uid int) {
|
||||
r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
|
||||
uid = int(r0)
|
||||
|
@ -2357,23 +2372,6 @@ func libc_ptrace_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
sec = int32(r0)
|
||||
usec = int32(r1)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
||||
_, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_poll(SB)
|
||||
TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -84,6 +82,8 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_flistxattr(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -106,6 +106,8 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_clock_gettime(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -339,22 +339,6 @@ func libc_futimes_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
||||
n = int(r0)
|
||||
|
@ -727,6 +711,22 @@ func libc_setattrlist_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
|
||||
if e1 != 0 {
|
||||
|
@ -1376,6 +1376,21 @@ func libc_getsid_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Gettimeofday(tp *Timeval) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getuid() (uid int) {
|
||||
r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
|
||||
uid = int(r0)
|
||||
|
@ -2357,23 +2372,6 @@ func libc_ptrace_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
sec = int64(r0)
|
||||
usec = int32(r1)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
||||
_, _, e1 := syscall_syscall(funcPC(libc_fstat64_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_poll(SB)
|
||||
TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -84,6 +82,8 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_flistxattr(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -339,22 +339,6 @@ func libc_futimes_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
||||
n = int(r0)
|
||||
|
@ -727,6 +711,22 @@ func libc_setattrlist_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
|
||||
if e1 != 0 {
|
||||
|
@ -1376,6 +1376,21 @@ func libc_getsid_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Gettimeofday(tp *Timeval) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getuid() (uid int) {
|
||||
r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
|
||||
uid = int(r0)
|
||||
|
@ -2342,23 +2357,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func gettimeofday(tp *Timeval) (sec int32, usec int32, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
sec = int32(r0)
|
||||
usec = int32(r1)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
||||
_, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_poll(SB)
|
||||
TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -84,10 +82,14 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_flistxattr(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_ioctl(SB)
|
||||
TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sysctl(SB)
|
||||
TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_sendfile(SB)
|
||||
TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -339,22 +339,6 @@ func libc_futimes_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
|
||||
n = int(r0)
|
||||
|
@ -727,6 +711,22 @@ func libc_setattrlist_trampoline()
|
|||
|
||||
// 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_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg))
|
||||
val = int(r0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_fcntl_trampoline()
|
||||
|
||||
//go:linkname libc_fcntl libc_fcntl
|
||||
//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// 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_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix))
|
||||
if e1 != 0 {
|
||||
|
@ -1376,6 +1376,21 @@ func libc_getsid_trampoline()
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Gettimeofday(tp *Timeval) (err error) {
|
||||
_, _, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Getuid() (uid int) {
|
||||
r0, _, _ := syscall_rawSyscall(funcPC(libc_getuid_trampoline), 0, 0, 0)
|
||||
uid = int(r0)
|
||||
|
@ -2342,23 +2357,6 @@ func writelen(fd int, buf *byte, nbuf int) (n int, err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func gettimeofday(tp *Timeval) (sec int64, usec int32, err error) {
|
||||
r0, r1, e1 := syscall_rawSyscall(funcPC(libc_gettimeofday_trampoline), uintptr(unsafe.Pointer(tp)), 0, 0)
|
||||
sec = int64(r0)
|
||||
usec = int32(r1)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func libc_gettimeofday_trampoline()
|
||||
|
||||
//go:linkname libc_gettimeofday libc_gettimeofday
|
||||
//go:cgo_import_dynamic libc_gettimeofday gettimeofday "/usr/lib/libSystem.B.dylib"
|
||||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func Fstat(fd int, stat *Stat_t) (err error) {
|
||||
_, _, e1 := syscall_syscall(funcPC(libc_fstat_trampoline), uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -44,8 +44,6 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_utimes(SB)
|
||||
TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_futimes(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_poll(SB)
|
||||
TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -84,6 +82,8 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_flistxattr(SB)
|
||||
TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_setattrlist(SB)
|
||||
TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_fcntl(SB)
|
||||
TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_kill(SB)
|
||||
TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0
|
||||
|
@ -106,6 +106,8 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0
|
|||
JMP libc_chown(SB)
|
||||
TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_chroot(SB)
|
||||
TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_clock_gettime(SB)
|
||||
TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0
|
||||
JMP libc_close(SB)
|
||||
TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0
|
||||
|
|
|
@ -255,17 +255,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|||
|
||||
// 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 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)
|
||||
|
|
|
@ -214,22 +214,6 @@ func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, ne
|
|||
|
||||
// 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 utimes(path string, timeval *[2]Timeval) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -255,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|||
|
||||
// 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 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)
|
||||
|
@ -387,16 +360,6 @@ func pipe2(p *[2]_C_int, flags int) (err error) {
|
|||
|
||||
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
|
||||
|
||||
func ptrace(request int, pid int, addr uintptr, data int) (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 Getcwd(buf []byte) (n int, err error) {
|
||||
var _p0 unsafe.Pointer
|
||||
if len(buf) > 0 {
|
||||
|
@ -424,6 +387,32 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// 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 ptrace(request int, pid int, addr uintptr, data int) (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 Access(path string, mode uint32) (err error) {
|
||||
var _p0 *byte
|
||||
_p0, err = BytePtrFromString(path)
|
||||
|
@ -1363,7 +1352,7 @@ func mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error)
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
_, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
|
||||
_, _, e1 := Syscall6(SYS_MKNODAT_FREEBSD12, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), uintptr(dev>>32), 0)
|
||||
if e1 != 0 {
|
||||
err = errnoErr(e1)
|
||||
}
|
||||
|
|
|
@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|||
|
||||
// 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 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)
|
||||
|
@ -361,22 +350,6 @@ func Munlockall() (err error) {
|
|||
|
||||
// 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 pipe2(p *[2]_C_int, flags int) (err error) {
|
||||
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
|
@ -414,6 +387,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// 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 ptrace(request int, pid int, addr uintptr, data int) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
|
@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|||
|
||||
// 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 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)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// go run mksyscall.go -tags freebsd,arm64 -- syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go
|
||||
// go run mksyscall.go -tags freebsd,arm64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm64.go
|
||||
// Code generated by the command above; see README.md. DO NOT EDIT.
|
||||
|
||||
// +build freebsd,arm64
|
||||
|
@ -239,17 +239,6 @@ func futimes(fd int, timeval *[2]Timeval) (err error) {
|
|||
|
||||
// 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 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)
|
||||
|
@ -361,22 +350,6 @@ func Munlockall() (err error) {
|
|||
|
||||
// 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 pipe2(p *[2]_C_int, flags int) (err error) {
|
||||
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
|
||||
if e1 != 0 {
|
||||
|
@ -414,6 +387,22 @@ func ioctl(fd int, req uint, arg uintptr) (err error) {
|
|||
|
||||
// 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 ptrace(request int, pid int, addr uintptr, data int) (err error) {
|
||||
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
|
||||
if e1 != 0 {
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче