From 89f1d03b4f7bd5ceb984a863a990ab548fe393a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Tue, 28 Jan 2020 13:39:19 +0800 Subject: [PATCH 1/5] First attempt at fixing #125. * Implemented .redial() member that only attempts to .dial() when transport is still registered in discovery. * Both .WritePacket() and .Serve() calls .redial() instead of .dial() * In .DeleteTransport(), we deregister the transport from discovery before closing the physical connection. --- pkg/transport/managed_transport.go | 33 ++++++++++++++++++++++++++++-- pkg/transport/manager.go | 16 ++++++++------- 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index 062b677b9b..c00bdc005a 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + "net" "sync" "sync/atomic" "time" @@ -150,8 +151,12 @@ func (mt *ManagedTransport) Serve(readCh chan<- routing.Packet, done <-chan stru // If there has not been any activity, ensure underlying 'write' tp is still up. mt.connMx.Lock() if mt.conn == nil { - if err := mt.dial(ctx); err != nil { + if ok, err := mt.redial(ctx); err != nil { mt.log.Warnf("failed to redial underlying connection: %v", err) + if !ok { + mt.connMx.Unlock() + return + } } } mt.connMx.Unlock() @@ -243,6 +248,30 @@ func (mt *ManagedTransport) dial(ctx context.Context) error { return mt.setIfConnNil(ctx, tp) } +// redial only actually dials if transport is still registered in transport discovery. +// The 'retry' output specifies whether we can retry dial on failure. +func (mt *ManagedTransport) redial(ctx context.Context) (retry bool, err error) { + + if _, err = mt.dc.GetTransportByID(ctx, mt.Entry.ID); err != nil { + + // If the error is a temporary network error, we should retry at a later stage. + if netErr, ok := err.(net.Error); ok && netErr.Temporary() { + return true, err + } + + // If the error is not temporary, it most likely means that the transport is no longer registered. + // Hence, we should close the managed transport. + mt.close() + mt.log. + WithError(err). + Warn("Transport closed due to redial failure. Transport is likely no longer in discovery.") + + return false, fmt.Errorf("transport is no longer registered in discovery: %v", err) + } + + return true, mt.dial(ctx) +} + func (mt *ManagedTransport) getConn() *snet.Conn { mt.connMx.Lock() conn := mt.conn @@ -301,7 +330,7 @@ func (mt *ManagedTransport) WritePacket(ctx context.Context, packet routing.Pack } if mt.conn == nil { - if err := mt.dial(ctx); err != nil { + if _, err := mt.redial(ctx); err != nil { return fmt.Errorf("failed to redial underlying connection: %v", err) } } diff --git a/pkg/transport/manager.go b/pkg/transport/manager.go index e463803efc..50a5b57ca6 100644 --- a/pkg/transport/manager.go +++ b/pkg/transport/manager.go @@ -233,18 +233,20 @@ func (tm *Manager) DeleteTransport(id uuid.UUID) { return } + // Deregister transport before closing the underlying connection. if tp, ok := tm.tps[id]; ok { - tp.Close() - tm.Logger.Infof("Deregister transport %s from manager", id) - ctx, cancel := context.WithTimeout(context.Background(), time.Minute) defer cancel() - err := tm.Conf.DiscoveryClient.DeleteTransport(ctx, id) - if err != nil { - tm.Logger.Errorf("Deregister transport %s from discovery failed with error: %s", id, err) + + // Deregister transport. + if err := tm.Conf.DiscoveryClient.DeleteTransport(ctx, id); err != nil { + tm.Logger.WithError(err).Warn("Failed to deregister transport %s from discovery.", id) + } else { + tm.Logger.Infof("Deregistered transport of ID %s from discovery.", id) } - tm.Logger.Infof("Deregister transport %s from discovery", id) + // Close underlying connection. + tp.close() delete(tm.tps, id) } } From eb7578850946014f03f49b37d27b1af498665c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Tue, 28 Jan 2020 20:24:58 +0800 Subject: [PATCH 2/5] Fix transport tests. --- Makefile | 2 +- ci_scripts/install-golangci-lint.sh | 2 +- go.mod | 4 +- go.sum | 6 + pkg/snet/snettest/env.go | 2 + pkg/transport/handshake_test.go | 7 +- pkg/transport/manager.go | 2 +- .../github.com/SkycoinProject/dmsg/.gitignore | 1 + .../github.com/SkycoinProject/dmsg/Makefile | 9 +- .../github.com/SkycoinProject/dmsg/README.md | 270 +----------------- .../github.com/SkycoinProject/dmsg/client.go | 79 +++-- .../SkycoinProject/dmsg/client_session.go | 8 +- .../SkycoinProject/dmsg/disc/entry.go | 2 + .../github.com/SkycoinProject/dmsg/dump.rdb | Bin 7718 -> 0 bytes .../SkycoinProject/dmsg/entity_common.go | 18 +- vendor/github.com/SkycoinProject/dmsg/go.mod | 2 +- vendor/github.com/SkycoinProject/dmsg/go.sum | 4 + .../SkycoinProject/dmsg/noise/read_writer.go | 29 +- .../github.com/SkycoinProject/dmsg/server.go | 10 + .../SkycoinProject/dmsg/server_session.go | 2 +- vendor/modules.txt | 2 +- 21 files changed, 140 insertions(+), 321 deletions(-) delete mode 100644 vendor/github.com/SkycoinProject/dmsg/dump.rdb diff --git a/Makefile b/Makefile index 1c1da25239..6dac85287a 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ test-no-ci: ## Run no_ci tests ${OPTS} go test ${TEST_OPTS_NOCI} ./pkg/transport/... -run "TCP|PubKeyTable" install-linters: ## Install linters - - VERSION=1.21.0 ./ci_scripts/install-golangci-lint.sh + - VERSION=1.23.1 ./ci_scripts/install-golangci-lint.sh # GO111MODULE=off go get -u github.com/FiloSottile/vendorcheck # For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install # However, they suggest `curl ... | bash` which we should not do diff --git a/ci_scripts/install-golangci-lint.sh b/ci_scripts/install-golangci-lint.sh index 1da1b97348..1deb3bd929 100755 --- a/ci_scripts/install-golangci-lint.sh +++ b/ci_scripts/install-golangci-lint.sh @@ -8,6 +8,6 @@ if [[ -z "$VERSION" ]]; then fi # In alpine linux (as it does not come with curl by default) -wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "$GOPATH/bin" "v$VERSION" +wget -O - -q https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b "${GOBIN}" "v${VERSION}" golangci-lint --version diff --git a/go.mod b/go.mod index a5ea22ad88..6bdd187aec 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/SkycoinProject/skywire-mainnet go 1.13 require ( - github.com/SkycoinProject/dmsg v0.0.0-20200116114634-91be578a1895 + github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b github.com/SkycoinProject/skycoin v0.26.0 github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 @@ -24,7 +24,7 @@ require ( golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a - golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0 // indirect + golang.org/x/tools v0.0.0-20200128002243-345141a36859 // indirect ) //replace github.com/SkycoinProject/dmsg => ../dmsg diff --git a/go.sum b/go.sum index ac102ced8e..f3da4abe5f 100644 --- a/go.sum +++ b/go.sum @@ -5,6 +5,10 @@ github.com/SkycoinProject/dmsg v0.0.0-20191107094546-85c27858fca6 h1:qL8+QqCaEzN github.com/SkycoinProject/dmsg v0.0.0-20191107094546-85c27858fca6/go.mod h1:Omi1J0gOWWriHkHn/9aGw8JXHtsEfnYwithZY6fIEQY= github.com/SkycoinProject/dmsg v0.0.0-20200116114634-91be578a1895 h1:lnTxeHdSdju5bdFknXD5CsxYe+MVAuBwFeHcG6DgYGA= github.com/SkycoinProject/dmsg v0.0.0-20200116114634-91be578a1895/go.mod h1:ND2IgJU0IdbkF1FS0We0EoI/2Gqx6MWJe12zC/KsTzI= +github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922 h1:u2puzXjAqvGoTAat3jJiIqsVGBqMHB8ZOVNMKJ5UXa4= +github.com/SkycoinProject/dmsg v0.0.0-20200127093622-ba9543931922/go.mod h1:/nTdcMBrMHE39N6fxm300DtMly3UvZXPfwxBa9U8oGs= +github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b h1:t0tIsfWPDDd/vsw/mOW4hA0xwQ3rFxdOQA+sjc9YSoo= +github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b/go.mod h1:/nTdcMBrMHE39N6fxm300DtMly3UvZXPfwxBa9U8oGs= github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a h1:6nHCJqh7trsuRcpMC5JmtDukUndn2VC9sY64K6xQ7hQ= @@ -208,6 +212,8 @@ golang.org/x/tools v0.0.0-20200123220707-24841a4f5f7d h1:KTOebTDPx6KUWl0wm5bjotr golang.org/x/tools v0.0.0-20200123220707-24841a4f5f7d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0 h1:G9K47VwP2wDdADV683EnkOYQHhb20LSa80C4AE+Gskw= golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200128002243-345141a36859 h1:xIszjAtlVeHg9hhv6Zhntvwqowji1k2rrgoOhj/aaKw= +golang.org/x/tools v0.0.0-20200128002243-345141a36859/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= diff --git a/pkg/snet/snettest/env.go b/pkg/snet/snettest/env.go index 2f23564199..c70b3764ad 100644 --- a/pkg/snet/snettest/env.go +++ b/pkg/snet/snettest/env.go @@ -83,6 +83,7 @@ func NewEnv(t *testing.T, keys []KeyPair, networks []string) *Env { if hasDmsg { dmsgClient = dmsg.NewClient(pairs.PK, pairs.SK, dmsgD, nil) + go dmsgClient.Serve() } if hasStcp { @@ -139,5 +140,6 @@ func createDmsgSrv(t *testing.T, dc disc.APIClient) (srv *dmsg.Server, srvErr <- errCh <- srv.Serve(l, "") close(errCh) }() + <-srv.Ready() return srv, errCh } diff --git a/pkg/transport/handshake_test.go b/pkg/transport/handshake_test.go index fc9cf7870b..82d65ecc77 100644 --- a/pkg/transport/handshake_test.go +++ b/pkg/transport/handshake_test.go @@ -34,13 +34,12 @@ func TestSettlementHS(t *testing.T) { } errCh1 <- transport.MakeSettlementHS(false).Do(context.TODO(), tpDisc, conn1, keys[1].SK) }() - defer func() { - require.NoError(t, <-errCh1) - }() conn0, err := nEnv.Nets[0].Dial(context.TODO(), dmsg.Type, keys[1].PK, skyenv.DmsgTransportPort) require.NoError(t, err) - require.NoError(t, transport.MakeSettlementHS(true).Do(context.TODO(), tpDisc, conn0, keys[0].SK), "fucked up") + require.NoError(t, transport.MakeSettlementHS(true).Do(context.TODO(), tpDisc, conn0, keys[0].SK)) + + require.NoError(t, <-errCh1) }) } diff --git a/pkg/transport/manager.go b/pkg/transport/manager.go index 50a5b57ca6..cb8d037a4b 100644 --- a/pkg/transport/manager.go +++ b/pkg/transport/manager.go @@ -240,7 +240,7 @@ func (tm *Manager) DeleteTransport(id uuid.UUID) { // Deregister transport. if err := tm.Conf.DiscoveryClient.DeleteTransport(ctx, id); err != nil { - tm.Logger.WithError(err).Warn("Failed to deregister transport %s from discovery.", id) + tm.Logger.WithError(err).Warnf("Failed to deregister transport of ID %s from discovery.", id) } else { tm.Logger.Infof("Deregistered transport of ID %s from discovery.", id) } diff --git a/vendor/github.com/SkycoinProject/dmsg/.gitignore b/vendor/github.com/SkycoinProject/dmsg/.gitignore index 5b58d7260d..f317893fe6 100644 --- a/vendor/github.com/SkycoinProject/dmsg/.gitignore +++ b/vendor/github.com/SkycoinProject/dmsg/.gitignore @@ -5,6 +5,7 @@ *.dylib *.test *.out +*.rdb .DS_Store .idea/ diff --git a/vendor/github.com/SkycoinProject/dmsg/Makefile b/vendor/github.com/SkycoinProject/dmsg/Makefile index 5cd1af08c9..012e190830 100644 --- a/vendor/github.com/SkycoinProject/dmsg/Makefile +++ b/vendor/github.com/SkycoinProject/dmsg/Makefile @@ -1,9 +1,10 @@ .DEFAULT_GOAL := help -.PHONY : check lint install-linters dep test +.PHONY : check lint install-linters dep test bin build OPTS?=GO111MODULE=on GOBIN=${PWD}/bin TEST_OPTS?=-race -tags no_ci -cover -timeout=5m BIN_DIR?=./bin +BUILD_OPTS?= check: lint test ## Run linters and tests @@ -20,7 +21,7 @@ test: ## Run tests ${OPTS} go test ${TEST_OPTS} ./... install-linters: ## Install linters - - VERSION=1.22.2 ./ci_scripts/install-golangci-lint.sh + - VERSION=1.23.1 ./ci_scripts/install-golangci-lint.sh # GO111MODULE=off go get -u github.com/FiloSottile/vendorcheck # For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install # However, they suggest `curl ... | bash` which we should not do @@ -37,5 +38,9 @@ dep: ## Sorts dependencies build: ## Build binaries into ./bin ${OPTS} go install ./cmd/* +bin: ## Build `dmsg-discovery`, `dmsg-server` + ${OPTS} go build ${BUILD_OPTS} -o ./dmsg-discovery ./cmd/dmsg-discovery + ${OPTS} go build ${BUILD_OPTS} -o ./dmsg-server ./cmd/dmsg-server + help: @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/vendor/github.com/SkycoinProject/dmsg/README.md b/vendor/github.com/SkycoinProject/dmsg/README.md index 6123a1292c..22fc0f8c15 100644 --- a/vendor/github.com/SkycoinProject/dmsg/README.md +++ b/vendor/github.com/SkycoinProject/dmsg/README.md @@ -2,34 +2,10 @@ # dmsg -Distributed messaging system. - ->**TODO:** -> ->- `ACK` frames should include the first 4 bytes of the rolling hash of incoming payloads, enforcing reliability of data. Streams should therefore keep track of incoming/outgoing rolling hashes. ->- Streams should also be noise-encrypted. `REQUEST` and `ACCEPT` frames should include noise handshake messages (`KK` handshake pattern), and the `FWD` and `ACK` payloads are to be encrypted. -> - Streams should implement read/write deadlines and local/remote addresses (like `net.Conn`). -> - `dmsg.Server` should check incoming frames to disallow excessive sending of `CLOSE`, `ACCEPT` and `REQUEST` frames. - -## Terminology - -- **entity -** A service of `dmsg` (typically being part of an executable running on a machine). -- **entity type -** The type of entity. `dmsg` has three entity types; `dmsg.Server`, `dmsg.Client`, `dmsg.Discovery`. -- **entry -** A data structure that describes an entity and is stored in `dmsg.Discovery` for entities to access. -- **frame -** The data unit of the `dmsg` system. -- **frame type -** The type of `dmsg` frame. There are four frame types; `REQUEST`, `ACCEPT`, `CLOSE`, `FWD`, `ACK`. -- **connection -** The direct line of duplex communication between a `dmsg.Server` and `dmsg.Client`. -- **stream -** A line of communication between two `dmsg.Client`s that is proxied via a `dmsg.Server`. -- **stream ID -** A uint16 value that identifies a stream. - -## Entities - -The `dmsg` system is made up of three entity types: -- `dmsg.Discovery` is a RESTful API that allows `dmsg.Client`s to find remote `dmg.Client`s and `dmsg.Server`s. -- `dmsg.Server` proxies frames between clients. -- `dmsg.Client` establishes streams between itself and remote `dmsg.Client`s. - -Entities of types `dmsg.Server` or `dmsg.Client` are represented by a `secp256k1` public key. +`dmsg` is a distributed messaging system comprised of three types of services: +- `dmsg.Client` represents a user/client that wishes to use the dmsg network to establish `dmsg.Session`s and `dmsg.Stream`s. +- `dmsg.Server` represents a service that proxies `dmsg.Stream`s between `dmsg.Client`s. +- `dmsg.Discovery` acts like a *DNS* of `dmsg.Server`s and `dmsg.Client`s, identifying them via their public keys. ``` [D] @@ -45,237 +21,11 @@ Legend: - `S(X)` - `dmsg.Server` - `C(X)` - `dmsg.Client` -## Connection Handshake - -A Connection refers to the line of communication between a `dmsg.Client` and `dmsg.Server`. - -To set up a `dmsg` Connection, `dmsg.Client` dials a TCP connection to the `dmsg.Server` and then they perform a handshake via the [noise protocol](http://noiseprotocol.org/) using the `XK` handshake pattern (with the `dmsg.Client` as the initiator). - -Note that `dmsg.Client` always initiates the `dmsg` connection, and it is a given that a `dmsg.Client` always knows the public key that identifies the `dmsg.Server` that it wishes to connect with. - -## Frames - -Frames are sent and received within a `dmsg` connection after the noise handshake. A frame has two sections; the header and the payload. Here are the fields of a frame: - -``` -|| FrameType | StreamID | PayloadSize || Payload || -|| 1 byte | 2 bytes | 2 bytes || ~ bytes || -``` - -- The `FrameType` specifies the frame type via the one byte. -- The `StreamID` contains an encoded `uint16` which represents a identifier for a stream. A set of IDs are unique for a given `dmsg` connection. -- The `PayloadSize` contains an encoded `uint16` which represents the size (in bytes) of the payload. -- The `Payload` have a size that is obtainable via `PayloadSize`. - -The following is a summary of the frame types: - -| FrameType | Name | Payload Contents | Payload Size | -| --- | --- | --- | --- | -| `0x1` | `REQUEST` | initiating client's public key + responding client's public key | 66 | -| `0x2` | `ACCEPT` | initiating client's public key + responding client's public key | 66 | -| `0x3` | `CLOSE` | 1 byte that represents the reason for closing | 1 | -| `0xa` | `FWD` | uint16 sequence + stream payload | >2 | -| `0xb` | `ACK` | uint16 sequence | 2 | - -## Streams - -Streams are represented by stream IDs and facilitate duplex communication between two `dmsg.Client`s which are connected to a common `dmsg.Server`. - -Stream IDs are assigned in such a manner: -- A `dmsg.Client` manages the assignment of even stream IDs between itself and each connected `dmsg.Server`. The set of stream IDs will be unique between itself and each `dmsg.Server`. -- A `dmsg.Server` manages the assignment of odd stream IDs between itself and each connected `dmsg.Client`. The set of stream IDs will be unique between itself and each `dmsg.Client`. - -For a given stream: -- Between the initiating client and the common server - the stream ID is always a even value. -- Between the responding client and the common server - the stream ID is always a odd value. - -Hence, a stream in it's entirety, is represented by 2 stream IDs. - -### Stream Establishment - -1. The initiating client chooses an even stream ID and forms a `REQUEST` frame with the chosen stream ID, initiating client's public key (itself) and also the responding client's public key. The `REQUEST` frame is then sent to the common server. The stream ID chosen must be unused between the initiating client and the server. -2. The common server receives the `REQUEST` frame and checks the contents. If valid, and the responding client exists, the server chooses an odd stream ID, swaps this original stream ID of the `REQUEST` frame with the chosen odd stream ID, and continues to forward it to the responding client. In doing this, the server records a rule relating the initiating/responding clients and the associated odd/even stream IDs. -3. The responding client receives the `REQUEST` frame and checks the contents. If valid, the responding client sends an `ACCEPT` frame (containing the same payload as the `REQUEST`) back to the common server. The common server changes the stream ID, and forwards the `ACCEPT` to the initiating client. - -On any step, if an error occurs, any entity can send a `CLOSE` frame. - -### Acknowledgement Logic - -Each `FWD` frame is to be met with an `ACK` frame in order to be considered delivered. - -- Each `FWD` payload has a 2-byte prefix (represented by a uint16 sequence). This sequence is unique per stream. -- The destination of the stream, after receiving the `FWD` frame, responds with an `ACK` frame with the same sequence as the payload. - -## `dmsg.Discovery` - -### Entry - -An entry within the `dmsg.Discovery` can either represent a `dmsg.Server` or a `dmsg.Client`. The `dmsg.Discovery` is a key-value store, in which entries (of either server or client) use their public keys as their "key". - -The following is the representation of an Entry in Golang. - -```golang -// Entry represents an entity's entry in the Discovery database. -type Entry struct { - // The data structure's version. - Version string `json:"version"` - - // A Entry of a given public key may need to iterate. This is the iteration sequence. - Sequence uint64 `json:"sequence"` - - // Timestamp of the current iteration. - Timestamp int64 `json:"timestamp"` - - // Public key that represents the entity. - Static cipher.PubKey `json:"static"` - - // Contains the entity's required client meta if it's to be advertised as a Client. - Client *Client `json:"client,omitempty"` - - // Contains the entity's required server meta if it's to be advertised as a Server. - Server *Server `json:"server,omitempty"` - - // Signature for proving authenticity of of the Entry. - Signature cipher.Sig `json:"signature,omitempty"` -} - -// Client contains the entity's required client meta, if it is to be advertised as a Client. -type Client struct { - // DelegatedServers contains a list of delegated servers represented by their public keys. - DelegatedServers []cipher.PubKey `json:"delegated_servers"` -} - -// Server contains the entity's required server meta, if it is to be advertised as a dmsg Server. -type Server struct { - // IPv4 or IPv6 public address of the dmsg Server. - Address string `json:"address"` - - // Number of connections still available. - AvailableConnections int `json:"available_connections"` -} -``` - -**Definition rules:** - -- A record **MUST** have either a "Server" field, a "Client" field, or both "Server" and "Client" fields. In other words, a dmsg node can be a dmsg Server, a dmsg Client, or both a dmsg Server and a dmsg Client. - -**Iteration rules:** - -- The first entry submitted of a given static public key, needs to have a "Sequence" value of `0`. Any future entries (of the same static public key) need to have a "Sequence" value of `{previous_sequence} + 1`. -- The "Timestamp" field of an entry, must be of a higher value than the "Timestamp" value of the previous entry. - -**Signature Rules:** - -The "Signature" field authenticates the entry. This is the process of generating a signature of the entry: - -1. Obtain a JSON representation of the Entry, in which: - 1. There is no whitespace (no ` ` or `\n` characters). - 2. The `"signature"` field is non-existent. -2. Hash this JSON representation, ensuring the above rules. -3. Create a Signature of the hash using the node's static secret key. - -The process of verifying an entry's signature will be similar. - -### Endpoints - -Only 3 endpoints need to be defined; Get Entry, Post Entry, and Get Available Servers. - -#### GET Entry - -Obtains a dmsg node's entry. - -> `GET {domain}/discovery/entries/{public_key}` - -**REQUEST** - -Header: - -``` -Accept: application/json -``` - -**RESPONSE** - -Possible Status Codes: - -- Success (200) - Successfully updated record. - - - Header: - - ``` - Content-Type: application/json - ``` - - - Body: - - > JSON-encoded entry. - -- Not Found (404) - Entry of public key is not found. - -- Unauthorized (401) - invalid signature. - -- Internal Server Error (500) - something unexpected happened. - -#### POST Entry - -Posts an entry and replaces the current entry if valid. - -> `POST {domain}/discovery/entries` - -**REQUEST** - -Header: - -``` -Content-Type: application/json -``` - -Body: - -> JSON-encoded, signed Entry. - -**RESPONSE** - -Possible Response Codes: - -- Success (200) - Successfully registered record. -- Unauthorized (401) - invalid signature. -- Internal Server Error (500) - something unexpected happened. - -#### GET Available Servers - -Obtains a subset of available server entries. - -> `GET {domain}/discovery/available_servers` - -**REQUEST** - -Header: - -``` -Accept: application/json -``` - -**RESPONSE** - -Possible Status Codes: - -- Success (200) - Got results. - - - Header: - - ``` - Content-Type: application/json - ``` - - - Body: - - > JSON-encoded `[]Entry`. - -- Not Found (404) - No results. - -- Forbidden (403) - When access is forbidden. - -- Internal Server Error (500) - Something unexpected happened. +`dmsg.Client`s and `dmsg.Server`s are identified via `secp256k1` public keys, and store records of themselves in the `dmsg.Discovery`. Records of `dmsg.Client`s also includes public keys of `dmsg.Server`s that are delegated to proxy data between it and other `dmsg.Client`s. +The connection between a `dmsg.Client` and `dmsg.Server` is called a `dmsg.Session`. A connection between two `dmsg.Client`s (via a `dmsg.Server`) is called a `dmsg.Stream`. A data unit of the dmsg network is called a `dmsg.Frame`. +## Additional resources +- [`dmsg` examples.](./examples) +- [`dmsg.Discovery` documentation.](./cmd/dmsg-discovery/README.md) +- [Starting a local `dmsg` environment.](./integration/README.md) diff --git a/vendor/github.com/SkycoinProject/dmsg/client.go b/vendor/github.com/SkycoinProject/dmsg/client.go index 178db86041..21f05f8267 100644 --- a/vendor/github.com/SkycoinProject/dmsg/client.go +++ b/vendor/github.com/SkycoinProject/dmsg/client.go @@ -8,6 +8,7 @@ import ( "time" "github.com/SkycoinProject/skycoin/src/util/logging" + "github.com/sirupsen/logrus" "github.com/SkycoinProject/dmsg/cipher" "github.com/SkycoinProject/dmsg/disc" @@ -19,6 +20,13 @@ type Config struct { MinSessions int } +func (c Config) PrintWarnings(log logrus.FieldLogger) { + log = log.WithField("location", "dmsg.Config") + if c.MinSessions < 1 { + log.Warn("Field 'MinSessions' has value < 1 : This will disallow establishment of dmsg streams.") + } +} + // DefaultConfig returns the default configuration for a dmsg client entity. func DefaultConfig() *Config { return &Config{ @@ -40,16 +48,9 @@ type Client struct { // NewClient creates a dmsg client entity. func NewClient(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, conf *Config) *Client { - if conf == nil { - conf = DefaultConfig() - } - c := new(Client) - c.conf = conf - c.porter = netutil.NewPorter(netutil.PorterMinEphemeral) - c.errCh = make(chan error, 10) - c.done = make(chan struct{}) + // Init common fields. c.EntityCommon.init(pk, sk, dc, logging.MustGetLogger("dmsg_client")) c.EntityCommon.setSessionCallback = func(ctx context.Context) error { return c.EntityCommon.updateClientEntry(ctx, c.done) @@ -58,6 +59,17 @@ func NewClient(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, conf *Conf return c.EntityCommon.updateClientEntry(ctx, c.done) } + // Init config. + if conf == nil { + conf = DefaultConfig() + } + c.conf = conf + c.conf.PrintWarnings(c.log) + + c.porter = netutil.NewPorter(netutil.PorterMinEphemeral) + c.errCh = make(chan error, 10) + c.done = make(chan struct{}) + return c } @@ -179,7 +191,7 @@ func (ce *Client) DialStream(ctx context.Context, addr Addr) (*Stream, error) { // Range client's delegated servers. // See if we are already connected to a delegated server. for _, srvPK := range entry.Client.DelegatedServers { - if dSes, ok := ce.ClientSession(ce.porter, srvPK); ok { + if dSes, ok := ce.clientSession(ce.porter, srvPK); ok { return dSes.DialStream(addr) } } @@ -187,7 +199,7 @@ func (ce *Client) DialStream(ctx context.Context, addr Addr) (*Stream, error) { // Range client's delegated servers. // Attempt to connect to a delegated server. for _, srvPK := range entry.Client.DelegatedServers { - dSes, err := ce.obtainSession(ctx, srvPK) + dSes, err := ce.EnsureAndObtainSession(ctx, srvPK) if err != nil { continue } @@ -197,27 +209,24 @@ func (ce *Client) DialStream(ctx context.Context, addr Addr) (*Stream, error) { return nil, ErrCannotConnectToDelegated } -// ensureSession ensures the existence of a session. -// It returns an error if the session does not exist AND cannot be established. -func (ce *Client) ensureSession(ctx context.Context, entry *disc.Entry) error { - ce.sesMx.Lock() - defer ce.sesMx.Unlock() - - // If session with server of pk already exists, skip. - if _, ok := ce.ClientSession(ce.porter, entry.Static); ok { - return nil - } +// Session obtains an established session. +func (ce *Client) Session(pk cipher.PubKey) (ClientSession, bool) { + return ce.clientSession(ce.porter, pk) +} - // Dial session. - _, err := ce.dialSession(ctx, entry) - return err +// AllSessions obtains all established sessions. +func (ce *Client) AllSessions() []ClientSession { + return ce.allClientSessions(ce.porter) } -func (ce *Client) obtainSession(ctx context.Context, srvPK cipher.PubKey) (ClientSession, error) { +// EnsureAndObtainSession attempts to obtain a session. +// If the session does not exist, we will attempt to establish one. +// It returns an error if the session does not exist AND cannot be established. +func (ce *Client) EnsureAndObtainSession(ctx context.Context, srvPK cipher.PubKey) (ClientSession, error) { ce.sesMx.Lock() defer ce.sesMx.Unlock() - if dSes, ok := ce.ClientSession(ce.porter, srvPK); ok { + if dSes, ok := ce.clientSession(ce.porter, srvPK); ok { return dSes, nil } @@ -229,9 +238,25 @@ func (ce *Client) obtainSession(ctx context.Context, srvPK cipher.PubKey) (Clien return ce.dialSession(ctx, srvEntry) } +// ensureSession ensures the existence of a session. +// It returns an error if the session does not exist AND cannot be established. +func (ce *Client) ensureSession(ctx context.Context, entry *disc.Entry) error { + ce.sesMx.Lock() + defer ce.sesMx.Unlock() + + // If session with server of pk already exists, skip. + if _, ok := ce.clientSession(ce.porter, entry.Static); ok { + return nil + } + + // Dial session. + _, err := ce.dialSession(ctx, entry) + return err +} + // It is expected that the session is created and served before the context cancels, otherwise an error will be returned. // NOTE: This should not be called directly as it may lead to session duplicates. -// Only `ensureSession` or `obtainSession` should call this function. +// Only `ensureSession` or `EnsureAndObtainSession` should call this function. func (ce *Client) dialSession(ctx context.Context, entry *disc.Entry) (ClientSession, error) { ce.log.WithField("remote_pk", entry.Static).Info("Dialing session...") @@ -250,7 +275,7 @@ func (ce *Client) dialSession(ctx context.Context, entry *disc.Entry) (ClientSes } go func() { ce.log.WithField("remote_pk", dSes.RemotePK()).Info("Serving session.") - if err := dSes.Serve(); !isClosed(ce.done) { + if err := dSes.serve(); !isClosed(ce.done) { ce.errCh <- err ce.delSession(ctx, dSes.RemotePK()) } diff --git a/vendor/github.com/SkycoinProject/dmsg/client_session.go b/vendor/github.com/SkycoinProject/dmsg/client_session.go index fd8cbcb6ec..1ba8872de3 100644 --- a/vendor/github.com/SkycoinProject/dmsg/client_session.go +++ b/vendor/github.com/SkycoinProject/dmsg/client_session.go @@ -34,7 +34,7 @@ func (cs *ClientSession) DialStream(dst Addr) (dStr *Stream, err error) { defer func() { if err != nil { cs.log.WithError(dStr.Close()). - Debug("On DialStream() failure, close stream resulted in error.") // TODO(evanlinjin): Race condition? + Debug("On DialStream() failure, close stream resulted in error.") } }() @@ -61,12 +61,12 @@ func (cs *ClientSession) DialStream(dst Addr) (dStr *Stream, err error) { return dStr, err } -// Serve accepts incoming streams from remote clients. -func (cs *ClientSession) Serve() error { +// serve accepts incoming streams from remote clients. +func (cs *ClientSession) serve() error { defer func() { if err := cs.Close(); err != nil { cs.log.WithError(err). - Debug("On (*ClientSession).Serve() return, close client session resulted in error.") + Debug("On (*ClientSession).serve() return, close client session resulted in error.") } }() for { diff --git a/vendor/github.com/SkycoinProject/dmsg/disc/entry.go b/vendor/github.com/SkycoinProject/dmsg/disc/entry.go index bdeafb5280..26759ce015 100644 --- a/vendor/github.com/SkycoinProject/dmsg/disc/entry.go +++ b/vendor/github.com/SkycoinProject/dmsg/disc/entry.go @@ -39,6 +39,8 @@ var ( ErrValidationWrongSequence = NewEntryValidationError("sequence field of new entry is not sequence of old entry + 1") // ErrValidationWrongTime occurs in case when previous entry timestamp is not set before current entry timestamp ErrValidationWrongTime = NewEntryValidationError("previous entry timestamp is not set before current entry timestamp") + // ErrValidationServerAddress occurs in case when client want to advertise wrong Server address + ErrValidationServerAddress = NewEntryValidationError("advertising localhost listening address is not allowed in production mode") errReverseMap = map[string]error{ ErrKeyNotFound.Error(): ErrKeyNotFound, diff --git a/vendor/github.com/SkycoinProject/dmsg/dump.rdb b/vendor/github.com/SkycoinProject/dmsg/dump.rdb deleted file mode 100644 index d565348a4b423458e4b925c5bea8fac16d3544e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7718 zcmc(kOOISf6~`^4@KRW?X4mT^I#qS*|g%v*^hqz;``5Te7*nJAAkAxU%va`#k=-ozyIk|x5wj= zfAQd-5B~Av2M<2{sl**5<FHs}wf59oYm#$M8gk;| zTf4oQ$G0zD4L>~}UHSFx>EY+6<&XRmyY=<)jXyosczXET6HnVio<;huVF?eqBmcGR zv-CE7n#>VP%v~%i&l)|A!G*K5)p~64^t=k$rOUM8kcDv$7DtL_C@hAS6ItJ5D6Y+r!G<= z=ULO*d968TYt#DbY-?UpWbRlv>?LQQHf@I(Ls;rPMCZ&i_0c$FHCUGLYL@(Z)6gvC zkXoEAGOrog>88%Ik}l5DDBCzY+9IbU@NJ8+fn%_l&zj{+TsG;UWN`Z*Twc7Idzq!O zg=v8qfSc4xm)L^0Wm_5}XcBCN$hHqQc2=~hcP#w$6hPf@5BreyW4Z9Ougp4 zA&snF*!B^`W*Z(%fW5i(!sr9+_!^fNGtNhUJcnaLR-Uu6^n7QQ7xN!?d&#E<$J$y? z{RU<|J$f?j(I1}N+&*mlECc`a$x~?f#Q)i6cJ;^*o{#5~>uX1)o?P>lAm1R;;T0Z{ zRHcOCoN%aZXz06z9CK)8Rx#b+E~m(7LJtcmVhnC2^-^}VIu~E>Uc%HcMp@|?Zak!I z#ht-T$#K@$RSt{~ZHZw)nR?v#^!z*D`${ani#lFBx#J$TXVY#Rtl(*@h6PgfklDm( ztH#pDkeO}vy0je74zf@Nf!=GV$2~$?9nxRBXETG2N*

jL~NtaD~HCjeiD$vq~JZ zrUf@F*&V{SL+R@d+_k12k+qh46;IIDM&MPFpn0i87;Qwg9;@ZqA+apcdyX}fV;ybv zsW4aFEZWeqaY##*9XcQS2o1H;o?35e1|3?jtd)ha607Z42kW;|B+VRCw1KNgaGUEW zJOdKNtf0%?)7%Mt4$(XtaO7FtfZ;2tt11Zc)Od(?*a!NgOr8=A1i-)&dEYrkV)%31W-gQkFaVLsoGx(ioxFZ7s!PikSdI@5wEP^no}lSoW6ZYhQVZ0J`S zOnvRT58@j=?kM7WCYUcGP#&>Rhlku8%-uLUc$?aH*x6GCUIX2%J~4}PjWP2^&<5V? zwQafdV1D$cbLg=Y*abn*UcXL{7sG^E{x5nAvEq$!#}7HDy`RO8joHi)4>Z}bfUN}2l8Dhg>AbeUBKfkSEL4zA+djxpSu_t_|2FOw6FeNP?0LGZ>_T2j}Wd@Zv zQcv&$sFn%=9KTXuPb_Uw-13luabCf5ok(NHI~Pz02kkj5LRER^A?PD`hv9UIckIuS z^U#NB3Kd@tQGI=47q8}C&^I7EJOofHj>+6wHMOR)2863MO>;6CY-$0=35QxgHv0HW zS-6uhv6Uki!q{NTF*mq2@zNXz0uD84s+~WWrJ>d)2z3aMY-4jwApDilyp+<gx@gGsR$hoSI+#>>^mS1hu_%U1HRA@SbSp2 zyTW$J?nuJ*13^m;Tv6}1x`3M&y*Y9>b8TsR1TDDB1smHYQmQtXcD{)Q6(CHcK4+2a zsGKy{Oax1{lq5(W@kDpgDjlz}LL01YDyMA`Ugr7e%c(0OcxPgluI66Q2kkQ{vO1v+ zqzT+Da!R5>XzzgWPHLl$ZhD_023(-xEE|_)&h>R_9E_hHoYMM`2NLrdbd=0^%eU0F+QW zkk1&sw9czvUPg9Jg*M}E%)4|o_cF^k*fBT`dBUIQP9y@PunRPq*?RmapVe9*oR_kA z)D?pL-OLOt%A{sA22PX?8qq!cVHF)j4{zN-7Og-brDI>HaykYFypyZOY>@RECZ$Q? zFlo+VP#GYOhS8BuH_!%`6Dkw;Nf^?_aai#XT0;`k*ru4~vv5h()1)XzvfuHf(EVkr z`4+Rh+$(*vN^6z4O|6A7oemVF&MBGE?Et^Qc2V&^B)`4gNjfX%m5LQ=Fa{MRuCn{W z$lyVR$morfH0$Ju1d2DXOarhzS!h``#^EIv?_ipw$oOC5^5T$ko+?JnQrAL6z2k5$ zUd`K8u@T6)>i^H|Y~bW<=Lj_|Ea}pb9L?eEYnuVeqxEd;yO6Y@Oh99jji{MWFe*s* zK>gLCP&xP7agu3c4!l^jK01+gQwSu_L_ER>-EExY=DFD@?)f$JE#OJ$G(bt{pNH4v zSMfW&*T9dU#2l?QIRZzg2R^NlnyJ+=NavNGuh0j3$8=|6pzpHP+za}8TDX#z%|ya! zVrFK?SPN!Sy2I+mF;v3`&y zVk_(zRko)!c5Y%)cIg#Rfw!y?iR=v-RNC%+c-P^G>rufWZB$x9{73yLa2k;^XG)qn zovLMEf<}2W%S-F8^O%&@f~?3Y>fQ45($&0`Nh$D3J&Q?+eVrcvuzHO+v8YU1I&2^# zsSRuzL3$<1J2-H1?41scF&w5s=%k70Ix+S*oS6t2netjD9C6}cOsk4c zQSj1BQmFDCZ%af6Gt4QB<49|iC4AWX;+>LFX=WW{cHqj3y##?#veJ+gD%QiD(p=NR g@ybDuREIf$i9J$w(yP)2ou2=T=wUzkP5bM=0XprFh5!Hn diff --git a/vendor/github.com/SkycoinProject/dmsg/entity_common.go b/vendor/github.com/SkycoinProject/dmsg/entity_common.go index a376ea2255..bc6b51c01f 100644 --- a/vendor/github.com/SkycoinProject/dmsg/entity_common.go +++ b/vendor/github.com/SkycoinProject/dmsg/entity_common.go @@ -49,18 +49,28 @@ func (c *EntityCommon) session(pk cipher.PubKey) (*SessionCommon, bool) { return dSes, ok } -// ServerSession obtains a session as a server. -func (c *EntityCommon) ServerSession(pk cipher.PubKey) (ServerSession, bool) { +// serverSession obtains a session as a server. +func (c *EntityCommon) serverSession(pk cipher.PubKey) (ServerSession, bool) { ses, ok := c.session(pk) return ServerSession{SessionCommon: ses}, ok } -// ClientSession obtains a session as a client. -func (c *EntityCommon) ClientSession(porter *netutil.Porter, pk cipher.PubKey) (ClientSession, bool) { +// clientSession obtains a session as a client. +func (c *EntityCommon) clientSession(porter *netutil.Porter, pk cipher.PubKey) (ClientSession, bool) { ses, ok := c.session(pk) return ClientSession{SessionCommon: ses, porter: porter}, ok } +func (c *EntityCommon) allClientSessions(porter *netutil.Porter) []ClientSession { + c.sessionsMx.Lock() + sessions := make([]ClientSession, 0, len(c.sessions)) + for _, ses := range c.sessions { + sessions = append(sessions, ClientSession{SessionCommon: ses, porter: porter}) + } + c.sessionsMx.Unlock() + return sessions +} + // SessionCount returns the number of sessions. func (c *EntityCommon) SessionCount() int { c.sessionsMx.Lock() diff --git a/vendor/github.com/SkycoinProject/dmsg/go.mod b/vendor/github.com/SkycoinProject/dmsg/go.mod index 725b2f0421..109ea3b4cc 100644 --- a/vendor/github.com/SkycoinProject/dmsg/go.mod +++ b/vendor/github.com/SkycoinProject/dmsg/go.mod @@ -17,6 +17,6 @@ require ( github.com/spf13/cobra v0.0.5 github.com/stretchr/testify v1.3.0 golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a - golang.org/x/tools v0.0.0-20200116062425-473961ec044c // indirect + golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0 // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) diff --git a/vendor/github.com/SkycoinProject/dmsg/go.sum b/vendor/github.com/SkycoinProject/dmsg/go.sum index e50beb05cb..f36c7c50c8 100644 --- a/vendor/github.com/SkycoinProject/dmsg/go.sum +++ b/vendor/github.com/SkycoinProject/dmsg/go.sum @@ -161,6 +161,10 @@ golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868 h1:6VZw2h4iwEB4GwgQU3Jvcsm golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200116062425-473961ec044c h1:D0OxfnjPaEGt7AluXNompYUYGhoY3u6+bValgqfd1vE= golang.org/x/tools v0.0.0-20200116062425-473961ec044c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122042241-dc16b66866f1 h1:468gVSKEm8NObiNTQ3it08aAGsPfuvz+WXUHmnq8Wws= +golang.org/x/tools v0.0.0-20200122042241-dc16b66866f1/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0 h1:G9K47VwP2wDdADV683EnkOYQHhb20LSa80C4AE+Gskw= +golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= diff --git a/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go b/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go index 8313cbee2a..93d57bb405 100644 --- a/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go +++ b/vendor/github.com/SkycoinProject/dmsg/noise/read_writer.go @@ -87,6 +87,7 @@ func (rw *ReadWriter) Write(p []byte) (n int, err error) { rw.wMx.Lock() defer rw.wMx.Unlock() + // Check for timeout errors. if _, err = rw.origin.Write(nil); err != nil { return 0, err } @@ -97,22 +98,26 @@ func (rw *ReadWriter) Write(p []byte) (n int, err error) { } } - // Enforce max frame size. - if len(p) > maxPayloadSize { - p, err = p[:maxPayloadSize], io.ErrShortWrite - } - - writtenB, wErr := WriteRawFrame(rw.origin, rw.ns.EncryptUnsafe(p)) + for len(p) > 0 { + // Enforce max frame size. + wn := len(p) + if len(p) > maxPayloadSize { + wn = maxPayloadSize + } - if !IsCompleteFrame(writtenB) { - rw.wPad.Reset(FillIncompleteFrame(writtenB)) - } + writtenB, err := WriteRawFrame(rw.origin, rw.ns.EncryptUnsafe(p[:wn])) + if !IsCompleteFrame(writtenB) { + rw.wPad.Reset(FillIncompleteFrame(writtenB)) + } + if err != nil { + return n, err + } - if wErr != nil { - return 0, wErr + n += wn + p = p[wn:] } - return len(p), err + return n, err } // Handshake performs a Noise handshake using the provided io.ReadWriter. diff --git a/vendor/github.com/SkycoinProject/dmsg/server.go b/vendor/github.com/SkycoinProject/dmsg/server.go index 9f04803684..4f6355d141 100644 --- a/vendor/github.com/SkycoinProject/dmsg/server.go +++ b/vendor/github.com/SkycoinProject/dmsg/server.go @@ -17,6 +17,9 @@ import ( type Server struct { EntityCommon + ready chan struct{} // Closed once dmsg.Server is serving. + readyOnce sync.Once + done chan struct{} once sync.Once wg sync.WaitGroup @@ -26,6 +29,7 @@ type Server struct { func NewServer(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient) *Server { s := new(Server) s.EntityCommon.init(pk, sk, dc, logging.MustGetLogger("dmsg_server")) + s.ready = make(chan struct{}) s.done = make(chan struct{}) return s } @@ -70,6 +74,7 @@ func (s *Server) Serve(lis net.Listener, addr string) error { } log.Info("Accepting sessions...") + s.readyOnce.Do(func() { close(s.ready) }) for { conn, err := lis.Accept() if err != nil { @@ -88,6 +93,11 @@ func (s *Server) Serve(lis net.Listener, addr string) error { } } +// Ready returns a chan which blocks until the server begins serving. +func (s *Server) Ready() <-chan struct{} { + return s.ready +} + func (s *Server) updateEntryLoop(addr string) error { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/vendor/github.com/SkycoinProject/dmsg/server_session.go b/vendor/github.com/SkycoinProject/dmsg/server_session.go index 3d7ad390fd..d201db039b 100644 --- a/vendor/github.com/SkycoinProject/dmsg/server_session.go +++ b/vendor/github.com/SkycoinProject/dmsg/server_session.go @@ -87,7 +87,7 @@ func (ss *ServerSession) serveStream(yStr *yamux.Stream) error { } // Obtain next session. - ss2, ok := ss.entity.ServerSession(req.DstAddr.PK) + ss2, ok := ss.entity.serverSession(req.DstAddr.PK) if !ok { return ErrReqNoSession } diff --git a/vendor/modules.txt b/vendor/modules.txt index 61bdbfb097..76eaf8c6a5 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/SkycoinProject/dmsg v0.0.0-20200116114634-91be578a1895 => ../dmsg +# github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b github.com/SkycoinProject/dmsg github.com/SkycoinProject/dmsg/cipher github.com/SkycoinProject/dmsg/disc From f02c2dbaca540b91f99fdeed0fa1bac991f87279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Wed, 29 Jan 2020 11:29:44 +0800 Subject: [PATCH 3/5] Update ManagedTransport to handle deregister better. --- pkg/transport/managed_transport.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/transport/managed_transport.go b/pkg/transport/managed_transport.go index c00bdc005a..736f0397a7 100644 --- a/pkg/transport/managed_transport.go +++ b/pkg/transport/managed_transport.go @@ -251,6 +251,9 @@ func (mt *ManagedTransport) dial(ctx context.Context) error { // redial only actually dials if transport is still registered in transport discovery. // The 'retry' output specifies whether we can retry dial on failure. func (mt *ManagedTransport) redial(ctx context.Context) (retry bool, err error) { + if !mt.isServing() { + return false, ErrNotServing + } if _, err = mt.dc.GetTransportByID(ctx, mt.Entry.ID); err != nil { @@ -273,6 +276,10 @@ func (mt *ManagedTransport) redial(ctx context.Context) (retry bool, err error) } func (mt *ManagedTransport) getConn() *snet.Conn { + if !mt.isServing() { + return nil + } + mt.connMx.Lock() conn := mt.conn mt.connMx.Unlock() @@ -308,6 +315,10 @@ func (mt *ManagedTransport) setIfConnNil(ctx context.Context, conn *snet.Conn) e } func (mt *ManagedTransport) clearConn(ctx context.Context) { + if !mt.isServing() { + return + } + if mt.conn != nil { if err := mt.conn.Close(); err != nil { log.WithError(err).Warn("Failed to close connection") @@ -316,6 +327,7 @@ func (mt *ManagedTransport) clearConn(ctx context.Context) { } if _, err := mt.dc.UpdateStatuses(ctx, &Status{ID: mt.Entry.ID, IsUp: false}); err != nil { mt.log.Warnf("Failed to update transport status: %s", err) + return } mt.log.Infoln("Status updated: DOWN") } @@ -325,10 +337,6 @@ func (mt *ManagedTransport) WritePacket(ctx context.Context, packet routing.Pack mt.connMx.Lock() defer mt.connMx.Unlock() - if !mt.isServing() { - return ErrNotServing - } - if mt.conn == nil { if _, err := mt.redial(ctx); err != nil { return fmt.Errorf("failed to redial underlying connection: %v", err) From fbb137cbca8ff912974d5732312c598143695328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Wed, 29 Jan 2020 11:37:52 +0800 Subject: [PATCH 4/5] Updated vendor. --- go.mod | 7 +- go.sum | 65 ++----------------- .../github.com/SkycoinProject/dmsg/client.go | 26 ++++++-- .../SkycoinProject/dmsg/client_session.go | 2 +- .../github.com/SkycoinProject/dmsg/errors.go | 10 +-- .../go-windows-terminal-sequences/README.md | 1 - .../sequences_dummy.go | 11 ---- vendor/github.com/mattn/go-isatty/.travis.yml | 15 ++--- vendor/github.com/mattn/go-isatty/README.md | 2 +- vendor/github.com/mattn/go-isatty/go.mod | 4 +- vendor/github.com/mattn/go-isatty/go.sum | 4 +- vendor/github.com/mattn/go-isatty/go.test.sh | 12 ---- .../mattn/go-isatty/isatty_android.go | 23 +++++++ .../github.com/mattn/go-isatty/isatty_bsd.go | 12 +++- .../mattn/go-isatty/isatty_plan9.go | 22 ------- .../mattn/go-isatty/isatty_tcgets.go | 1 + .../mattn/go-isatty/isatty_windows.go | 39 ++--------- .../github.com/mattn/go-isatty/renovate.json | 8 --- vendor/golang.org/x/sys/cpu/cpu_arm64.go | 10 +-- .../golang.org/x/sys/unix/asm_linux_riscv64.s | 7 ++ vendor/golang.org/x/sys/unix/fcntl.go | 12 ++-- vendor/golang.org/x/sys/unix/syscall_bsd.go | 19 +----- .../golang.org/x/sys/unix/syscall_darwin.go | 19 +++++- .../x/sys/unix/syscall_darwin_arm.1_11.go | 2 +- .../golang.org/x/sys/unix/syscall_freebsd.go | 6 ++ .../x/sys/unix/syscall_freebsd_386.go | 6 -- .../x/sys/unix/syscall_freebsd_amd64.go | 6 -- .../x/sys/unix/syscall_freebsd_arm.go | 6 -- .../x/sys/unix/syscall_freebsd_arm64.go | 6 -- vendor/golang.org/x/sys/unix/syscall_linux.go | 25 +------ .../x/sys/unix/syscall_linux_386.go | 4 +- .../x/sys/unix/syscall_linux_amd64.go | 4 +- .../x/sys/unix/syscall_linux_arm.go | 4 +- .../x/sys/unix/syscall_linux_arm64.go | 4 +- .../x/sys/unix/syscall_linux_mips64x.go | 4 +- .../x/sys/unix/syscall_linux_mipsx.go | 4 +- .../x/sys/unix/syscall_linux_ppc64x.go | 4 +- .../x/sys/unix/syscall_linux_riscv64.go | 4 +- .../x/sys/unix/syscall_linux_s390x.go | 4 +- .../x/sys/unix/syscall_linux_sparc64.go | 4 +- .../golang.org/x/sys/unix/syscall_netbsd.go | 22 ++++++- .../golang.org/x/sys/unix/syscall_openbsd.go | 29 ++++++--- .../x/sys/unix/zsyscall_darwin_386.1_11.go | 22 +++---- .../x/sys/unix/zsyscall_darwin_386.go | 32 ++++----- .../x/sys/unix/zsyscall_darwin_386.s | 6 +- .../x/sys/unix/zsyscall_darwin_amd64.1_11.go | 22 +++---- .../x/sys/unix/zsyscall_darwin_amd64.go | 32 ++++----- .../x/sys/unix/zsyscall_darwin_amd64.s | 4 +- .../x/sys/unix/zsyscall_darwin_arm.1_11.go | 22 +++---- .../x/sys/unix/zsyscall_darwin_arm.go | 32 ++++----- .../x/sys/unix/zsyscall_darwin_arm.s | 6 +- .../x/sys/unix/zsyscall_darwin_arm64.1_11.go | 22 +++---- .../x/sys/unix/zsyscall_darwin_arm64.go | 32 ++++----- .../x/sys/unix/zsyscall_darwin_arm64.s | 6 +- .../x/sys/unix/zsyscall_dragonfly_amd64.go | 11 ++++ .../x/sys/unix/zsyscall_freebsd_386.go | 11 ++++ .../x/sys/unix/zsyscall_freebsd_amd64.go | 11 ++++ .../x/sys/unix/zsyscall_freebsd_arm.go | 11 ++++ .../x/sys/unix/zsyscall_freebsd_arm64.go | 11 ++++ .../x/sys/unix/zsyscall_linux_386.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_amd64.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_arm.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_arm64.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_mips.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_mips64.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_mips64le.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_mipsle.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_ppc64.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_ppc64le.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_riscv64.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_s390x.go | 21 ++++-- .../x/sys/unix/zsyscall_linux_sparc64.go | 21 ++++-- .../x/sys/unix/zsyscall_netbsd_386.go | 53 +++++++-------- .../x/sys/unix/zsyscall_netbsd_amd64.go | 53 +++++++-------- .../x/sys/unix/zsyscall_netbsd_arm.go | 53 +++++++-------- .../x/sys/unix/zsyscall_netbsd_arm64.go | 53 +++++++-------- .../x/sys/unix/zsyscall_openbsd_386.go | 57 ++++++++-------- .../x/sys/unix/zsyscall_openbsd_amd64.go | 57 ++++++++-------- .../x/sys/unix/zsyscall_openbsd_arm.go | 57 ++++++++-------- .../x/sys/unix/zsyscall_openbsd_arm64.go | 57 ++++++++-------- .../x/sys/unix/ztypes_dragonfly_amd64.go | 10 --- .../x/sys/unix/ztypes_freebsd_386.go | 12 +--- .../x/sys/unix/ztypes_freebsd_amd64.go | 12 +--- .../x/sys/unix/ztypes_freebsd_arm.go | 12 +--- .../x/sys/unix/ztypes_freebsd_arm64.go | 12 +--- .../x/sys/unix/ztypes_solaris_amd64.go | 7 -- .../golang.org/x/sys/windows/types_windows.go | 19 ++---- vendor/modules.txt | 8 +-- 88 files changed, 787 insertions(+), 790 deletions(-) delete mode 100644 vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go delete mode 100644 vendor/github.com/mattn/go-isatty/go.test.sh create mode 100644 vendor/github.com/mattn/go-isatty/isatty_android.go delete mode 100644 vendor/github.com/mattn/go-isatty/isatty_plan9.go delete mode 100644 vendor/github.com/mattn/go-isatty/renovate.json diff --git a/go.mod b/go.mod index 083b5e12d0..0ecd687fa8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/SkycoinProject/skywire-mainnet go 1.13 require ( - github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b + github.com/SkycoinProject/dmsg v0.0.0-20200129011427-cd48108c339f github.com/SkycoinProject/skycoin v0.27.0 github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 @@ -13,19 +13,16 @@ require ( github.com/gorilla/handlers v1.4.2 github.com/gorilla/securecookie v1.1.1 github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d - github.com/mattn/go-isatty v0.0.12 // indirect + github.com/kr/pretty v0.2.0 // indirect github.com/pkg/profile v1.3.0 github.com/prometheus/client_golang v1.3.0 github.com/prometheus/common v0.7.0 github.com/sirupsen/logrus v1.4.2 - github.com/skycoin/dmsg v0.0.0-20190805065636-70f4c32a994f // indirect github.com/spf13/cobra v0.0.5 github.com/stretchr/testify v1.4.0 go.etcd.io/bbolt v1.3.3 golang.org/x/crypto v0.0.0-20200117160349-530e935923ad - golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a - golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 // indirect ) //replace github.com/SkycoinProject/dmsg => ../dmsg diff --git a/go.sum b/go.sum index 2698529668..9047f2192d 100644 --- a/go.sum +++ b/go.sum @@ -1,12 +1,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/SkycoinProject/dmsg v0.0.0-20191106075825-cabc26522b11 h1:OpkHFoRtTKkcaNy/iCdBOyuFqLyy0geXtLz3vOD1FfE= -github.com/SkycoinProject/dmsg v0.0.0-20191106075825-cabc26522b11/go.mod h1:aJrtm4X13hJDh+EX4amx51EBaLvSKjhFH8tf0E8Xxx4= -github.com/SkycoinProject/dmsg v0.0.0-20191107094546-85c27858fca6 h1:qL8+QqCaEzNO4vesE50kZyX1o7BOiwxUMYi1OX/J6KM= -github.com/SkycoinProject/dmsg v0.0.0-20191107094546-85c27858fca6/go.mod h1:Omi1J0gOWWriHkHn/9aGw8JXHtsEfnYwithZY6fIEQY= -github.com/SkycoinProject/dmsg v0.0.0-20200116114634-91be578a1895 h1:lnTxeHdSdju5bdFknXD5CsxYe+MVAuBwFeHcG6DgYGA= -github.com/SkycoinProject/dmsg v0.0.0-20200116114634-91be578a1895/go.mod h1:ND2IgJU0IdbkF1FS0We0EoI/2Gqx6MWJe12zC/KsTzI= -github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b h1:t0tIsfWPDDd/vsw/mOW4hA0xwQ3rFxdOQA+sjc9YSoo= -github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b/go.mod h1:/nTdcMBrMHE39N6fxm300DtMly3UvZXPfwxBa9U8oGs= +github.com/SkycoinProject/dmsg v0.0.0-20200129011427-cd48108c339f h1:hAb4pyFTJ5hJttXGQ/6PzsMqpiOBfBj/BN3jJoeD5Vo= +github.com/SkycoinProject/dmsg v0.0.0-20200129011427-cd48108c339f/go.mod h1:/nTdcMBrMHE39N6fxm300DtMly3UvZXPfwxBa9U8oGs= github.com/SkycoinProject/skycoin v0.26.0 h1:8/ZRZb2VM2DM4YTIitRJMZ3Yo/3H1FFmbCMx5o6ekmA= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/SkycoinProject/skycoin v0.27.0 h1:N3IHxj8ossHOcsxLYOYugT+OaELLncYHJHxbbYLPPmY= @@ -26,8 +20,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReGkA= -github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -55,8 +47,7 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= @@ -71,28 +62,21 @@ github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKe github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= @@ -116,14 +100,10 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= -github.com/prometheus/client_golang v1.2.1 h1:JnMpQc6ppsNgw9QPAGF6Dod479itz7lvlsMzzNayLOI= -github.com/prometheus/client_golang v1.2.1/go.mod h1:XMU6Z2MjaRKVu/dC1qupJI9SiNkDYzz3xecMgSW/F+U= github.com/prometheus/client_golang v1.3.0 h1:miYCvYqFXtl/J9FIy8eNpBfYthAEFg+Ys0XyUVEcDsc= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0 h1:ElTg5tNp4DqfV7UQjDqv2+RJlNzsDtvNAWccbItceIE= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= @@ -131,15 +111,12 @@ github.com/prometheus/common v0.7.0 h1:L+1lyG48J1zAQXA3RBX/nG/B3gjlHq0zTt2tlbJLy github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.5 h1:3+auTFlqw+ZaQYJARz6ArODtkaIwtvBTx3N2NehQlL8= -github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/skycoin/dmsg v0.0.0-20190805065636-70f4c32a994f/go.mod h1:obZYZp8eKR7Xqz+KNhJdUE6Gvp6rEXbDO8YTlW2YXgU= github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= @@ -164,21 +141,14 @@ go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4 h1:PDpCLFAH/YIX0QpHPf2eO7L4rC2OOirBrKtXTLLiNTY= -golang.org/x/crypto v0.0.0-20191106202628-ed6320f186d4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad h1:Jh8cai0fqIK+f6nG0UgPW5wFk8wmiMhM3AyciDBdtQg= golang.org/x/crypto v0.0.0-20200117160349-530e935923ad/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a h1:+HHJiFUXVOIS9mr1ThqkQD1N8vpFCfCShqADBM12KTc= golang.org/x/net v0.0.0-20191204025024-5ee1b9f4859a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -192,41 +162,16 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47 h1:/XfQ9z7ib8eEJX2hdgFTZJ/ntt0swNk5oYBziWeTCvY= -golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f h1:68K/z8GLUxV76xGSqwTWw2gyk/jwn79LUL43rES2g8o= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk= -golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190627182818-9947fec5c3ab/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f h1:kDxGY2VmgABOe55qheT/TFqUMtcTHnomIPS1iv3G4Ms= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191206204035-259af5ff87bd/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2 h1:V9r/14uGBqLgNlHRYWdVqjMdWkcOHnE2KG8DwVqQSEc= -golang.org/x/tools v0.0.0-20200110213125-a7a6caa82ab2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200116062425-473961ec044c h1:D0OxfnjPaEGt7AluXNompYUYGhoY3u6+bValgqfd1vE= -golang.org/x/tools v0.0.0-20200116062425-473961ec044c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200123162537-45e69182d161 h1:96UK0Rx+sC4aQeuLGFxtAiCxAWzUu0OA4hhWlg4YvPQ= -golang.org/x/tools v0.0.0-20200123162537-45e69182d161/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200123220707-24841a4f5f7d h1:KTOebTDPx6KUWl0wm5bjotr4ceAFMsScfXJderPyZ2c= -golang.org/x/tools v0.0.0-20200123220707-24841a4f5f7d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0 h1:G9K47VwP2wDdADV683EnkOYQHhb20LSa80C4AE+Gskw= golang.org/x/tools v0.0.0-20200124021010-5c352bb417e0/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200128002243-345141a36859 h1:xIszjAtlVeHg9hhv6Zhntvwqowji1k2rrgoOhj/aaKw= -golang.org/x/tools v0.0.0-20200128002243-345141a36859/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/SkycoinProject/dmsg/client.go b/vendor/github.com/SkycoinProject/dmsg/client.go index 21f05f8267..d975ccde04 100644 --- a/vendor/github.com/SkycoinProject/dmsg/client.go +++ b/vendor/github.com/SkycoinProject/dmsg/client.go @@ -20,6 +20,7 @@ type Config struct { MinSessions int } +// PrintWarnings prints warnings with config. func (c Config) PrintWarnings(log logrus.FieldLogger) { log = log.WithField("location", "dmsg.Config") if c.MinSessions < 1 { @@ -36,12 +37,16 @@ func DefaultConfig() *Config { // Client represents a dmsg client entity. type Client struct { + ready chan struct{} + readyOnce sync.Once + EntityCommon conf *Config porter *netutil.Porter - errCh chan error - done chan struct{} - once sync.Once + + errCh chan error + done chan struct{} + once sync.Once sesMx sync.Mutex } @@ -49,11 +54,18 @@ type Client struct { // NewClient creates a dmsg client entity. func NewClient(pk cipher.PubKey, sk cipher.SecKey, dc disc.APIClient, conf *Config) *Client { c := new(Client) + c.ready = make(chan struct{}) // Init common fields. c.EntityCommon.init(pk, sk, dc, logging.MustGetLogger("dmsg_client")) c.EntityCommon.setSessionCallback = func(ctx context.Context) error { - return c.EntityCommon.updateClientEntry(ctx, c.done) + err := c.EntityCommon.updateClientEntry(ctx, c.done) + if err != nil { + // Client is 'ready' once we have successfully updated the discovery entry + // with at least one delegated server. + c.readyOnce.Do(func() { close(c.ready) }) + } + return err } c.EntityCommon.delSessionCallback = func(ctx context.Context) error { return c.EntityCommon.updateClientEntry(ctx, c.done) @@ -126,6 +138,12 @@ func (ce *Client) Serve() { } } +// Ready returns a chan which blocks until the client has at least one delegated server and has an entry in the +// dmsg discovery. +func (ce *Client) Ready() <-chan struct{} { + return ce.ready +} + func (ce *Client) discoverServers(ctx context.Context) (entries []*disc.Entry, err error) { err = netutil.NewDefaultRetrier(ce.log).Do(ctx, func() error { entries, err = ce.dc.AvailableServers(ctx) diff --git a/vendor/github.com/SkycoinProject/dmsg/client_session.go b/vendor/github.com/SkycoinProject/dmsg/client_session.go index 1ba8872de3..526af9f062 100644 --- a/vendor/github.com/SkycoinProject/dmsg/client_session.go +++ b/vendor/github.com/SkycoinProject/dmsg/client_session.go @@ -34,7 +34,7 @@ func (cs *ClientSession) DialStream(dst Addr) (dStr *Stream, err error) { defer func() { if err != nil { cs.log.WithError(dStr.Close()). - Debug("On DialStream() failure, close stream resulted in error.") + Debug("Stream closed on DialStream() failure.") } }() diff --git a/vendor/github.com/SkycoinProject/dmsg/errors.go b/vendor/github.com/SkycoinProject/dmsg/errors.go index 53cc864360..c8d8c1a784 100644 --- a/vendor/github.com/SkycoinProject/dmsg/errors.go +++ b/vendor/github.com/SkycoinProject/dmsg/errors.go @@ -7,10 +7,10 @@ import ( // Errors for dmsg discovery (1xx). var ( - ErrDiscEntryNotFound = registerErr(Error{code: 100, msg: "discovery entry is not found"}) - ErrDiscEntryIsNotServer = registerErr(Error{code: 101, msg: "discovery entry is not of server"}) - ErrDiscEntryIsNotClient = registerErr(Error{code: 102, msg: "discovery entry is not of client"}) - ErrDiscEntryHasNoDelegated = registerErr(Error{code: 103, msg: "discovery client entry has no delegated servers"}) + ErrDiscEntryNotFound = registerErr(Error{code: 100, msg: "entry is not found in discovery"}) + ErrDiscEntryIsNotServer = registerErr(Error{code: 101, msg: "entry is not of server in discovery"}) + ErrDiscEntryIsNotClient = registerErr(Error{code: 102, msg: "entry is not of client in discovery"}) + ErrDiscEntryHasNoDelegated = registerErr(Error{code: 103, msg: "client entry in discovery has no delegated servers"}) ) // Entity Errors (2xx). @@ -84,7 +84,7 @@ type Error struct { // Error implements error func (e Error) Error() string { - return fmt.Sprintf("%d - %s", e.code, e.errorString()) + return fmt.Sprintf("dmsg error %d - %s", e.code, e.errorString()) } func (e Error) errorString() string { diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md index 195333e51d..949b77e304 100644 --- a/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md +++ b/vendor/github.com/konsorten/go-windows-terminal-sequences/README.md @@ -26,7 +26,6 @@ The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de). We thank all the authors who provided code to this library: * Felix Kollmann -* Nicolas Perraut ## License diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go b/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go deleted file mode 100644 index df61a6f2f6..0000000000 --- a/vendor/github.com/konsorten/go-windows-terminal-sequences/sequences_dummy.go +++ /dev/null @@ -1,11 +0,0 @@ -// +build linux darwin - -package sequences - -import ( - "fmt" -) - -func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error { - return fmt.Errorf("windows only package") -} diff --git a/vendor/github.com/mattn/go-isatty/.travis.yml b/vendor/github.com/mattn/go-isatty/.travis.yml index 604314dd44..5597e026dd 100644 --- a/vendor/github.com/mattn/go-isatty/.travis.yml +++ b/vendor/github.com/mattn/go-isatty/.travis.yml @@ -1,14 +1,13 @@ language: go -sudo: false go: - - 1.13.x - tip -before_install: - - go get -t -v ./... +os: + - linux + - osx +before_install: + - go get github.com/mattn/goveralls + - go get golang.org/x/tools/cmd/cover script: - - ./go.test.sh - -after_success: - - bash <(curl -s https://codecov.io/bash) + - $HOME/gopath/bin/goveralls -repotoken 3gHdORO5k5ziZcWMBxnd9LrMZaJs8m9x5 diff --git a/vendor/github.com/mattn/go-isatty/README.md b/vendor/github.com/mattn/go-isatty/README.md index 38418353e3..1e69004bb0 100644 --- a/vendor/github.com/mattn/go-isatty/README.md +++ b/vendor/github.com/mattn/go-isatty/README.md @@ -1,7 +1,7 @@ # go-isatty [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) -[![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) +[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) diff --git a/vendor/github.com/mattn/go-isatty/go.mod b/vendor/github.com/mattn/go-isatty/go.mod index 605c4c2210..f310320c33 100644 --- a/vendor/github.com/mattn/go-isatty/go.mod +++ b/vendor/github.com/mattn/go-isatty/go.mod @@ -1,5 +1,3 @@ module github.com/mattn/go-isatty -go 1.12 - -require golang.org/x/sys v0.0.0-20200116001909-b77594299b42 +require golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 diff --git a/vendor/github.com/mattn/go-isatty/go.sum b/vendor/github.com/mattn/go-isatty/go.sum index 912e29cbc1..426c8973c0 100644 --- a/vendor/github.com/mattn/go-isatty/go.sum +++ b/vendor/github.com/mattn/go-isatty/go.sum @@ -1,2 +1,2 @@ -golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/vendor/github.com/mattn/go-isatty/go.test.sh b/vendor/github.com/mattn/go-isatty/go.test.sh deleted file mode 100644 index 012162b077..0000000000 --- a/vendor/github.com/mattn/go-isatty/go.test.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -set -e -echo "" > coverage.txt - -for d in $(go list ./... | grep -v vendor); do - go test -race -coverprofile=profile.out -covermode=atomic "$d" - if [ -f profile.out ]; then - cat profile.out >> coverage.txt - rm profile.out - fi -done diff --git a/vendor/github.com/mattn/go-isatty/isatty_android.go b/vendor/github.com/mattn/go-isatty/isatty_android.go new file mode 100644 index 0000000000..d3567cb5bf --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_android.go @@ -0,0 +1,23 @@ +// +build android + +package isatty + +import ( + "syscall" + "unsafe" +) + +const ioctlReadTermios = syscall.TCGETS + +// IsTerminal return true if the file descriptor is terminal. +func IsTerminal(fd uintptr) bool { + var termios syscall.Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 +} + +// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go index 711f288085..07e93039db 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_bsd.go +++ b/vendor/github.com/mattn/go-isatty/isatty_bsd.go @@ -3,12 +3,18 @@ package isatty -import "golang.org/x/sys/unix" +import ( + "syscall" + "unsafe" +) + +const ioctlReadTermios = syscall.TIOCGETA // IsTerminal return true if the file descriptor is terminal. func IsTerminal(fd uintptr) bool { - _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) - return err == nil + var termios syscall.Termios + _, _, err := syscall.Syscall6(syscall.SYS_IOCTL, fd, ioctlReadTermios, uintptr(unsafe.Pointer(&termios)), 0, 0, 0) + return err == 0 } // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 diff --git a/vendor/github.com/mattn/go-isatty/isatty_plan9.go b/vendor/github.com/mattn/go-isatty/isatty_plan9.go deleted file mode 100644 index c5b6e0c084..0000000000 --- a/vendor/github.com/mattn/go-isatty/isatty_plan9.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build plan9 - -package isatty - -import ( - "syscall" -) - -// IsTerminal returns true if the given file descriptor is a terminal. -func IsTerminal(fd uintptr) bool { - path, err := syscall.Fd2path(int(fd)) - if err != nil { - return false - } - return path == "/dev/cons" || path == "/mnt/term/dev/cons" -} - -// IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 -// terminal. This is also always false on this environment. -func IsCygwinTerminal(fd uintptr) bool { - return false -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go index 31a1ca973c..453b025d0d 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go +++ b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go @@ -1,5 +1,6 @@ // +build linux aix // +build !appengine +// +build !android package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go index 1fa8691540..af51cbcaa4 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -4,7 +4,6 @@ package isatty import ( - "errors" "strings" "syscall" "unicode/utf16" @@ -12,18 +11,15 @@ import ( ) const ( - objectNameInfo uintptr = 1 - fileNameInfo = 2 - fileTypePipe = 3 + fileNameInfo uintptr = 2 + fileTypePipe = 3 ) var ( kernel32 = syscall.NewLazyDLL("kernel32.dll") - ntdll = syscall.NewLazyDLL("ntdll.dll") procGetConsoleMode = kernel32.NewProc("GetConsoleMode") procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx") procGetFileType = kernel32.NewProc("GetFileType") - procNtQueryObject = ntdll.NewProc("NtQueryObject") ) func init() { @@ -49,10 +45,7 @@ func isCygwinPipeName(name string) bool { return false } - if token[0] != `\msys` && - token[0] != `\cygwin` && - token[0] != `\Device\NamedPipe\msys` && - token[0] != `\Device\NamedPipe\cygwin` { + if token[0] != `\msys` && token[0] != `\cygwin` { return false } @@ -75,35 +68,11 @@ func isCygwinPipeName(name string) bool { return true } -// getFileNameByHandle use the undocomented ntdll NtQueryObject to get file full name from file handler -// since GetFileInformationByHandleEx is not avilable under windows Vista and still some old fashion -// guys are using Windows XP, this is a workaround for those guys, it will also work on system from -// Windows vista to 10 -// see https://stackoverflow.com/a/18792477 for details -func getFileNameByHandle(fd uintptr) (string, error) { - if procNtQueryObject == nil { - return "", errors.New("ntdll.dll: NtQueryObject not supported") - } - - var buf [4 + syscall.MAX_PATH]uint16 - var result int - r, _, e := syscall.Syscall6(procNtQueryObject.Addr(), 5, - fd, objectNameInfo, uintptr(unsafe.Pointer(&buf)), uintptr(2*len(buf)), uintptr(unsafe.Pointer(&result)), 0) - if r != 0 { - return "", e - } - return string(utf16.Decode(buf[4 : 4+buf[0]/2])), nil -} - // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 // terminal. func IsCygwinTerminal(fd uintptr) bool { if procGetFileInformationByHandleEx == nil { - name, err := getFileNameByHandle(fd) - if err != nil { - return false - } - return isCygwinPipeName(name) + return false } // Cygwin/msys's pty is a pipe. diff --git a/vendor/github.com/mattn/go-isatty/renovate.json b/vendor/github.com/mattn/go-isatty/renovate.json deleted file mode 100644 index 5ae9d96b74..0000000000 --- a/vendor/github.com/mattn/go-isatty/renovate.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": [ - "config:base" - ], - "postUpdateOptions": [ - "gomodTidy" - ] -} diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go index 9c87677aef..6ac0b3535d 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -10,13 +10,9 @@ const cacheLineSize = 64 func init() { switch runtime.GOOS { - case "android", "darwin": - // Android and iOS don't seem to allow reading these registers. - // Fake the minimal features expected by - // TestARM64minimalFeatures. - ARM64.HasASIMD = true - ARM64.HasFP = true - case "linux": + case "darwin": + // iOS does not seem to allow reading these registers + case "android", "linux": doinit() default: readARM64Registers() diff --git a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s index 3cfefed2ec..6db717de53 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s @@ -23,6 +23,10 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 MOV a1+8(FP), A0 MOV a2+16(FP), A1 MOV a3+24(FP), A2 + MOV $0, A3 + MOV $0, A4 + MOV $0, A5 + MOV $0, A6 MOV trap+0(FP), A7 // syscall entry ECALL MOV A0, r1+32(FP) // r1 @@ -40,6 +44,9 @@ TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 MOV a1+8(FP), A0 MOV a2+16(FP), A1 MOV a3+24(FP), A2 + MOV ZERO, A3 + MOV ZERO, A4 + MOV ZERO, A5 MOV trap+0(FP), A7 // syscall entry ECALL MOV A0, r1+32(FP) diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go index 4dc5348643..39c03f1ef1 100644 --- a/vendor/golang.org/x/sys/unix/fcntl.go +++ b/vendor/golang.org/x/sys/unix/fcntl.go @@ -9,11 +9,12 @@ package unix import "unsafe" // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux -// systems by fcntl_linux_32bit.go to be SYS_FCNTL64. +// systems by flock_linux_32bit.go to be SYS_FCNTL64. var fcntl64Syscall uintptr = SYS_FCNTL -func fcntl(fd int, cmd, arg int) (int, error) { - valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) +// FcntlInt performs a fcntl syscall on fd with the provided command and argument. +func FcntlInt(fd uintptr, cmd, arg int) (int, error) { + valptr, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(arg)) var err error if errno != 0 { err = errno @@ -21,11 +22,6 @@ func fcntl(fd int, cmd, arg int) (int, error) { return int(valptr), err } -// FcntlInt performs a fcntl syscall on fd with the provided command and argument. -func FcntlInt(fd uintptr, cmd, arg int) (int, error) { - return fcntl(int(fd), cmd, arg) -} - // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index 68605db624..d52bcc41c3 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -510,23 +510,6 @@ func SysctlRaw(name string, args ...int) ([]byte, error) { return buf[:n], nil } -func SysctlClockinfo(name string) (*Clockinfo, error) { - mib, err := sysctlmib(name) - if err != nil { - return nil, err - } - - n := uintptr(SizeofClockinfo) - var ci Clockinfo - if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { - return nil, err - } - if n != SizeofClockinfo { - return nil, EIO - } - return &ci, nil -} - //sys utimes(path string, timeval *[2]Timeval) (err error) func Utimes(path string, tv []Timeval) error { @@ -594,6 +577,8 @@ func Futimes(fd int, tv []Timeval) error { return futimes(fd, (*[2]Timeval)(unsafe.Pointer(&tv[0]))) } +//sys fcntl(fd int, cmd int, arg int) (val int, err error) + //sys poll(fds *PollFd, nfds int, timeout int) (n int, err error) func Poll(fds []PollFd, timeout int) (n int, err error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 9a5a6ee544..0a1cc74b3e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -155,6 +155,23 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) ( //sys getattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error) +func SysctlClockinfo(name string) (*Clockinfo, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofClockinfo) + var ci Clockinfo + if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofClockinfo { + return nil, EIO + } + return &ci, nil +} + //sysnb pipe() (r int, w int, err error) func Pipe(p []int) (err error) { @@ -316,8 +333,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error { * Wrapped */ -//sys fcntl(fd int, cmd int, arg int) (val int, err error) - //sys kill(pid int, signum int, posix int) (err error) func Kill(pid int, signum syscall.Signal) (err error) { return kill(pid, int(signum), 1) } diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go index 0e3f25aca1..c81510da27 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm.1_11.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build darwin,arm,!go1.12 +// +build darwin,386,!go1.12 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go index 6b2eca493d..34918d8ed7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go @@ -529,6 +529,12 @@ func PtraceGetRegs(pid int, regsout *Reg) (err error) { return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0) } +func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { + ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint(countin)} + err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) + return int(ioDesc.Len), err +} + func PtraceLwpEvents(pid int, enable int) (err error) { return ptrace(PTRACE_LWPEVENTS, pid, 0, enable) } diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go index 0a5a66fabd..dcc56457a0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go @@ -54,9 +54,3 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) - -func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { - ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} - err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) - return int(ioDesc.Len), err -} diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go index 8025b22d08..321c3baceb 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go @@ -54,9 +54,3 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) - -func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { - ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} - err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) - return int(ioDesc.Len), err -} diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go index 4ea45bce52..6977008313 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go @@ -54,9 +54,3 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) - -func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { - ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)} - err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) - return int(ioDesc.Len), err -} diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go index aa5326db19..dbbbfd6035 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go @@ -54,9 +54,3 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) - -func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { - ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)} - err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) - return int(ioDesc.Len), err -} diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 0efe45aeca..4c9d27e54d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1575,6 +1575,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Fchdir(fd int) (err error) //sys Fchmod(fd int, mode uint32) (err error) //sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) +//sys fcntl(fd int, cmd int, arg int) (val int, err error) //sys Fdatasync(fd int) (err error) //sys Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) //sys FinitModule(fd int, params string, flags int) (err error) @@ -1654,30 +1655,6 @@ func Setgid(uid int) (err error) { return EOPNOTSUPP } -// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set. -// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability. -// If the call fails due to other reasons, current fsgid will be returned. -func SetfsgidRetGid(gid int) (int, error) { - return setfsgid(gid) -} - -// SetfsuidRetUid sets fsuid for current thread and returns previous fsuid set. -// setfsgid(2) will return a non-nil error only if its caller lacks CAP_SETUID capability -// If the call fails due to other reasons, current fsuid will be returned. -func SetfsuidRetUid(uid int) (int, error) { - return setfsuid(uid) -} - -func Setfsgid(gid int) error { - _, err := setfsgid(gid) - return err -} - -func Setfsuid(uid int) error { - _, err := setfsuid(uid) - return err -} - func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { return signalfd(fd, sigmask, _C__NSIG/8, flags) } diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go index a8374b67cf..e7fa665e68 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -70,8 +70,8 @@ func Pipe2(p []int, flags int) (err error) { //sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64 //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 -//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 -//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 +//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32 +//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32 //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 //sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 //sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go index 8ed1d546f0..088ce0f935 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -55,8 +55,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go index 99ae613733..11930fc8fa 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -98,8 +98,8 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT -//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32 -//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32 +//sys Setfsgid(gid int) (err error) = SYS_SETFSGID32 +//sys Setfsuid(uid int) (err error) = SYS_SETFSUID32 //sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32 //sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32 //sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32 diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go index 807a0b20c3..251e2d9715 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -42,8 +42,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go index e9d2f1d715..7562fe97b8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -36,8 +36,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index e286c6ba31..a939ff8f21 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -31,8 +31,8 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, //sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64 -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go index ca0345aabf..28d6d0f229 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -34,8 +34,8 @@ package unix //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go index abdabbac3f..6798c26258 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -41,8 +41,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err } //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 533e9305e7..eb5cb1a71d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -34,8 +34,8 @@ import ( //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go index d890a227bf..37321c12ef 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -30,8 +30,8 @@ package unix //sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK //sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) //sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) -//sys setfsgid(gid int) (prev int, err error) -//sys setfsuid(uid int) (prev int, err error) +//sys Setfsgid(gid int) (err error) +//sys Setfsuid(uid int) (err error) //sysnb Setregid(rgid int, egid int) (err error) //sysnb Setresgid(rgid int, egid int, sgid int) (err error) //sysnb Setresuid(ruid int, euid int, suid int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go index 45b50a6105..6135d383c3 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go @@ -106,6 +106,23 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } +func SysctlClockinfo(name string) (*Clockinfo, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofClockinfo) + var ci Clockinfo + if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofClockinfo { + return nil, EIO + } + return &ci, nil +} + //sysnb pipe() (fd1 int, fd2 int, err error) func Pipe(p []int) (err error) { if len(p) != 2 { @@ -253,7 +270,6 @@ func Statvfs(path string, buf *Statvfs_t) (err error) { //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) -//sys Dup3(from int, to int, flags int) (err error) //sys Exit(code int) //sys ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) //sys ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbytes int) (ret int, err error) @@ -279,7 +295,7 @@ func Statvfs(path string, buf *Statvfs_t) (err error) { //sys Fpathconf(fd int, name int) (val int, err error) //sys Fstat(fd int, stat *Stat_t) (err error) //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) -//sys Fstatvfs1(fd int, buf *Statvfs_t, flags int) (err error) = SYS_FSTATVFS1 +//sys Fstatvfs1(fd int, buf *Statvfs_t) (err error) = SYS_FSTATVFS1 //sys Fsync(fd int) (err error) //sys Ftruncate(fd int, length int64) (err error) //sysnb Getegid() (egid int) @@ -336,7 +352,7 @@ func Statvfs(path string, buf *Statvfs_t) (err error) { //sysnb Settimeofday(tp *Timeval) (err error) //sysnb Setuid(uid int) (err error) //sys Stat(path string, stat *Stat_t) (err error) -//sys Statvfs1(path string, buf *Statvfs_t, flags int) (err error) = SYS_STATVFS1 +//sys Statvfs1(path string, buf *Statvfs_t) (err error) = SYS_STATVFS1 //sys Symlink(path string, link string) (err error) //sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error) //sys Sync() (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index a266e92a9b..92ed67de0b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -55,6 +55,23 @@ func direntNamlen(buf []byte) (uint64, bool) { return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen)) } +func SysctlClockinfo(name string) (*Clockinfo, error) { + mib, err := sysctlmib(name) + if err != nil { + return nil, err + } + + n := uintptr(SizeofClockinfo) + var ci Clockinfo + if err := sysctl(mib, (*byte)(unsafe.Pointer(&ci)), &n, nil, 0); err != nil { + return nil, err + } + if n != SizeofClockinfo { + return nil, EIO + } + return &ci, nil +} + func SysctlUvmexp(name string) (*Uvmexp, error) { mib, err := sysctlmib(name) if err != nil { @@ -72,20 +89,16 @@ func SysctlUvmexp(name string) (*Uvmexp, error) { return &u, nil } +//sysnb pipe(p *[2]_C_int) (err error) func Pipe(p []int) (err error) { - return Pipe2(p, 0) -} - -//sysnb pipe2(p *[2]_C_int, flags int) (err error) -func Pipe2(p []int, flags int) error { if len(p) != 2 { return EINVAL } var pp [2]_C_int - err := pipe2(&pp, flags) + err = pipe(&pp) p[0] = int(pp[0]) p[1] = int(pp[1]) - return err + return } //sys Getdents(fd int, buf []byte) (n int, err error) @@ -235,7 +248,6 @@ func Uname(uname *Utsname) error { //sys Close(fd int) (err error) //sys Dup(fd int) (nfd int, err error) //sys Dup2(from int, to int) (err error) -//sys Dup3(from int, to int, flags int) (err error) //sys Exit(code int) //sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error) //sys Fchdir(fd int) (err error) @@ -340,6 +352,7 @@ func Uname(uname *Utsname) error { // clock_settime // closefrom // execve +// fcntl // fhopen // fhstat // fhstatfs diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go index c1cc0a415f..b5ed805899 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_11.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -516,17 +527,6 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index a3fc490041..cdf8a70002 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -339,6 +339,22 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -711,22 +727,6 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s index 6836a41290..9cae5b1da3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s @@ -44,6 +44,8 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -82,8 +84,6 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 @@ -106,8 +106,6 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 JMP libc_chown(SB) TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) -TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0 - JMP libc_clock_gettime(SB) TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 JMP libc_close(SB) TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go index f8e5c37c5c..8bde8235a0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_11.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -516,17 +527,6 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 50d6437e6b..63b51fbf00 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -339,6 +339,22 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -711,22 +727,6 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index a3fdf099d0..1a0e52aa20 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -44,6 +44,8 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -82,8 +84,6 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go index cea04e041c..63a236b504 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_11.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -516,17 +527,6 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index 63103950ca..adb8668c2b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -339,6 +339,22 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -711,22 +727,6 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s index b67f518fa3..5bebb1bbd0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s @@ -44,6 +44,8 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -82,14 +84,10 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 JMP libc_ioctl(SB) -TEXT ·libc_sysctl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_sysctl(SB) TEXT ·libc_sendfile_trampoline(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) TEXT ·libc_access_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go index 8c3bb3a25d..87c0b61221 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_11.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -516,17 +527,6 @@ func setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintp // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index a8709f72dd..c882a4f9d2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -339,6 +339,22 @@ func libc_futimes_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +func libc_fcntl_trampoline() + +//go:linkname libc_fcntl libc_fcntl +//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := syscall_syscall(funcPC(libc_poll_trampoline), uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -711,22 +727,6 @@ func libc_setattrlist_trampoline() // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func fcntl(fd int, cmd int, arg int) (val int, err error) { - r0, _, e1 := syscall_syscall(funcPC(libc_fcntl_trampoline), uintptr(fd), uintptr(cmd), uintptr(arg)) - val = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -func libc_fcntl_trampoline() - -//go:linkname libc_fcntl libc_fcntl -//go:cgo_import_dynamic libc_fcntl fcntl "/usr/lib/libSystem.B.dylib" - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func kill(pid int, signum int, posix int) (err error) { _, _, e1 := syscall_syscall(funcPC(libc_kill_trampoline), uintptr(pid), uintptr(signum), uintptr(posix)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 40cce1bb28..19faa4d8d6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -44,6 +44,8 @@ TEXT ·libc_utimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_utimes(SB) TEXT ·libc_futimes_trampoline(SB),NOSPLIT,$0-0 JMP libc_futimes(SB) +TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) TEXT ·libc_poll_trampoline(SB),NOSPLIT,$0-0 JMP libc_poll(SB) TEXT ·libc_madvise_trampoline(SB),NOSPLIT,$0-0 @@ -82,8 +84,6 @@ TEXT ·libc_flistxattr_trampoline(SB),NOSPLIT,$0-0 JMP libc_flistxattr(SB) TEXT ·libc_setattrlist_trampoline(SB),NOSPLIT,$0-0 JMP libc_setattrlist(SB) -TEXT ·libc_fcntl_trampoline(SB),NOSPLIT,$0-0 - JMP libc_fcntl(SB) TEXT ·libc_kill_trampoline(SB),NOSPLIT,$0-0 JMP libc_kill(SB) TEXT ·libc_ioctl_trampoline(SB),NOSPLIT,$0-0 @@ -106,8 +106,6 @@ TEXT ·libc_chown_trampoline(SB),NOSPLIT,$0-0 JMP libc_chown(SB) TEXT ·libc_chroot_trampoline(SB),NOSPLIT,$0-0 JMP libc_chroot(SB) -TEXT ·libc_clock_gettime_trampoline(SB),NOSPLIT,$0-0 - JMP libc_clock_gettime(SB) TEXT ·libc_close_trampoline(SB),NOSPLIT,$0-0 JMP libc_close(SB) TEXT ·libc_dup_trampoline(SB),NOSPLIT,$0-0 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index fe1fdd78d7..df199b3454 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -255,6 +255,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index c9058f3091..e68185f1e3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -255,6 +255,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index 49b20c2296..2f77f93c4e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index 31d2c46165..e9a12c9d93 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go index abab3d7cbe..27ab0fbda0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index 0e68c146a1..385a623782 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2121,9 +2132,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2132,9 +2142,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index c038e52e3f..86aa25d6f0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2137,9 +2148,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2148,9 +2158,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index 333683d9c7..b55ecfdec8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2257,9 +2268,8 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID32, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2268,9 +2278,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID32, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 838bbdba29..e2c720cd42 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2060,9 +2071,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2071,9 +2081,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index 7da49ae266..b6728f15f1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2051,9 +2062,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2062,9 +2072,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index f22f83fd68..e794ca5064 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2081,9 +2092,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2092,9 +2102,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index 307c430d03..9e678e76c5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2081,9 +2092,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2092,9 +2102,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 0997b6ed95..79a91ceb9f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2051,9 +2062,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2062,9 +2072,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index a601e72558..79eafede30 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2163,9 +2174,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2174,9 +2184,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 6e4cb194c8..3c562f228a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2163,9 +2174,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2174,9 +2184,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index e690f1934a..376221d087 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2040,9 +2051,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2051,9 +2061,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index f4cd0860a2..b8aa99b6ce 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2133,9 +2144,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2144,9 +2154,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 2447f2a7dc..c533901c08 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -659,6 +659,17 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fdatasync(fd int) (err error) { _, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0) if e1 != 0 { @@ -2132,9 +2143,8 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsgid(gid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) - prev = int(r0) +func Setfsgid(gid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -2143,9 +2153,8 @@ func setfsgid(gid int) (prev int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setfsuid(uid int) (prev int, err error) { - r0, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) - prev = int(r0) +func Setfsuid(uid int) (err error) { + _, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index 3bbd9e39cd..0fa4c37892 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,6 +361,22 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -406,22 +433,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -553,16 +564,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index d8cf5012c2..43da75301d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,6 +361,22 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -406,22 +433,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -553,16 +564,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index 1153fe69b8..b8b340421a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,6 +361,22 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -406,22 +433,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -553,16 +564,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go index 24b4ebb41f..f6243da407 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,6 +361,22 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func pipe() (fd1 int, fd2 int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) fd1 = int(r0) @@ -406,22 +433,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -553,16 +564,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index b44b31aeb1..2938e4124e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,8 +361,24 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -404,22 +431,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -562,16 +573,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 67f93ee76d..22b79ab0e2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,8 +361,24 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -404,22 +431,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -562,16 +573,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index d7c878b1d0..cb921f37af 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,8 +361,24 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -404,22 +431,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -562,16 +573,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 8facd695d5..5a74380355 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -239,6 +239,17 @@ func futimes(fd int, timeval *[2]Timeval) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (val int, err error) { + r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) + val = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) @@ -350,8 +361,24 @@ func Munlockall() (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pipe2(p *[2]_C_int, flags int) (err error) { - _, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0) +func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { + var _p0 unsafe.Pointer + if len(mib) > 0 { + _p0 = unsafe.Pointer(&mib[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pipe(p *[2]_C_int) (err error) { + _, _, e1 := RawSyscall(SYS_PIPE, uintptr(unsafe.Pointer(p)), 0, 0) if e1 != 0 { err = errnoErr(e1) } @@ -404,22 +431,6 @@ func ioctl(fd int, req uint, arg uintptr) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { - var _p0 unsafe.Pointer - if len(mib) > 0 { - _p0 = unsafe.Pointer(&mib[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) @@ -562,16 +573,6 @@ func Dup2(from int, to int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func Dup3(from int, to int, flags int) (err error) { - _, _, e1 := Syscall(SYS_DUP3, uintptr(from), uintptr(to), uintptr(flags)) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return diff --git a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go index 71ea1d6d23..c206f2b053 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go @@ -467,13 +467,3 @@ type Utsname struct { Version [32]byte Machine [32]byte } - -const SizeofClockinfo = 0x14 - -type Clockinfo struct { - Hz int32 - Tick int32 - Tickadj int32 - Stathz int32 - Profhz int32 -} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go index 0ec159680b..7312e95ff4 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -423,7 +423,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint32 + Len uint } type Kevent_t struct { @@ -698,13 +698,3 @@ type Utsname struct { Version [256]byte Machine [256]byte } - -const SizeofClockinfo = 0x14 - -type Clockinfo struct { - Hz int32 - Tick int32 - Spare int32 - Stathz int32 - Profhz int32 -} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go index 8340f57753..29ba2f5bf7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -428,7 +428,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint64 + Len uint } type Kevent_t struct { @@ -704,13 +704,3 @@ type Utsname struct { Version [256]byte Machine [256]byte } - -const SizeofClockinfo = 0x14 - -type Clockinfo struct { - Hz int32 - Tick int32 - Spare int32 - Stathz int32 - Profhz int32 -} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go index 6f79227d74..b4090ef311 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -405,7 +405,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint32 + Len uint } type Kevent_t struct { @@ -681,13 +681,3 @@ type Utsname struct { Version [256]byte Machine [256]byte } - -const SizeofClockinfo = 0x14 - -type Clockinfo struct { - Hz int32 - Tick int32 - Spare int32 - Stathz int32 - Profhz int32 -} diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go index e751e00336..c681d7dbcd 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -406,7 +406,7 @@ type PtraceIoDesc struct { Op int32 Offs *byte Addr *byte - Len uint64 + Len uint } type Kevent_t struct { @@ -682,13 +682,3 @@ type Utsname struct { Version [256]byte Machine [256]byte } - -const SizeofClockinfo = 0x14 - -type Clockinfo struct { - Hz int32 - Tick int32 - Spare int32 - Stathz int32 - Profhz int32 -} diff --git a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go index 23ed9fe51d..8531a190f2 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go @@ -211,12 +211,6 @@ type Cmsghdr struct { Type int32 } -type Inet4Pktinfo struct { - Ifindex uint32 - Spec_dst [4]byte /* in_addr */ - Addr [4]byte /* in_addr */ -} - type Inet6Pktinfo struct { Addr [16]byte /* in6_addr */ Ifindex uint32 @@ -242,7 +236,6 @@ const ( SizeofIPv6Mreq = 0x14 SizeofMsghdr = 0x30 SizeofCmsghdr = 0xc - SizeofInet4Pktinfo = 0xc SizeofInet6Pktinfo = 0x14 SizeofIPv6MTUInfo = 0x24 SizeofICMPv6Filter = 0x20 diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 809fff0b49..8dd95a0a6f 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -681,26 +681,18 @@ const ( AF_UNSPEC = 0 AF_UNIX = 1 AF_INET = 2 - AF_NETBIOS = 17 AF_INET6 = 23 - AF_IRDA = 26 - AF_BTH = 32 + AF_NETBIOS = 17 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 - SOCK_RDM = 4 SOCK_SEQPACKET = 5 - IPPROTO_IP = 0 - IPPROTO_ICMP = 1 - IPPROTO_IGMP = 2 - BTHPROTO_RFCOMM = 3 - IPPROTO_TCP = 6 - IPPROTO_UDP = 17 - IPPROTO_IPV6 = 41 - IPPROTO_ICMPV6 = 58 - IPPROTO_RM = 113 + IPPROTO_IP = 0 + IPPROTO_IPV6 = 0x29 + IPPROTO_TCP = 6 + IPPROTO_UDP = 17 SOL_SOCKET = 0xffff SO_REUSEADDR = 4 @@ -709,7 +701,6 @@ const ( SO_BROADCAST = 32 SO_LINGER = 128 SO_RCVBUF = 0x1002 - SO_RCVTIMEO = 0x1006 SO_SNDBUF = 0x1001 SO_UPDATE_ACCEPT_CONTEXT = 0x700b SO_UPDATE_CONNECT_CONTEXT = 0x7010 diff --git a/vendor/modules.txt b/vendor/modules.txt index 1107ef2e55..41f492e5ed 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/SkycoinProject/dmsg v0.0.0-20200128120244-669ad29a4e6b +# github.com/SkycoinProject/dmsg v0.0.0-20200129011427-cd48108c339f github.com/SkycoinProject/dmsg github.com/SkycoinProject/dmsg/cipher github.com/SkycoinProject/dmsg/disc @@ -46,11 +46,11 @@ github.com/gorilla/securecookie github.com/hashicorp/yamux # github.com/inconshreveable/mousetrap v1.0.0 github.com/inconshreveable/mousetrap -# github.com/konsorten/go-windows-terminal-sequences v1.0.2 +# github.com/konsorten/go-windows-terminal-sequences v1.0.1 github.com/konsorten/go-windows-terminal-sequences # github.com/mattn/go-colorable v0.1.4 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.12 +# github.com/mattn/go-isatty v0.0.8 github.com/mattn/go-isatty # github.com/matttproud/golang_protobuf_extensions v1.0.1 github.com/matttproud/golang_protobuf_extensions/pbutil @@ -105,7 +105,7 @@ golang.org/x/net/context golang.org/x/net/internal/socks golang.org/x/net/nettest golang.org/x/net/proxy -# golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 +# golang.org/x/sys v0.0.0-20191220142924-d4481acd189f golang.org/x/sys/cpu golang.org/x/sys/unix golang.org/x/sys/windows From 7d5cd955e4f7a16ddedfb9e4780b562817d56d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Wed, 29 Jan 2020 12:06:32 +0800 Subject: [PATCH 5/5] Temporarily disable 'make lint' in Travis. https://github.com/golangci/golangci-lint/issues/827 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e5ddecfa96..1a050d7890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,6 @@ before_script: - ci_scripts/create-ip-aliases.sh script: - - make lint +# - make lint TODO(evanlinjin): Temporary due to https://github.com/golangci/golangci-lint/issues/827 - make test - make test-no-ci