updated syscall usage
This commit is contained in:
parent
c9aa60ca28
commit
204aec8135
333 changed files with 12973 additions and 7669 deletions
10
go.mod
10
go.mod
|
|
@ -1,16 +1,18 @@
|
||||||
module git.giftfish.de/ston1th/gowiki
|
module git.giftfish.de/ston1th/gowiki
|
||||||
|
|
||||||
go 1.19
|
go 1.22
|
||||||
|
|
||||||
|
toolchain go1.23.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
git.giftfish.de/ston1th/godrop/v2 v2.1.1
|
git.giftfish.de/ston1th/godrop/v2 v2.2.0
|
||||||
git.giftfish.de/ston1th/jwt/v3 v3.2.0
|
git.giftfish.de/ston1th/jwt/v3 v3.2.0
|
||||||
github.com/blevesearch/bleve v1.0.14
|
github.com/blevesearch/bleve v1.0.14
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/pquerna/otp v1.4.0
|
github.com/pquerna/otp v1.4.0
|
||||||
github.com/russross/blackfriday v1.6.0
|
github.com/russross/blackfriday v1.6.0
|
||||||
github.com/urfave/cli v1.22.12
|
github.com/urfave/cli v1.22.12
|
||||||
go.etcd.io/bbolt v1.3.7
|
go.etcd.io/bbolt v1.3.11
|
||||||
golang.org/x/crypto v0.7.0
|
golang.org/x/crypto v0.7.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -35,6 +37,6 @@ require (
|
||||||
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
github.com/russross/blackfriday/v2 v2.1.0 // indirect
|
||||||
github.com/steveyen/gtreap v0.1.0 // indirect
|
github.com/steveyen/gtreap v0.1.0 // indirect
|
||||||
github.com/willf/bitset v1.1.11 // indirect
|
github.com/willf/bitset v1.1.11 // indirect
|
||||||
golang.org/x/sys v0.6.0 // indirect
|
golang.org/x/sys v0.24.0 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.30.0 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
||||||
14
go.sum
14
go.sum
|
|
@ -1,5 +1,5 @@
|
||||||
git.giftfish.de/ston1th/godrop/v2 v2.1.1 h1:jCzQPFpRImr2N4kz+4lC7wGZJAWGx9pH5X09nUsRQDU=
|
git.giftfish.de/ston1th/godrop/v2 v2.2.0 h1:jdcPJeotiuug3tC4zXvwnauen1Y7kfF9CbFKQbGttYU=
|
||||||
git.giftfish.de/ston1th/godrop/v2 v2.1.1/go.mod h1:DWC4iM+u/bpdJsauL00h0V9tZ97d6Bzi2RGaFKlvZoQ=
|
git.giftfish.de/ston1th/godrop/v2 v2.2.0/go.mod h1:gDAD0cWURkN0cMAjjSKB6a6jqIXvOrY8Th25HdoJAyg=
|
||||||
git.giftfish.de/ston1th/jwt/v3 v3.2.0 h1:V6Lh7OjXn4D3HPd/LoDf7w5N7cyiSXEPAQCIfSVZ05c=
|
git.giftfish.de/ston1th/jwt/v3 v3.2.0 h1:V6Lh7OjXn4D3HPd/LoDf7w5N7cyiSXEPAQCIfSVZ05c=
|
||||||
git.giftfish.de/ston1th/jwt/v3 v3.2.0/go.mod h1:jDALrW7OKeIaqYuMxs3GWyPRnQZmk/R+Lu9p/Em3Ziw=
|
git.giftfish.de/ston1th/jwt/v3 v3.2.0/go.mod h1:jDALrW7OKeIaqYuMxs3GWyPRnQZmk/R+Lu9p/Em3Ziw=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
|
|
@ -139,21 +139,23 @@ github.com/willf/bitset v1.1.11 h1:N7Z7E9UvjW+sGsEl7k/SJrvY2reP1A07MrGuCjIOjRE=
|
||||||
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
|
github.com/willf/bitset v1.1.11/go.mod h1:83CECat5yLh5zVOf4P1ErAgKA5UDvKtgyUABdr3+MjI=
|
||||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ=
|
||||||
go.etcd.io/bbolt v1.3.7 h1:j+zJOnnEjF/kyHlDDgGnVL/AIqIJPq8UoB2GSNfkUfQ=
|
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
|
||||||
go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw=
|
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
|
||||||
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
|
||||||
|
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
|
|
||||||
1
vendor/go.etcd.io/bbolt/.go-version
generated
vendored
Normal file
1
vendor/go.etcd.io/bbolt/.go-version
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
1.22.6
|
||||||
13
vendor/go.etcd.io/bbolt/Makefile
generated
vendored
13
vendor/go.etcd.io/bbolt/Makefile
generated
vendored
|
|
@ -41,6 +41,15 @@ coverage:
|
||||||
TEST_FREELIST_TYPE=array go test -v -timeout 30m \
|
TEST_FREELIST_TYPE=array go test -v -timeout 30m \
|
||||||
-coverprofile cover-freelist-array.out -covermode atomic
|
-coverprofile cover-freelist-array.out -covermode atomic
|
||||||
|
|
||||||
|
BOLT_CMD=bbolt
|
||||||
|
|
||||||
|
build:
|
||||||
|
go build -o bin/${BOLT_CMD} ./cmd/${BOLT_CMD}
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean: # Clean binaries
|
||||||
|
rm -f ./bin/${BOLT_CMD}
|
||||||
|
|
||||||
.PHONY: gofail-enable
|
.PHONY: gofail-enable
|
||||||
gofail-enable: install-gofail
|
gofail-enable: install-gofail
|
||||||
gofail enable .
|
gofail enable .
|
||||||
|
|
@ -61,3 +70,7 @@ test-failpoint:
|
||||||
@echo "[failpoint] array freelist test"
|
@echo "[failpoint] array freelist test"
|
||||||
TEST_FREELIST_TYPE=array go test -v ${TESTFLAGS} -timeout 30m ./tests/failpoint
|
TEST_FREELIST_TYPE=array go test -v ${TESTFLAGS} -timeout 30m ./tests/failpoint
|
||||||
|
|
||||||
|
.PHONY: test-robustness # Running robustness tests requires root permission
|
||||||
|
test-robustness:
|
||||||
|
go test -v ${TESTFLAGS} ./tests/dmflakey -test.root
|
||||||
|
go test -v ${TESTFLAGS} ./tests/robustness -test.root
|
||||||
|
|
|
||||||
23
vendor/go.etcd.io/bbolt/README.md
generated
vendored
23
vendor/go.etcd.io/bbolt/README.md
generated
vendored
|
|
@ -421,10 +421,19 @@ Prev() Move to the previous key.
|
||||||
```
|
```
|
||||||
|
|
||||||
Each of those functions has a return signature of `(key []byte, value []byte)`.
|
Each of those functions has a return signature of `(key []byte, value []byte)`.
|
||||||
When you have iterated to the end of the cursor then `Next()` will return a
|
You must seek to a position using `First()`, `Last()`, or `Seek()` before calling
|
||||||
`nil` key. You must seek to a position using `First()`, `Last()`, or `Seek()`
|
`Next()` or `Prev()`. If you do not seek to a position then these functions will
|
||||||
before calling `Next()` or `Prev()`. If you do not seek to a position then
|
return a `nil` key.
|
||||||
these functions will return a `nil` key.
|
|
||||||
|
When you have iterated to the end of the cursor, then `Next()` will return a
|
||||||
|
`nil` key and the cursor still points to the last element if present. When you
|
||||||
|
have iterated to the beginning of the cursor, then `Prev()` will return a `nil`
|
||||||
|
key and the cursor still points to the first element if present.
|
||||||
|
|
||||||
|
If you remove key/value pairs during iteration, the cursor may automatically
|
||||||
|
move to the next position if present in current node each time removing a key.
|
||||||
|
When you call `c.Next()` after removing a key, it may skip one key/value pair.
|
||||||
|
Refer to [pull/611](https://github.com/etcd-io/bbolt/pull/611) to get more detailed info.
|
||||||
|
|
||||||
During iteration, if the key is non-`nil` but the value is `nil`, that means
|
During iteration, if the key is non-`nil` but the value is `nil`, that means
|
||||||
the key refers to a bucket rather than a value. Use `Bucket.Bucket()` to
|
the key refers to a bucket rather than a value. Use `Bucket.Bucket()` to
|
||||||
|
|
@ -850,6 +859,12 @@ Here are a few things to note when evaluating and using Bolt:
|
||||||
to grow. However, it's important to note that deleting large chunks of data
|
to grow. However, it's important to note that deleting large chunks of data
|
||||||
will not allow you to reclaim that space on disk.
|
will not allow you to reclaim that space on disk.
|
||||||
|
|
||||||
|
* Removing key/values pairs in a bucket during iteration on the bucket using
|
||||||
|
cursor may not work properly. Each time when removing a key/value pair, the
|
||||||
|
cursor may automatically move to the next position if present. When users
|
||||||
|
call `c.Next()` after removing a key, it may skip one key/value pair.
|
||||||
|
Refer to https://github.com/etcd-io/bbolt/pull/611 for more detailed info.
|
||||||
|
|
||||||
For more information on page allocation, [see this comment][page-allocation].
|
For more information on page allocation, [see this comment][page-allocation].
|
||||||
|
|
||||||
[page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638
|
[page-allocation]: https://github.com/boltdb/bolt/issues/308#issuecomment-74811638
|
||||||
|
|
|
||||||
15
vendor/go.etcd.io/bbolt/bolt_openbsd.go
generated
vendored
15
vendor/go.etcd.io/bbolt/bolt_openbsd.go
generated
vendored
|
|
@ -1,22 +1,11 @@
|
||||||
package bbolt
|
package bbolt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"syscall"
|
"golang.org/x/sys/unix"
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
msAsync = 1 << iota // perform asynchronous writes
|
|
||||||
msSync // perform synchronous writes
|
|
||||||
msInvalidate // invalidate cached data
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func msync(db *DB) error {
|
func msync(db *DB) error {
|
||||||
_, _, errno := syscall.Syscall(syscall.SYS_MSYNC, uintptr(unsafe.Pointer(db.data)), uintptr(db.datasz), msInvalidate)
|
return unix.Msync(db.data[:db.datasz], unix.MS_INVALIDATE)
|
||||||
if errno != 0 {
|
|
||||||
return errno
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func fdatasync(db *DB) error {
|
func fdatasync(db *DB) error {
|
||||||
|
|
|
||||||
30
vendor/go.etcd.io/bbolt/bucket.go
generated
vendored
30
vendor/go.etcd.io/bbolt/bucket.go
generated
vendored
|
|
@ -162,12 +162,17 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
|
||||||
return nil, ErrBucketNameRequired
|
return nil, ErrBucketNameRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insert into node.
|
||||||
|
// Tip: Use a new variable `newKey` instead of reusing the existing `key` to prevent
|
||||||
|
// it from being marked as leaking, and accordingly cannot be allocated on stack.
|
||||||
|
newKey := cloneBytes(key)
|
||||||
|
|
||||||
// Move cursor to correct position.
|
// Move cursor to correct position.
|
||||||
c := b.Cursor()
|
c := b.Cursor()
|
||||||
k, _, flags := c.seek(key)
|
k, _, flags := c.seek(newKey)
|
||||||
|
|
||||||
// Return an error if there is an existing key.
|
// Return an error if there is an existing key.
|
||||||
if bytes.Equal(key, k) {
|
if bytes.Equal(newKey, k) {
|
||||||
if (flags & bucketLeafFlag) != 0 {
|
if (flags & bucketLeafFlag) != 0 {
|
||||||
return nil, ErrBucketExists
|
return nil, ErrBucketExists
|
||||||
}
|
}
|
||||||
|
|
@ -182,16 +187,14 @@ func (b *Bucket) CreateBucket(key []byte) (*Bucket, error) {
|
||||||
}
|
}
|
||||||
var value = bucket.write()
|
var value = bucket.write()
|
||||||
|
|
||||||
// Insert into node.
|
c.node().put(newKey, newKey, value, 0, bucketLeafFlag)
|
||||||
key = cloneBytes(key)
|
|
||||||
c.node().put(key, key, value, 0, bucketLeafFlag)
|
|
||||||
|
|
||||||
// Since subbuckets are not allowed on inline buckets, we need to
|
// Since subbuckets are not allowed on inline buckets, we need to
|
||||||
// dereference the inline page, if it exists. This will cause the bucket
|
// dereference the inline page, if it exists. This will cause the bucket
|
||||||
// to be treated as a regular, non-inline bucket for the rest of the tx.
|
// to be treated as a regular, non-inline bucket for the rest of the tx.
|
||||||
b.page = nil
|
b.page = nil
|
||||||
|
|
||||||
return b.Bucket(key), nil
|
return b.Bucket(newKey), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it.
|
// CreateBucketIfNotExists creates a new bucket if it doesn't already exist and returns a reference to it.
|
||||||
|
|
@ -288,18 +291,23 @@ func (b *Bucket) Put(key []byte, value []byte) error {
|
||||||
return ErrValueTooLarge
|
return ErrValueTooLarge
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Insert into node.
|
||||||
|
// Tip: Use a new variable `newKey` instead of reusing the existing `key` to prevent
|
||||||
|
// it from being marked as leaking, and accordingly cannot be allocated on stack.
|
||||||
|
newKey := cloneBytes(key)
|
||||||
|
|
||||||
// Move cursor to correct position.
|
// Move cursor to correct position.
|
||||||
c := b.Cursor()
|
c := b.Cursor()
|
||||||
k, _, flags := c.seek(key)
|
k, _, flags := c.seek(newKey)
|
||||||
|
|
||||||
// Return an error if there is an existing key with a bucket value.
|
// Return an error if there is an existing key with a bucket value.
|
||||||
if bytes.Equal(key, k) && (flags&bucketLeafFlag) != 0 {
|
if bytes.Equal(newKey, k) && (flags&bucketLeafFlag) != 0 {
|
||||||
return ErrIncompatibleValue
|
return ErrIncompatibleValue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert into node.
|
// gofail: var beforeBucketPut struct{}
|
||||||
key = cloneBytes(key)
|
|
||||||
c.node().put(key, key, value, 0, 0)
|
c.node().put(newKey, newKey, value, 0, 0)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
11
vendor/go.etcd.io/bbolt/cursor.go
generated
vendored
11
vendor/go.etcd.io/bbolt/cursor.go
generated
vendored
|
|
@ -71,7 +71,7 @@ func (c *Cursor) Last() (key []byte, value []byte) {
|
||||||
|
|
||||||
// If this is an empty page (calling Delete may result in empty pages)
|
// If this is an empty page (calling Delete may result in empty pages)
|
||||||
// we call prev to find the last page that is not empty
|
// we call prev to find the last page that is not empty
|
||||||
for len(c.stack) > 0 && c.stack[len(c.stack)-1].count() == 0 {
|
for len(c.stack) > 1 && c.stack[len(c.stack)-1].count() == 0 {
|
||||||
c.prev()
|
c.prev()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -254,6 +254,15 @@ func (c *Cursor) prev() (key []byte, value []byte, flags uint32) {
|
||||||
elem.index--
|
elem.index--
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
// If we've hit the beginning, we should stop moving the cursor,
|
||||||
|
// and stay at the first element, so that users can continue to
|
||||||
|
// iterate over the elements in reverse direction by calling `Next`.
|
||||||
|
// We should return nil in such case.
|
||||||
|
// Refer to https://github.com/etcd-io/bbolt/issues/733
|
||||||
|
if len(c.stack) == 1 {
|
||||||
|
c.first()
|
||||||
|
return nil, nil, 0
|
||||||
|
}
|
||||||
c.stack = c.stack[:i]
|
c.stack = c.stack[:i]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
54
vendor/go.etcd.io/bbolt/db.go
generated
vendored
54
vendor/go.etcd.io/bbolt/db.go
generated
vendored
|
|
@ -57,6 +57,12 @@ const (
|
||||||
// All data access is performed through transactions which can be obtained through the DB.
|
// All data access is performed through transactions which can be obtained through the DB.
|
||||||
// All the functions on DB will return a ErrDatabaseNotOpen if accessed before Open() is called.
|
// All the functions on DB will return a ErrDatabaseNotOpen if accessed before Open() is called.
|
||||||
type DB struct {
|
type DB struct {
|
||||||
|
// Put `stats` at the first field to ensure it's 64-bit aligned. Note that
|
||||||
|
// the first word in an allocated struct can be relied upon to be 64-bit
|
||||||
|
// aligned. Refer to https://pkg.go.dev/sync/atomic#pkg-note-BUG. Also
|
||||||
|
// refer to discussion in https://github.com/etcd-io/bbolt/issues/577.
|
||||||
|
stats Stats
|
||||||
|
|
||||||
// When enabled, the database will perform a Check() after every commit.
|
// When enabled, the database will perform a Check() after every commit.
|
||||||
// A panic is issued if the database is in an inconsistent state. This
|
// A panic is issued if the database is in an inconsistent state. This
|
||||||
// flag has a large performance impact so it should only be used for
|
// flag has a large performance impact so it should only be used for
|
||||||
|
|
@ -147,7 +153,6 @@ type DB struct {
|
||||||
opened bool
|
opened bool
|
||||||
rwtx *Tx
|
rwtx *Tx
|
||||||
txs []*Tx
|
txs []*Tx
|
||||||
stats Stats
|
|
||||||
|
|
||||||
freelist *freelist
|
freelist *freelist
|
||||||
freelistLoad sync.Once
|
freelistLoad sync.Once
|
||||||
|
|
@ -424,7 +429,7 @@ func (db *DB) hasSyncedFreelist() bool {
|
||||||
|
|
||||||
// mmap opens the underlying memory-mapped file and initializes the meta references.
|
// mmap opens the underlying memory-mapped file and initializes the meta references.
|
||||||
// minsz is the minimum size that the new mmap can be.
|
// minsz is the minimum size that the new mmap can be.
|
||||||
func (db *DB) mmap(minsz int) error {
|
func (db *DB) mmap(minsz int) (err error) {
|
||||||
db.mmaplock.Lock()
|
db.mmaplock.Lock()
|
||||||
defer db.mmaplock.Unlock()
|
defer db.mmaplock.Unlock()
|
||||||
|
|
||||||
|
|
@ -459,17 +464,27 @@ func (db *DB) mmap(minsz int) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unmap existing data before continuing.
|
// Unmap existing data before continuing.
|
||||||
if err := db.munmap(); err != nil {
|
if err = db.munmap(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Memory-map the data file as a byte slice.
|
// Memory-map the data file as a byte slice.
|
||||||
// gofail: var mapError string
|
// gofail: var mapError string
|
||||||
// return errors.New(mapError)
|
// return errors.New(mapError)
|
||||||
if err := mmap(db, size); err != nil {
|
if err = mmap(db, size); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Perform unmmap on any error to reset all data fields:
|
||||||
|
// dataref, data, datasz, meta0 and meta1.
|
||||||
|
defer func() {
|
||||||
|
if err != nil {
|
||||||
|
if unmapErr := db.munmap(); unmapErr != nil {
|
||||||
|
err = fmt.Errorf("%w; rollback unmap also failed: %v", err, unmapErr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if db.Mlock {
|
if db.Mlock {
|
||||||
// Don't allow swapping of data file
|
// Don't allow swapping of data file
|
||||||
if err := db.mlock(fileSize); err != nil {
|
if err := db.mlock(fileSize); err != nil {
|
||||||
|
|
@ -509,7 +524,7 @@ func (db *DB) munmap() error {
|
||||||
// gofail: var unmapError string
|
// gofail: var unmapError string
|
||||||
// return errors.New(unmapError)
|
// return errors.New(unmapError)
|
||||||
if err := munmap(db); err != nil {
|
if err := munmap(db); err != nil {
|
||||||
return fmt.Errorf("unmap error: " + err.Error())
|
return fmt.Errorf("unmap error: %v", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -553,15 +568,19 @@ func (db *DB) mmapSize(size int) (int, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) munlock(fileSize int) error {
|
func (db *DB) munlock(fileSize int) error {
|
||||||
|
// gofail: var munlockError string
|
||||||
|
// return errors.New(munlockError)
|
||||||
if err := munlock(db, fileSize); err != nil {
|
if err := munlock(db, fileSize); err != nil {
|
||||||
return fmt.Errorf("munlock error: " + err.Error())
|
return fmt.Errorf("munlock error: %v", err.Error())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (db *DB) mlock(fileSize int) error {
|
func (db *DB) mlock(fileSize int) error {
|
||||||
|
// gofail: var mlockError string
|
||||||
|
// return errors.New(mlockError)
|
||||||
if err := mlock(db, fileSize); err != nil {
|
if err := mlock(db, fileSize); err != nil {
|
||||||
return fmt.Errorf("mlock error: " + err.Error())
|
return fmt.Errorf("mlock error: %v", err.Error())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -649,9 +668,10 @@ func (db *DB) close() error {
|
||||||
// Clear ops.
|
// Clear ops.
|
||||||
db.ops.writeAt = nil
|
db.ops.writeAt = nil
|
||||||
|
|
||||||
|
var errs []error
|
||||||
// Close the mmap.
|
// Close the mmap.
|
||||||
if err := db.munmap(); err != nil {
|
if err := db.munmap(); err != nil {
|
||||||
return err
|
errs = append(errs, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close file handles.
|
// Close file handles.
|
||||||
|
|
@ -660,18 +680,22 @@ func (db *DB) close() error {
|
||||||
if !db.readOnly {
|
if !db.readOnly {
|
||||||
// Unlock the file.
|
// Unlock the file.
|
||||||
if err := funlock(db); err != nil {
|
if err := funlock(db); err != nil {
|
||||||
return fmt.Errorf("bolt.Close(): funlock error: %w", err)
|
errs = append(errs, fmt.Errorf("bolt.Close(): funlock error: %w", err))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close the file descriptor.
|
// Close the file descriptor.
|
||||||
if err := db.file.Close(); err != nil {
|
if err := db.file.Close(); err != nil {
|
||||||
return fmt.Errorf("db file close: %s", err)
|
errs = append(errs, fmt.Errorf("db file close: %w", err))
|
||||||
}
|
}
|
||||||
db.file = nil
|
db.file = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
db.path = ""
|
db.path = ""
|
||||||
|
|
||||||
|
if len(errs) > 0 {
|
||||||
|
return errs[0]
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1135,6 +1159,8 @@ func (db *DB) grow(sz int) error {
|
||||||
// https://github.com/boltdb/bolt/issues/284
|
// https://github.com/boltdb/bolt/issues/284
|
||||||
if !db.NoGrowSync && !db.readOnly {
|
if !db.NoGrowSync && !db.readOnly {
|
||||||
if runtime.GOOS != "windows" {
|
if runtime.GOOS != "windows" {
|
||||||
|
// gofail: var resizeFileError string
|
||||||
|
// return errors.New(resizeFileError)
|
||||||
if err := db.file.Truncate(int64(sz)); err != nil {
|
if err := db.file.Truncate(int64(sz)); err != nil {
|
||||||
return fmt.Errorf("file resize error: %s", err)
|
return fmt.Errorf("file resize error: %s", err)
|
||||||
}
|
}
|
||||||
|
|
@ -1263,6 +1289,12 @@ var DefaultOptions = &Options{
|
||||||
|
|
||||||
// Stats represents statistics about the database.
|
// Stats represents statistics about the database.
|
||||||
type Stats struct {
|
type Stats struct {
|
||||||
|
// Put `TxStats` at the first field to ensure it's 64-bit aligned. Note
|
||||||
|
// that the first word in an allocated struct can be relied upon to be
|
||||||
|
// 64-bit aligned. Refer to https://pkg.go.dev/sync/atomic#pkg-note-BUG.
|
||||||
|
// Also refer to discussion in https://github.com/etcd-io/bbolt/issues/577.
|
||||||
|
TxStats TxStats // global, ongoing stats.
|
||||||
|
|
||||||
// Freelist stats
|
// Freelist stats
|
||||||
FreePageN int // total number of free pages on the freelist
|
FreePageN int // total number of free pages on the freelist
|
||||||
PendingPageN int // total number of pending pages on the freelist
|
PendingPageN int // total number of pending pages on the freelist
|
||||||
|
|
@ -1272,8 +1304,6 @@ type Stats struct {
|
||||||
// Transaction stats
|
// Transaction stats
|
||||||
TxN int // total number of started read transactions
|
TxN int // total number of started read transactions
|
||||||
OpenTxN int // number of currently open read transactions
|
OpenTxN int // number of currently open read transactions
|
||||||
|
|
||||||
TxStats TxStats // global, ongoing stats.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sub calculates and returns the difference between two sets of database stats.
|
// Sub calculates and returns the difference between two sets of database stats.
|
||||||
|
|
|
||||||
19
vendor/go.etcd.io/bbolt/freelist.go
generated
vendored
19
vendor/go.etcd.io/bbolt/freelist.go
generated
vendored
|
|
@ -252,6 +252,14 @@ func (f *freelist) rollback(txid txid) {
|
||||||
}
|
}
|
||||||
// Remove pages from pending list and mark as free if allocated by txid.
|
// Remove pages from pending list and mark as free if allocated by txid.
|
||||||
delete(f.pending, txid)
|
delete(f.pending, txid)
|
||||||
|
|
||||||
|
// Remove pgids which are allocated by this txid
|
||||||
|
for pgid, tid := range f.allocs {
|
||||||
|
if tid == txid {
|
||||||
|
delete(f.allocs, pgid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
f.mergeSpans(m)
|
f.mergeSpans(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,9 +290,8 @@ func (f *freelist) read(p *page) {
|
||||||
if count == 0 {
|
if count == 0 {
|
||||||
f.ids = nil
|
f.ids = nil
|
||||||
} else {
|
} else {
|
||||||
var ids []pgid
|
data := unsafeIndex(unsafe.Pointer(p), unsafe.Sizeof(*p), unsafe.Sizeof(pgid(0)), idx)
|
||||||
data := unsafeIndex(unsafe.Pointer(p), unsafe.Sizeof(*p), unsafe.Sizeof(ids[0]), idx)
|
ids := unsafe.Slice((*pgid)(data), count)
|
||||||
unsafeSlice(unsafe.Pointer(&ids), data, count)
|
|
||||||
|
|
||||||
// copy the ids, so we don't modify on the freelist page directly
|
// copy the ids, so we don't modify on the freelist page directly
|
||||||
idsCopy := make([]pgid, count)
|
idsCopy := make([]pgid, count)
|
||||||
|
|
@ -322,15 +329,13 @@ func (f *freelist) write(p *page) error {
|
||||||
p.count = uint16(l)
|
p.count = uint16(l)
|
||||||
} else if l < 0xFFFF {
|
} else if l < 0xFFFF {
|
||||||
p.count = uint16(l)
|
p.count = uint16(l)
|
||||||
var ids []pgid
|
|
||||||
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
||||||
unsafeSlice(unsafe.Pointer(&ids), data, l)
|
ids := unsafe.Slice((*pgid)(data), l)
|
||||||
f.copyall(ids)
|
f.copyall(ids)
|
||||||
} else {
|
} else {
|
||||||
p.count = 0xFFFF
|
p.count = 0xFFFF
|
||||||
var ids []pgid
|
|
||||||
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
||||||
unsafeSlice(unsafe.Pointer(&ids), data, l+1)
|
ids := unsafe.Slice((*pgid)(data), l+1)
|
||||||
ids[0] = pgid(l)
|
ids[0] = pgid(l)
|
||||||
f.copyall(ids[1:])
|
f.copyall(ids[1:])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
6
vendor/go.etcd.io/bbolt/page.go
generated
vendored
6
vendor/go.etcd.io/bbolt/page.go
generated
vendored
|
|
@ -74,9 +74,8 @@ func (p *page) leafPageElements() []leafPageElement {
|
||||||
if p.count == 0 {
|
if p.count == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var elems []leafPageElement
|
|
||||||
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
||||||
unsafeSlice(unsafe.Pointer(&elems), data, int(p.count))
|
elems := unsafe.Slice((*leafPageElement)(data), int(p.count))
|
||||||
return elems
|
return elems
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -91,9 +90,8 @@ func (p *page) branchPageElements() []branchPageElement {
|
||||||
if p.count == 0 {
|
if p.count == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var elems []branchPageElement
|
|
||||||
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
data := unsafeAdd(unsafe.Pointer(p), unsafe.Sizeof(*p))
|
||||||
unsafeSlice(unsafe.Pointer(&elems), data, int(p.count))
|
elems := unsafe.Slice((*branchPageElement)(data), int(p.count))
|
||||||
return elems
|
return elems
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
7
vendor/go.etcd.io/bbolt/tx.go
generated
vendored
7
vendor/go.etcd.io/bbolt/tx.go
generated
vendored
|
|
@ -1,6 +1,7 @@
|
||||||
package bbolt
|
package bbolt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
|
@ -185,6 +186,10 @@ func (tx *Tx) Commit() error {
|
||||||
|
|
||||||
// If the high water mark has moved up then attempt to grow the database.
|
// If the high water mark has moved up then attempt to grow the database.
|
||||||
if tx.meta.pgid > opgid {
|
if tx.meta.pgid > opgid {
|
||||||
|
_ = errors.New("")
|
||||||
|
// gofail: var lackOfDiskSpace string
|
||||||
|
// tx.rollback()
|
||||||
|
// return errors.New(lackOfDiskSpace)
|
||||||
if err := tx.db.grow(int(tx.meta.pgid+1) * tx.db.pageSize); err != nil {
|
if err := tx.db.grow(int(tx.meta.pgid+1) * tx.db.pageSize); err != nil {
|
||||||
tx.rollback()
|
tx.rollback()
|
||||||
return err
|
return err
|
||||||
|
|
@ -470,6 +475,7 @@ func (tx *Tx) write() error {
|
||||||
|
|
||||||
// Ignore file sync if flag is set on DB.
|
// Ignore file sync if flag is set on DB.
|
||||||
if !tx.db.NoSync || IgnoreNoSync {
|
if !tx.db.NoSync || IgnoreNoSync {
|
||||||
|
// gofail: var beforeSyncDataPages struct{}
|
||||||
if err := fdatasync(tx.db); err != nil {
|
if err := fdatasync(tx.db); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
@ -507,6 +513,7 @@ func (tx *Tx) writeMeta() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if !tx.db.NoSync || IgnoreNoSync {
|
if !tx.db.NoSync || IgnoreNoSync {
|
||||||
|
// gofail: var beforeSyncMetaPage struct{}
|
||||||
if err := fdatasync(tx.db); err != nil {
|
if err := fdatasync(tx.db); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
vendor/go.etcd.io/bbolt/unsafe.go
generated
vendored
12
vendor/go.etcd.io/bbolt/unsafe.go
generated
vendored
|
|
@ -1,7 +1,6 @@
|
||||||
package bbolt
|
package bbolt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -26,14 +25,3 @@ func unsafeByteSlice(base unsafe.Pointer, offset uintptr, i, j int) []byte {
|
||||||
// all), so this is believed to be correct.
|
// all), so this is believed to be correct.
|
||||||
return (*[maxAllocSize]byte)(unsafeAdd(base, offset))[i:j:j]
|
return (*[maxAllocSize]byte)(unsafeAdd(base, offset))[i:j:j]
|
||||||
}
|
}
|
||||||
|
|
||||||
// unsafeSlice modifies the data, len, and cap of a slice variable pointed to by
|
|
||||||
// the slice parameter. This helper should be used over other direct
|
|
||||||
// manipulation of reflect.SliceHeader to prevent misuse, namely, converting
|
|
||||||
// from reflect.SliceHeader to a Go slice type.
|
|
||||||
func unsafeSlice(slice, data unsafe.Pointer, len int) {
|
|
||||||
s := (*reflect.SliceHeader)(slice)
|
|
||||||
s.Data = uintptr(data)
|
|
||||||
s.Cap = len
|
|
||||||
s.Len = len
|
|
||||||
}
|
|
||||||
|
|
|
||||||
4
vendor/golang.org/x/sys/LICENSE
generated
vendored
4
vendor/golang.org/x/sys/LICENSE
generated
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
Copyright (c) 2009 The Go Authors. All rights reserved.
|
Copyright 2009 The Go Authors.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
Redistribution and use in source and binary forms, with or without
|
||||||
modification, are permitted provided that the following conditions are
|
modification, are permitted provided that the following conditions are
|
||||||
|
|
@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
|
||||||
copyright notice, this list of conditions and the following disclaimer
|
copyright notice, this list of conditions and the following disclaimer
|
||||||
in the documentation and/or other materials provided with the
|
in the documentation and/or other materials provided with the
|
||||||
distribution.
|
distribution.
|
||||||
* Neither the name of Google Inc. nor the names of its
|
* Neither the name of Google LLC nor the names of its
|
||||||
contributors may be used to endorse or promote products derived from
|
contributors may be used to endorse or promote products derived from
|
||||||
this software without specific prior written permission.
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
|
|
||||||
30
vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go
generated
vendored
30
vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go
generated
vendored
|
|
@ -1,30 +0,0 @@
|
||||||
// Copyright 2020 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
// Package unsafeheader contains header declarations for the Go runtime's
|
|
||||||
// slice and string implementations.
|
|
||||||
//
|
|
||||||
// This package allows x/sys to use types equivalent to
|
|
||||||
// reflect.SliceHeader and reflect.StringHeader without introducing
|
|
||||||
// a dependency on the (relatively heavy) "reflect" package.
|
|
||||||
package unsafeheader
|
|
||||||
|
|
||||||
import (
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Slice is the runtime representation of a slice.
|
|
||||||
// It cannot be used safely or portably and its representation may change in a later release.
|
|
||||||
type Slice struct {
|
|
||||||
Data unsafe.Pointer
|
|
||||||
Len int
|
|
||||||
Cap int
|
|
||||||
}
|
|
||||||
|
|
||||||
// String is the runtime representation of a string.
|
|
||||||
// It cannot be used safely or portably and its representation may change in a later release.
|
|
||||||
type String struct {
|
|
||||||
Data unsafe.Pointer
|
|
||||||
Len int
|
|
||||||
}
|
|
||||||
4
vendor/golang.org/x/sys/unix/aliases.go
generated
vendored
4
vendor/golang.org/x/sys/unix/aliases.go
generated
vendored
|
|
@ -2,9 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
// +build go1.9
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
generated
vendored
1
vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
//go:build gc
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_bsd_386.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_bsd_386.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (freebsd || netbsd || openbsd) && gc
|
//go:build (freebsd || netbsd || openbsd) && gc
|
||||||
// +build freebsd netbsd openbsd
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
|
//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
|
||||||
// +build darwin dragonfly freebsd netbsd openbsd
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_bsd_arm.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_bsd_arm.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (freebsd || netbsd || openbsd) && gc
|
//go:build (freebsd || netbsd || openbsd) && gc
|
||||||
// +build freebsd netbsd openbsd
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
||||||
// +build darwin freebsd netbsd openbsd
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
||||||
// +build darwin freebsd netbsd openbsd
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
//go:build (darwin || freebsd || netbsd || openbsd) && gc
|
||||||
// +build darwin freebsd netbsd openbsd
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/asm_linux_386.s
generated
vendored
1
vendor/golang.org/x/sys/unix/asm_linux_386.s
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
//go:build gc
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/asm_linux_amd64.s
generated
vendored
1
vendor/golang.org/x/sys/unix/asm_linux_amd64.s
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
//go:build gc
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/asm_linux_arm.s
generated
vendored
1
vendor/golang.org/x/sys/unix/asm_linux_arm.s
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
//go:build gc
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/asm_linux_arm64.s
generated
vendored
3
vendor/golang.org/x/sys/unix/asm_linux_arm64.s
generated
vendored
|
|
@ -3,9 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && arm64 && gc
|
//go:build linux && arm64 && gc
|
||||||
// +build linux
|
|
||||||
// +build arm64
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/asm_linux_loong64.s
generated
vendored
3
vendor/golang.org/x/sys/unix/asm_linux_loong64.s
generated
vendored
|
|
@ -3,9 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && loong64 && gc
|
//go:build linux && loong64 && gc
|
||||||
// +build linux
|
|
||||||
// +build loong64
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
generated
vendored
3
vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
generated
vendored
|
|
@ -3,9 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && (mips64 || mips64le) && gc
|
//go:build linux && (mips64 || mips64le) && gc
|
||||||
// +build linux
|
|
||||||
// +build mips64 mips64le
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
generated
vendored
3
vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
generated
vendored
|
|
@ -3,9 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && (mips || mipsle) && gc
|
//go:build linux && (mips || mipsle) && gc
|
||||||
// +build linux
|
|
||||||
// +build mips mipsle
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
generated
vendored
3
vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
generated
vendored
|
|
@ -3,9 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && (ppc64 || ppc64le) && gc
|
//go:build linux && (ppc64 || ppc64le) && gc
|
||||||
// +build linux
|
|
||||||
// +build ppc64 ppc64le
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
generated
vendored
2
vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build riscv64 && gc
|
//go:build riscv64 && gc
|
||||||
// +build riscv64
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/asm_linux_s390x.s
generated
vendored
3
vendor/golang.org/x/sys/unix/asm_linux_s390x.s
generated
vendored
|
|
@ -3,9 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && s390x && gc
|
//go:build linux && s390x && gc
|
||||||
// +build linux
|
|
||||||
// +build s390x
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
generated
vendored
1
vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
//go:build gc
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
generated
vendored
1
vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
//go:build gc
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
|
|
|
||||||
678
vendor/golang.org/x/sys/unix/asm_zos_s390x.s
generated
vendored
678
vendor/golang.org/x/sys/unix/asm_zos_s390x.s
generated
vendored
|
|
@ -3,18 +3,17 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build zos && s390x && gc
|
//go:build zos && s390x && gc
|
||||||
// +build zos
|
|
||||||
// +build s390x
|
|
||||||
// +build gc
|
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
|
||||||
#define PSALAA 1208(R0)
|
#define PSALAA 1208(R0)
|
||||||
#define GTAB64(x) 80(x)
|
#define GTAB64(x) 80(x)
|
||||||
#define LCA64(x) 88(x)
|
#define LCA64(x) 88(x)
|
||||||
|
#define SAVSTACK_ASYNC(x) 336(x) // in the LCA
|
||||||
#define CAA(x) 8(x)
|
#define CAA(x) 8(x)
|
||||||
#define EDCHPXV(x) 1016(x) // in the CAA
|
#define CEECAATHDID(x) 976(x) // in the CAA
|
||||||
#define SAVSTACK_ASYNC(x) 336(x) // in the LCA
|
#define EDCHPXV(x) 1016(x) // in the CAA
|
||||||
|
#define GOCB(x) 1104(x) // in the CAA
|
||||||
|
|
||||||
// SS_*, where x=SAVSTACK_ASYNC
|
// SS_*, where x=SAVSTACK_ASYNC
|
||||||
#define SS_LE(x) 0(x)
|
#define SS_LE(x) 0(x)
|
||||||
|
|
@ -22,394 +21,125 @@
|
||||||
#define SS_ERRNO(x) 16(x)
|
#define SS_ERRNO(x) 16(x)
|
||||||
#define SS_ERRNOJR(x) 20(x)
|
#define SS_ERRNOJR(x) 20(x)
|
||||||
|
|
||||||
#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6
|
// Function Descriptor Offsets
|
||||||
|
#define __errno 0x156*16
|
||||||
|
#define __err2ad 0x16C*16
|
||||||
|
|
||||||
TEXT ·clearErrno(SB),NOSPLIT,$0-0
|
// Call Instructions
|
||||||
BL addrerrno<>(SB)
|
#define LE_CALL BYTE $0x0D; BYTE $0x76 // BL R7, R6
|
||||||
MOVD $0, 0(R3)
|
#define SVC_LOAD BYTE $0x0A; BYTE $0x08 // SVC 08 LOAD
|
||||||
|
#define SVC_DELETE BYTE $0x0A; BYTE $0x09 // SVC 09 DELETE
|
||||||
|
|
||||||
|
DATA zosLibVec<>(SB)/8, $0
|
||||||
|
GLOBL zosLibVec<>(SB), NOPTR, $8
|
||||||
|
|
||||||
|
TEXT ·initZosLibVec(SB), NOSPLIT|NOFRAME, $0-0
|
||||||
|
MOVW PSALAA, R8
|
||||||
|
MOVD LCA64(R8), R8
|
||||||
|
MOVD CAA(R8), R8
|
||||||
|
MOVD EDCHPXV(R8), R8
|
||||||
|
MOVD R8, zosLibVec<>(SB)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·GetZosLibVec(SB), NOSPLIT|NOFRAME, $0-0
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·clearErrno(SB), NOSPLIT, $0-0
|
||||||
|
BL addrerrno<>(SB)
|
||||||
|
MOVD $0, 0(R3)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// Returns the address of errno in R3.
|
// Returns the address of errno in R3.
|
||||||
TEXT addrerrno<>(SB),NOSPLIT|NOFRAME,$0-0
|
TEXT addrerrno<>(SB), NOSPLIT|NOFRAME, $0-0
|
||||||
// Get library control area (LCA).
|
// Get library control area (LCA).
|
||||||
MOVW PSALAA, R8
|
MOVW PSALAA, R8
|
||||||
MOVD LCA64(R8), R8
|
MOVD LCA64(R8), R8
|
||||||
|
|
||||||
// Get __errno FuncDesc.
|
// Get __errno FuncDesc.
|
||||||
MOVD CAA(R8), R9
|
MOVD CAA(R8), R9
|
||||||
MOVD EDCHPXV(R9), R9
|
MOVD EDCHPXV(R9), R9
|
||||||
ADD $(0x156*16), R9
|
ADD $(__errno), R9
|
||||||
LMG 0(R9), R5, R6
|
LMG 0(R9), R5, R6
|
||||||
|
|
||||||
// Switch to saved LE stack.
|
// Switch to saved LE stack.
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
MOVD SAVSTACK_ASYNC(R8), R9
|
||||||
MOVD 0(R9), R4
|
MOVD 0(R9), R4
|
||||||
MOVD $0, 0(R9)
|
MOVD $0, 0(R9)
|
||||||
|
|
||||||
// Call __errno function.
|
// Call __errno function.
|
||||||
LE_CALL
|
LE_CALL
|
||||||
NOPH
|
NOPH
|
||||||
|
|
||||||
// Switch back to Go stack.
|
// Switch back to Go stack.
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
XOR R0, R0 // Restore R0 to $0.
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
MOVD R4, 0(R9) // Save stack pointer.
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_syscall(SB),NOSPLIT,$0-56
|
|
||||||
BL runtime·entersyscall(SB)
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+32(FP)
|
|
||||||
MOVD R0, r2+40(FP)
|
|
||||||
MOVD R0, err+48(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+48(FP)
|
|
||||||
done:
|
|
||||||
BL runtime·exitsyscall(SB)
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+32(FP)
|
|
||||||
MOVD R0, r2+40(FP)
|
|
||||||
MOVD R0, err+48(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+48(FP)
|
|
||||||
done:
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80
|
|
||||||
BL runtime·entersyscall(SB)
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+56(FP)
|
|
||||||
MOVD R0, r2+64(FP)
|
|
||||||
MOVD R0, err+72(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+72(FP)
|
|
||||||
done:
|
|
||||||
BL runtime·exitsyscall(SB)
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+56(FP)
|
|
||||||
MOVD R0, r2+64(FP)
|
|
||||||
MOVD R0, err+72(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL ·rrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+72(FP)
|
|
||||||
done:
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_syscall9(SB),NOSPLIT,$0
|
|
||||||
BL runtime·entersyscall(SB)
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
MOVD a7+56(FP), R12
|
|
||||||
MOVD R12, (2176+48)(R4)
|
|
||||||
MOVD a8+64(FP), R12
|
|
||||||
MOVD R12, (2176+56)(R4)
|
|
||||||
MOVD a9+72(FP), R12
|
|
||||||
MOVD R12, (2176+64)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+80(FP)
|
|
||||||
MOVD R0, r2+88(FP)
|
|
||||||
MOVD R0, err+96(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+96(FP)
|
|
||||||
done:
|
|
||||||
BL runtime·exitsyscall(SB)
|
|
||||||
RET
|
|
||||||
|
|
||||||
TEXT ·syscall_rawsyscall9(SB),NOSPLIT,$0
|
|
||||||
MOVD a1+8(FP), R1
|
|
||||||
MOVD a2+16(FP), R2
|
|
||||||
MOVD a3+24(FP), R3
|
|
||||||
|
|
||||||
// Get library control area (LCA).
|
|
||||||
MOVW PSALAA, R8
|
|
||||||
MOVD LCA64(R8), R8
|
|
||||||
|
|
||||||
// Get function.
|
|
||||||
MOVD CAA(R8), R9
|
|
||||||
MOVD EDCHPXV(R9), R9
|
|
||||||
MOVD trap+0(FP), R5
|
|
||||||
SLD $4, R5
|
|
||||||
ADD R5, R9
|
|
||||||
LMG 0(R9), R5, R6
|
|
||||||
|
|
||||||
// Restore LE stack.
|
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
|
||||||
MOVD 0(R9), R4
|
|
||||||
MOVD $0, 0(R9)
|
|
||||||
|
|
||||||
// Fill in parameter list.
|
|
||||||
MOVD a4+32(FP), R12
|
|
||||||
MOVD R12, (2176+24)(R4)
|
|
||||||
MOVD a5+40(FP), R12
|
|
||||||
MOVD R12, (2176+32)(R4)
|
|
||||||
MOVD a6+48(FP), R12
|
|
||||||
MOVD R12, (2176+40)(R4)
|
|
||||||
MOVD a7+56(FP), R12
|
|
||||||
MOVD R12, (2176+48)(R4)
|
|
||||||
MOVD a8+64(FP), R12
|
|
||||||
MOVD R12, (2176+56)(R4)
|
|
||||||
MOVD a9+72(FP), R12
|
|
||||||
MOVD R12, (2176+64)(R4)
|
|
||||||
|
|
||||||
// Call function.
|
|
||||||
LE_CALL
|
|
||||||
NOPH
|
|
||||||
XOR R0, R0 // Restore R0 to $0.
|
|
||||||
MOVD R4, 0(R9) // Save stack pointer.
|
|
||||||
|
|
||||||
MOVD R3, r1+80(FP)
|
|
||||||
MOVD R0, r2+88(FP)
|
|
||||||
MOVD R0, err+96(FP)
|
|
||||||
MOVW R3, R4
|
|
||||||
CMP R4, $-1
|
|
||||||
BNE done
|
|
||||||
BL addrerrno<>(SB)
|
|
||||||
MOVWZ 0(R3), R3
|
|
||||||
MOVD R3, err+96(FP)
|
|
||||||
done:
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
|
// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
|
||||||
TEXT ·svcCall(SB),NOSPLIT,$0
|
TEXT ·svcCall(SB), NOSPLIT, $0
|
||||||
BL runtime·save_g(SB) // Save g and stack pointer
|
BL runtime·save_g(SB) // Save g and stack pointer
|
||||||
MOVW PSALAA, R8
|
MOVW PSALAA, R8
|
||||||
MOVD LCA64(R8), R8
|
MOVD LCA64(R8), R8
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
MOVD SAVSTACK_ASYNC(R8), R9
|
||||||
MOVD R15, 0(R9)
|
MOVD R15, 0(R9)
|
||||||
|
|
||||||
MOVD argv+8(FP), R1 // Move function arguments into registers
|
MOVD argv+8(FP), R1 // Move function arguments into registers
|
||||||
MOVD dsa+16(FP), g
|
MOVD dsa+16(FP), g
|
||||||
MOVD fnptr+0(FP), R15
|
MOVD fnptr+0(FP), R15
|
||||||
|
|
||||||
BYTE $0x0D // Branch to function
|
BYTE $0x0D // Branch to function
|
||||||
BYTE $0xEF
|
BYTE $0xEF
|
||||||
|
|
||||||
BL runtime·load_g(SB) // Restore g and stack pointer
|
BL runtime·load_g(SB) // Restore g and stack pointer
|
||||||
MOVW PSALAA, R8
|
MOVW PSALAA, R8
|
||||||
MOVD LCA64(R8), R8
|
MOVD LCA64(R8), R8
|
||||||
MOVD SAVSTACK_ASYNC(R8), R9
|
MOVD SAVSTACK_ASYNC(R8), R9
|
||||||
MOVD 0(R9), R15
|
MOVD 0(R9), R15
|
||||||
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func svcLoad(name *byte) unsafe.Pointer
|
// func svcLoad(name *byte) unsafe.Pointer
|
||||||
TEXT ·svcLoad(SB),NOSPLIT,$0
|
TEXT ·svcLoad(SB), NOSPLIT, $0
|
||||||
MOVD R15, R2 // Save go stack pointer
|
MOVD R15, R2 // Save go stack pointer
|
||||||
MOVD name+0(FP), R0 // Move SVC args into registers
|
MOVD name+0(FP), R0 // Move SVC args into registers
|
||||||
MOVD $0x80000000, R1
|
MOVD $0x80000000, R1
|
||||||
MOVD $0, R15
|
MOVD $0, R15
|
||||||
BYTE $0x0A // SVC 08 LOAD
|
SVC_LOAD
|
||||||
BYTE $0x08
|
MOVW R15, R3 // Save return code from SVC
|
||||||
MOVW R15, R3 // Save return code from SVC
|
MOVD R2, R15 // Restore go stack pointer
|
||||||
MOVD R2, R15 // Restore go stack pointer
|
CMP R3, $0 // Check SVC return code
|
||||||
CMP R3, $0 // Check SVC return code
|
BNE error
|
||||||
BNE error
|
|
||||||
|
|
||||||
MOVD $-2, R3 // Reset last bit of entry point to zero
|
MOVD $-2, R3 // Reset last bit of entry point to zero
|
||||||
AND R0, R3
|
AND R0, R3
|
||||||
MOVD R3, addr+8(FP) // Return entry point returned by SVC
|
MOVD R3, ret+8(FP) // Return entry point returned by SVC
|
||||||
CMP R0, R3 // Check if last bit of entry point was set
|
CMP R0, R3 // Check if last bit of entry point was set
|
||||||
BNE done
|
BNE done
|
||||||
|
|
||||||
MOVD R15, R2 // Save go stack pointer
|
MOVD R15, R2 // Save go stack pointer
|
||||||
MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08)
|
MOVD $0, R15 // Move SVC args into registers (entry point still in r0 from SVC 08)
|
||||||
BYTE $0x0A // SVC 09 DELETE
|
SVC_DELETE
|
||||||
BYTE $0x09
|
MOVD R2, R15 // Restore go stack pointer
|
||||||
MOVD R2, R15 // Restore go stack pointer
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
MOVD $0, addr+8(FP) // Return 0 on failure
|
MOVD $0, ret+8(FP) // Return 0 on failure
|
||||||
|
|
||||||
done:
|
done:
|
||||||
XOR R0, R0 // Reset r0 to 0
|
XOR R0, R0 // Reset r0 to 0
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
|
// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
|
||||||
TEXT ·svcUnload(SB),NOSPLIT,$0
|
TEXT ·svcUnload(SB), NOSPLIT, $0
|
||||||
MOVD R15, R2 // Save go stack pointer
|
MOVD R15, R2 // Save go stack pointer
|
||||||
MOVD name+0(FP), R0 // Move SVC args into registers
|
MOVD name+0(FP), R0 // Move SVC args into registers
|
||||||
MOVD addr+8(FP), R15
|
MOVD fnptr+8(FP), R15
|
||||||
BYTE $0x0A // SVC 09
|
SVC_DELETE
|
||||||
BYTE $0x09
|
XOR R0, R0 // Reset r0 to 0
|
||||||
XOR R0, R0 // Reset r0 to 0
|
MOVD R15, R1 // Save SVC return code
|
||||||
MOVD R15, R1 // Save SVC return code
|
MOVD R2, R15 // Restore go stack pointer
|
||||||
MOVD R2, R15 // Restore go stack pointer
|
MOVD R1, ret+16(FP) // Return SVC return code
|
||||||
MOVD R1, rc+0(FP) // Return SVC return code
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// func gettid() uint64
|
// func gettid() uint64
|
||||||
|
|
@ -420,7 +150,233 @@ TEXT ·gettid(SB), NOSPLIT, $0
|
||||||
|
|
||||||
// Get CEECAATHDID
|
// Get CEECAATHDID
|
||||||
MOVD CAA(R8), R9
|
MOVD CAA(R8), R9
|
||||||
MOVD 0x3D0(R9), R9
|
MOVD CEECAATHDID(R9), R9
|
||||||
MOVD R9, ret+0(FP)
|
MOVD R9, ret+0(FP)
|
||||||
|
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call LE function, if the return is -1
|
||||||
|
// errno and errno2 is retrieved
|
||||||
|
//
|
||||||
|
TEXT ·CallLeFuncWithErr(SB), NOSPLIT, $0
|
||||||
|
MOVW PSALAA, R8
|
||||||
|
MOVD LCA64(R8), R8
|
||||||
|
MOVD CAA(R8), R9
|
||||||
|
MOVD g, GOCB(R9)
|
||||||
|
|
||||||
|
// Restore LE stack.
|
||||||
|
MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address
|
||||||
|
MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer
|
||||||
|
|
||||||
|
MOVD parms_base+8(FP), R7 // R7 -> argument array
|
||||||
|
MOVD parms_len+16(FP), R8 // R8 number of arguments
|
||||||
|
|
||||||
|
// arg 1 ---> R1
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
MOVD 0(R7), R1
|
||||||
|
|
||||||
|
// arg 2 ---> R2
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R2
|
||||||
|
|
||||||
|
// arg 3 --> R3
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R3
|
||||||
|
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument
|
||||||
|
|
||||||
|
repeat:
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R0 // advance arg pointer by 8 byte
|
||||||
|
ADD $8, R6 // advance LE argument address by 8 byte
|
||||||
|
MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame
|
||||||
|
SUB $1, R8
|
||||||
|
CMP R8, $0
|
||||||
|
BNE repeat
|
||||||
|
|
||||||
|
docall:
|
||||||
|
MOVD funcdesc+0(FP), R8 // R8-> function descriptor
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC
|
||||||
|
LE_CALL // balr R7, R6 (return #1)
|
||||||
|
NOPH
|
||||||
|
MOVD R3, ret+32(FP)
|
||||||
|
CMP R3, $-1 // compare result to -1
|
||||||
|
BNE done
|
||||||
|
|
||||||
|
// retrieve errno and errno2
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__errno), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __errno (return #3)
|
||||||
|
NOPH
|
||||||
|
MOVWZ 0(R3), R3
|
||||||
|
MOVD R3, err+48(FP)
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__err2ad), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __err2ad (return #2)
|
||||||
|
NOPH
|
||||||
|
MOVW (R3), R2 // retrieve errno2
|
||||||
|
MOVD R2, errno2+40(FP) // store in return area
|
||||||
|
|
||||||
|
done:
|
||||||
|
MOVD R4, 0(R9) // Save stack pointer.
|
||||||
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// Call LE function, if the return is 0
|
||||||
|
// errno and errno2 is retrieved
|
||||||
|
//
|
||||||
|
TEXT ·CallLeFuncWithPtrReturn(SB), NOSPLIT, $0
|
||||||
|
MOVW PSALAA, R8
|
||||||
|
MOVD LCA64(R8), R8
|
||||||
|
MOVD CAA(R8), R9
|
||||||
|
MOVD g, GOCB(R9)
|
||||||
|
|
||||||
|
// Restore LE stack.
|
||||||
|
MOVD SAVSTACK_ASYNC(R8), R9 // R9-> LE stack frame saving address
|
||||||
|
MOVD 0(R9), R4 // R4-> restore previously saved stack frame pointer
|
||||||
|
|
||||||
|
MOVD parms_base+8(FP), R7 // R7 -> argument array
|
||||||
|
MOVD parms_len+16(FP), R8 // R8 number of arguments
|
||||||
|
|
||||||
|
// arg 1 ---> R1
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
MOVD 0(R7), R1
|
||||||
|
|
||||||
|
// arg 2 ---> R2
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R2
|
||||||
|
|
||||||
|
// arg 3 --> R3
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
SUB $1, R8
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R3
|
||||||
|
|
||||||
|
CMP R8, $0
|
||||||
|
BEQ docall
|
||||||
|
MOVD $2176+16, R6 // starting LE stack address-8 to store 4th argument
|
||||||
|
|
||||||
|
repeat:
|
||||||
|
ADD $8, R7
|
||||||
|
MOVD 0(R7), R0 // advance arg pointer by 8 byte
|
||||||
|
ADD $8, R6 // advance LE argument address by 8 byte
|
||||||
|
MOVD R0, (R4)(R6*1) // copy argument from go-slice to le-frame
|
||||||
|
SUB $1, R8
|
||||||
|
CMP R8, $0
|
||||||
|
BNE repeat
|
||||||
|
|
||||||
|
docall:
|
||||||
|
MOVD funcdesc+0(FP), R8 // R8-> function descriptor
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
MOVD $0, 0(R9) // R9 address of SAVSTACK_ASYNC
|
||||||
|
LE_CALL // balr R7, R6 (return #1)
|
||||||
|
NOPH
|
||||||
|
MOVD R3, ret+32(FP)
|
||||||
|
CMP R3, $0 // compare result to 0
|
||||||
|
BNE done
|
||||||
|
|
||||||
|
// retrieve errno and errno2
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__errno), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __errno (return #3)
|
||||||
|
NOPH
|
||||||
|
MOVWZ 0(R3), R3
|
||||||
|
MOVD R3, err+48(FP)
|
||||||
|
MOVD zosLibVec<>(SB), R8
|
||||||
|
ADD $(__err2ad), R8
|
||||||
|
LMG 0(R8), R5, R6
|
||||||
|
LE_CALL // balr R7, R6 __err2ad (return #2)
|
||||||
|
NOPH
|
||||||
|
MOVW (R3), R2 // retrieve errno2
|
||||||
|
MOVD R2, errno2+40(FP) // store in return area
|
||||||
|
XOR R2, R2
|
||||||
|
MOVWZ R2, (R3) // clear errno2
|
||||||
|
|
||||||
|
done:
|
||||||
|
MOVD R4, 0(R9) // Save stack pointer.
|
||||||
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// function to test if a pointer can be safely dereferenced (content read)
|
||||||
|
// return 0 for succces
|
||||||
|
//
|
||||||
|
TEXT ·ptrtest(SB), NOSPLIT, $0-16
|
||||||
|
MOVD arg+0(FP), R10 // test pointer in R10
|
||||||
|
|
||||||
|
// set up R2 to point to CEECAADMC
|
||||||
|
BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208
|
||||||
|
BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2
|
||||||
|
BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2)
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2)
|
||||||
|
BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2)
|
||||||
|
|
||||||
|
// set up R5 to point to the "shunt" path which set 1 to R3 (failure)
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1
|
||||||
|
BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1
|
||||||
|
|
||||||
|
// if r3 is not zero (failed) then branch to finish
|
||||||
|
BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2
|
||||||
|
|
||||||
|
// stomic store shunt address in R5 into CEECAADMC
|
||||||
|
BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2)
|
||||||
|
|
||||||
|
// now try reading from the test pointer in R10, if it fails it branches to the "lghi" instruction above
|
||||||
|
BYTE $0xE3; BYTE $0x9A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 9,0(10)
|
||||||
|
|
||||||
|
// finish here, restore 0 into CEECAADMC
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9
|
||||||
|
BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2)
|
||||||
|
MOVD R3, ret+8(FP) // result in R3
|
||||||
|
RET
|
||||||
|
|
||||||
|
//
|
||||||
|
// function to test if a untptr can be loaded from a pointer
|
||||||
|
// return 1: the 8-byte content
|
||||||
|
// 2: 0 for success, 1 for failure
|
||||||
|
//
|
||||||
|
// func safeload(ptr uintptr) ( value uintptr, error uintptr)
|
||||||
|
TEXT ·safeload(SB), NOSPLIT, $0-24
|
||||||
|
MOVD ptr+0(FP), R10 // test pointer in R10
|
||||||
|
MOVD $0x0, R6
|
||||||
|
BYTE $0xE3; BYTE $0x20; BYTE $0x04; BYTE $0xB8; BYTE $0x00; BYTE $0x17 // llgt 2,1208
|
||||||
|
BYTE $0xB9; BYTE $0x17; BYTE $0x00; BYTE $0x22 // llgtr 2,2
|
||||||
|
BYTE $0xA5; BYTE $0x26; BYTE $0x7F; BYTE $0xFF // nilh 2,32767
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x58; BYTE $0x00; BYTE $0x04 // lg 2,88(2)
|
||||||
|
BYTE $0xE3; BYTE $0x22; BYTE $0x00; BYTE $0x08; BYTE $0x00; BYTE $0x04 // lg 2,8(2)
|
||||||
|
BYTE $0x41; BYTE $0x22; BYTE $0x03; BYTE $0x68 // la 2,872(2)
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x33 // xgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x55; BYTE $0x00; BYTE $0x04 // bras 5,lbl1
|
||||||
|
BYTE $0xA7; BYTE $0x39; BYTE $0x00; BYTE $0x01 // lghi 3,1
|
||||||
|
BYTE $0xB9; BYTE $0x02; BYTE $0x00; BYTE $0x33 // lbl1 ltgr 3,3
|
||||||
|
BYTE $0xA7; BYTE $0x74; BYTE $0x00; BYTE $0x08 // brc b'0111',lbl2
|
||||||
|
BYTE $0xE3; BYTE $0x52; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 5,0(2)
|
||||||
|
BYTE $0xE3; BYTE $0x6A; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x04 // lg 6,0(10)
|
||||||
|
BYTE $0xB9; BYTE $0x82; BYTE $0x00; BYTE $0x99 // lbl2 xgr 9,9
|
||||||
|
BYTE $0xE3; BYTE $0x92; BYTE $0x00; BYTE $0x00; BYTE $0x00; BYTE $0x24 // stg 9,0(2)
|
||||||
|
MOVD R6, value+8(FP) // result in R6
|
||||||
|
MOVD R3, error+16(FP) // error in R3
|
||||||
|
RET
|
||||||
|
|
|
||||||
657
vendor/golang.org/x/sys/unix/bpxsvc_zos.go
generated
vendored
Normal file
657
vendor/golang.org/x/sys/unix/bpxsvc_zos.go
generated
vendored
Normal file
|
|
@ -0,0 +1,657 @@
|
||||||
|
// Copyright 2024 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.
|
||||||
|
|
||||||
|
//go:build zos
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"fmt"
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
//go:noescape
|
||||||
|
func bpxcall(plist []unsafe.Pointer, bpx_offset int64)
|
||||||
|
|
||||||
|
//go:noescape
|
||||||
|
func A2e([]byte)
|
||||||
|
|
||||||
|
//go:noescape
|
||||||
|
func E2a([]byte)
|
||||||
|
|
||||||
|
const (
|
||||||
|
BPX4STA = 192 // stat
|
||||||
|
BPX4FST = 104 // fstat
|
||||||
|
BPX4LST = 132 // lstat
|
||||||
|
BPX4OPN = 156 // open
|
||||||
|
BPX4CLO = 72 // close
|
||||||
|
BPX4CHR = 500 // chattr
|
||||||
|
BPX4FCR = 504 // fchattr
|
||||||
|
BPX4LCR = 1180 // lchattr
|
||||||
|
BPX4CTW = 492 // cond_timed_wait
|
||||||
|
BPX4GTH = 1056 // __getthent
|
||||||
|
BPX4PTQ = 412 // pthread_quiesc
|
||||||
|
BPX4PTR = 320 // ptrace
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
//options
|
||||||
|
//byte1
|
||||||
|
BPX_OPNFHIGH = 0x80
|
||||||
|
//byte2
|
||||||
|
BPX_OPNFEXEC = 0x80
|
||||||
|
//byte3
|
||||||
|
BPX_O_NOLARGEFILE = 0x08
|
||||||
|
BPX_O_LARGEFILE = 0x04
|
||||||
|
BPX_O_ASYNCSIG = 0x02
|
||||||
|
BPX_O_SYNC = 0x01
|
||||||
|
//byte4
|
||||||
|
BPX_O_CREXCL = 0xc0
|
||||||
|
BPX_O_CREAT = 0x80
|
||||||
|
BPX_O_EXCL = 0x40
|
||||||
|
BPX_O_NOCTTY = 0x20
|
||||||
|
BPX_O_TRUNC = 0x10
|
||||||
|
BPX_O_APPEND = 0x08
|
||||||
|
BPX_O_NONBLOCK = 0x04
|
||||||
|
BPX_FNDELAY = 0x04
|
||||||
|
BPX_O_RDWR = 0x03
|
||||||
|
BPX_O_RDONLY = 0x02
|
||||||
|
BPX_O_WRONLY = 0x01
|
||||||
|
BPX_O_ACCMODE = 0x03
|
||||||
|
BPX_O_GETFL = 0x0f
|
||||||
|
|
||||||
|
//mode
|
||||||
|
// byte1 (file type)
|
||||||
|
BPX_FT_DIR = 1
|
||||||
|
BPX_FT_CHARSPEC = 2
|
||||||
|
BPX_FT_REGFILE = 3
|
||||||
|
BPX_FT_FIFO = 4
|
||||||
|
BPX_FT_SYMLINK = 5
|
||||||
|
BPX_FT_SOCKET = 6
|
||||||
|
//byte3
|
||||||
|
BPX_S_ISUID = 0x08
|
||||||
|
BPX_S_ISGID = 0x04
|
||||||
|
BPX_S_ISVTX = 0x02
|
||||||
|
BPX_S_IRWXU1 = 0x01
|
||||||
|
BPX_S_IRUSR = 0x01
|
||||||
|
//byte4
|
||||||
|
BPX_S_IRWXU2 = 0xc0
|
||||||
|
BPX_S_IWUSR = 0x80
|
||||||
|
BPX_S_IXUSR = 0x40
|
||||||
|
BPX_S_IRWXG = 0x38
|
||||||
|
BPX_S_IRGRP = 0x20
|
||||||
|
BPX_S_IWGRP = 0x10
|
||||||
|
BPX_S_IXGRP = 0x08
|
||||||
|
BPX_S_IRWXOX = 0x07
|
||||||
|
BPX_S_IROTH = 0x04
|
||||||
|
BPX_S_IWOTH = 0x02
|
||||||
|
BPX_S_IXOTH = 0x01
|
||||||
|
|
||||||
|
CW_INTRPT = 1
|
||||||
|
CW_CONDVAR = 32
|
||||||
|
CW_TIMEOUT = 64
|
||||||
|
|
||||||
|
PGTHA_NEXT = 2
|
||||||
|
PGTHA_CURRENT = 1
|
||||||
|
PGTHA_FIRST = 0
|
||||||
|
PGTHA_LAST = 3
|
||||||
|
PGTHA_PROCESS = 0x80
|
||||||
|
PGTHA_CONTTY = 0x40
|
||||||
|
PGTHA_PATH = 0x20
|
||||||
|
PGTHA_COMMAND = 0x10
|
||||||
|
PGTHA_FILEDATA = 0x08
|
||||||
|
PGTHA_THREAD = 0x04
|
||||||
|
PGTHA_PTAG = 0x02
|
||||||
|
PGTHA_COMMANDLONG = 0x01
|
||||||
|
PGTHA_THREADFAST = 0x80
|
||||||
|
PGTHA_FILEPATH = 0x40
|
||||||
|
PGTHA_THDSIGMASK = 0x20
|
||||||
|
// thread quiece mode
|
||||||
|
QUIESCE_TERM int32 = 1
|
||||||
|
QUIESCE_FORCE int32 = 2
|
||||||
|
QUIESCE_QUERY int32 = 3
|
||||||
|
QUIESCE_FREEZE int32 = 4
|
||||||
|
QUIESCE_UNFREEZE int32 = 5
|
||||||
|
FREEZE_THIS_THREAD int32 = 6
|
||||||
|
FREEZE_EXIT int32 = 8
|
||||||
|
QUIESCE_SRB int32 = 9
|
||||||
|
)
|
||||||
|
|
||||||
|
type Pgtha struct {
|
||||||
|
Pid uint32 // 0
|
||||||
|
Tid0 uint32 // 4
|
||||||
|
Tid1 uint32
|
||||||
|
Accesspid byte // C
|
||||||
|
Accesstid byte // D
|
||||||
|
Accessasid uint16 // E
|
||||||
|
Loginname [8]byte // 10
|
||||||
|
Flag1 byte // 18
|
||||||
|
Flag1b2 byte // 19
|
||||||
|
}
|
||||||
|
|
||||||
|
type Bpxystat_t struct { // DSECT BPXYSTAT
|
||||||
|
St_id [4]uint8 // 0
|
||||||
|
St_length uint16 // 0x4
|
||||||
|
St_version uint16 // 0x6
|
||||||
|
St_mode uint32 // 0x8
|
||||||
|
St_ino uint32 // 0xc
|
||||||
|
St_dev uint32 // 0x10
|
||||||
|
St_nlink uint32 // 0x14
|
||||||
|
St_uid uint32 // 0x18
|
||||||
|
St_gid uint32 // 0x1c
|
||||||
|
St_size uint64 // 0x20
|
||||||
|
St_atime uint32 // 0x28
|
||||||
|
St_mtime uint32 // 0x2c
|
||||||
|
St_ctime uint32 // 0x30
|
||||||
|
St_rdev uint32 // 0x34
|
||||||
|
St_auditoraudit uint32 // 0x38
|
||||||
|
St_useraudit uint32 // 0x3c
|
||||||
|
St_blksize uint32 // 0x40
|
||||||
|
St_createtime uint32 // 0x44
|
||||||
|
St_auditid [4]uint32 // 0x48
|
||||||
|
St_res01 uint32 // 0x58
|
||||||
|
Ft_ccsid uint16 // 0x5c
|
||||||
|
Ft_flags uint16 // 0x5e
|
||||||
|
St_res01a [2]uint32 // 0x60
|
||||||
|
St_res02 uint32 // 0x68
|
||||||
|
St_blocks uint32 // 0x6c
|
||||||
|
St_opaque [3]uint8 // 0x70
|
||||||
|
St_visible uint8 // 0x73
|
||||||
|
St_reftime uint32 // 0x74
|
||||||
|
St_fid uint64 // 0x78
|
||||||
|
St_filefmt uint8 // 0x80
|
||||||
|
St_fspflag2 uint8 // 0x81
|
||||||
|
St_res03 [2]uint8 // 0x82
|
||||||
|
St_ctimemsec uint32 // 0x84
|
||||||
|
St_seclabel [8]uint8 // 0x88
|
||||||
|
St_res04 [4]uint8 // 0x90
|
||||||
|
// end of version 1
|
||||||
|
_ uint32 // 0x94
|
||||||
|
St_atime64 uint64 // 0x98
|
||||||
|
St_mtime64 uint64 // 0xa0
|
||||||
|
St_ctime64 uint64 // 0xa8
|
||||||
|
St_createtime64 uint64 // 0xb0
|
||||||
|
St_reftime64 uint64 // 0xb8
|
||||||
|
_ uint64 // 0xc0
|
||||||
|
St_res05 [16]uint8 // 0xc8
|
||||||
|
// end of version 2
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpxFilestatus struct {
|
||||||
|
Oflag1 byte
|
||||||
|
Oflag2 byte
|
||||||
|
Oflag3 byte
|
||||||
|
Oflag4 byte
|
||||||
|
}
|
||||||
|
|
||||||
|
type BpxMode struct {
|
||||||
|
Ftype byte
|
||||||
|
Mode1 byte
|
||||||
|
Mode2 byte
|
||||||
|
Mode3 byte
|
||||||
|
}
|
||||||
|
|
||||||
|
// Thr attribute structure for extended attributes
|
||||||
|
type Bpxyatt_t struct { // DSECT BPXYATT
|
||||||
|
Att_id [4]uint8
|
||||||
|
Att_version uint16
|
||||||
|
Att_res01 [2]uint8
|
||||||
|
Att_setflags1 uint8
|
||||||
|
Att_setflags2 uint8
|
||||||
|
Att_setflags3 uint8
|
||||||
|
Att_setflags4 uint8
|
||||||
|
Att_mode uint32
|
||||||
|
Att_uid uint32
|
||||||
|
Att_gid uint32
|
||||||
|
Att_opaquemask [3]uint8
|
||||||
|
Att_visblmaskres uint8
|
||||||
|
Att_opaque [3]uint8
|
||||||
|
Att_visibleres uint8
|
||||||
|
Att_size_h uint32
|
||||||
|
Att_size_l uint32
|
||||||
|
Att_atime uint32
|
||||||
|
Att_mtime uint32
|
||||||
|
Att_auditoraudit uint32
|
||||||
|
Att_useraudit uint32
|
||||||
|
Att_ctime uint32
|
||||||
|
Att_reftime uint32
|
||||||
|
// end of version 1
|
||||||
|
Att_filefmt uint8
|
||||||
|
Att_res02 [3]uint8
|
||||||
|
Att_filetag uint32
|
||||||
|
Att_res03 [8]uint8
|
||||||
|
// end of version 2
|
||||||
|
Att_atime64 uint64
|
||||||
|
Att_mtime64 uint64
|
||||||
|
Att_ctime64 uint64
|
||||||
|
Att_reftime64 uint64
|
||||||
|
Att_seclabel [8]uint8
|
||||||
|
Att_ver3res02 [8]uint8
|
||||||
|
// end of version 3
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxOpen(name string, options *BpxFilestatus, mode *BpxMode) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(name) < 1024 {
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], name))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(options)
|
||||||
|
parms[3] = unsafe.Pointer(mode)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4OPN)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxClose(fd int32) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [4]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&fd)
|
||||||
|
parms[1] = unsafe.Pointer(&rv)
|
||||||
|
parms[2] = unsafe.Pointer(&rc)
|
||||||
|
parms[3] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4CLO)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFileFStat(fd int32, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
|
||||||
|
st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
|
||||||
|
st.St_version = 2
|
||||||
|
stat_sz := uint32(unsafe.Sizeof(*st))
|
||||||
|
var parms [6]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&fd)
|
||||||
|
parms[1] = unsafe.Pointer(&stat_sz)
|
||||||
|
parms[2] = unsafe.Pointer(st)
|
||||||
|
parms[3] = unsafe.Pointer(&rv)
|
||||||
|
parms[4] = unsafe.Pointer(&rc)
|
||||||
|
parms[5] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4FST)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFileStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(name) < 1024 {
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], name))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
|
||||||
|
st.St_version = 2
|
||||||
|
stat_sz := uint32(unsafe.Sizeof(*st))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&stat_sz)
|
||||||
|
parms[3] = unsafe.Pointer(st)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4STA)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFileLStat(name string, st *Bpxystat_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(name) < 1024 {
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], name))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
st.St_id = [4]uint8{0xe2, 0xe3, 0xc1, 0xe3}
|
||||||
|
st.St_version = 2
|
||||||
|
stat_sz := uint32(unsafe.Sizeof(*st))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&stat_sz)
|
||||||
|
parms[3] = unsafe.Pointer(st)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4LST)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxChattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(path) >= 1024 {
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], path))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
attr_sz := uint32(unsafe.Sizeof(*attr))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&attr_sz)
|
||||||
|
parms[3] = unsafe.Pointer(attr)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4CHR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxLchattr(path string, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
|
||||||
|
if len(path) >= 1024 {
|
||||||
|
return -1, -1, -1
|
||||||
|
}
|
||||||
|
var namebuf [1024]byte
|
||||||
|
sz := int32(copy(namebuf[:], path))
|
||||||
|
A2e(namebuf[:sz])
|
||||||
|
attr_sz := uint32(unsafe.Sizeof(*attr))
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sz)
|
||||||
|
parms[1] = unsafe.Pointer(&namebuf[0])
|
||||||
|
parms[2] = unsafe.Pointer(&attr_sz)
|
||||||
|
parms[3] = unsafe.Pointer(attr)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4LCR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxFchattr(fd int32, attr *Bpxyatt_t) (rv int32, rc int32, rn int32) {
|
||||||
|
attr_sz := uint32(unsafe.Sizeof(*attr))
|
||||||
|
var parms [6]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&fd)
|
||||||
|
parms[1] = unsafe.Pointer(&attr_sz)
|
||||||
|
parms[2] = unsafe.Pointer(attr)
|
||||||
|
parms[3] = unsafe.Pointer(&rv)
|
||||||
|
parms[4] = unsafe.Pointer(&rc)
|
||||||
|
parms[5] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4FCR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func BpxCondTimedWait(sec uint32, nsec uint32, events uint32, secrem *uint32, nsecrem *uint32) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [8]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&sec)
|
||||||
|
parms[1] = unsafe.Pointer(&nsec)
|
||||||
|
parms[2] = unsafe.Pointer(&events)
|
||||||
|
parms[3] = unsafe.Pointer(secrem)
|
||||||
|
parms[4] = unsafe.Pointer(nsecrem)
|
||||||
|
parms[5] = unsafe.Pointer(&rv)
|
||||||
|
parms[6] = unsafe.Pointer(&rc)
|
||||||
|
parms[7] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4CTW)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
func BpxGetthent(in *Pgtha, outlen *uint32, out unsafe.Pointer) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [7]unsafe.Pointer
|
||||||
|
inlen := uint32(26) // nothing else will work. Go says Pgtha is 28-byte because of alignment, but Pgtha is "packed" and must be 26-byte
|
||||||
|
parms[0] = unsafe.Pointer(&inlen)
|
||||||
|
parms[1] = unsafe.Pointer(&in)
|
||||||
|
parms[2] = unsafe.Pointer(outlen)
|
||||||
|
parms[3] = unsafe.Pointer(&out)
|
||||||
|
parms[4] = unsafe.Pointer(&rv)
|
||||||
|
parms[5] = unsafe.Pointer(&rc)
|
||||||
|
parms[6] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4GTH)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
func ZosJobname() (jobname string, err error) {
|
||||||
|
var pgtha Pgtha
|
||||||
|
pgtha.Pid = uint32(Getpid())
|
||||||
|
pgtha.Accesspid = PGTHA_CURRENT
|
||||||
|
pgtha.Flag1 = PGTHA_PROCESS
|
||||||
|
var out [256]byte
|
||||||
|
var outlen uint32
|
||||||
|
outlen = 256
|
||||||
|
rv, rc, rn := BpxGetthent(&pgtha, &outlen, unsafe.Pointer(&out[0]))
|
||||||
|
if rv == 0 {
|
||||||
|
gthc := []byte{0x87, 0xa3, 0x88, 0x83} // 'gthc' in ebcdic
|
||||||
|
ix := bytes.Index(out[:], gthc)
|
||||||
|
if ix == -1 {
|
||||||
|
err = fmt.Errorf("BPX4GTH: gthc return data not found")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
jn := out[ix+80 : ix+88] // we didn't declare Pgthc, but jobname is 8-byte at offset 80
|
||||||
|
E2a(jn)
|
||||||
|
jobname = string(bytes.TrimRight(jn, " "))
|
||||||
|
|
||||||
|
} else {
|
||||||
|
err = fmt.Errorf("BPX4GTH: rc=%d errno=%d reason=code=0x%x", rv, rc, rn)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func Bpx4ptq(code int32, data string) (rv int32, rc int32, rn int32) {
|
||||||
|
var userdata [8]byte
|
||||||
|
var parms [5]unsafe.Pointer
|
||||||
|
copy(userdata[:], data+" ")
|
||||||
|
A2e(userdata[:])
|
||||||
|
parms[0] = unsafe.Pointer(&code)
|
||||||
|
parms[1] = unsafe.Pointer(&userdata[0])
|
||||||
|
parms[2] = unsafe.Pointer(&rv)
|
||||||
|
parms[3] = unsafe.Pointer(&rc)
|
||||||
|
parms[4] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4PTQ)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
PT_TRACE_ME = 0 // Debug this process
|
||||||
|
PT_READ_I = 1 // Read a full word
|
||||||
|
PT_READ_D = 2 // Read a full word
|
||||||
|
PT_READ_U = 3 // Read control info
|
||||||
|
PT_WRITE_I = 4 //Write a full word
|
||||||
|
PT_WRITE_D = 5 //Write a full word
|
||||||
|
PT_CONTINUE = 7 //Continue the process
|
||||||
|
PT_KILL = 8 //Terminate the process
|
||||||
|
PT_READ_GPR = 11 // Read GPR, CR, PSW
|
||||||
|
PT_READ_FPR = 12 // Read FPR
|
||||||
|
PT_READ_VR = 13 // Read VR
|
||||||
|
PT_WRITE_GPR = 14 // Write GPR, CR, PSW
|
||||||
|
PT_WRITE_FPR = 15 // Write FPR
|
||||||
|
PT_WRITE_VR = 16 // Write VR
|
||||||
|
PT_READ_BLOCK = 17 // Read storage
|
||||||
|
PT_WRITE_BLOCK = 19 // Write storage
|
||||||
|
PT_READ_GPRH = 20 // Read GPRH
|
||||||
|
PT_WRITE_GPRH = 21 // Write GPRH
|
||||||
|
PT_REGHSET = 22 // Read all GPRHs
|
||||||
|
PT_ATTACH = 30 // Attach to a process
|
||||||
|
PT_DETACH = 31 // Detach from a process
|
||||||
|
PT_REGSET = 32 // Read all GPRs
|
||||||
|
PT_REATTACH = 33 // Reattach to a process
|
||||||
|
PT_LDINFO = 34 // Read loader info
|
||||||
|
PT_MULTI = 35 // Multi process mode
|
||||||
|
PT_LD64INFO = 36 // RMODE64 Info Area
|
||||||
|
PT_BLOCKREQ = 40 // Block request
|
||||||
|
PT_THREAD_INFO = 60 // Read thread info
|
||||||
|
PT_THREAD_MODIFY = 61
|
||||||
|
PT_THREAD_READ_FOCUS = 62
|
||||||
|
PT_THREAD_WRITE_FOCUS = 63
|
||||||
|
PT_THREAD_HOLD = 64
|
||||||
|
PT_THREAD_SIGNAL = 65
|
||||||
|
PT_EXPLAIN = 66
|
||||||
|
PT_EVENTS = 67
|
||||||
|
PT_THREAD_INFO_EXTENDED = 68
|
||||||
|
PT_REATTACH2 = 71
|
||||||
|
PT_CAPTURE = 72
|
||||||
|
PT_UNCAPTURE = 73
|
||||||
|
PT_GET_THREAD_TCB = 74
|
||||||
|
PT_GET_ALET = 75
|
||||||
|
PT_SWAPIN = 76
|
||||||
|
PT_EXTENDED_EVENT = 98
|
||||||
|
PT_RECOVER = 99 // Debug a program check
|
||||||
|
PT_GPR0 = 0 // General purpose register 0
|
||||||
|
PT_GPR1 = 1 // General purpose register 1
|
||||||
|
PT_GPR2 = 2 // General purpose register 2
|
||||||
|
PT_GPR3 = 3 // General purpose register 3
|
||||||
|
PT_GPR4 = 4 // General purpose register 4
|
||||||
|
PT_GPR5 = 5 // General purpose register 5
|
||||||
|
PT_GPR6 = 6 // General purpose register 6
|
||||||
|
PT_GPR7 = 7 // General purpose register 7
|
||||||
|
PT_GPR8 = 8 // General purpose register 8
|
||||||
|
PT_GPR9 = 9 // General purpose register 9
|
||||||
|
PT_GPR10 = 10 // General purpose register 10
|
||||||
|
PT_GPR11 = 11 // General purpose register 11
|
||||||
|
PT_GPR12 = 12 // General purpose register 12
|
||||||
|
PT_GPR13 = 13 // General purpose register 13
|
||||||
|
PT_GPR14 = 14 // General purpose register 14
|
||||||
|
PT_GPR15 = 15 // General purpose register 15
|
||||||
|
PT_FPR0 = 16 // Floating point register 0
|
||||||
|
PT_FPR1 = 17 // Floating point register 1
|
||||||
|
PT_FPR2 = 18 // Floating point register 2
|
||||||
|
PT_FPR3 = 19 // Floating point register 3
|
||||||
|
PT_FPR4 = 20 // Floating point register 4
|
||||||
|
PT_FPR5 = 21 // Floating point register 5
|
||||||
|
PT_FPR6 = 22 // Floating point register 6
|
||||||
|
PT_FPR7 = 23 // Floating point register 7
|
||||||
|
PT_FPR8 = 24 // Floating point register 8
|
||||||
|
PT_FPR9 = 25 // Floating point register 9
|
||||||
|
PT_FPR10 = 26 // Floating point register 10
|
||||||
|
PT_FPR11 = 27 // Floating point register 11
|
||||||
|
PT_FPR12 = 28 // Floating point register 12
|
||||||
|
PT_FPR13 = 29 // Floating point register 13
|
||||||
|
PT_FPR14 = 30 // Floating point register 14
|
||||||
|
PT_FPR15 = 31 // Floating point register 15
|
||||||
|
PT_FPC = 32 // Floating point control register
|
||||||
|
PT_PSW = 40 // PSW
|
||||||
|
PT_PSW0 = 40 // Left half of the PSW
|
||||||
|
PT_PSW1 = 41 // Right half of the PSW
|
||||||
|
PT_CR0 = 42 // Control register 0
|
||||||
|
PT_CR1 = 43 // Control register 1
|
||||||
|
PT_CR2 = 44 // Control register 2
|
||||||
|
PT_CR3 = 45 // Control register 3
|
||||||
|
PT_CR4 = 46 // Control register 4
|
||||||
|
PT_CR5 = 47 // Control register 5
|
||||||
|
PT_CR6 = 48 // Control register 6
|
||||||
|
PT_CR7 = 49 // Control register 7
|
||||||
|
PT_CR8 = 50 // Control register 8
|
||||||
|
PT_CR9 = 51 // Control register 9
|
||||||
|
PT_CR10 = 52 // Control register 10
|
||||||
|
PT_CR11 = 53 // Control register 11
|
||||||
|
PT_CR12 = 54 // Control register 12
|
||||||
|
PT_CR13 = 55 // Control register 13
|
||||||
|
PT_CR14 = 56 // Control register 14
|
||||||
|
PT_CR15 = 57 // Control register 15
|
||||||
|
PT_GPRH0 = 58 // GP High register 0
|
||||||
|
PT_GPRH1 = 59 // GP High register 1
|
||||||
|
PT_GPRH2 = 60 // GP High register 2
|
||||||
|
PT_GPRH3 = 61 // GP High register 3
|
||||||
|
PT_GPRH4 = 62 // GP High register 4
|
||||||
|
PT_GPRH5 = 63 // GP High register 5
|
||||||
|
PT_GPRH6 = 64 // GP High register 6
|
||||||
|
PT_GPRH7 = 65 // GP High register 7
|
||||||
|
PT_GPRH8 = 66 // GP High register 8
|
||||||
|
PT_GPRH9 = 67 // GP High register 9
|
||||||
|
PT_GPRH10 = 68 // GP High register 10
|
||||||
|
PT_GPRH11 = 69 // GP High register 11
|
||||||
|
PT_GPRH12 = 70 // GP High register 12
|
||||||
|
PT_GPRH13 = 71 // GP High register 13
|
||||||
|
PT_GPRH14 = 72 // GP High register 14
|
||||||
|
PT_GPRH15 = 73 // GP High register 15
|
||||||
|
PT_VR0 = 74 // Vector register 0
|
||||||
|
PT_VR1 = 75 // Vector register 1
|
||||||
|
PT_VR2 = 76 // Vector register 2
|
||||||
|
PT_VR3 = 77 // Vector register 3
|
||||||
|
PT_VR4 = 78 // Vector register 4
|
||||||
|
PT_VR5 = 79 // Vector register 5
|
||||||
|
PT_VR6 = 80 // Vector register 6
|
||||||
|
PT_VR7 = 81 // Vector register 7
|
||||||
|
PT_VR8 = 82 // Vector register 8
|
||||||
|
PT_VR9 = 83 // Vector register 9
|
||||||
|
PT_VR10 = 84 // Vector register 10
|
||||||
|
PT_VR11 = 85 // Vector register 11
|
||||||
|
PT_VR12 = 86 // Vector register 12
|
||||||
|
PT_VR13 = 87 // Vector register 13
|
||||||
|
PT_VR14 = 88 // Vector register 14
|
||||||
|
PT_VR15 = 89 // Vector register 15
|
||||||
|
PT_VR16 = 90 // Vector register 16
|
||||||
|
PT_VR17 = 91 // Vector register 17
|
||||||
|
PT_VR18 = 92 // Vector register 18
|
||||||
|
PT_VR19 = 93 // Vector register 19
|
||||||
|
PT_VR20 = 94 // Vector register 20
|
||||||
|
PT_VR21 = 95 // Vector register 21
|
||||||
|
PT_VR22 = 96 // Vector register 22
|
||||||
|
PT_VR23 = 97 // Vector register 23
|
||||||
|
PT_VR24 = 98 // Vector register 24
|
||||||
|
PT_VR25 = 99 // Vector register 25
|
||||||
|
PT_VR26 = 100 // Vector register 26
|
||||||
|
PT_VR27 = 101 // Vector register 27
|
||||||
|
PT_VR28 = 102 // Vector register 28
|
||||||
|
PT_VR29 = 103 // Vector register 29
|
||||||
|
PT_VR30 = 104 // Vector register 30
|
||||||
|
PT_VR31 = 105 // Vector register 31
|
||||||
|
PT_PSWG = 106 // PSWG
|
||||||
|
PT_PSWG0 = 106 // Bytes 0-3
|
||||||
|
PT_PSWG1 = 107 // Bytes 4-7
|
||||||
|
PT_PSWG2 = 108 // Bytes 8-11 (IA high word)
|
||||||
|
PT_PSWG3 = 109 // Bytes 12-15 (IA low word)
|
||||||
|
)
|
||||||
|
|
||||||
|
func Bpx4ptr(request int32, pid int32, addr unsafe.Pointer, data unsafe.Pointer, buffer unsafe.Pointer) (rv int32, rc int32, rn int32) {
|
||||||
|
var parms [8]unsafe.Pointer
|
||||||
|
parms[0] = unsafe.Pointer(&request)
|
||||||
|
parms[1] = unsafe.Pointer(&pid)
|
||||||
|
parms[2] = unsafe.Pointer(&addr)
|
||||||
|
parms[3] = unsafe.Pointer(&data)
|
||||||
|
parms[4] = unsafe.Pointer(&buffer)
|
||||||
|
parms[5] = unsafe.Pointer(&rv)
|
||||||
|
parms[6] = unsafe.Pointer(&rc)
|
||||||
|
parms[7] = unsafe.Pointer(&rn)
|
||||||
|
bpxcall(parms[:], BPX4PTR)
|
||||||
|
return rv, rc, rn
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU8(val uint8, dest []uint8) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU8Arr(src, dest []uint8) int {
|
||||||
|
if len(dest) < len(src) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
for i, v := range src {
|
||||||
|
dest[i] = v
|
||||||
|
}
|
||||||
|
return len(src)
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU16(val uint16, dest []uint16) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU32(val uint32, dest []uint32) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU32Arr(src, dest []uint32) int {
|
||||||
|
if len(dest) < len(src) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
for i, v := range src {
|
||||||
|
dest[i] = v
|
||||||
|
}
|
||||||
|
return len(src)
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyU64(val uint64, dest []uint64) int {
|
||||||
|
if len(dest) < 1 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
dest[0] = val
|
||||||
|
return 1
|
||||||
|
}
|
||||||
192
vendor/golang.org/x/sys/unix/bpxsvc_zos.s
generated
vendored
Normal file
192
vendor/golang.org/x/sys/unix/bpxsvc_zos.s
generated
vendored
Normal file
|
|
@ -0,0 +1,192 @@
|
||||||
|
// Copyright 2024 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.
|
||||||
|
|
||||||
|
#include "go_asm.h"
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// function to call USS assembly language services
|
||||||
|
//
|
||||||
|
// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bit64env.htm
|
||||||
|
//
|
||||||
|
// arg1 unsafe.Pointer array that ressembles an OS PLIST
|
||||||
|
//
|
||||||
|
// arg2 function offset as in
|
||||||
|
// doc: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_3.1.0/com.ibm.zos.v3r1.bpxb100/bpx2cr_List_of_offsets.htm
|
||||||
|
//
|
||||||
|
// func bpxcall(plist []unsafe.Pointer, bpx_offset int64)
|
||||||
|
|
||||||
|
TEXT ·bpxcall(SB), NOSPLIT|NOFRAME, $0
|
||||||
|
MOVD plist_base+0(FP), R1 // r1 points to plist
|
||||||
|
MOVD bpx_offset+24(FP), R2 // r2 offset to BPX vector table
|
||||||
|
MOVD R14, R7 // save r14
|
||||||
|
MOVD R15, R8 // save r15
|
||||||
|
MOVWZ 16(R0), R9
|
||||||
|
MOVWZ 544(R9), R9
|
||||||
|
MOVWZ 24(R9), R9 // call vector in r9
|
||||||
|
ADD R2, R9 // add offset to vector table
|
||||||
|
MOVWZ (R9), R9 // r9 points to entry point
|
||||||
|
BYTE $0x0D // BL R14,R9 --> basr r14,r9
|
||||||
|
BYTE $0xE9 // clobbers 0,1,14,15
|
||||||
|
MOVD R8, R15 // restore 15
|
||||||
|
JMP R7 // return via saved return address
|
||||||
|
|
||||||
|
// func A2e(arr [] byte)
|
||||||
|
// code page conversion from 819 to 1047
|
||||||
|
TEXT ·A2e(SB), NOSPLIT|NOFRAME, $0
|
||||||
|
MOVD arg_base+0(FP), R2 // pointer to arry of characters
|
||||||
|
MOVD arg_len+8(FP), R3 // count
|
||||||
|
XOR R0, R0
|
||||||
|
XOR R1, R1
|
||||||
|
BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2))
|
||||||
|
|
||||||
|
// ASCII -> EBCDIC conversion table:
|
||||||
|
BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03
|
||||||
|
BYTE $0x37; BYTE $0x2d; BYTE $0x2e; BYTE $0x2f
|
||||||
|
BYTE $0x16; BYTE $0x05; BYTE $0x15; BYTE $0x0b
|
||||||
|
BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f
|
||||||
|
BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13
|
||||||
|
BYTE $0x3c; BYTE $0x3d; BYTE $0x32; BYTE $0x26
|
||||||
|
BYTE $0x18; BYTE $0x19; BYTE $0x3f; BYTE $0x27
|
||||||
|
BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f
|
||||||
|
BYTE $0x40; BYTE $0x5a; BYTE $0x7f; BYTE $0x7b
|
||||||
|
BYTE $0x5b; BYTE $0x6c; BYTE $0x50; BYTE $0x7d
|
||||||
|
BYTE $0x4d; BYTE $0x5d; BYTE $0x5c; BYTE $0x4e
|
||||||
|
BYTE $0x6b; BYTE $0x60; BYTE $0x4b; BYTE $0x61
|
||||||
|
BYTE $0xf0; BYTE $0xf1; BYTE $0xf2; BYTE $0xf3
|
||||||
|
BYTE $0xf4; BYTE $0xf5; BYTE $0xf6; BYTE $0xf7
|
||||||
|
BYTE $0xf8; BYTE $0xf9; BYTE $0x7a; BYTE $0x5e
|
||||||
|
BYTE $0x4c; BYTE $0x7e; BYTE $0x6e; BYTE $0x6f
|
||||||
|
BYTE $0x7c; BYTE $0xc1; BYTE $0xc2; BYTE $0xc3
|
||||||
|
BYTE $0xc4; BYTE $0xc5; BYTE $0xc6; BYTE $0xc7
|
||||||
|
BYTE $0xc8; BYTE $0xc9; BYTE $0xd1; BYTE $0xd2
|
||||||
|
BYTE $0xd3; BYTE $0xd4; BYTE $0xd5; BYTE $0xd6
|
||||||
|
BYTE $0xd7; BYTE $0xd8; BYTE $0xd9; BYTE $0xe2
|
||||||
|
BYTE $0xe3; BYTE $0xe4; BYTE $0xe5; BYTE $0xe6
|
||||||
|
BYTE $0xe7; BYTE $0xe8; BYTE $0xe9; BYTE $0xad
|
||||||
|
BYTE $0xe0; BYTE $0xbd; BYTE $0x5f; BYTE $0x6d
|
||||||
|
BYTE $0x79; BYTE $0x81; BYTE $0x82; BYTE $0x83
|
||||||
|
BYTE $0x84; BYTE $0x85; BYTE $0x86; BYTE $0x87
|
||||||
|
BYTE $0x88; BYTE $0x89; BYTE $0x91; BYTE $0x92
|
||||||
|
BYTE $0x93; BYTE $0x94; BYTE $0x95; BYTE $0x96
|
||||||
|
BYTE $0x97; BYTE $0x98; BYTE $0x99; BYTE $0xa2
|
||||||
|
BYTE $0xa3; BYTE $0xa4; BYTE $0xa5; BYTE $0xa6
|
||||||
|
BYTE $0xa7; BYTE $0xa8; BYTE $0xa9; BYTE $0xc0
|
||||||
|
BYTE $0x4f; BYTE $0xd0; BYTE $0xa1; BYTE $0x07
|
||||||
|
BYTE $0x20; BYTE $0x21; BYTE $0x22; BYTE $0x23
|
||||||
|
BYTE $0x24; BYTE $0x25; BYTE $0x06; BYTE $0x17
|
||||||
|
BYTE $0x28; BYTE $0x29; BYTE $0x2a; BYTE $0x2b
|
||||||
|
BYTE $0x2c; BYTE $0x09; BYTE $0x0a; BYTE $0x1b
|
||||||
|
BYTE $0x30; BYTE $0x31; BYTE $0x1a; BYTE $0x33
|
||||||
|
BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x08
|
||||||
|
BYTE $0x38; BYTE $0x39; BYTE $0x3a; BYTE $0x3b
|
||||||
|
BYTE $0x04; BYTE $0x14; BYTE $0x3e; BYTE $0xff
|
||||||
|
BYTE $0x41; BYTE $0xaa; BYTE $0x4a; BYTE $0xb1
|
||||||
|
BYTE $0x9f; BYTE $0xb2; BYTE $0x6a; BYTE $0xb5
|
||||||
|
BYTE $0xbb; BYTE $0xb4; BYTE $0x9a; BYTE $0x8a
|
||||||
|
BYTE $0xb0; BYTE $0xca; BYTE $0xaf; BYTE $0xbc
|
||||||
|
BYTE $0x90; BYTE $0x8f; BYTE $0xea; BYTE $0xfa
|
||||||
|
BYTE $0xbe; BYTE $0xa0; BYTE $0xb6; BYTE $0xb3
|
||||||
|
BYTE $0x9d; BYTE $0xda; BYTE $0x9b; BYTE $0x8b
|
||||||
|
BYTE $0xb7; BYTE $0xb8; BYTE $0xb9; BYTE $0xab
|
||||||
|
BYTE $0x64; BYTE $0x65; BYTE $0x62; BYTE $0x66
|
||||||
|
BYTE $0x63; BYTE $0x67; BYTE $0x9e; BYTE $0x68
|
||||||
|
BYTE $0x74; BYTE $0x71; BYTE $0x72; BYTE $0x73
|
||||||
|
BYTE $0x78; BYTE $0x75; BYTE $0x76; BYTE $0x77
|
||||||
|
BYTE $0xac; BYTE $0x69; BYTE $0xed; BYTE $0xee
|
||||||
|
BYTE $0xeb; BYTE $0xef; BYTE $0xec; BYTE $0xbf
|
||||||
|
BYTE $0x80; BYTE $0xfd; BYTE $0xfe; BYTE $0xfb
|
||||||
|
BYTE $0xfc; BYTE $0xba; BYTE $0xae; BYTE $0x59
|
||||||
|
BYTE $0x44; BYTE $0x45; BYTE $0x42; BYTE $0x46
|
||||||
|
BYTE $0x43; BYTE $0x47; BYTE $0x9c; BYTE $0x48
|
||||||
|
BYTE $0x54; BYTE $0x51; BYTE $0x52; BYTE $0x53
|
||||||
|
BYTE $0x58; BYTE $0x55; BYTE $0x56; BYTE $0x57
|
||||||
|
BYTE $0x8c; BYTE $0x49; BYTE $0xcd; BYTE $0xce
|
||||||
|
BYTE $0xcb; BYTE $0xcf; BYTE $0xcc; BYTE $0xe1
|
||||||
|
BYTE $0x70; BYTE $0xdd; BYTE $0xde; BYTE $0xdb
|
||||||
|
BYTE $0xdc; BYTE $0x8d; BYTE $0x8e; BYTE $0xdf
|
||||||
|
|
||||||
|
retry:
|
||||||
|
WORD $0xB9931022 // TROO 2,2,b'0001'
|
||||||
|
BVS retry
|
||||||
|
RET
|
||||||
|
|
||||||
|
// func e2a(arr [] byte)
|
||||||
|
// code page conversion from 1047 to 819
|
||||||
|
TEXT ·E2a(SB), NOSPLIT|NOFRAME, $0
|
||||||
|
MOVD arg_base+0(FP), R2 // pointer to arry of characters
|
||||||
|
MOVD arg_len+8(FP), R3 // count
|
||||||
|
XOR R0, R0
|
||||||
|
XOR R1, R1
|
||||||
|
BYTE $0xA7; BYTE $0x15; BYTE $0x00; BYTE $0x82 // BRAS 1,(2+(256/2))
|
||||||
|
|
||||||
|
// EBCDIC -> ASCII conversion table:
|
||||||
|
BYTE $0x00; BYTE $0x01; BYTE $0x02; BYTE $0x03
|
||||||
|
BYTE $0x9c; BYTE $0x09; BYTE $0x86; BYTE $0x7f
|
||||||
|
BYTE $0x97; BYTE $0x8d; BYTE $0x8e; BYTE $0x0b
|
||||||
|
BYTE $0x0c; BYTE $0x0d; BYTE $0x0e; BYTE $0x0f
|
||||||
|
BYTE $0x10; BYTE $0x11; BYTE $0x12; BYTE $0x13
|
||||||
|
BYTE $0x9d; BYTE $0x0a; BYTE $0x08; BYTE $0x87
|
||||||
|
BYTE $0x18; BYTE $0x19; BYTE $0x92; BYTE $0x8f
|
||||||
|
BYTE $0x1c; BYTE $0x1d; BYTE $0x1e; BYTE $0x1f
|
||||||
|
BYTE $0x80; BYTE $0x81; BYTE $0x82; BYTE $0x83
|
||||||
|
BYTE $0x84; BYTE $0x85; BYTE $0x17; BYTE $0x1b
|
||||||
|
BYTE $0x88; BYTE $0x89; BYTE $0x8a; BYTE $0x8b
|
||||||
|
BYTE $0x8c; BYTE $0x05; BYTE $0x06; BYTE $0x07
|
||||||
|
BYTE $0x90; BYTE $0x91; BYTE $0x16; BYTE $0x93
|
||||||
|
BYTE $0x94; BYTE $0x95; BYTE $0x96; BYTE $0x04
|
||||||
|
BYTE $0x98; BYTE $0x99; BYTE $0x9a; BYTE $0x9b
|
||||||
|
BYTE $0x14; BYTE $0x15; BYTE $0x9e; BYTE $0x1a
|
||||||
|
BYTE $0x20; BYTE $0xa0; BYTE $0xe2; BYTE $0xe4
|
||||||
|
BYTE $0xe0; BYTE $0xe1; BYTE $0xe3; BYTE $0xe5
|
||||||
|
BYTE $0xe7; BYTE $0xf1; BYTE $0xa2; BYTE $0x2e
|
||||||
|
BYTE $0x3c; BYTE $0x28; BYTE $0x2b; BYTE $0x7c
|
||||||
|
BYTE $0x26; BYTE $0xe9; BYTE $0xea; BYTE $0xeb
|
||||||
|
BYTE $0xe8; BYTE $0xed; BYTE $0xee; BYTE $0xef
|
||||||
|
BYTE $0xec; BYTE $0xdf; BYTE $0x21; BYTE $0x24
|
||||||
|
BYTE $0x2a; BYTE $0x29; BYTE $0x3b; BYTE $0x5e
|
||||||
|
BYTE $0x2d; BYTE $0x2f; BYTE $0xc2; BYTE $0xc4
|
||||||
|
BYTE $0xc0; BYTE $0xc1; BYTE $0xc3; BYTE $0xc5
|
||||||
|
BYTE $0xc7; BYTE $0xd1; BYTE $0xa6; BYTE $0x2c
|
||||||
|
BYTE $0x25; BYTE $0x5f; BYTE $0x3e; BYTE $0x3f
|
||||||
|
BYTE $0xf8; BYTE $0xc9; BYTE $0xca; BYTE $0xcb
|
||||||
|
BYTE $0xc8; BYTE $0xcd; BYTE $0xce; BYTE $0xcf
|
||||||
|
BYTE $0xcc; BYTE $0x60; BYTE $0x3a; BYTE $0x23
|
||||||
|
BYTE $0x40; BYTE $0x27; BYTE $0x3d; BYTE $0x22
|
||||||
|
BYTE $0xd8; BYTE $0x61; BYTE $0x62; BYTE $0x63
|
||||||
|
BYTE $0x64; BYTE $0x65; BYTE $0x66; BYTE $0x67
|
||||||
|
BYTE $0x68; BYTE $0x69; BYTE $0xab; BYTE $0xbb
|
||||||
|
BYTE $0xf0; BYTE $0xfd; BYTE $0xfe; BYTE $0xb1
|
||||||
|
BYTE $0xb0; BYTE $0x6a; BYTE $0x6b; BYTE $0x6c
|
||||||
|
BYTE $0x6d; BYTE $0x6e; BYTE $0x6f; BYTE $0x70
|
||||||
|
BYTE $0x71; BYTE $0x72; BYTE $0xaa; BYTE $0xba
|
||||||
|
BYTE $0xe6; BYTE $0xb8; BYTE $0xc6; BYTE $0xa4
|
||||||
|
BYTE $0xb5; BYTE $0x7e; BYTE $0x73; BYTE $0x74
|
||||||
|
BYTE $0x75; BYTE $0x76; BYTE $0x77; BYTE $0x78
|
||||||
|
BYTE $0x79; BYTE $0x7a; BYTE $0xa1; BYTE $0xbf
|
||||||
|
BYTE $0xd0; BYTE $0x5b; BYTE $0xde; BYTE $0xae
|
||||||
|
BYTE $0xac; BYTE $0xa3; BYTE $0xa5; BYTE $0xb7
|
||||||
|
BYTE $0xa9; BYTE $0xa7; BYTE $0xb6; BYTE $0xbc
|
||||||
|
BYTE $0xbd; BYTE $0xbe; BYTE $0xdd; BYTE $0xa8
|
||||||
|
BYTE $0xaf; BYTE $0x5d; BYTE $0xb4; BYTE $0xd7
|
||||||
|
BYTE $0x7b; BYTE $0x41; BYTE $0x42; BYTE $0x43
|
||||||
|
BYTE $0x44; BYTE $0x45; BYTE $0x46; BYTE $0x47
|
||||||
|
BYTE $0x48; BYTE $0x49; BYTE $0xad; BYTE $0xf4
|
||||||
|
BYTE $0xf6; BYTE $0xf2; BYTE $0xf3; BYTE $0xf5
|
||||||
|
BYTE $0x7d; BYTE $0x4a; BYTE $0x4b; BYTE $0x4c
|
||||||
|
BYTE $0x4d; BYTE $0x4e; BYTE $0x4f; BYTE $0x50
|
||||||
|
BYTE $0x51; BYTE $0x52; BYTE $0xb9; BYTE $0xfb
|
||||||
|
BYTE $0xfc; BYTE $0xf9; BYTE $0xfa; BYTE $0xff
|
||||||
|
BYTE $0x5c; BYTE $0xf7; BYTE $0x53; BYTE $0x54
|
||||||
|
BYTE $0x55; BYTE $0x56; BYTE $0x57; BYTE $0x58
|
||||||
|
BYTE $0x59; BYTE $0x5a; BYTE $0xb2; BYTE $0xd4
|
||||||
|
BYTE $0xd6; BYTE $0xd2; BYTE $0xd3; BYTE $0xd5
|
||||||
|
BYTE $0x30; BYTE $0x31; BYTE $0x32; BYTE $0x33
|
||||||
|
BYTE $0x34; BYTE $0x35; BYTE $0x36; BYTE $0x37
|
||||||
|
BYTE $0x38; BYTE $0x39; BYTE $0xb3; BYTE $0xdb
|
||||||
|
BYTE $0xdc; BYTE $0xd9; BYTE $0xda; BYTE $0x9f
|
||||||
|
|
||||||
|
retry:
|
||||||
|
WORD $0xB9931022 // TROO 2,2,b'0001'
|
||||||
|
BVS retry
|
||||||
|
RET
|
||||||
1
vendor/golang.org/x/sys/unix/cap_freebsd.go
generated
vendored
1
vendor/golang.org/x/sys/unix/cap_freebsd.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build freebsd
|
//go:build freebsd
|
||||||
// +build freebsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/constants.go
generated
vendored
1
vendor/golang.org/x/sys/unix/constants.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/dev_aix_ppc.go
generated
vendored
1
vendor/golang.org/x/sys/unix/dev_aix_ppc.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix && ppc
|
//go:build aix && ppc
|
||||||
// +build aix,ppc
|
|
||||||
|
|
||||||
// Functions to access/create device major and minor numbers matching the
|
// Functions to access/create device major and minor numbers matching the
|
||||||
// encoding used by AIX.
|
// encoding used by AIX.
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix && ppc64
|
//go:build aix && ppc64
|
||||||
// +build aix,ppc64
|
|
||||||
|
|
||||||
// Functions to access/create device major and minor numbers matching the
|
// Functions to access/create device major and minor numbers matching the
|
||||||
// encoding used AIX.
|
// encoding used AIX.
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/dev_zos.go
generated
vendored
1
vendor/golang.org/x/sys/unix/dev_zos.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build zos && s390x
|
//go:build zos && s390x
|
||||||
// +build zos,s390x
|
|
||||||
|
|
||||||
// Functions to access/create device major and minor numbers matching the
|
// Functions to access/create device major and minor numbers matching the
|
||||||
// encoding used by z/OS.
|
// encoding used by z/OS.
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/dirent.go
generated
vendored
1
vendor/golang.org/x/sys/unix/dirent.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/endian_big.go
generated
vendored
1
vendor/golang.org/x/sys/unix/endian_big.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
//
|
//
|
||||||
//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
|
//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
|
||||||
// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/endian_little.go
generated
vendored
1
vendor/golang.org/x/sys/unix/endian_little.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
//
|
//
|
||||||
//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
|
//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
|
||||||
// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/env_unix.go
generated
vendored
1
vendor/golang.org/x/sys/unix/env_unix.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
// Unix environment variables.
|
// Unix environment variables.
|
||||||
|
|
||||||
|
|
|
||||||
221
vendor/golang.org/x/sys/unix/epoll_zos.go
generated
vendored
221
vendor/golang.org/x/sys/unix/epoll_zos.go
generated
vendored
|
|
@ -1,221 +0,0 @@
|
||||||
// Copyright 2020 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build zos && s390x
|
|
||||||
// +build zos,s390x
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"sync"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This file simulates epoll on z/OS using poll.
|
|
||||||
|
|
||||||
// Analogous to epoll_event on Linux.
|
|
||||||
// TODO(neeilan): Pad is because the Linux kernel expects a 96-bit struct. We never pass this to the kernel; remove?
|
|
||||||
type EpollEvent struct {
|
|
||||||
Events uint32
|
|
||||||
Fd int32
|
|
||||||
Pad int32
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
|
||||||
EPOLLERR = 0x8
|
|
||||||
EPOLLHUP = 0x10
|
|
||||||
EPOLLIN = 0x1
|
|
||||||
EPOLLMSG = 0x400
|
|
||||||
EPOLLOUT = 0x4
|
|
||||||
EPOLLPRI = 0x2
|
|
||||||
EPOLLRDBAND = 0x80
|
|
||||||
EPOLLRDNORM = 0x40
|
|
||||||
EPOLLWRBAND = 0x200
|
|
||||||
EPOLLWRNORM = 0x100
|
|
||||||
EPOLL_CTL_ADD = 0x1
|
|
||||||
EPOLL_CTL_DEL = 0x2
|
|
||||||
EPOLL_CTL_MOD = 0x3
|
|
||||||
// The following constants are part of the epoll API, but represent
|
|
||||||
// currently unsupported functionality on z/OS.
|
|
||||||
// EPOLL_CLOEXEC = 0x80000
|
|
||||||
// EPOLLET = 0x80000000
|
|
||||||
// EPOLLONESHOT = 0x40000000
|
|
||||||
// EPOLLRDHUP = 0x2000 // Typically used with edge-triggered notis
|
|
||||||
// EPOLLEXCLUSIVE = 0x10000000 // Exclusive wake-up mode
|
|
||||||
// EPOLLWAKEUP = 0x20000000 // Relies on Linux's BLOCK_SUSPEND capability
|
|
||||||
)
|
|
||||||
|
|
||||||
// TODO(neeilan): We can eliminate these epToPoll / pToEpoll calls by using identical mask values for POLL/EPOLL
|
|
||||||
// constants where possible The lower 16 bits of epoll events (uint32) can fit any system poll event (int16).
|
|
||||||
|
|
||||||
// epToPollEvt converts epoll event field to poll equivalent.
|
|
||||||
// In epoll, Events is a 32-bit field, while poll uses 16 bits.
|
|
||||||
func epToPollEvt(events uint32) int16 {
|
|
||||||
var ep2p = map[uint32]int16{
|
|
||||||
EPOLLIN: POLLIN,
|
|
||||||
EPOLLOUT: POLLOUT,
|
|
||||||
EPOLLHUP: POLLHUP,
|
|
||||||
EPOLLPRI: POLLPRI,
|
|
||||||
EPOLLERR: POLLERR,
|
|
||||||
}
|
|
||||||
|
|
||||||
var pollEvts int16 = 0
|
|
||||||
for epEvt, pEvt := range ep2p {
|
|
||||||
if (events & epEvt) != 0 {
|
|
||||||
pollEvts |= pEvt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return pollEvts
|
|
||||||
}
|
|
||||||
|
|
||||||
// pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields.
|
|
||||||
func pToEpollEvt(revents int16) uint32 {
|
|
||||||
var p2ep = map[int16]uint32{
|
|
||||||
POLLIN: EPOLLIN,
|
|
||||||
POLLOUT: EPOLLOUT,
|
|
||||||
POLLHUP: EPOLLHUP,
|
|
||||||
POLLPRI: EPOLLPRI,
|
|
||||||
POLLERR: EPOLLERR,
|
|
||||||
}
|
|
||||||
|
|
||||||
var epollEvts uint32 = 0
|
|
||||||
for pEvt, epEvt := range p2ep {
|
|
||||||
if (revents & pEvt) != 0 {
|
|
||||||
epollEvts |= epEvt
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return epollEvts
|
|
||||||
}
|
|
||||||
|
|
||||||
// Per-process epoll implementation.
|
|
||||||
type epollImpl struct {
|
|
||||||
mu sync.Mutex
|
|
||||||
epfd2ep map[int]*eventPoll
|
|
||||||
nextEpfd int
|
|
||||||
}
|
|
||||||
|
|
||||||
// eventPoll holds a set of file descriptors being watched by the process. A process can have multiple epoll instances.
|
|
||||||
// On Linux, this is an in-kernel data structure accessed through a fd.
|
|
||||||
type eventPoll struct {
|
|
||||||
mu sync.Mutex
|
|
||||||
fds map[int]*EpollEvent
|
|
||||||
}
|
|
||||||
|
|
||||||
// epoll impl for this process.
|
|
||||||
var impl epollImpl = epollImpl{
|
|
||||||
epfd2ep: make(map[int]*eventPoll),
|
|
||||||
nextEpfd: 0,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollcreate(size int) (epfd int, err error) {
|
|
||||||
e.mu.Lock()
|
|
||||||
defer e.mu.Unlock()
|
|
||||||
epfd = e.nextEpfd
|
|
||||||
e.nextEpfd++
|
|
||||||
|
|
||||||
e.epfd2ep[epfd] = &eventPoll{
|
|
||||||
fds: make(map[int]*EpollEvent),
|
|
||||||
}
|
|
||||||
return epfd, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollcreate1(flag int) (fd int, err error) {
|
|
||||||
return e.epollcreate(4)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|
||||||
e.mu.Lock()
|
|
||||||
defer e.mu.Unlock()
|
|
||||||
|
|
||||||
ep, ok := e.epfd2ep[epfd]
|
|
||||||
if !ok {
|
|
||||||
|
|
||||||
return EBADF
|
|
||||||
}
|
|
||||||
|
|
||||||
switch op {
|
|
||||||
case EPOLL_CTL_ADD:
|
|
||||||
// TODO(neeilan): When we make epfds and fds disjoint, detect epoll
|
|
||||||
// loops here (instances watching each other) and return ELOOP.
|
|
||||||
if _, ok := ep.fds[fd]; ok {
|
|
||||||
return EEXIST
|
|
||||||
}
|
|
||||||
ep.fds[fd] = event
|
|
||||||
case EPOLL_CTL_MOD:
|
|
||||||
if _, ok := ep.fds[fd]; !ok {
|
|
||||||
return ENOENT
|
|
||||||
}
|
|
||||||
ep.fds[fd] = event
|
|
||||||
case EPOLL_CTL_DEL:
|
|
||||||
if _, ok := ep.fds[fd]; !ok {
|
|
||||||
return ENOENT
|
|
||||||
}
|
|
||||||
delete(ep.fds, fd)
|
|
||||||
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Must be called while holding ep.mu
|
|
||||||
func (ep *eventPoll) getFds() []int {
|
|
||||||
fds := make([]int, len(ep.fds))
|
|
||||||
for fd := range ep.fds {
|
|
||||||
fds = append(fds, fd)
|
|
||||||
}
|
|
||||||
return fds
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
e.mu.Lock() // in [rare] case of concurrent epollcreate + epollwait
|
|
||||||
ep, ok := e.epfd2ep[epfd]
|
|
||||||
|
|
||||||
if !ok {
|
|
||||||
e.mu.Unlock()
|
|
||||||
return 0, EBADF
|
|
||||||
}
|
|
||||||
|
|
||||||
pollfds := make([]PollFd, 4)
|
|
||||||
for fd, epollevt := range ep.fds {
|
|
||||||
pollfds = append(pollfds, PollFd{Fd: int32(fd), Events: epToPollEvt(epollevt.Events)})
|
|
||||||
}
|
|
||||||
e.mu.Unlock()
|
|
||||||
|
|
||||||
n, err = Poll(pollfds, msec)
|
|
||||||
if err != nil {
|
|
||||||
return n, err
|
|
||||||
}
|
|
||||||
|
|
||||||
i := 0
|
|
||||||
for _, pFd := range pollfds {
|
|
||||||
if pFd.Revents != 0 {
|
|
||||||
events[i] = EpollEvent{Fd: pFd.Fd, Events: pToEpollEvt(pFd.Revents)}
|
|
||||||
i++
|
|
||||||
}
|
|
||||||
|
|
||||||
if i == n {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return n, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func EpollCreate(size int) (fd int, err error) {
|
|
||||||
return impl.epollcreate(size)
|
|
||||||
}
|
|
||||||
|
|
||||||
func EpollCreate1(flag int) (fd int, err error) {
|
|
||||||
return impl.epollcreate1(flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
|
|
||||||
return impl.epollctl(epfd, op, fd, event)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Because EpollWait mutates events, the caller is expected to coordinate
|
|
||||||
// concurrent access if calling with the same epfd from multiple goroutines.
|
|
||||||
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
|
|
||||||
return impl.epollwait(epfd, events, msec)
|
|
||||||
}
|
|
||||||
3
vendor/golang.org/x/sys/unix/fcntl.go
generated
vendored
3
vendor/golang.org/x/sys/unix/fcntl.go
generated
vendored
|
|
@ -2,8 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build dragonfly || freebsd || linux || netbsd || openbsd
|
//go:build dragonfly || freebsd || linux || netbsd
|
||||||
// +build dragonfly freebsd linux netbsd openbsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
generated
vendored
1
vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc)
|
//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc)
|
||||||
// +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/fdset.go
generated
vendored
1
vendor/golang.org/x/sys/unix/fdset.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
164
vendor/golang.org/x/sys/unix/fstatfs_zos.go
generated
vendored
164
vendor/golang.org/x/sys/unix/fstatfs_zos.go
generated
vendored
|
|
@ -1,164 +0,0 @@
|
||||||
// Copyright 2020 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build zos && s390x
|
|
||||||
// +build zos,s390x
|
|
||||||
|
|
||||||
package unix
|
|
||||||
|
|
||||||
import (
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent.
|
|
||||||
|
|
||||||
func Fstatfs(fd int, stat *Statfs_t) (err error) {
|
|
||||||
var stat_v Statvfs_t
|
|
||||||
err = Fstatvfs(fd, &stat_v)
|
|
||||||
if err == nil {
|
|
||||||
// populate stat
|
|
||||||
stat.Type = 0
|
|
||||||
stat.Bsize = stat_v.Bsize
|
|
||||||
stat.Blocks = stat_v.Blocks
|
|
||||||
stat.Bfree = stat_v.Bfree
|
|
||||||
stat.Bavail = stat_v.Bavail
|
|
||||||
stat.Files = stat_v.Files
|
|
||||||
stat.Ffree = stat_v.Ffree
|
|
||||||
stat.Fsid = stat_v.Fsid
|
|
||||||
stat.Namelen = stat_v.Namemax
|
|
||||||
stat.Frsize = stat_v.Frsize
|
|
||||||
stat.Flags = stat_v.Flag
|
|
||||||
for passn := 0; passn < 5; passn++ {
|
|
||||||
switch passn {
|
|
||||||
case 0:
|
|
||||||
err = tryGetmntent64(stat)
|
|
||||||
break
|
|
||||||
case 1:
|
|
||||||
err = tryGetmntent128(stat)
|
|
||||||
break
|
|
||||||
case 2:
|
|
||||||
err = tryGetmntent256(stat)
|
|
||||||
break
|
|
||||||
case 3:
|
|
||||||
err = tryGetmntent512(stat)
|
|
||||||
break
|
|
||||||
case 4:
|
|
||||||
err = tryGetmntent1024(stat)
|
|
||||||
break
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
//proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred)
|
|
||||||
if err == nil || err != nil && err != ERANGE {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent64(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [64]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent128(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [128]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent256(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [256]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent512(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [512]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
func tryGetmntent1024(stat *Statfs_t) (err error) {
|
|
||||||
var mnt_ent_buffer struct {
|
|
||||||
header W_Mnth
|
|
||||||
filesys_info [1024]W_Mntent
|
|
||||||
}
|
|
||||||
var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
|
|
||||||
fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
err = ERANGE //return ERANGE if no match is found in this batch
|
|
||||||
for i := 0; i < fs_count; i++ {
|
|
||||||
if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
|
|
||||||
stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
|
|
||||||
err = nil
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
1
vendor/golang.org/x/sys/unix/gccgo.go
generated
vendored
1
vendor/golang.org/x/sys/unix/gccgo.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gccgo && !aix && !hurd
|
//go:build gccgo && !aix && !hurd
|
||||||
// +build gccgo,!aix,!hurd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/gccgo_c.c
generated
vendored
1
vendor/golang.org/x/sys/unix/gccgo_c.c
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gccgo && !aix && !hurd
|
//go:build gccgo && !aix && !hurd
|
||||||
// +build gccgo,!aix,!hurd
|
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gccgo && linux && amd64
|
//go:build gccgo && linux && amd64
|
||||||
// +build gccgo,linux,amd64
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/ifreq_linux.go
generated
vendored
1
vendor/golang.org/x/sys/unix/ifreq_linux.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux
|
//go:build linux
|
||||||
// +build linux
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
5
vendor/golang.org/x/sys/unix/ioctl_linux.go
generated
vendored
5
vendor/golang.org/x/sys/unix/ioctl_linux.go
generated
vendored
|
|
@ -231,3 +231,8 @@ func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) {
|
||||||
func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
|
func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
|
||||||
return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value))
|
return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IoctlLoopConfigure configures all loop device parameters in a single step
|
||||||
|
func IoctlLoopConfigure(fd int, value *LoopConfig) error {
|
||||||
|
return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value))
|
||||||
|
}
|
||||||
|
|
|
||||||
69
vendor/golang.org/x/sys/unix/ioctl_signed.go
generated
vendored
Normal file
69
vendor/golang.org/x/sys/unix/ioctl_signed.go
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
// Copyright 2018 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build aix || solaris
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"unsafe"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ioctl itself should not be exposed directly, but additional get/set
|
||||||
|
// functions for specific types are permissible.
|
||||||
|
|
||||||
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
|
// on fd, using the specified request number.
|
||||||
|
func IoctlSetInt(fd int, req int, 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 int, value int) error {
|
||||||
|
v := int32(value)
|
||||||
|
return ioctlPtr(fd, req, 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.
|
||||||
|
func IoctlSetWinsize(fd int, req int, value *Winsize) error {
|
||||||
|
// TODO: if we get the chance, remove the req parameter and
|
||||||
|
// hardcode TIOCSWINSZ.
|
||||||
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlSetTermios performs an ioctl on fd with a *Termios.
|
||||||
|
//
|
||||||
|
// The req value will usually be TCSETA or TIOCSETA.
|
||||||
|
func IoctlSetTermios(fd int, req int, value *Termios) error {
|
||||||
|
// TODO: if we get the chance, remove the req parameter.
|
||||||
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// IoctlGetInt performs an ioctl operation which gets an integer value
|
||||||
|
// from fd, using the specified request number.
|
||||||
|
//
|
||||||
|
// A few ioctl requests use the return value as an output parameter;
|
||||||
|
// for those, IoctlRetInt should be used instead of this function.
|
||||||
|
func IoctlGetInt(fd int, req int) (int, error) {
|
||||||
|
var value int
|
||||||
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
|
return value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
|
||||||
|
var value Winsize
|
||||||
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func IoctlGetTermios(fd int, req int) (*Termios, error) {
|
||||||
|
var value Termios
|
||||||
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
|
return &value, err
|
||||||
|
}
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
|
//go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd
|
||||||
// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
13
vendor/golang.org/x/sys/unix/ioctl_zos.go
generated
vendored
13
vendor/golang.org/x/sys/unix/ioctl_zos.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build zos && s390x
|
//go:build zos && s390x
|
||||||
// +build zos,s390x
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
@ -17,14 +16,14 @@ import (
|
||||||
|
|
||||||
// IoctlSetInt performs an ioctl operation which sets an integer value
|
// IoctlSetInt performs an ioctl operation which sets an integer value
|
||||||
// on fd, using the specified request number.
|
// on fd, using the specified request number.
|
||||||
func IoctlSetInt(fd int, req uint, value int) error {
|
func IoctlSetInt(fd int, req int, value int) error {
|
||||||
return ioctl(fd, req, uintptr(value))
|
return ioctl(fd, req, uintptr(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
|
||||||
//
|
//
|
||||||
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
// To change fd's window size, the req argument should be TIOCSWINSZ.
|
||||||
func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
func IoctlSetWinsize(fd int, req int, value *Winsize) error {
|
||||||
// TODO: if we get the chance, remove the req parameter and
|
// TODO: if we get the chance, remove the req parameter and
|
||||||
// hardcode TIOCSWINSZ.
|
// hardcode TIOCSWINSZ.
|
||||||
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
return ioctlPtr(fd, req, unsafe.Pointer(value))
|
||||||
|
|
@ -33,7 +32,7 @@ func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
|
||||||
// IoctlSetTermios performs an ioctl on fd with a *Termios.
|
// IoctlSetTermios performs an ioctl on fd with a *Termios.
|
||||||
//
|
//
|
||||||
// The req value is expected to be TCSETS, TCSETSW, or TCSETSF
|
// The req value is expected to be TCSETS, TCSETSW, or TCSETSF
|
||||||
func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
func IoctlSetTermios(fd int, req int, value *Termios) error {
|
||||||
if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) {
|
if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) {
|
||||||
return ENOSYS
|
return ENOSYS
|
||||||
}
|
}
|
||||||
|
|
@ -47,13 +46,13 @@ func IoctlSetTermios(fd int, req uint, value *Termios) error {
|
||||||
//
|
//
|
||||||
// A few ioctl requests use the return value as an output parameter;
|
// A few ioctl requests use the return value as an output parameter;
|
||||||
// for those, IoctlRetInt should be used instead of this function.
|
// for those, IoctlRetInt should be used instead of this function.
|
||||||
func IoctlGetInt(fd int, req uint) (int, error) {
|
func IoctlGetInt(fd int, req int) (int, error) {
|
||||||
var value int
|
var value int
|
||||||
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
return value, err
|
return value, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
func IoctlGetWinsize(fd int, req int) (*Winsize, error) {
|
||||||
var value Winsize
|
var value Winsize
|
||||||
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
err := ioctlPtr(fd, req, unsafe.Pointer(&value))
|
||||||
return &value, err
|
return &value, err
|
||||||
|
|
@ -62,7 +61,7 @@ func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
|
||||||
// IoctlGetTermios performs an ioctl on fd with a *Termios.
|
// IoctlGetTermios performs an ioctl on fd with a *Termios.
|
||||||
//
|
//
|
||||||
// The req value is expected to be TCGETS
|
// The req value is expected to be TCGETS
|
||||||
func IoctlGetTermios(fd int, req uint) (*Termios, error) {
|
func IoctlGetTermios(fd int, req int) (*Termios, error) {
|
||||||
var value Termios
|
var value Termios
|
||||||
if req != TCGETS {
|
if req != TCGETS {
|
||||||
return &value, ENOSYS
|
return &value, ENOSYS
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
2
vendor/golang.org/x/sys/unix/mkall.sh
generated
vendored
|
|
@ -50,7 +50,7 @@ if [[ "$GOOS" = "linux" ]]; then
|
||||||
# Use the Docker-based build system
|
# Use the Docker-based build system
|
||||||
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
|
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
|
||||||
$cmd docker build --tag generate:$GOOS $GOOS
|
$cmd docker build --tag generate:$GOOS $GOOS
|
||||||
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && /bin/pwd):/build generate:$GOOS
|
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
60
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
60
vendor/golang.org/x/sys/unix/mkerrors.sh
generated
vendored
|
|
@ -58,6 +58,7 @@ includes_Darwin='
|
||||||
#define _DARWIN_USE_64_BIT_INODE
|
#define _DARWIN_USE_64_BIT_INODE
|
||||||
#define __APPLE_USE_RFC_3542
|
#define __APPLE_USE_RFC_3542
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <sys/stdio.h>
|
||||||
#include <sys/attr.h>
|
#include <sys/attr.h>
|
||||||
#include <sys/clonefile.h>
|
#include <sys/clonefile.h>
|
||||||
#include <sys/kern_control.h>
|
#include <sys/kern_control.h>
|
||||||
|
|
@ -66,6 +67,7 @@ includes_Darwin='
|
||||||
#include <sys/ptrace.h>
|
#include <sys/ptrace.h>
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#include <sys/sys_domain.h>
|
#include <sys/sys_domain.h>
|
||||||
|
|
@ -203,6 +205,7 @@ struct ltchars {
|
||||||
#include <sys/timerfd.h>
|
#include <sys/timerfd.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sys/xattr.h>
|
#include <sys/xattr.h>
|
||||||
|
#include <netinet/udp.h>
|
||||||
#include <linux/audit.h>
|
#include <linux/audit.h>
|
||||||
#include <linux/bpf.h>
|
#include <linux/bpf.h>
|
||||||
#include <linux/can.h>
|
#include <linux/can.h>
|
||||||
|
|
@ -246,6 +249,7 @@ struct ltchars {
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/mount.h>
|
#include <linux/mount.h>
|
||||||
#include <linux/netfilter/nfnetlink.h>
|
#include <linux/netfilter/nfnetlink.h>
|
||||||
|
#include <linux/netfilter/nf_tables.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
#include <linux/net_namespace.h>
|
#include <linux/net_namespace.h>
|
||||||
#include <linux/nfc.h>
|
#include <linux/nfc.h>
|
||||||
|
|
@ -260,6 +264,7 @@ struct ltchars {
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/seccomp.h>
|
#include <linux/seccomp.h>
|
||||||
#include <linux/serial.h>
|
#include <linux/serial.h>
|
||||||
|
#include <linux/sock_diag.h>
|
||||||
#include <linux/sockios.h>
|
#include <linux/sockios.h>
|
||||||
#include <linux/taskstats.h>
|
#include <linux/taskstats.h>
|
||||||
#include <linux/tipc.h>
|
#include <linux/tipc.h>
|
||||||
|
|
@ -281,10 +286,6 @@ struct ltchars {
|
||||||
#include <asm/termbits.h>
|
#include <asm/termbits.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MSG_FASTOPEN
|
|
||||||
#define MSG_FASTOPEN 0x20000000
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef PTRACE_GETREGS
|
#ifndef PTRACE_GETREGS
|
||||||
#define PTRACE_GETREGS 0xc
|
#define PTRACE_GETREGS 0xc
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -293,14 +294,6 @@ struct ltchars {
|
||||||
#define PTRACE_SETREGS 0xd
|
#define PTRACE_SETREGS 0xd
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SOL_NETLINK
|
|
||||||
#define SOL_NETLINK 270
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SOL_SMC
|
|
||||||
#define SOL_SMC 286
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef SOL_BLUETOOTH
|
#ifdef SOL_BLUETOOTH
|
||||||
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
|
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
|
||||||
// but it is already in bluetooth_linux.go
|
// but it is already in bluetooth_linux.go
|
||||||
|
|
@ -317,10 +310,23 @@ struct ltchars {
|
||||||
#undef TIPC_WAIT_FOREVER
|
#undef TIPC_WAIT_FOREVER
|
||||||
#define TIPC_WAIT_FOREVER 0xffffffff
|
#define TIPC_WAIT_FOREVER 0xffffffff
|
||||||
|
|
||||||
// Copied from linux/l2tp.h
|
// Copied from linux/netfilter/nf_nat.h
|
||||||
// Including linux/l2tp.h here causes conflicts between linux/in.h
|
// Including linux/netfilter/nf_nat.h here causes conflicts between linux/in.h
|
||||||
// and netinet/in.h included via net/route.h above.
|
// and netinet/in.h.
|
||||||
#define IPPROTO_L2TP 115
|
#define NF_NAT_RANGE_MAP_IPS (1 << 0)
|
||||||
|
#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1)
|
||||||
|
#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2)
|
||||||
|
#define NF_NAT_RANGE_PERSISTENT (1 << 3)
|
||||||
|
#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)
|
||||||
|
#define NF_NAT_RANGE_PROTO_OFFSET (1 << 5)
|
||||||
|
#define NF_NAT_RANGE_NETMAP (1 << 6)
|
||||||
|
#define NF_NAT_RANGE_PROTO_RANDOM_ALL \
|
||||||
|
(NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)
|
||||||
|
#define NF_NAT_RANGE_MASK \
|
||||||
|
(NF_NAT_RANGE_MAP_IPS | NF_NAT_RANGE_PROTO_SPECIFIED | \
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PERSISTENT | \
|
||||||
|
NF_NAT_RANGE_PROTO_RANDOM_FULLY | NF_NAT_RANGE_PROTO_OFFSET | \
|
||||||
|
NF_NAT_RANGE_NETMAP)
|
||||||
|
|
||||||
// Copied from linux/hid.h.
|
// Copied from linux/hid.h.
|
||||||
// Keep in sync with the size of the referenced fields.
|
// Keep in sync with the size of the referenced fields.
|
||||||
|
|
@ -517,10 +523,12 @@ ccflags="$@"
|
||||||
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
|
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
|
||||||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
|
||||||
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
|
||||||
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT)_/ ||
|
$2 == "LOOP_CONFIGURE" ||
|
||||||
|
$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ ||
|
||||||
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
|
||||||
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
|
||||||
$2 ~ /^RAW_PAYLOAD_/ ||
|
$2 ~ /^RAW_PAYLOAD_/ ||
|
||||||
|
$2 ~ /^[US]F_/ ||
|
||||||
$2 ~ /^TP_STATUS_/ ||
|
$2 ~ /^TP_STATUS_/ ||
|
||||||
$2 ~ /^FALLOC_/ ||
|
$2 ~ /^FALLOC_/ ||
|
||||||
$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
|
$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
|
||||||
|
|
@ -543,6 +551,7 @@ ccflags="$@"
|
||||||
$2 !~ "NLA_TYPE_MASK" &&
|
$2 !~ "NLA_TYPE_MASK" &&
|
||||||
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
|
$2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ &&
|
||||||
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
|
$2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ ||
|
||||||
|
$2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ ||
|
||||||
$2 ~ /^FIORDCHK$/ ||
|
$2 ~ /^FIORDCHK$/ ||
|
||||||
$2 ~ /^SIOC/ ||
|
$2 ~ /^SIOC/ ||
|
||||||
$2 ~ /^TIOC/ ||
|
$2 ~ /^TIOC/ ||
|
||||||
|
|
@ -557,7 +566,7 @@ ccflags="$@"
|
||||||
$2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ ||
|
$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)/ ||
|
$2 ~ /^PRIO_(PROCESS|PGRP|USER)/ ||
|
||||||
$2 ~ /^CLONE_[A-Z_]+/ ||
|
$2 ~ /^CLONE_[A-Z_]+/ ||
|
||||||
$2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ &&
|
$2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+|BPF_F_LINK)$/ &&
|
||||||
$2 ~ /^(BPF|DLT)_/ ||
|
$2 ~ /^(BPF|DLT)_/ ||
|
||||||
$2 ~ /^AUDIT_/ ||
|
$2 ~ /^AUDIT_/ ||
|
||||||
$2 ~ /^(CLOCK|TIMER)_/ ||
|
$2 ~ /^(CLOCK|TIMER)_/ ||
|
||||||
|
|
@ -578,8 +587,9 @@ ccflags="$@"
|
||||||
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
$2 ~ /^KEY_(SPEC|REQKEY_DEFL)_/ ||
|
||||||
$2 ~ /^KEYCTL_/ ||
|
$2 ~ /^KEYCTL_/ ||
|
||||||
$2 ~ /^PERF_/ ||
|
$2 ~ /^PERF_/ ||
|
||||||
$2 ~ /^SECCOMP_MODE_/ ||
|
$2 ~ /^SECCOMP_/ ||
|
||||||
$2 ~ /^SEEK_/ ||
|
$2 ~ /^SEEK_/ ||
|
||||||
|
$2 ~ /^SCHED_/ ||
|
||||||
$2 ~ /^SPLICE_/ ||
|
$2 ~ /^SPLICE_/ ||
|
||||||
$2 ~ /^SYNC_FILE_RANGE_/ ||
|
$2 ~ /^SYNC_FILE_RANGE_/ ||
|
||||||
$2 !~ /IOC_MAGIC/ &&
|
$2 !~ /IOC_MAGIC/ &&
|
||||||
|
|
@ -598,6 +608,9 @@ ccflags="$@"
|
||||||
$2 ~ /^FSOPT_/ ||
|
$2 ~ /^FSOPT_/ ||
|
||||||
$2 ~ /^WDIO[CFS]_/ ||
|
$2 ~ /^WDIO[CFS]_/ ||
|
||||||
$2 ~ /^NFN/ ||
|
$2 ~ /^NFN/ ||
|
||||||
|
$2 !~ /^NFT_META_IIFTYPE/ &&
|
||||||
|
$2 ~ /^NFT_/ ||
|
||||||
|
$2 ~ /^NF_NAT_/ ||
|
||||||
$2 ~ /^XDP_/ ||
|
$2 ~ /^XDP_/ ||
|
||||||
$2 ~ /^RWF_/ ||
|
$2 ~ /^RWF_/ ||
|
||||||
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
$2 ~ /^(HDIO|WIN|SMART)_/ ||
|
||||||
|
|
@ -621,7 +634,7 @@ ccflags="$@"
|
||||||
$2 ~ /^MEM/ ||
|
$2 ~ /^MEM/ ||
|
||||||
$2 ~ /^WG/ ||
|
$2 ~ /^WG/ ||
|
||||||
$2 ~ /^FIB_RULE_/ ||
|
$2 ~ /^FIB_RULE_/ ||
|
||||||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
|
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE|IOMIN$|IOOPT$|ALIGNOFF$|DISCARD|ROTATIONAL$|ZEROOUT$|GETDISKSEQ$)/ {printf("\t%s = C.%s\n", $2, $2)}
|
||||||
$2 ~ /^__WCOREFLAG$/ {next}
|
$2 ~ /^__WCOREFLAG$/ {next}
|
||||||
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
|
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
|
||||||
|
|
||||||
|
|
@ -659,7 +672,6 @@ echo '// mkerrors.sh' "$@"
|
||||||
echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
|
echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
|
||||||
echo
|
echo
|
||||||
echo "//go:build ${GOARCH} && ${GOOS}"
|
echo "//go:build ${GOARCH} && ${GOOS}"
|
||||||
echo "// +build ${GOARCH},${GOOS}"
|
|
||||||
echo
|
echo
|
||||||
go tool cgo -godefs -- "$@" _const.go >_error.out
|
go tool cgo -godefs -- "$@" _const.go >_error.out
|
||||||
cat _error.out | grep -vf _error.grep | grep -vf _signal.grep
|
cat _error.out | grep -vf _error.grep | grep -vf _signal.grep
|
||||||
|
|
@ -738,7 +750,8 @@ main(void)
|
||||||
e = errors[i].num;
|
e = errors[i].num;
|
||||||
if(i > 0 && errors[i-1].num == e)
|
if(i > 0 && errors[i-1].num == e)
|
||||||
continue;
|
continue;
|
||||||
strcpy(buf, strerror(e));
|
strncpy(buf, strerror(e), sizeof(buf) - 1);
|
||||||
|
buf[sizeof(buf) - 1] = '\0';
|
||||||
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
||||||
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
|
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
|
||||||
buf[0] += a - A;
|
buf[0] += a - A;
|
||||||
|
|
@ -757,7 +770,8 @@ main(void)
|
||||||
e = signals[i].num;
|
e = signals[i].num;
|
||||||
if(i > 0 && signals[i-1].num == e)
|
if(i > 0 && signals[i-1].num == e)
|
||||||
continue;
|
continue;
|
||||||
strcpy(buf, strsignal(e));
|
strncpy(buf, strsignal(e), sizeof(buf) - 1);
|
||||||
|
buf[sizeof(buf) - 1] = '\0';
|
||||||
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
|
||||||
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
|
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
|
||||||
buf[0] += a - A;
|
buf[0] += a - A;
|
||||||
|
|
|
||||||
13
vendor/golang.org/x/sys/unix/mmap_nomremap.go
generated
vendored
Normal file
13
vendor/golang.org/x/sys/unix/mmap_nomremap.go
generated
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Copyright 2023 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.
|
||||||
|
|
||||||
|
//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
var mapper = &mmapper{
|
||||||
|
active: make(map[*byte][]byte),
|
||||||
|
mmap: mmap,
|
||||||
|
munmap: munmap,
|
||||||
|
}
|
||||||
57
vendor/golang.org/x/sys/unix/mremap.go
generated
vendored
Normal file
57
vendor/golang.org/x/sys/unix/mremap.go
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
// Copyright 2023 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.
|
||||||
|
|
||||||
|
//go:build linux || netbsd
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
type mremapMmapper struct {
|
||||||
|
mmapper
|
||||||
|
mremap func(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error)
|
||||||
|
}
|
||||||
|
|
||||||
|
var mapper = &mremapMmapper{
|
||||||
|
mmapper: mmapper{
|
||||||
|
active: make(map[*byte][]byte),
|
||||||
|
mmap: mmap,
|
||||||
|
munmap: munmap,
|
||||||
|
},
|
||||||
|
mremap: mremap,
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *mremapMmapper) Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) {
|
||||||
|
if newLength <= 0 || len(oldData) == 0 || len(oldData) != cap(oldData) || flags&mremapFixed != 0 {
|
||||||
|
return nil, EINVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
pOld := &oldData[cap(oldData)-1]
|
||||||
|
m.Lock()
|
||||||
|
defer m.Unlock()
|
||||||
|
bOld := m.active[pOld]
|
||||||
|
if bOld == nil || &bOld[0] != &oldData[0] {
|
||||||
|
return nil, EINVAL
|
||||||
|
}
|
||||||
|
newAddr, errno := m.mremap(uintptr(unsafe.Pointer(&bOld[0])), uintptr(len(bOld)), uintptr(newLength), flags, 0)
|
||||||
|
if errno != nil {
|
||||||
|
return nil, errno
|
||||||
|
}
|
||||||
|
bNew := unsafe.Slice((*byte)(unsafe.Pointer(newAddr)), newLength)
|
||||||
|
pNew := &bNew[cap(bNew)-1]
|
||||||
|
if flags&mremapDontunmap == 0 {
|
||||||
|
delete(m.active, pOld)
|
||||||
|
}
|
||||||
|
m.active[pNew] = bNew
|
||||||
|
return bNew, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) {
|
||||||
|
return mapper.Mremap(oldData, newLength, flags)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) {
|
||||||
|
xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr))
|
||||||
|
return unsafe.Pointer(xaddr), err
|
||||||
|
}
|
||||||
3
vendor/golang.org/x/sys/unix/pagesize_unix.go
generated
vendored
3
vendor/golang.org/x/sys/unix/pagesize_unix.go
generated
vendored
|
|
@ -2,8 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
||||||
|
|
||||||
// For Unix, get the pagesize from the runtime.
|
// For Unix, get the pagesize from the runtime.
|
||||||
|
|
||||||
|
|
|
||||||
110
vendor/golang.org/x/sys/unix/pledge_openbsd.go
generated
vendored
110
vendor/golang.org/x/sys/unix/pledge_openbsd.go
generated
vendored
|
|
@ -8,54 +8,31 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
"syscall"
|
|
||||||
"unsafe"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Pledge implements the pledge syscall.
|
// Pledge implements the pledge syscall.
|
||||||
//
|
//
|
||||||
// The pledge syscall does not accept execpromises on OpenBSD releases
|
// This changes both the promises and execpromises; use PledgePromises or
|
||||||
// before 6.3.
|
// PledgeExecpromises to only change the promises or execpromises
|
||||||
//
|
// respectively.
|
||||||
// execpromises must be empty when Pledge is called on OpenBSD
|
|
||||||
// releases predating 6.3, otherwise an error will be returned.
|
|
||||||
//
|
//
|
||||||
// For more information see pledge(2).
|
// For more information see pledge(2).
|
||||||
func Pledge(promises, execpromises string) error {
|
func Pledge(promises, execpromises string) error {
|
||||||
maj, min, err := majmin()
|
if err := pledgeAvailable(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
pptr, err := BytePtrFromString(promises)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pledgeAvailable(maj, min, execpromises)
|
exptr, err := BytePtrFromString(execpromises)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
pptr, err := syscall.BytePtrFromString(promises)
|
return pledge(pptr, exptr)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// This variable will hold either a nil unsafe.Pointer or
|
|
||||||
// an unsafe.Pointer to a string (execpromises).
|
|
||||||
var expr unsafe.Pointer
|
|
||||||
|
|
||||||
// If we're running on OpenBSD > 6.2, pass execpromises to the syscall.
|
|
||||||
if maj > 6 || (maj == 6 && min > 2) {
|
|
||||||
exptr, err := syscall.BytePtrFromString(execpromises)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
expr = unsafe.Pointer(exptr)
|
|
||||||
}
|
|
||||||
|
|
||||||
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
|
|
||||||
if e != 0 {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PledgePromises implements the pledge syscall.
|
// PledgePromises implements the pledge syscall.
|
||||||
|
|
@ -64,30 +41,16 @@ func Pledge(promises, execpromises string) error {
|
||||||
//
|
//
|
||||||
// For more information see pledge(2).
|
// For more information see pledge(2).
|
||||||
func PledgePromises(promises string) error {
|
func PledgePromises(promises string) error {
|
||||||
maj, min, err := majmin()
|
if err := pledgeAvailable(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
pptr, err := BytePtrFromString(promises)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pledgeAvailable(maj, min, "")
|
return pledge(pptr, nil)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// This variable holds the execpromises and is always nil.
|
|
||||||
var expr unsafe.Pointer
|
|
||||||
|
|
||||||
pptr, err := syscall.BytePtrFromString(promises)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0)
|
|
||||||
if e != 0 {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PledgeExecpromises implements the pledge syscall.
|
// PledgeExecpromises implements the pledge syscall.
|
||||||
|
|
@ -96,30 +59,16 @@ func PledgePromises(promises string) error {
|
||||||
//
|
//
|
||||||
// For more information see pledge(2).
|
// For more information see pledge(2).
|
||||||
func PledgeExecpromises(execpromises string) error {
|
func PledgeExecpromises(execpromises string) error {
|
||||||
maj, min, err := majmin()
|
if err := pledgeAvailable(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
exptr, err := BytePtrFromString(execpromises)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = pledgeAvailable(maj, min, execpromises)
|
return pledge(nil, exptr)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// This variable holds the promises and is always nil.
|
|
||||||
var pptr unsafe.Pointer
|
|
||||||
|
|
||||||
exptr, err := syscall.BytePtrFromString(execpromises)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr), uintptr(unsafe.Pointer(exptr)), 0)
|
|
||||||
if e != 0 {
|
|
||||||
return e
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// majmin returns major and minor version number for an OpenBSD system.
|
// majmin returns major and minor version number for an OpenBSD system.
|
||||||
|
|
@ -147,16 +96,15 @@ func majmin() (major int, minor int, err error) {
|
||||||
|
|
||||||
// pledgeAvailable checks for availability of the pledge(2) syscall
|
// pledgeAvailable checks for availability of the pledge(2) syscall
|
||||||
// based on the running OpenBSD version.
|
// based on the running OpenBSD version.
|
||||||
func pledgeAvailable(maj, min int, execpromises string) error {
|
func pledgeAvailable() error {
|
||||||
// If OpenBSD <= 5.9, pledge is not available.
|
maj, min, err := majmin()
|
||||||
if (maj == 5 && min != 9) || maj < 5 {
|
if err != nil {
|
||||||
return fmt.Errorf("pledge syscall is not available on OpenBSD %d.%d", maj, min)
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// If OpenBSD <= 6.2 and execpromises is not empty,
|
// Require OpenBSD 6.4 as a minimum.
|
||||||
// return an error - execpromises is not available before 6.3
|
if maj < 6 || (maj == 6 && min <= 3) {
|
||||||
if (maj < 6 || (maj == 6 && min <= 2)) && execpromises != "" {
|
return fmt.Errorf("cannot call Pledge on OpenBSD %d.%d", maj, min)
|
||||||
return fmt.Errorf("cannot use execpromises on OpenBSD %d.%d", maj, min)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
7
vendor/golang.org/x/sys/unix/ptrace_darwin.go
generated
vendored
7
vendor/golang.org/x/sys/unix/ptrace_darwin.go
generated
vendored
|
|
@ -3,16 +3,9 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build darwin && !ios
|
//go:build darwin && !ios
|
||||||
// +build darwin,!ios
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) error {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) error {
|
||||||
return ptrace1(request, pid, addr, data)
|
return ptrace1(request, pid, addr, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) error {
|
|
||||||
return ptrace1Ptr(request, pid, addr, data)
|
|
||||||
}
|
|
||||||
|
|
|
||||||
7
vendor/golang.org/x/sys/unix/ptrace_ios.go
generated
vendored
7
vendor/golang.org/x/sys/unix/ptrace_ios.go
generated
vendored
|
|
@ -3,16 +3,9 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build ios
|
//go:build ios
|
||||||
// +build ios
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
|
||||||
return ENOTSUP
|
return ENOTSUP
|
||||||
}
|
}
|
||||||
|
|
||||||
func ptracePtr(request int, pid int, addr uintptr, data unsafe.Pointer) (err error) {
|
|
||||||
return ENOTSUP
|
|
||||||
}
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/race.go
generated
vendored
1
vendor/golang.org/x/sys/unix/race.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (darwin && race) || (linux && race) || (freebsd && race)
|
//go:build (darwin && race) || (linux && race) || (freebsd && race)
|
||||||
// +build darwin,race linux,race freebsd,race
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/race0.go
generated
vendored
1
vendor/golang.org/x/sys/unix/race0.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos
|
//go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos
|
||||||
// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/readdirent_getdents.go
generated
vendored
1
vendor/golang.org/x/sys/unix/readdirent_getdents.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd
|
//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd
|
||||||
// +build aix dragonfly freebsd linux netbsd openbsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
generated
vendored
3
vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
generated
vendored
|
|
@ -2,8 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build darwin
|
//go:build darwin || zos
|
||||||
// +build darwin
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/sockcmsg_unix.go
generated
vendored
1
vendor/golang.org/x/sys/unix/sockcmsg_unix.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
// Socket control messages
|
// Socket control messages
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
generated
vendored
1
vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
58
vendor/golang.org/x/sys/unix/sockcmsg_zos.go
generated
vendored
Normal file
58
vendor/golang.org/x/sys/unix/sockcmsg_zos.go
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
// Copyright 2024 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.
|
||||||
|
|
||||||
|
// Socket control messages
|
||||||
|
|
||||||
|
package unix
|
||||||
|
|
||||||
|
import "unsafe"
|
||||||
|
|
||||||
|
// UnixCredentials encodes credentials into a socket control message
|
||||||
|
// for sending to another process. This can be used for
|
||||||
|
// authentication.
|
||||||
|
func UnixCredentials(ucred *Ucred) []byte {
|
||||||
|
b := make([]byte, CmsgSpace(SizeofUcred))
|
||||||
|
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||||
|
h.Level = SOL_SOCKET
|
||||||
|
h.Type = SCM_CREDENTIALS
|
||||||
|
h.SetLen(CmsgLen(SizeofUcred))
|
||||||
|
*(*Ucred)(h.data(0)) = *ucred
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// ParseUnixCredentials decodes a socket control message that contains
|
||||||
|
// credentials in a Ucred structure. To receive such a message, the
|
||||||
|
// SO_PASSCRED option must be enabled on the socket.
|
||||||
|
func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) {
|
||||||
|
if m.Header.Level != SOL_SOCKET {
|
||||||
|
return nil, EINVAL
|
||||||
|
}
|
||||||
|
if m.Header.Type != SCM_CREDENTIALS {
|
||||||
|
return nil, EINVAL
|
||||||
|
}
|
||||||
|
ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0]))
|
||||||
|
return &ucred, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// PktInfo4 encodes Inet4Pktinfo into a socket control message of type IP_PKTINFO.
|
||||||
|
func PktInfo4(info *Inet4Pktinfo) []byte {
|
||||||
|
b := make([]byte, CmsgSpace(SizeofInet4Pktinfo))
|
||||||
|
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||||
|
h.Level = SOL_IP
|
||||||
|
h.Type = IP_PKTINFO
|
||||||
|
h.SetLen(CmsgLen(SizeofInet4Pktinfo))
|
||||||
|
*(*Inet4Pktinfo)(h.data(0)) = *info
|
||||||
|
return b
|
||||||
|
}
|
||||||
|
|
||||||
|
// PktInfo6 encodes Inet6Pktinfo into a socket control message of type IPV6_PKTINFO.
|
||||||
|
func PktInfo6(info *Inet6Pktinfo) []byte {
|
||||||
|
b := make([]byte, CmsgSpace(SizeofInet6Pktinfo))
|
||||||
|
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
|
||||||
|
h.Level = SOL_IPV6
|
||||||
|
h.Type = IPV6_PKTINFO
|
||||||
|
h.SetLen(CmsgLen(SizeofInet6Pktinfo))
|
||||||
|
*(*Inet6Pktinfo)(h.data(0)) = *info
|
||||||
|
return b
|
||||||
|
}
|
||||||
75
vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s
generated
vendored
Normal file
75
vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
// Copyright 2024 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.
|
||||||
|
|
||||||
|
//go:build zos && s390x && gc
|
||||||
|
|
||||||
|
#include "textflag.h"
|
||||||
|
|
||||||
|
// provide the address of function variable to be fixed up.
|
||||||
|
|
||||||
|
TEXT ·getPipe2Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Pipe2(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_FlockAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Flock(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_GetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Getxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_NanosleepAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Nanosleep(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_SetxattrAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Setxattr(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_Wait4Addr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Wait4(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_MountAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Mount(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_UnmountAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Unmount(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_UtimesNanoAtAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·UtimesNanoAt(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_UtimesNanoAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·UtimesNano(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_MkfifoatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Mkfifoat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_ChtagAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Chtag(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
|
TEXT ·get_ReadlinkatAddr(SB), NOSPLIT|NOFRAME, $0-8
|
||||||
|
MOVD $·Readlinkat(SB), R8
|
||||||
|
MOVD R8, ret+0(FP)
|
||||||
|
RET
|
||||||
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
|
||||||
// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
|
|
||||||
|
|
||||||
// Package unix contains an interface to the low-level operating system
|
// Package unix contains an interface to the low-level operating system
|
||||||
// primitives. OS details vary depending on the underlying system, and
|
// primitives. OS details vary depending on the underlying system, and
|
||||||
|
|
|
||||||
25
vendor/golang.org/x/sys/unix/syscall_aix.go
generated
vendored
25
vendor/golang.org/x/sys/unix/syscall_aix.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix
|
//go:build aix
|
||||||
// +build aix
|
|
||||||
|
|
||||||
// Aix system calls.
|
// Aix system calls.
|
||||||
// This file is compiled as ordinary Go code,
|
// This file is compiled as ordinary Go code,
|
||||||
|
|
@ -107,7 +106,8 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
sl += _Socklen(n) + 1
|
sl += _Socklen(n) + 1
|
||||||
}
|
}
|
||||||
if sa.raw.Path[0] == '@' {
|
if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) {
|
||||||
|
// Check sl > 3 so we don't change unnamed socket behavior.
|
||||||
sa.raw.Path[0] = 0
|
sa.raw.Path[0] = 0
|
||||||
// Don't count trailing NUL for abstract address.
|
// Don't count trailing NUL for abstract address.
|
||||||
sl--
|
sl--
|
||||||
|
|
@ -408,8 +408,8 @@ func (w WaitStatus) CoreDump() bool { return w&0x80 == 0x80 }
|
||||||
|
|
||||||
func (w WaitStatus) TrapCause() int { return -1 }
|
func (w WaitStatus) TrapCause() int { return -1 }
|
||||||
|
|
||||||
//sys ioctl(fd int, req uint, arg uintptr) (err error)
|
//sys ioctl(fd int, req int, arg uintptr) (err error)
|
||||||
//sys ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) = ioctl
|
//sys ioctlPtr(fd int, req int, arg unsafe.Pointer) (err error) = ioctl
|
||||||
|
|
||||||
// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
|
// fcntl must never be called with cmd=F_DUP2FD because it doesn't work on AIX
|
||||||
// There is no way to create a custom fcntl and to keep //sys fcntl easily,
|
// There is no way to create a custom fcntl and to keep //sys fcntl easily,
|
||||||
|
|
@ -487,8 +487,6 @@ func Fsync(fd int) error {
|
||||||
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
//sys Unlinkat(dirfd int, path string, flags int) (err error)
|
||||||
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys readlen(fd int, p *byte, np int) (n int, err error) = read
|
|
||||||
//sys writelen(fd int, p *byte, np int) (n int, err error) = write
|
|
||||||
|
|
||||||
//sys Dup2(oldfd int, newfd int) (err error)
|
//sys Dup2(oldfd int, newfd int) (err error)
|
||||||
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = posix_fadvise64
|
//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = posix_fadvise64
|
||||||
|
|
@ -535,21 +533,6 @@ func Fsync(fd int) error {
|
||||||
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = nsendmsg
|
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = nsendmsg
|
||||||
|
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
|
|
||||||
var mapper = &mmapper{
|
|
||||||
active: make(map[*byte][]byte),
|
|
||||||
mmap: mmap,
|
|
||||||
munmap: munmap,
|
|
||||||
}
|
|
||||||
|
|
||||||
func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
|
|
||||||
return mapper.Mmap(fd, offset, length, prot, flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Munmap(b []byte) (err error) {
|
|
||||||
return mapper.Munmap(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
//sys Madvise(b []byte, advice int) (err error)
|
//sys Madvise(b []byte, advice int) (err error)
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_aix_ppc.go
generated
vendored
|
|
@ -3,12 +3,10 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix && ppc
|
//go:build aix && ppc
|
||||||
// +build aix,ppc
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
|
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64
|
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64
|
||||||
|
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go
generated
vendored
|
|
@ -3,12 +3,10 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build aix && ppc64
|
//go:build aix && ppc64
|
||||||
// +build aix,ppc64
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
|
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek
|
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek
|
||||||
|
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64
|
//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64
|
||||||
|
|
|
||||||
17
vendor/golang.org/x/sys/unix/syscall_bsd.go
generated
vendored
17
vendor/golang.org/x/sys/unix/syscall_bsd.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
|
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
|
||||||
// +build darwin dragonfly freebsd netbsd openbsd
|
|
||||||
|
|
||||||
// BSD system call wrappers shared by *BSD based systems
|
// BSD system call wrappers shared by *BSD based systems
|
||||||
// including OS X (Darwin) and FreeBSD. Like the other
|
// including OS X (Darwin) and FreeBSD. Like the other
|
||||||
|
|
@ -317,7 +316,7 @@ func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return string(buf[:vallen-1]), nil
|
return ByteSliceToString(buf[:vallen]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
|
//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
|
||||||
|
|
@ -601,20 +600,6 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
|
||||||
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
// Gethostuuid(uuid *byte, timeout *Timespec) (err error)
|
||||||
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
// Ptrace(req int, pid int, addr uintptr, data int) (ret uintptr, err error)
|
||||||
|
|
||||||
var mapper = &mmapper{
|
|
||||||
active: make(map[*byte][]byte),
|
|
||||||
mmap: mmap,
|
|
||||||
munmap: munmap,
|
|
||||||
}
|
|
||||||
|
|
||||||
func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
|
|
||||||
return mapper.Mmap(fd, offset, length, prot, flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Munmap(b []byte) (err error) {
|
|
||||||
return mapper.Munmap(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
//sys Madvise(b []byte, behav int) (err error)
|
//sys Madvise(b []byte, behav int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
//sys Mlockall(flags int) (err error)
|
//sys Mlockall(flags int) (err error)
|
||||||
|
|
|
||||||
263
vendor/golang.org/x/sys/unix/syscall_darwin.go
generated
vendored
263
vendor/golang.org/x/sys/unix/syscall_darwin.go
generated
vendored
|
|
@ -402,6 +402,18 @@ func IoctlSetIfreqMTU(fd int, ifreq *IfreqMTU) error {
|
||||||
return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq))
|
return ioctlPtr(fd, SIOCSIFMTU, unsafe.Pointer(ifreq))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sys renamexNp(from string, to string, flag uint32) (err error)
|
||||||
|
|
||||||
|
func RenamexNp(from string, to string, flag uint32) (err error) {
|
||||||
|
return renamexNp(from, to, flag)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys renameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error)
|
||||||
|
|
||||||
|
func RenameatxNp(fromfd int, from string, tofd int, to string, flag uint32) (err error) {
|
||||||
|
return renameatxNp(fromfd, from, tofd, to, flag)
|
||||||
|
}
|
||||||
|
|
||||||
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
|
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS_SYSCTL
|
||||||
|
|
||||||
func Uname(uname *Utsname) error {
|
func Uname(uname *Utsname) error {
|
||||||
|
|
@ -510,30 +522,48 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find size.
|
for {
|
||||||
n := uintptr(0)
|
// Find size.
|
||||||
if err := sysctl(mib, nil, &n, nil, 0); err != nil {
|
n := uintptr(0)
|
||||||
return nil, err
|
if err := sysctl(mib, nil, &n, nil, 0); err != nil {
|
||||||
}
|
return nil, err
|
||||||
if n == 0 {
|
}
|
||||||
return nil, nil
|
if n == 0 {
|
||||||
}
|
return nil, nil
|
||||||
if n%SizeofKinfoProc != 0 {
|
}
|
||||||
return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
|
if n%SizeofKinfoProc != 0 {
|
||||||
}
|
return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
|
||||||
|
}
|
||||||
|
|
||||||
// Read into buffer of that size.
|
// Read into buffer of that size.
|
||||||
buf := make([]KinfoProc, n/SizeofKinfoProc)
|
buf := make([]KinfoProc, n/SizeofKinfoProc)
|
||||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&buf[0])), &n, nil, 0); err != nil {
|
if err := sysctl(mib, (*byte)(unsafe.Pointer(&buf[0])), &n, nil, 0); err != nil {
|
||||||
return nil, err
|
if err == ENOMEM {
|
||||||
}
|
// Process table grew. Try again.
|
||||||
if n%SizeofKinfoProc != 0 {
|
continue
|
||||||
return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
|
}
|
||||||
}
|
return nil, err
|
||||||
|
}
|
||||||
|
if n%SizeofKinfoProc != 0 {
|
||||||
|
return nil, fmt.Errorf("sysctl() returned a size of %d, which is not a multiple of %d", n, SizeofKinfoProc)
|
||||||
|
}
|
||||||
|
|
||||||
// The actual call may return less than the original reported required
|
// The actual call may return less than the original reported required
|
||||||
// size so ensure we deal with that.
|
// size so ensure we deal with that.
|
||||||
return buf[:n/SizeofKinfoProc], nil
|
return buf[:n/SizeofKinfoProc], nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys pthread_chdir_np(path string) (err error)
|
||||||
|
|
||||||
|
func PthreadChdir(path string) (err error) {
|
||||||
|
return pthread_chdir_np(path)
|
||||||
|
}
|
||||||
|
|
||||||
|
//sys pthread_fchdir_np(fd int) (err error)
|
||||||
|
|
||||||
|
func PthreadFchdir(fd int) (err error) {
|
||||||
|
return pthread_fchdir_np(fd)
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
|
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
|
||||||
|
|
@ -613,6 +643,7 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
||||||
//sys Rmdir(path string) (err error)
|
//sys Rmdir(path string) (err error)
|
||||||
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
//sys Seek(fd int, offset int64, whence int) (newoffset int64, err error) = SYS_LSEEK
|
||||||
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
|
||||||
|
//sys Setattrlist(path string, attrlist *Attrlist, attrBuf []byte, options int) (err error)
|
||||||
//sys Setegid(egid int) (err error)
|
//sys Setegid(egid int) (err error)
|
||||||
//sysnb Seteuid(euid int) (err error)
|
//sysnb Seteuid(euid int) (err error)
|
||||||
//sysnb Setgid(gid int) (err error)
|
//sysnb Setgid(gid int) (err error)
|
||||||
|
|
@ -622,7 +653,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
||||||
//sys Setprivexec(flag int) (err error)
|
//sys Setprivexec(flag int) (err error)
|
||||||
//sysnb Setregid(rgid int, egid int) (err error)
|
//sysnb Setregid(rgid int, egid int) (err error)
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
|
|
@ -638,190 +668,3 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Unimplemented
|
|
||||||
*/
|
|
||||||
// Profil
|
|
||||||
// Sigaction
|
|
||||||
// Sigprocmask
|
|
||||||
// Getlogin
|
|
||||||
// Sigpending
|
|
||||||
// Sigaltstack
|
|
||||||
// Ioctl
|
|
||||||
// Reboot
|
|
||||||
// Execve
|
|
||||||
// Vfork
|
|
||||||
// Sbrk
|
|
||||||
// Sstk
|
|
||||||
// Ovadvise
|
|
||||||
// Mincore
|
|
||||||
// Setitimer
|
|
||||||
// Swapon
|
|
||||||
// Select
|
|
||||||
// Sigsuspend
|
|
||||||
// Readv
|
|
||||||
// Writev
|
|
||||||
// Nfssvc
|
|
||||||
// Getfh
|
|
||||||
// Quotactl
|
|
||||||
// Csops
|
|
||||||
// Waitid
|
|
||||||
// Add_profil
|
|
||||||
// Kdebug_trace
|
|
||||||
// Sigreturn
|
|
||||||
// Atsocket
|
|
||||||
// Kqueue_from_portset_np
|
|
||||||
// Kqueue_portset
|
|
||||||
// Getattrlist
|
|
||||||
// Setattrlist
|
|
||||||
// Getdirentriesattr
|
|
||||||
// Searchfs
|
|
||||||
// Delete
|
|
||||||
// Copyfile
|
|
||||||
// Watchevent
|
|
||||||
// Waitevent
|
|
||||||
// Modwatch
|
|
||||||
// Fsctl
|
|
||||||
// Initgroups
|
|
||||||
// Posix_spawn
|
|
||||||
// Nfsclnt
|
|
||||||
// Fhopen
|
|
||||||
// Minherit
|
|
||||||
// Semsys
|
|
||||||
// Msgsys
|
|
||||||
// Shmsys
|
|
||||||
// Semctl
|
|
||||||
// Semget
|
|
||||||
// Semop
|
|
||||||
// Msgctl
|
|
||||||
// Msgget
|
|
||||||
// Msgsnd
|
|
||||||
// Msgrcv
|
|
||||||
// Shm_open
|
|
||||||
// Shm_unlink
|
|
||||||
// Sem_open
|
|
||||||
// Sem_close
|
|
||||||
// Sem_unlink
|
|
||||||
// Sem_wait
|
|
||||||
// Sem_trywait
|
|
||||||
// Sem_post
|
|
||||||
// Sem_getvalue
|
|
||||||
// Sem_init
|
|
||||||
// Sem_destroy
|
|
||||||
// Open_extended
|
|
||||||
// Umask_extended
|
|
||||||
// Stat_extended
|
|
||||||
// Lstat_extended
|
|
||||||
// Fstat_extended
|
|
||||||
// Chmod_extended
|
|
||||||
// Fchmod_extended
|
|
||||||
// Access_extended
|
|
||||||
// Settid
|
|
||||||
// Gettid
|
|
||||||
// Setsgroups
|
|
||||||
// Getsgroups
|
|
||||||
// Setwgroups
|
|
||||||
// Getwgroups
|
|
||||||
// Mkfifo_extended
|
|
||||||
// Mkdir_extended
|
|
||||||
// Identitysvc
|
|
||||||
// Shared_region_check_np
|
|
||||||
// Shared_region_map_np
|
|
||||||
// __pthread_mutex_destroy
|
|
||||||
// __pthread_mutex_init
|
|
||||||
// __pthread_mutex_lock
|
|
||||||
// __pthread_mutex_trylock
|
|
||||||
// __pthread_mutex_unlock
|
|
||||||
// __pthread_cond_init
|
|
||||||
// __pthread_cond_destroy
|
|
||||||
// __pthread_cond_broadcast
|
|
||||||
// __pthread_cond_signal
|
|
||||||
// Setsid_with_pid
|
|
||||||
// __pthread_cond_timedwait
|
|
||||||
// Aio_fsync
|
|
||||||
// Aio_return
|
|
||||||
// Aio_suspend
|
|
||||||
// Aio_cancel
|
|
||||||
// Aio_error
|
|
||||||
// Aio_read
|
|
||||||
// Aio_write
|
|
||||||
// Lio_listio
|
|
||||||
// __pthread_cond_wait
|
|
||||||
// Iopolicysys
|
|
||||||
// __pthread_kill
|
|
||||||
// __pthread_sigmask
|
|
||||||
// __sigwait
|
|
||||||
// __disable_threadsignal
|
|
||||||
// __pthread_markcancel
|
|
||||||
// __pthread_canceled
|
|
||||||
// __semwait_signal
|
|
||||||
// Proc_info
|
|
||||||
// sendfile
|
|
||||||
// Stat64_extended
|
|
||||||
// Lstat64_extended
|
|
||||||
// Fstat64_extended
|
|
||||||
// __pthread_chdir
|
|
||||||
// __pthread_fchdir
|
|
||||||
// Audit
|
|
||||||
// Auditon
|
|
||||||
// Getauid
|
|
||||||
// Setauid
|
|
||||||
// Getaudit
|
|
||||||
// Setaudit
|
|
||||||
// Getaudit_addr
|
|
||||||
// Setaudit_addr
|
|
||||||
// Auditctl
|
|
||||||
// Bsdthread_create
|
|
||||||
// Bsdthread_terminate
|
|
||||||
// Stack_snapshot
|
|
||||||
// Bsdthread_register
|
|
||||||
// Workq_open
|
|
||||||
// Workq_ops
|
|
||||||
// __mac_execve
|
|
||||||
// __mac_syscall
|
|
||||||
// __mac_get_file
|
|
||||||
// __mac_set_file
|
|
||||||
// __mac_get_link
|
|
||||||
// __mac_set_link
|
|
||||||
// __mac_get_proc
|
|
||||||
// __mac_set_proc
|
|
||||||
// __mac_get_fd
|
|
||||||
// __mac_set_fd
|
|
||||||
// __mac_get_pid
|
|
||||||
// __mac_get_lcid
|
|
||||||
// __mac_get_lctx
|
|
||||||
// __mac_set_lctx
|
|
||||||
// Setlcid
|
|
||||||
// Read_nocancel
|
|
||||||
// Write_nocancel
|
|
||||||
// Open_nocancel
|
|
||||||
// Close_nocancel
|
|
||||||
// Wait4_nocancel
|
|
||||||
// Recvmsg_nocancel
|
|
||||||
// Sendmsg_nocancel
|
|
||||||
// Recvfrom_nocancel
|
|
||||||
// Accept_nocancel
|
|
||||||
// Fcntl_nocancel
|
|
||||||
// Select_nocancel
|
|
||||||
// Fsync_nocancel
|
|
||||||
// Connect_nocancel
|
|
||||||
// Sigsuspend_nocancel
|
|
||||||
// Readv_nocancel
|
|
||||||
// Writev_nocancel
|
|
||||||
// Sendto_nocancel
|
|
||||||
// Pread_nocancel
|
|
||||||
// Pwrite_nocancel
|
|
||||||
// Waitid_nocancel
|
|
||||||
// Poll_nocancel
|
|
||||||
// Msgsnd_nocancel
|
|
||||||
// Msgrcv_nocancel
|
|
||||||
// Sem_wait_nocancel
|
|
||||||
// Aio_suspend_nocancel
|
|
||||||
// __sigwait_nocancel
|
|
||||||
// __semwait_signal_nocancel
|
|
||||||
// __mac_mount
|
|
||||||
// __mac_get_mount
|
|
||||||
// __mac_getfsstat
|
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build amd64 && darwin
|
//go:build amd64 && darwin
|
||||||
// +build amd64,darwin
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
@ -47,6 +46,5 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||||
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
|
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT64
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
|
||||||
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
||||||
//sys ptrace1Ptr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) = SYS_ptrace
|
|
||||||
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
//sys Statfs(path string, stat *Statfs_t) (err error) = SYS_STATFS64
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build arm64 && darwin
|
//go:build arm64 && darwin
|
||||||
// +build arm64,darwin
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
@ -47,6 +46,5 @@ func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
|
||||||
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
|
//sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT
|
||||||
//sys Lstat(path string, stat *Stat_t) (err error)
|
//sys Lstat(path string, stat *Stat_t) (err error)
|
||||||
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
//sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace
|
||||||
//sys ptrace1Ptr(request int, pid int, addr unsafe.Pointer, data uintptr) (err error) = SYS_ptrace
|
|
||||||
//sys Stat(path string, stat *Stat_t) (err error)
|
//sys Stat(path string, stat *Stat_t) (err error)
|
||||||
//sys Statfs(path string, stat *Statfs_t) (err error)
|
//sys Statfs(path string, stat *Statfs_t) (err error)
|
||||||
|
|
|
||||||
3
vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
generated
vendored
3
vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go
generated
vendored
|
|
@ -2,8 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build darwin && go1.12
|
//go:build darwin
|
||||||
// +build darwin,go1.12
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
199
vendor/golang.org/x/sys/unix/syscall_dragonfly.go
generated
vendored
199
vendor/golang.org/x/sys/unix/syscall_dragonfly.go
generated
vendored
|
|
@ -326,7 +326,6 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
|
|
@ -344,203 +343,5 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
|
||||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
|
||||||
* Unimplemented
|
|
||||||
* TODO(jsing): Update this list for DragonFly.
|
|
||||||
*/
|
|
||||||
// Profil
|
|
||||||
// Sigaction
|
|
||||||
// Sigprocmask
|
|
||||||
// Getlogin
|
|
||||||
// Sigpending
|
|
||||||
// Sigaltstack
|
|
||||||
// Reboot
|
|
||||||
// Execve
|
|
||||||
// Vfork
|
|
||||||
// Sbrk
|
|
||||||
// Sstk
|
|
||||||
// Ovadvise
|
|
||||||
// Mincore
|
|
||||||
// Setitimer
|
|
||||||
// Swapon
|
|
||||||
// Select
|
|
||||||
// Sigsuspend
|
|
||||||
// Readv
|
|
||||||
// Writev
|
|
||||||
// Nfssvc
|
|
||||||
// Getfh
|
|
||||||
// Quotactl
|
|
||||||
// Mount
|
|
||||||
// Csops
|
|
||||||
// Waitid
|
|
||||||
// Add_profil
|
|
||||||
// Kdebug_trace
|
|
||||||
// Sigreturn
|
|
||||||
// Atsocket
|
|
||||||
// Kqueue_from_portset_np
|
|
||||||
// Kqueue_portset
|
|
||||||
// Getattrlist
|
|
||||||
// Setattrlist
|
|
||||||
// Getdirentriesattr
|
|
||||||
// Searchfs
|
|
||||||
// Delete
|
|
||||||
// Copyfile
|
|
||||||
// Watchevent
|
|
||||||
// Waitevent
|
|
||||||
// Modwatch
|
|
||||||
// Getxattr
|
|
||||||
// Fgetxattr
|
|
||||||
// Setxattr
|
|
||||||
// Fsetxattr
|
|
||||||
// Removexattr
|
|
||||||
// Fremovexattr
|
|
||||||
// Listxattr
|
|
||||||
// Flistxattr
|
|
||||||
// Fsctl
|
|
||||||
// Initgroups
|
|
||||||
// Posix_spawn
|
|
||||||
// Nfsclnt
|
|
||||||
// Fhopen
|
|
||||||
// Minherit
|
|
||||||
// Semsys
|
|
||||||
// Msgsys
|
|
||||||
// Shmsys
|
|
||||||
// Semctl
|
|
||||||
// Semget
|
|
||||||
// Semop
|
|
||||||
// Msgctl
|
|
||||||
// Msgget
|
|
||||||
// Msgsnd
|
|
||||||
// Msgrcv
|
|
||||||
// Shmat
|
|
||||||
// Shmctl
|
|
||||||
// Shmdt
|
|
||||||
// Shmget
|
|
||||||
// Shm_open
|
|
||||||
// Shm_unlink
|
|
||||||
// Sem_open
|
|
||||||
// Sem_close
|
|
||||||
// Sem_unlink
|
|
||||||
// Sem_wait
|
|
||||||
// Sem_trywait
|
|
||||||
// Sem_post
|
|
||||||
// Sem_getvalue
|
|
||||||
// Sem_init
|
|
||||||
// Sem_destroy
|
|
||||||
// Open_extended
|
|
||||||
// Umask_extended
|
|
||||||
// Stat_extended
|
|
||||||
// Lstat_extended
|
|
||||||
// Fstat_extended
|
|
||||||
// Chmod_extended
|
|
||||||
// Fchmod_extended
|
|
||||||
// Access_extended
|
|
||||||
// Settid
|
|
||||||
// Gettid
|
|
||||||
// Setsgroups
|
|
||||||
// Getsgroups
|
|
||||||
// Setwgroups
|
|
||||||
// Getwgroups
|
|
||||||
// Mkfifo_extended
|
|
||||||
// Mkdir_extended
|
|
||||||
// Identitysvc
|
|
||||||
// Shared_region_check_np
|
|
||||||
// Shared_region_map_np
|
|
||||||
// __pthread_mutex_destroy
|
|
||||||
// __pthread_mutex_init
|
|
||||||
// __pthread_mutex_lock
|
|
||||||
// __pthread_mutex_trylock
|
|
||||||
// __pthread_mutex_unlock
|
|
||||||
// __pthread_cond_init
|
|
||||||
// __pthread_cond_destroy
|
|
||||||
// __pthread_cond_broadcast
|
|
||||||
// __pthread_cond_signal
|
|
||||||
// Setsid_with_pid
|
|
||||||
// __pthread_cond_timedwait
|
|
||||||
// Aio_fsync
|
|
||||||
// Aio_return
|
|
||||||
// Aio_suspend
|
|
||||||
// Aio_cancel
|
|
||||||
// Aio_error
|
|
||||||
// Aio_read
|
|
||||||
// Aio_write
|
|
||||||
// Lio_listio
|
|
||||||
// __pthread_cond_wait
|
|
||||||
// Iopolicysys
|
|
||||||
// __pthread_kill
|
|
||||||
// __pthread_sigmask
|
|
||||||
// __sigwait
|
|
||||||
// __disable_threadsignal
|
|
||||||
// __pthread_markcancel
|
|
||||||
// __pthread_canceled
|
|
||||||
// __semwait_signal
|
|
||||||
// Proc_info
|
|
||||||
// Stat64_extended
|
|
||||||
// Lstat64_extended
|
|
||||||
// Fstat64_extended
|
|
||||||
// __pthread_chdir
|
|
||||||
// __pthread_fchdir
|
|
||||||
// Audit
|
|
||||||
// Auditon
|
|
||||||
// Getauid
|
|
||||||
// Setauid
|
|
||||||
// Getaudit
|
|
||||||
// Setaudit
|
|
||||||
// Getaudit_addr
|
|
||||||
// Setaudit_addr
|
|
||||||
// Auditctl
|
|
||||||
// Bsdthread_create
|
|
||||||
// Bsdthread_terminate
|
|
||||||
// Stack_snapshot
|
|
||||||
// Bsdthread_register
|
|
||||||
// Workq_open
|
|
||||||
// Workq_ops
|
|
||||||
// __mac_execve
|
|
||||||
// __mac_syscall
|
|
||||||
// __mac_get_file
|
|
||||||
// __mac_set_file
|
|
||||||
// __mac_get_link
|
|
||||||
// __mac_set_link
|
|
||||||
// __mac_get_proc
|
|
||||||
// __mac_set_proc
|
|
||||||
// __mac_get_fd
|
|
||||||
// __mac_set_fd
|
|
||||||
// __mac_get_pid
|
|
||||||
// __mac_get_lcid
|
|
||||||
// __mac_get_lctx
|
|
||||||
// __mac_set_lctx
|
|
||||||
// Setlcid
|
|
||||||
// Read_nocancel
|
|
||||||
// Write_nocancel
|
|
||||||
// Open_nocancel
|
|
||||||
// Close_nocancel
|
|
||||||
// Wait4_nocancel
|
|
||||||
// Recvmsg_nocancel
|
|
||||||
// Sendmsg_nocancel
|
|
||||||
// Recvfrom_nocancel
|
|
||||||
// Accept_nocancel
|
|
||||||
// Fcntl_nocancel
|
|
||||||
// Select_nocancel
|
|
||||||
// Fsync_nocancel
|
|
||||||
// Connect_nocancel
|
|
||||||
// Sigsuspend_nocancel
|
|
||||||
// Readv_nocancel
|
|
||||||
// Writev_nocancel
|
|
||||||
// Sendto_nocancel
|
|
||||||
// Pread_nocancel
|
|
||||||
// Pwrite_nocancel
|
|
||||||
// Waitid_nocancel
|
|
||||||
// Msgsnd_nocancel
|
|
||||||
// Msgrcv_nocancel
|
|
||||||
// Sem_wait_nocancel
|
|
||||||
// Aio_suspend_nocancel
|
|
||||||
// __sigwait_nocancel
|
|
||||||
// __semwait_signal_nocancel
|
|
||||||
// __mac_mount
|
|
||||||
// __mac_get_mount
|
|
||||||
// __mac_getfsstat
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build amd64 && dragonfly
|
//go:build amd64 && dragonfly
|
||||||
// +build amd64,dragonfly
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
205
vendor/golang.org/x/sys/unix/syscall_freebsd.go
generated
vendored
205
vendor/golang.org/x/sys/unix/syscall_freebsd.go
generated
vendored
|
|
@ -13,6 +13,7 @@
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"sync"
|
"sync"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
@ -169,25 +170,26 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
|
||||||
func Uname(uname *Utsname) error {
|
func Uname(uname *Utsname) error {
|
||||||
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
mib := []_C_int{CTL_KERN, KERN_OSTYPE}
|
||||||
n := unsafe.Sizeof(uname.Sysname)
|
n := unsafe.Sizeof(uname.Sysname)
|
||||||
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil {
|
// Suppress ENOMEM errors to be compatible with the C library __xuname() implementation.
|
||||||
|
if err := sysctl(mib, &uname.Sysname[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
mib = []_C_int{CTL_KERN, KERN_HOSTNAME}
|
||||||
n = unsafe.Sizeof(uname.Nodename)
|
n = unsafe.Sizeof(uname.Nodename)
|
||||||
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil {
|
if err := sysctl(mib, &uname.Nodename[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
mib = []_C_int{CTL_KERN, KERN_OSRELEASE}
|
||||||
n = unsafe.Sizeof(uname.Release)
|
n = unsafe.Sizeof(uname.Release)
|
||||||
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil {
|
if err := sysctl(mib, &uname.Release[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
mib = []_C_int{CTL_KERN, KERN_VERSION}
|
||||||
n = unsafe.Sizeof(uname.Version)
|
n = unsafe.Sizeof(uname.Version)
|
||||||
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil {
|
if err := sysctl(mib, &uname.Version[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -205,7 +207,7 @@ func Uname(uname *Utsname) error {
|
||||||
|
|
||||||
mib = []_C_int{CTL_HW, HW_MACHINE}
|
mib = []_C_int{CTL_HW, HW_MACHINE}
|
||||||
n = unsafe.Sizeof(uname.Machine)
|
n = unsafe.Sizeof(uname.Machine)
|
||||||
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil {
|
if err := sysctl(mib, &uname.Machine[0], &n, nil, 0); err != nil && !errors.Is(err, ENOMEM) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -433,7 +435,6 @@ func Dup3(oldfd, newfd, flags int) error {
|
||||||
//sysnb Setreuid(ruid int, euid int) (err error)
|
//sysnb Setreuid(ruid int, euid int) (err error)
|
||||||
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
|
||||||
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
|
||||||
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
|
|
||||||
//sysnb Setsid() (pid int, err error)
|
//sysnb Setsid() (pid int, err error)
|
||||||
//sysnb Settimeofday(tp *Timeval) (err error)
|
//sysnb Settimeofday(tp *Timeval) (err error)
|
||||||
//sysnb Setuid(uid int) (err error)
|
//sysnb Setuid(uid int) (err error)
|
||||||
|
|
@ -450,197 +451,5 @@ func Dup3(oldfd, newfd, flags int) error {
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
//sys readlen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_READ
|
|
||||||
//sys writelen(fd int, buf *byte, nbuf int) (n int, err error) = SYS_WRITE
|
|
||||||
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
//sys accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error)
|
||||||
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
|
||||||
|
|
||||||
/*
|
|
||||||
* Unimplemented
|
|
||||||
*/
|
|
||||||
// Profil
|
|
||||||
// Sigaction
|
|
||||||
// Sigprocmask
|
|
||||||
// Getlogin
|
|
||||||
// Sigpending
|
|
||||||
// Sigaltstack
|
|
||||||
// Ioctl
|
|
||||||
// Reboot
|
|
||||||
// Execve
|
|
||||||
// Vfork
|
|
||||||
// Sbrk
|
|
||||||
// Sstk
|
|
||||||
// Ovadvise
|
|
||||||
// Mincore
|
|
||||||
// Setitimer
|
|
||||||
// Swapon
|
|
||||||
// Select
|
|
||||||
// Sigsuspend
|
|
||||||
// Readv
|
|
||||||
// Writev
|
|
||||||
// Nfssvc
|
|
||||||
// Getfh
|
|
||||||
// Quotactl
|
|
||||||
// Mount
|
|
||||||
// Csops
|
|
||||||
// Waitid
|
|
||||||
// Add_profil
|
|
||||||
// Kdebug_trace
|
|
||||||
// Sigreturn
|
|
||||||
// Atsocket
|
|
||||||
// Kqueue_from_portset_np
|
|
||||||
// Kqueue_portset
|
|
||||||
// Getattrlist
|
|
||||||
// Setattrlist
|
|
||||||
// Getdents
|
|
||||||
// Getdirentriesattr
|
|
||||||
// Searchfs
|
|
||||||
// Delete
|
|
||||||
// Copyfile
|
|
||||||
// Watchevent
|
|
||||||
// Waitevent
|
|
||||||
// Modwatch
|
|
||||||
// Fsctl
|
|
||||||
// Initgroups
|
|
||||||
// Posix_spawn
|
|
||||||
// Nfsclnt
|
|
||||||
// Fhopen
|
|
||||||
// Minherit
|
|
||||||
// Semsys
|
|
||||||
// Msgsys
|
|
||||||
// Shmsys
|
|
||||||
// Semctl
|
|
||||||
// Semget
|
|
||||||
// Semop
|
|
||||||
// Msgctl
|
|
||||||
// Msgget
|
|
||||||
// Msgsnd
|
|
||||||
// Msgrcv
|
|
||||||
// Shmat
|
|
||||||
// Shmctl
|
|
||||||
// Shmdt
|
|
||||||
// Shmget
|
|
||||||
// Shm_open
|
|
||||||
// Shm_unlink
|
|
||||||
// Sem_open
|
|
||||||
// Sem_close
|
|
||||||
// Sem_unlink
|
|
||||||
// Sem_wait
|
|
||||||
// Sem_trywait
|
|
||||||
// Sem_post
|
|
||||||
// Sem_getvalue
|
|
||||||
// Sem_init
|
|
||||||
// Sem_destroy
|
|
||||||
// Open_extended
|
|
||||||
// Umask_extended
|
|
||||||
// Stat_extended
|
|
||||||
// Lstat_extended
|
|
||||||
// Fstat_extended
|
|
||||||
// Chmod_extended
|
|
||||||
// Fchmod_extended
|
|
||||||
// Access_extended
|
|
||||||
// Settid
|
|
||||||
// Gettid
|
|
||||||
// Setsgroups
|
|
||||||
// Getsgroups
|
|
||||||
// Setwgroups
|
|
||||||
// Getwgroups
|
|
||||||
// Mkfifo_extended
|
|
||||||
// Mkdir_extended
|
|
||||||
// Identitysvc
|
|
||||||
// Shared_region_check_np
|
|
||||||
// Shared_region_map_np
|
|
||||||
// __pthread_mutex_destroy
|
|
||||||
// __pthread_mutex_init
|
|
||||||
// __pthread_mutex_lock
|
|
||||||
// __pthread_mutex_trylock
|
|
||||||
// __pthread_mutex_unlock
|
|
||||||
// __pthread_cond_init
|
|
||||||
// __pthread_cond_destroy
|
|
||||||
// __pthread_cond_broadcast
|
|
||||||
// __pthread_cond_signal
|
|
||||||
// Setsid_with_pid
|
|
||||||
// __pthread_cond_timedwait
|
|
||||||
// Aio_fsync
|
|
||||||
// Aio_return
|
|
||||||
// Aio_suspend
|
|
||||||
// Aio_cancel
|
|
||||||
// Aio_error
|
|
||||||
// Aio_read
|
|
||||||
// Aio_write
|
|
||||||
// Lio_listio
|
|
||||||
// __pthread_cond_wait
|
|
||||||
// Iopolicysys
|
|
||||||
// __pthread_kill
|
|
||||||
// __pthread_sigmask
|
|
||||||
// __sigwait
|
|
||||||
// __disable_threadsignal
|
|
||||||
// __pthread_markcancel
|
|
||||||
// __pthread_canceled
|
|
||||||
// __semwait_signal
|
|
||||||
// Proc_info
|
|
||||||
// Stat64_extended
|
|
||||||
// Lstat64_extended
|
|
||||||
// Fstat64_extended
|
|
||||||
// __pthread_chdir
|
|
||||||
// __pthread_fchdir
|
|
||||||
// Audit
|
|
||||||
// Auditon
|
|
||||||
// Getauid
|
|
||||||
// Setauid
|
|
||||||
// Getaudit
|
|
||||||
// Setaudit
|
|
||||||
// Getaudit_addr
|
|
||||||
// Setaudit_addr
|
|
||||||
// Auditctl
|
|
||||||
// Bsdthread_create
|
|
||||||
// Bsdthread_terminate
|
|
||||||
// Stack_snapshot
|
|
||||||
// Bsdthread_register
|
|
||||||
// Workq_open
|
|
||||||
// Workq_ops
|
|
||||||
// __mac_execve
|
|
||||||
// __mac_syscall
|
|
||||||
// __mac_get_file
|
|
||||||
// __mac_set_file
|
|
||||||
// __mac_get_link
|
|
||||||
// __mac_set_link
|
|
||||||
// __mac_get_proc
|
|
||||||
// __mac_set_proc
|
|
||||||
// __mac_get_fd
|
|
||||||
// __mac_set_fd
|
|
||||||
// __mac_get_pid
|
|
||||||
// __mac_get_lcid
|
|
||||||
// __mac_get_lctx
|
|
||||||
// __mac_set_lctx
|
|
||||||
// Setlcid
|
|
||||||
// Read_nocancel
|
|
||||||
// Write_nocancel
|
|
||||||
// Open_nocancel
|
|
||||||
// Close_nocancel
|
|
||||||
// Wait4_nocancel
|
|
||||||
// Recvmsg_nocancel
|
|
||||||
// Sendmsg_nocancel
|
|
||||||
// Recvfrom_nocancel
|
|
||||||
// Accept_nocancel
|
|
||||||
// Fcntl_nocancel
|
|
||||||
// Select_nocancel
|
|
||||||
// Fsync_nocancel
|
|
||||||
// Connect_nocancel
|
|
||||||
// Sigsuspend_nocancel
|
|
||||||
// Readv_nocancel
|
|
||||||
// Writev_nocancel
|
|
||||||
// Sendto_nocancel
|
|
||||||
// Pread_nocancel
|
|
||||||
// Pwrite_nocancel
|
|
||||||
// Waitid_nocancel
|
|
||||||
// Poll_nocancel
|
|
||||||
// Msgsnd_nocancel
|
|
||||||
// Msgrcv_nocancel
|
|
||||||
// Sem_wait_nocancel
|
|
||||||
// Aio_suspend_nocancel
|
|
||||||
// __sigwait_nocancel
|
|
||||||
// __semwait_signal_nocancel
|
|
||||||
// __mac_mount
|
|
||||||
// __mac_get_mount
|
|
||||||
// __mac_getfsstat
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build 386 && freebsd
|
//go:build 386 && freebsd
|
||||||
// +build 386,freebsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build amd64 && freebsd
|
//go:build amd64 && freebsd
|
||||||
// +build amd64,freebsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build arm && freebsd
|
//go:build arm && freebsd
|
||||||
// +build arm,freebsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build arm64 && freebsd
|
//go:build arm64 && freebsd
|
||||||
// +build arm64,freebsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build riscv64 && freebsd
|
//go:build riscv64 && freebsd
|
||||||
// +build riscv64,freebsd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_hurd.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_hurd.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build hurd
|
//go:build hurd
|
||||||
// +build hurd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_hurd_386.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_hurd_386.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build 386 && hurd
|
//go:build 386 && hurd
|
||||||
// +build 386,hurd
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
1
vendor/golang.org/x/sys/unix/syscall_illumos.go
generated
vendored
1
vendor/golang.org/x/sys/unix/syscall_illumos.go
generated
vendored
|
|
@ -5,7 +5,6 @@
|
||||||
// illumos system calls not present on Solaris.
|
// illumos system calls not present on Solaris.
|
||||||
|
|
||||||
//go:build amd64 && illumos
|
//go:build amd64 && illumos
|
||||||
// +build amd64,illumos
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
365
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
365
vendor/golang.org/x/sys/unix/syscall_linux.go
generated
vendored
|
|
@ -61,15 +61,23 @@ func FanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname string) (
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys fchmodat(dirfd int, path string, mode uint32) (err error)
|
//sys fchmodat(dirfd int, path string, mode uint32) (err error)
|
||||||
|
//sys fchmodat2(dirfd int, path string, mode uint32, flags int) (err error)
|
||||||
|
|
||||||
func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) {
|
func Fchmodat(dirfd int, path string, mode uint32, flags int) error {
|
||||||
// Linux fchmodat doesn't support the flags parameter. Mimick glibc's behavior
|
// Linux fchmodat doesn't support the flags parameter, but fchmodat2 does.
|
||||||
// and check the flags. Otherwise the mode would be applied to the symlink
|
// Try fchmodat2 if flags are specified.
|
||||||
// destination which is not what the user expects.
|
if flags != 0 {
|
||||||
if flags&^AT_SYMLINK_NOFOLLOW != 0 {
|
err := fchmodat2(dirfd, path, mode, flags)
|
||||||
return EINVAL
|
if err == ENOSYS {
|
||||||
} else if flags&AT_SYMLINK_NOFOLLOW != 0 {
|
// fchmodat2 isn't available. If the flags are known to be valid,
|
||||||
return EOPNOTSUPP
|
// return EOPNOTSUPP to indicate that fchmodat doesn't support them.
|
||||||
|
if flags&^(AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) != 0 {
|
||||||
|
return EINVAL
|
||||||
|
} else if flags&(AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) != 0 {
|
||||||
|
return EOPNOTSUPP
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return fchmodat(dirfd, path, mode)
|
return fchmodat(dirfd, path, mode)
|
||||||
}
|
}
|
||||||
|
|
@ -417,7 +425,8 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
sl += _Socklen(n) + 1
|
sl += _Socklen(n) + 1
|
||||||
}
|
}
|
||||||
if sa.raw.Path[0] == '@' {
|
if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) {
|
||||||
|
// Check sl > 3 so we don't change unnamed socket behavior.
|
||||||
sa.raw.Path[0] = 0
|
sa.raw.Path[0] = 0
|
||||||
// Don't count trailing NUL for abstract address.
|
// Don't count trailing NUL for abstract address.
|
||||||
sl--
|
sl--
|
||||||
|
|
@ -693,10 +702,10 @@ type SockaddrALG struct {
|
||||||
|
|
||||||
func (sa *SockaddrALG) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
func (sa *SockaddrALG) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
// Leave room for NUL byte terminator.
|
// Leave room for NUL byte terminator.
|
||||||
if len(sa.Type) > 13 {
|
if len(sa.Type) > len(sa.raw.Type)-1 {
|
||||||
return nil, 0, EINVAL
|
return nil, 0, EINVAL
|
||||||
}
|
}
|
||||||
if len(sa.Name) > 63 {
|
if len(sa.Name) > len(sa.raw.Name)-1 {
|
||||||
return nil, 0, EINVAL
|
return nil, 0, EINVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -704,17 +713,8 @@ func (sa *SockaddrALG) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
sa.raw.Feat = sa.Feature
|
sa.raw.Feat = sa.Feature
|
||||||
sa.raw.Mask = sa.Mask
|
sa.raw.Mask = sa.Mask
|
||||||
|
|
||||||
typ, err := ByteSliceFromString(sa.Type)
|
copy(sa.raw.Type[:], sa.Type)
|
||||||
if err != nil {
|
copy(sa.raw.Name[:], sa.Name)
|
||||||
return nil, 0, err
|
|
||||||
}
|
|
||||||
name, err := ByteSliceFromString(sa.Name)
|
|
||||||
if err != nil {
|
|
||||||
return nil, 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
copy(sa.raw.Type[:], typ)
|
|
||||||
copy(sa.raw.Name[:], name)
|
|
||||||
|
|
||||||
return unsafe.Pointer(&sa.raw), SizeofSockaddrALG, nil
|
return unsafe.Pointer(&sa.raw), SizeofSockaddrALG, nil
|
||||||
}
|
}
|
||||||
|
|
@ -1310,7 +1310,7 @@ func GetsockoptString(fd, level, opt int) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return string(buf[:vallen-1]), nil
|
return ByteSliceToString(buf[:vallen]), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetsockoptTpacketStats(fd, level, opt int) (*TpacketStats, error) {
|
func GetsockoptTpacketStats(fd, level, opt int) (*TpacketStats, error) {
|
||||||
|
|
@ -1699,12 +1699,23 @@ func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) {
|
||||||
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
|
return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// elfNT_PRSTATUS is a copy of the debug/elf.NT_PRSTATUS constant so
|
||||||
|
// x/sys/unix doesn't need to depend on debug/elf and thus
|
||||||
|
// compress/zlib, debug/dwarf, and other packages.
|
||||||
|
const elfNT_PRSTATUS = 1
|
||||||
|
|
||||||
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) {
|
||||||
return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout))
|
var iov Iovec
|
||||||
|
iov.Base = (*byte)(unsafe.Pointer(regsout))
|
||||||
|
iov.SetLen(int(unsafe.Sizeof(*regsout)))
|
||||||
|
return ptracePtr(PTRACE_GETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov))
|
||||||
}
|
}
|
||||||
|
|
||||||
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
|
func PtraceSetRegs(pid int, regs *PtraceRegs) (err error) {
|
||||||
return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs))
|
var iov Iovec
|
||||||
|
iov.Base = (*byte)(unsafe.Pointer(regs))
|
||||||
|
iov.SetLen(int(unsafe.Sizeof(*regs)))
|
||||||
|
return ptracePtr(PTRACE_SETREGSET, pid, uintptr(elfNT_PRSTATUS), unsafe.Pointer(&iov))
|
||||||
}
|
}
|
||||||
|
|
||||||
func PtraceSetOptions(pid int, options int) (err error) {
|
func PtraceSetOptions(pid int, options int) (err error) {
|
||||||
|
|
@ -1838,6 +1849,105 @@ func Dup2(oldfd, newfd int) error {
|
||||||
//sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error)
|
//sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error)
|
||||||
//sys Fsopen(fsName string, flags int) (fd int, err error)
|
//sys Fsopen(fsName string, flags int) (fd int, err error)
|
||||||
//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error)
|
//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error)
|
||||||
|
|
||||||
|
//sys fsconfig(fd int, cmd uint, key *byte, value *byte, aux int) (err error)
|
||||||
|
|
||||||
|
func fsconfigCommon(fd int, cmd uint, key string, value *byte, aux int) (err error) {
|
||||||
|
var keyp *byte
|
||||||
|
if keyp, err = BytePtrFromString(key); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return fsconfig(fd, cmd, keyp, value, aux)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigSetFlag is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_SET_FLAG.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
// key the parameter key to set.
|
||||||
|
func FsconfigSetFlag(fd int, key string) (err error) {
|
||||||
|
return fsconfigCommon(fd, FSCONFIG_SET_FLAG, key, nil, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigSetString is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_SET_STRING.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
// key the parameter key to set.
|
||||||
|
// value is the parameter value to set.
|
||||||
|
func FsconfigSetString(fd int, key string, value string) (err error) {
|
||||||
|
var valuep *byte
|
||||||
|
if valuep, err = BytePtrFromString(value); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return fsconfigCommon(fd, FSCONFIG_SET_STRING, key, valuep, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigSetBinary is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_SET_BINARY.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
// key the parameter key to set.
|
||||||
|
// value is the parameter value to set.
|
||||||
|
func FsconfigSetBinary(fd int, key string, value []byte) (err error) {
|
||||||
|
if len(value) == 0 {
|
||||||
|
return EINVAL
|
||||||
|
}
|
||||||
|
return fsconfigCommon(fd, FSCONFIG_SET_BINARY, key, &value[0], len(value))
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigSetPath is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_SET_PATH.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
// key the parameter key to set.
|
||||||
|
// path is a non-empty path for specified key.
|
||||||
|
// atfd is a file descriptor at which to start lookup from or AT_FDCWD.
|
||||||
|
func FsconfigSetPath(fd int, key string, path string, atfd int) (err error) {
|
||||||
|
var valuep *byte
|
||||||
|
if valuep, err = BytePtrFromString(path); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return fsconfigCommon(fd, FSCONFIG_SET_PATH, key, valuep, atfd)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigSetPathEmpty is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_SET_PATH_EMPTY. The same as
|
||||||
|
// FconfigSetPath but with AT_PATH_EMPTY implied.
|
||||||
|
func FsconfigSetPathEmpty(fd int, key string, path string, atfd int) (err error) {
|
||||||
|
var valuep *byte
|
||||||
|
if valuep, err = BytePtrFromString(path); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return fsconfigCommon(fd, FSCONFIG_SET_PATH_EMPTY, key, valuep, atfd)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigSetFd is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_SET_FD.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
// key the parameter key to set.
|
||||||
|
// value is a file descriptor to be assigned to specified key.
|
||||||
|
func FsconfigSetFd(fd int, key string, value int) (err error) {
|
||||||
|
return fsconfigCommon(fd, FSCONFIG_SET_FD, key, nil, value)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigCreate is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_CMD_CREATE.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
func FsconfigCreate(fd int) (err error) {
|
||||||
|
return fsconfig(fd, FSCONFIG_CMD_CREATE, nil, nil, 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
// FsconfigReconfigure is equivalent to fsconfig(2) called
|
||||||
|
// with cmd == FSCONFIG_CMD_RECONFIGURE.
|
||||||
|
//
|
||||||
|
// fd is the filesystem context to act upon.
|
||||||
|
func FsconfigReconfigure(fd int) (err error) {
|
||||||
|
return fsconfig(fd, FSCONFIG_CMD_RECONFIGURE, nil, nil, 0)
|
||||||
|
}
|
||||||
|
|
||||||
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
|
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
|
||||||
//sysnb Getpgid(pid int) (pgid int, err error)
|
//sysnb Getpgid(pid int) (pgid int, err error)
|
||||||
|
|
||||||
|
|
@ -1873,9 +1983,8 @@ func Getpgrp() (pid int) {
|
||||||
//sys OpenTree(dfd int, fileName string, flags uint) (r int, err error)
|
//sys OpenTree(dfd int, fileName string, flags uint) (r int, err error)
|
||||||
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
|
//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
|
||||||
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
|
||||||
//sysnb Prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
|
|
||||||
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
|
||||||
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) = SYS_PSELECT6
|
//sys pselect6(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *sigset_argpack) (n int, err error)
|
||||||
//sys read(fd int, p []byte) (n int, err error)
|
//sys read(fd int, p []byte) (n int, err error)
|
||||||
//sys Removexattr(path string, attr string) (err error)
|
//sys Removexattr(path string, attr string) (err error)
|
||||||
//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)
|
//sys Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error)
|
||||||
|
|
@ -1887,6 +1996,15 @@ func Getpgrp() (pid int) {
|
||||||
//sysnb Settimeofday(tv *Timeval) (err error)
|
//sysnb Settimeofday(tv *Timeval) (err error)
|
||||||
//sys Setns(fd int, nstype int) (err error)
|
//sys Setns(fd int, nstype int) (err error)
|
||||||
|
|
||||||
|
//go:linkname syscall_prlimit syscall.prlimit
|
||||||
|
func syscall_prlimit(pid, resource int, newlimit, old *syscall.Rlimit) error
|
||||||
|
|
||||||
|
func Prlimit(pid, resource int, newlimit, old *Rlimit) error {
|
||||||
|
// Just call the syscall version, because as of Go 1.21
|
||||||
|
// it will affect starting a new process.
|
||||||
|
return syscall_prlimit(pid, resource, (*syscall.Rlimit)(newlimit), (*syscall.Rlimit)(old))
|
||||||
|
}
|
||||||
|
|
||||||
// PrctlRetInt performs a prctl operation specified by option and further
|
// PrctlRetInt performs a prctl operation specified by option and further
|
||||||
// optional arguments arg2 through arg5 depending on option. It returns a
|
// optional arguments arg2 through arg5 depending on option. It returns a
|
||||||
// non-negative integer that is returned by the prctl syscall.
|
// non-negative integer that is returned by the prctl syscall.
|
||||||
|
|
@ -1969,8 +2087,6 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
|
||||||
//sys Unshare(flags int) (err error)
|
//sys Unshare(flags int) (err error)
|
||||||
//sys write(fd int, p []byte) (n int, err error)
|
//sys write(fd int, p []byte) (n int, err error)
|
||||||
//sys exitThread(code int) (err error) = SYS_EXIT
|
//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 readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV
|
||||||
//sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV
|
//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 preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV
|
||||||
|
|
@ -2105,21 +2221,7 @@ func writevRacedetect(iovecs []Iovec, n int) {
|
||||||
|
|
||||||
// mmap varies by architecture; see syscall_linux_*.go.
|
// mmap varies by architecture; see syscall_linux_*.go.
|
||||||
//sys munmap(addr uintptr, length uintptr) (err error)
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
||||||
|
//sys mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error)
|
||||||
var mapper = &mmapper{
|
|
||||||
active: make(map[*byte][]byte),
|
|
||||||
mmap: mmap,
|
|
||||||
munmap: munmap,
|
|
||||||
}
|
|
||||||
|
|
||||||
func Mmap(fd int, offset int64, length int, prot int, flags int) (data []byte, err error) {
|
|
||||||
return mapper.Mmap(fd, offset, length, prot, flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Munmap(b []byte) (err error) {
|
|
||||||
return mapper.Munmap(b)
|
|
||||||
}
|
|
||||||
|
|
||||||
//sys Madvise(b []byte, advice int) (err error)
|
//sys Madvise(b []byte, advice int) (err error)
|
||||||
//sys Mprotect(b []byte, prot int) (err error)
|
//sys Mprotect(b []byte, prot int) (err error)
|
||||||
//sys Mlock(b []byte) (err error)
|
//sys Mlock(b []byte) (err error)
|
||||||
|
|
@ -2128,6 +2230,12 @@ func Munmap(b []byte) (err error) {
|
||||||
//sys Munlock(b []byte) (err error)
|
//sys Munlock(b []byte) (err error)
|
||||||
//sys Munlockall() (err error)
|
//sys Munlockall() (err error)
|
||||||
|
|
||||||
|
const (
|
||||||
|
mremapFixed = MREMAP_FIXED
|
||||||
|
mremapDontunmap = MREMAP_DONTUNMAP
|
||||||
|
mremapMaymove = MREMAP_MAYMOVE
|
||||||
|
)
|
||||||
|
|
||||||
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd,
|
||||||
// using the specified flags.
|
// using the specified flags.
|
||||||
func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) {
|
||||||
|
|
@ -2412,99 +2520,76 @@ func PthreadSigmask(how int, set, oldset *Sigset_t) error {
|
||||||
return rtSigprocmask(how, set, oldset, _C__NSIG/8)
|
return rtSigprocmask(how, set, oldset, _C__NSIG/8)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
//sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int)
|
||||||
* Unimplemented
|
//sysnb getresgid(rgid *_C_int, egid *_C_int, sgid *_C_int)
|
||||||
*/
|
|
||||||
// AfsSyscall
|
func Getresuid() (ruid, euid, suid int) {
|
||||||
// ArchPrctl
|
var r, e, s _C_int
|
||||||
// Brk
|
getresuid(&r, &e, &s)
|
||||||
// ClockNanosleep
|
return int(r), int(e), int(s)
|
||||||
// ClockSettime
|
}
|
||||||
// Clone
|
|
||||||
// EpollCtlOld
|
func Getresgid() (rgid, egid, sgid int) {
|
||||||
// EpollPwait
|
var r, e, s _C_int
|
||||||
// EpollWaitOld
|
getresgid(&r, &e, &s)
|
||||||
// Execve
|
return int(r), int(e), int(s)
|
||||||
// Fork
|
}
|
||||||
// Futex
|
|
||||||
// GetKernelSyms
|
// Pselect is a wrapper around the Linux pselect6 system call.
|
||||||
// GetMempolicy
|
// This version does not modify the timeout argument.
|
||||||
// GetRobustList
|
func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
|
||||||
// GetThreadArea
|
// Per https://man7.org/linux/man-pages/man2/select.2.html#NOTES,
|
||||||
// Getpmsg
|
// The Linux pselect6() system call modifies its timeout argument.
|
||||||
// IoCancel
|
// [Not modifying the argument] is the behavior required by POSIX.1-2001.
|
||||||
// IoDestroy
|
var mutableTimeout *Timespec
|
||||||
// IoGetevents
|
if timeout != nil {
|
||||||
// IoSetup
|
mutableTimeout = new(Timespec)
|
||||||
// IoSubmit
|
*mutableTimeout = *timeout
|
||||||
// IoprioGet
|
}
|
||||||
// IoprioSet
|
|
||||||
// KexecLoad
|
// The final argument of the pselect6() system call is not a
|
||||||
// LookupDcookie
|
// sigset_t * pointer, but is instead a structure
|
||||||
// Mbind
|
var kernelMask *sigset_argpack
|
||||||
// MigratePages
|
if sigmask != nil {
|
||||||
// Mincore
|
wordBits := 32 << (^uintptr(0) >> 63) // see math.intSize
|
||||||
// ModifyLdt
|
|
||||||
// Mount
|
// A sigset stores one bit per signal,
|
||||||
// MovePages
|
// offset by 1 (because signal 0 does not exist).
|
||||||
// MqGetsetattr
|
// So the number of words needed is ⌈__C_NSIG - 1 / wordBits⌉.
|
||||||
// MqNotify
|
sigsetWords := (_C__NSIG - 1 + wordBits - 1) / (wordBits)
|
||||||
// MqOpen
|
|
||||||
// MqTimedreceive
|
sigsetBytes := uintptr(sigsetWords * (wordBits / 8))
|
||||||
// MqTimedsend
|
kernelMask = &sigset_argpack{
|
||||||
// MqUnlink
|
ss: sigmask,
|
||||||
// Mremap
|
ssLen: sigsetBytes,
|
||||||
// Msgctl
|
}
|
||||||
// Msgget
|
}
|
||||||
// Msgrcv
|
|
||||||
// Msgsnd
|
return pselect6(nfd, r, w, e, mutableTimeout, kernelMask)
|
||||||
// Nfsservctl
|
}
|
||||||
// Personality
|
|
||||||
// Pselect6
|
//sys schedSetattr(pid int, attr *SchedAttr, flags uint) (err error)
|
||||||
// Ptrace
|
//sys schedGetattr(pid int, attr *SchedAttr, size uint, flags uint) (err error)
|
||||||
// Putpmsg
|
|
||||||
// Quotactl
|
// SchedSetAttr is a wrapper for sched_setattr(2) syscall.
|
||||||
// Readahead
|
// https://man7.org/linux/man-pages/man2/sched_setattr.2.html
|
||||||
// Readv
|
func SchedSetAttr(pid int, attr *SchedAttr, flags uint) error {
|
||||||
// RemapFilePages
|
if attr == nil {
|
||||||
// RestartSyscall
|
return EINVAL
|
||||||
// RtSigaction
|
}
|
||||||
// RtSigpending
|
attr.Size = SizeofSchedAttr
|
||||||
// RtSigqueueinfo
|
return schedSetattr(pid, attr, flags)
|
||||||
// RtSigreturn
|
}
|
||||||
// RtSigsuspend
|
|
||||||
// RtSigtimedwait
|
// SchedGetAttr is a wrapper for sched_getattr(2) syscall.
|
||||||
// SchedGetPriorityMax
|
// https://man7.org/linux/man-pages/man2/sched_getattr.2.html
|
||||||
// SchedGetPriorityMin
|
func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) {
|
||||||
// SchedGetparam
|
attr := &SchedAttr{}
|
||||||
// SchedGetscheduler
|
if err := schedGetattr(pid, attr, SizeofSchedAttr, flags); err != nil {
|
||||||
// SchedRrGetInterval
|
return nil, err
|
||||||
// SchedSetparam
|
}
|
||||||
// SchedYield
|
return attr, nil
|
||||||
// Security
|
}
|
||||||
// Semctl
|
|
||||||
// Semget
|
//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error)
|
||||||
// Semop
|
//sys Mseal(b []byte, flags uint) (err error)
|
||||||
// Semtimedop
|
|
||||||
// SetMempolicy
|
|
||||||
// SetRobustList
|
|
||||||
// SetThreadArea
|
|
||||||
// SetTidAddress
|
|
||||||
// Sigaltstack
|
|
||||||
// Swapoff
|
|
||||||
// Swapon
|
|
||||||
// Sysfs
|
|
||||||
// TimerCreate
|
|
||||||
// TimerDelete
|
|
||||||
// TimerGetoverrun
|
|
||||||
// TimerGettime
|
|
||||||
// TimerSettime
|
|
||||||
// Tkill (obsolete)
|
|
||||||
// Tuxcall
|
|
||||||
// Umount2
|
|
||||||
// Uselib
|
|
||||||
// Utimensat
|
|
||||||
// Vfork
|
|
||||||
// Vhangup
|
|
||||||
// Vserver
|
|
||||||
// _Sysctl
|
|
||||||
|
|
|
||||||
28
vendor/golang.org/x/sys/unix/syscall_linux_386.go
generated
vendored
28
vendor/golang.org/x/sys/unix/syscall_linux_386.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build 386 && linux
|
//go:build 386 && linux
|
||||||
// +build 386,linux
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
@ -97,33 +96,6 @@ func Getrlimit(resource int, rlim *Rlimit) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//sysnb setrlimit(resource int, rlim *rlimit32) (err error) = SYS_SETRLIMIT
|
|
||||||
|
|
||||||
func Setrlimit(resource int, rlim *Rlimit) (err error) {
|
|
||||||
err = Prlimit(0, resource, rlim, nil)
|
|
||||||
if err != ENOSYS {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
rl := rlimit32{}
|
|
||||||
if rlim.Cur == rlimInf64 {
|
|
||||||
rl.Cur = rlimInf32
|
|
||||||
} else if rlim.Cur < uint64(rlimInf32) {
|
|
||||||
rl.Cur = uint32(rlim.Cur)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
if rlim.Max == rlimInf64 {
|
|
||||||
rl.Max = rlimInf32
|
|
||||||
} else if rlim.Max < uint64(rlimInf32) {
|
|
||||||
rl.Max = uint32(rlim.Max)
|
|
||||||
} else {
|
|
||||||
return EINVAL
|
|
||||||
}
|
|
||||||
|
|
||||||
return setrlimit(resource, &rl)
|
|
||||||
}
|
|
||||||
|
|
||||||
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
|
||||||
newoffset, errno := seek(fd, offset, whence)
|
newoffset, errno := seek(fd, offset, whence)
|
||||||
if errno != 0 {
|
if errno != 0 {
|
||||||
|
|
|
||||||
2
vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
generated
vendored
2
vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
generated
vendored
|
|
@ -3,8 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64)
|
//go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64)
|
||||||
// +build linux
|
|
||||||
// +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
|
||||||
4
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
generated
vendored
4
vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
generated
vendored
|
|
@ -3,7 +3,6 @@
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build amd64 && linux
|
//go:build amd64 && linux
|
||||||
// +build amd64,linux
|
|
||||||
|
|
||||||
package unix
|
package unix
|
||||||
|
|
||||||
|
|
@ -40,13 +39,12 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
|
||||||
if timeout != nil {
|
if timeout != nil {
|
||||||
ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
|
||||||
}
|
}
|
||||||
return Pselect(nfd, r, w, e, ts, nil)
|
return pselect6(nfd, r, w, e, ts, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
|
||||||
//sys setfsgid(gid int) (prev int, err error)
|
//sys setfsgid(gid int) (prev int, err error)
|
||||||
//sys setfsuid(uid int) (prev int, err error)
|
//sys setfsuid(uid int) (prev int, err error)
|
||||||
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
|
|
||||||
//sys Shutdown(fd int, how int) (err error)
|
//sys Shutdown(fd int, how int) (err error)
|
||||||
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue