diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f520ca70..2e3687b0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,10 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: set up go 1.20 + - name: set up go 1.21 uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" id: go - name: checkout diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 121ea783..bf3c9532 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - name: set up go uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" - name: import gpg key run: | diff --git a/go.mod b/go.mod index d42fa6be..83ac7e4a 100644 --- a/go.mod +++ b/go.mod @@ -1,45 +1,45 @@ module github.com/umputun/spot -go 1.20 +go 1.21 require ( - github.com/aws/aws-sdk-go-v2/config v1.18.33 - github.com/aws/aws-sdk-go-v2/credentials v1.13.32 - github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.20.2 + github.com/aws/aws-sdk-go-v2/config v1.22.0 + github.com/aws/aws-sdk-go-v2/credentials v1.15.1 + github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.0 github.com/fatih/color v1.15.0 github.com/go-pkgz/fileutils v0.2.0 - github.com/go-pkgz/lgr v0.11.0 + github.com/go-pkgz/lgr v0.11.1 github.com/go-pkgz/stringutils v1.1.0 github.com/go-pkgz/syncs v1.3.2 github.com/go-sql-driver/mysql v1.7.1 github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/vault/api v1.9.2 + github.com/hashicorp/vault/api v1.10.0 github.com/jessevdk/go-flags v1.5.0 github.com/lib/pq v1.10.9 - github.com/pelletier/go-toml/v2 v2.0.9 - github.com/pkg/sftp v1.13.5 + github.com/pelletier/go-toml/v2 v2.1.0 + github.com/pkg/sftp v1.13.6 github.com/sosedoff/ansible-vault-go v0.2.0 github.com/stretchr/testify v1.8.4 github.com/testcontainers/testcontainers-go v0.22.0 golang.org/x/crypto v0.14.0 gopkg.in/yaml.v3 v3.0.1 - modernc.org/sqlite v1.25.0 + modernc.org/sqlite v1.27.0 ) require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.20.1 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.13.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.21.2 // indirect - github.com/aws/smithy-go v1.14.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.22.1 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 // indirect + github.com/aws/smithy-go v1.16.0 // indirect github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/containerd/containerd v1.7.3 // indirect @@ -53,14 +53,14 @@ require ( github.com/go-jose/go-jose/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/google/uuid v1.4.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-retryablehttp v0.7.4 // indirect github.com/hashicorp/go-rootcerts v1.0.2 // indirect - github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 // indirect + github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 // indirect github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect - github.com/hashicorp/go-sockaddr v1.0.2 // indirect + github.com/hashicorp/go-sockaddr v1.0.5 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.16.7 // indirect @@ -68,7 +68,7 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moby/patternmatcher v0.5.0 // indirect @@ -84,22 +84,22 @@ require ( github.com/ryanuber/go-glob v1.0.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect golang.org/x/exp v0.0.0-20230807204917-050eac23e9de // indirect - golang.org/x/mod v0.12.0 // indirect + golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect - golang.org/x/tools v0.12.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.4.0 // indirect + golang.org/x/tools v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect google.golang.org/grpc v1.57.1 // indirect google.golang.org/protobuf v1.30.0 // indirect lukechampine.com/uint128 v1.3.0 // indirect modernc.org/cc/v3 v3.41.0 // indirect - modernc.org/ccgo/v3 v3.16.14 // indirect - modernc.org/libc v1.24.1 // indirect + modernc.org/ccgo/v3 v3.16.15 // indirect + modernc.org/libc v1.30.0 // indirect modernc.org/mathutil v1.6.0 // indirect - modernc.org/memory v1.6.0 // indirect + modernc.org/memory v1.7.2 // indirect modernc.org/opt v0.1.3 // indirect - modernc.org/strutil v1.1.3 // indirect + modernc.org/strutil v1.2.0 // indirect modernc.org/token v1.1.0 // indirect ) diff --git a/go.sum b/go.sum index 27184c38..f15a1d5b 100644 --- a/go.sum +++ b/go.sum @@ -1,39 +1,39 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.10.0-rc.8 h1:YSZVvlIIDD1UxQpJp0h+dnpLUw+TrY0cx8obKsp3bek= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go-v2 v1.20.1 h1:rZBf5DWr7YGrnlTK4kgDQGn1ltqOg5orCYb/UhOFZkg= -github.com/aws/aws-sdk-go-v2 v1.20.1/go.mod h1:NU06lETsFm8fUC6ZjhgDpVBcGZTFQ6XM+LZWZxMI4ac= -github.com/aws/aws-sdk-go-v2/config v1.18.33 h1:JKcw5SFxFW/rpM4mOPjv0VQ11E2kxW13F3exWOy7VZU= -github.com/aws/aws-sdk-go-v2/config v1.18.33/go.mod h1:hXO/l9pgY3K5oZJldamP0pbZHdPqqk+4/maa7DSD3cA= -github.com/aws/aws-sdk-go-v2/credentials v1.13.32 h1:lIH1eKPcCY1ylR4B6PkBGRWMHO3aVenOKJHWiS4/G2w= -github.com/aws/aws-sdk-go-v2/credentials v1.13.32/go.mod h1:lL8U3v/Y79YRG69WlAho0OHIKUXCyFvSXaIvfo81sls= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8 h1:DK/9C+UN/X+1+Wm8pqaDksQr2tSLzq+8X1/rI/ZxKEQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8/go.mod h1:ce7BgLQfYr5hQFdy67oX2svto3ufGtm6oBvmsHScI1Q= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 h1:c8ed/T9T2K5I+h/JzmF5tpI46+OODQ74dzmdo+QnaMg= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38/go.mod h1:qggunOChCMu9ZF/UkAfhTz25+U2rLVb3ya0Ua6TTfCA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 h1:hNeAAymUY5gu11WrrmFb3CVIp9Dar9hbo44yzzcQpzA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32/go.mod h1:0ZXSqrty4FtQ7p8TEuRde/SZm9X05KT18LAUlR40Ln0= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 h1:fc0ukRAiP1syoSGZYu+DaE+FulSYhTiJ8WpVu5jElU4= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39/go.mod h1:WLAW8PT7+JhjZfLSWe7WEJaJu0GNo0cKc2Zyo003RBs= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 h1:dGAseBFEYxth10V23b5e2mAS+tX7oVbfYHD6dnDdAsg= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32/go.mod h1:4jwAWKEkCR0anWk5+1RbfSg1R5Gzld7NLiuaq5bTR/Y= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.20.2 h1:vlkGQk8JiUo1KmZF4wsZP3qclbyQHSUvLMf8aPOS79g= -github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.20.2/go.mod h1:Z6Oq1mXqvgwmUxvMrV/jMkQhwm06A9XO015dzGnS8TM= -github.com/aws/aws-sdk-go-v2/service/sso v1.13.2 h1:A2RlEMo4SJSwbNoUUgkxTAEMduAy/8wG3eB2b2lP4gY= -github.com/aws/aws-sdk-go-v2/service/sso v1.13.2/go.mod h1:ju+nNXUunfIFamXUIZQiICjnO/TPlOmWcYhZcSy7xaE= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2 h1:OJELEgyaT2kmaBGZ+myyZbTTLobfe3ox3FSh5eYK9Qs= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2/go.mod h1:ubDBBaDFs1GHijSOTi8ljppML15GLG0HxhILtbjNNYQ= -github.com/aws/aws-sdk-go-v2/service/sts v1.21.2 h1:ympg1+Lnq33XLhcK/xTG4yZHPs1Oyxu+6DEWbl7qOzA= -github.com/aws/aws-sdk-go-v2/service/sts v1.21.2/go.mod h1:FQ/DQcOfESELfJi5ED+IPPAjI5xC6nxtSolVVB773jM= -github.com/aws/smithy-go v1.14.1 h1:EFKMUmH/iHMqLiwoEDx2rRjRQpI1YCn5jTysoaDujFs= -github.com/aws/smithy-go v1.14.1/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/Microsoft/hcsshim v0.10.0-rc.8/go.mod h1:OEthFdQv/AD2RAdzR6Mm1N1KPCztGKDurW1Z8b8VGMM= +github.com/aws/aws-sdk-go-v2 v1.22.1 h1:sjnni/AuoTXxHitsIdT0FwmqUuNUuHtufcVDErVFT9U= +github.com/aws/aws-sdk-go-v2 v1.22.1/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c= +github.com/aws/aws-sdk-go-v2/config v1.22.0 h1:9Mm99OalzZRz0ab5fpodMoHBApHS6pqRNp3M9NmzvDg= +github.com/aws/aws-sdk-go-v2/config v1.22.0/go.mod h1:2eWgw5lps8fKI7LZVTrRTYP6HE6k/uEFUuTSHfXwqP0= +github.com/aws/aws-sdk-go-v2/credentials v1.15.1 h1:hmf6lAm9hk7uLCfapZn/jL05lm6Uwdbn1B0fgjyuf4M= +github.com/aws/aws-sdk-go-v2/credentials v1.15.1/go.mod h1:QTcHga3ZbQOneJuxmGBOCxiClxmp+TlvmjFexAnJ790= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 h1:gIeH4+o1MN/caGBWjoGQTUTIu94xD6fI5B2+TcwBf70= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2/go.mod h1:wLyMIo/zPOhQhPXTddpfdkSleyigtFi8iMnC+2m/SK4= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 h1:fi1ga6WysOyYb5PAf3Exd6B5GiSNpnZim4h1rhlBqx0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1/go.mod h1:V5CY8wNurvPUibTi9mwqUqpiFZ5LnioKWIFUDtIzdI8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 h1:ZpaV/j48RlPc4AmOZuPv22pJliXjXq8/reL63YzyFnw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1/go.mod h1:R8aXraabD2e3qv1csxM14/X9WF4wFMIY0kH4YEtYD5M= +github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 h1:DqOQvIfmGkXZUVJnl9VRk0AnxyS59tCtX9k1Pyss4Ak= +github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0/go.mod h1:VV/Kbw9Mg1GWJOT9WK+oTL3cWZiXtapnNvDSRqTZLsg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 h1:2OXw3ppu1XsB6rqKEMV4tnecTjIY3PRV2U6IP6KPJQo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1/go.mod h1:FZB4AdakIqW/yERVdGJA6Z9jraax1beXfhBBnK2wwR8= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.0 h1:PXSCgeF51ApT3k+fduqw7IaCxICt1nozWV1iPz7TyxU= +github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.0/go.mod h1:bpDXZjRbNT5gb9pa2jJlSUvBkfNwfG3OWgGqFYY73kA= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 h1:I/Oh3IxGPfHXiGnwM54TD6hNr/8TlUrBXAtTyGhR+zw= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.0/go.mod h1:H6NCMvDBqA+CvIaXzaSqM6LWtzv9BzZrqBOqz+PzRF8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 h1:irbXQkfVYIRaewYSXcu4yVk0m2T+JzZd0dkop7FjmO0= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0/go.mod h1:4wPNCkM22+oRe71oydP66K50ojDUC33XutSMi2pEF/M= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 h1:sYIFy8tm1xQwRvVQ4CRuBGXKIg9sHNuG6+3UAQuoujk= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.0/go.mod h1:S/LOQUeYDfJeJpFCIJDMjy7dwL4aA33HUdVi+i7uH8k= +github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik= +github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/cenkalti/backoff/v3 v3.2.2 h1:cfUAAO3yvKMYKPrvhDuHSwQnhZNk/RMHKdZqKTxfm6M= github.com/cenkalti/backoff/v3 v3.2.2/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= @@ -44,7 +44,9 @@ github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoY github.com/cpuguy83/dockercfg v0.3.1/go.mod h1:sugsbF4//dDlL/i+S+rtpIWp+5h0BHJHfjj5/jFyUJc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.3 h1:YX6ebbZCZP7VkM3scTTokDgBL2TY741X51MTk3ycuNI= +github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -58,15 +60,14 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4 github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= github.com/go-jose/go-jose/v3 v3.0.0 h1:s6rrhirfEP/CGIoc6p+PZAeogN2SxKav6Wp7+dyMWVo= github.com/go-jose/go-jose/v3 v3.0.0/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8= github.com/go-pkgz/fileutils v0.2.0 h1:TyCYD02ESjG+5rPVBMydmyWYaGdMEbjbvG6kNRuW60w= github.com/go-pkgz/fileutils v0.2.0/go.mod h1:8J7iLe7WensJoQ/WjqODxoAI9ju8jXR/3iVWCDtyZWY= -github.com/go-pkgz/lgr v0.11.0 h1:9XH5o+vj09L0sRWEswIGK1lJ6g07xVB4/Z28RV9Z+qM= -github.com/go-pkgz/lgr v0.11.0/go.mod h1:4rdRmMSs4yGFjnUg0rSDbKx21LmFNZoH4y8OLl3qDnU= +github.com/go-pkgz/lgr v0.11.1 h1:hXFhZcznehI6imLhEa379oMOKFz7TQUmisAqb3oLOSM= +github.com/go-pkgz/lgr v0.11.1/go.mod h1:tgDF4RXQnBfIgJqjgkv0yOeTQ3F1yewWIZkpUhHnAkU= github.com/go-pkgz/stringutils v1.1.0 h1:+EJPrIY4JQNWXwdudv0QBXHChdVzKRtSYG6fb3MDl9w= github.com/go-pkgz/stringutils v1.1.0/go.mod h1:p5XLM6BpFFOhtJYdUAbeE8a41vBsEqj4BFHbklNI5mo= github.com/go-pkgz/syncs v1.3.2 h1:gmioASlJNy3gNosPlgvWOM2QP0Hdjzn2u+/sUShgd8E= @@ -74,6 +75,7 @@ github.com/go-pkgz/syncs v1.3.2/go.mod h1:qjgzpp7OpuhDf7BWsW/FHCu9DLjE32NPy6/vXA github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= +github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= @@ -81,11 +83,12 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -93,28 +96,25 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2 h1:jzhAVGtqPKbwpyCPELlgNWhE1znq+qwJtW5Oi2viEzc= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs= -github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8= -github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 h1:iBt4Ew4XEGLfh6/bPk4rSYmuZJGizr6/x/AEizP0CQc= +github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8/go.mod h1:aiJI+PIApBRQG7FZTEBx5GiiX+HbOHilUdNxUZi4eV0= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts= github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4= -github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= +github.com/hashicorp/go-sockaddr v1.0.5 h1:dvk7TIXCZpmfOlM+9mlcrWmWjw/wlKT+VDq2wMvfPJU= +github.com/hashicorp/go-sockaddr v1.0.5/go.mod h1:uoUUmtwU7n9Dv3O4SNLeFvg0SxQ3lyjsj6+CCykpaxI= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/vault/api v1.9.2 h1:YjkZLJ7K3inKgMZ0wzCU9OHqc+UqMQyXsPXnf3Cl2as= -github.com/hashicorp/vault/api v1.9.2/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= +github.com/hashicorp/vault/api v1.10.0 h1:/US7sIjWN6Imp4o/Rj1Ce2Nr5bki/AXi9vAW3p2tOJQ= +github.com/hashicorp/vault/api v1.10.0/go.mod h1:jo5Y/ET+hNyz+JnKDt8XLAdKs+AM0G5W0Vp1IrFI8N8= github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= @@ -131,19 +131,15 @@ github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/moby/patternmatcher v0.5.0 h1:YCZgJOeULcxLw1Q+sVR636pmS7sPEn1Qo2iAN6M7DBo= @@ -160,21 +156,19 @@ github.com/opencontainers/image-spec v1.1.0-rc4 h1:oOxKUJWnFC4YGHCCMNql1x4YaDfYB github.com/opencontainers/image-spec v1.1.0-rc4/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= github.com/opencontainers/runc v1.1.8 h1:zICRlc+C1XzivLc3nzE+cbJV4LIi8tib6YG0MqC6OqA= github.com/opencontainers/runc v1.1.8/go.mod h1:CbUumNnWCuTGFukNXahoo/RFBZvDAgRh/smNYNOhA50= -github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= -github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= +github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.13.5 h1:a3RLUqkyjYRtBTZJZ1VRrKbN3zhuPLlUc3sphVz81go= -github.com/pkg/sftp v1.13.5/go.mod h1:wHDZ0IZX6JcBYRK1TH9bcVq8G7TLpVHYIGJRFnmPfxg= +github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo= +github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= @@ -195,60 +189,72 @@ github.com/testcontainers/testcontainers-go v0.22.0 h1:hOK4NzNu82VZcKEB1aP9LO1xY github.com/testcontainers/testcontainers-go v0.22.0/go.mod h1:k0YiPa26xJCRUbUkYqy5rY6NGvSbVCeUBXCvucscBR4= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/exp v0.0.0-20230807204917-050eac23e9de h1:l5Za6utMv/HsBWWqzt4S8X17j+kt1uVETUX5UFhn2rE= golang.org/x/exp v0.0.0-20230807204917-050eac23e9de/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/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-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= +golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.12.0 h1:YW6HUoUmYBpwSgyaGaZq1fHjrBjX1rlpZ54T6mu2kss= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -263,32 +269,37 @@ google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cn google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= +gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= modernc.org/cc/v3 v3.41.0/go.mod h1:Ni4zjJYJ04CDOhG7dn640WGfwBzfE0ecX8TyMB0Fv0Y= -modernc.org/ccgo/v3 v3.16.14 h1:af6KNtFgsVmnDYrWk3PQCS9XT6BXe7o3ZFJKkIKvXNQ= -modernc.org/ccgo/v3 v3.16.14/go.mod h1:mPDSujUIaTNWQSG4eqKw+atqLOEbma6Ncsa94WbC9zo= +modernc.org/ccgo/v3 v3.16.15 h1:KbDR3ZAVU+wiLyMESPtbtE/Add4elztFyfsWoNTgxS0= +modernc.org/ccgo/v3 v3.16.15/go.mod h1:yT7B+/E2m43tmMOT51GMoM98/MtHIcQQSleGnddkUNI= modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= +modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= -modernc.org/libc v1.24.1 h1:uvJSeCKL/AgzBo2yYIPPTy82v21KgGnizcGYfBHaNuM= -modernc.org/libc v1.24.1/go.mod h1:FmfO1RLrU3MHJfyi9eYYmZBfi/R+tqZ6+hQ3yQQUkak= +modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= +modernc.org/libc v1.30.0 h1:tw+o+UObwSE4Bfu3+Ztz9NW/Olqp7nTL/vcaEY/x4rc= +modernc.org/libc v1.30.0/go.mod h1:SUKVISl2sU6aasM35Y0v4SsSBTt89uDKrvxgXkvsC/4= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= -modernc.org/memory v1.6.0 h1:i6mzavxrE9a30whzMfwf7XWVODx2r5OYXvU46cirX7o= -modernc.org/memory v1.6.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= +modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= +modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.25.0 h1:AFweiwPNd/b3BoKnBOfFm+Y260guGMF+0UFk0savqeA= -modernc.org/sqlite v1.25.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= -modernc.org/strutil v1.1.3 h1:fNMm+oJklMGYfU9Ylcywl0CO5O6nTfaowNsh2wpPjzY= -modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= +modernc.org/sqlite v1.27.0 h1:MpKAHoyYB7xqcwnUwkuD+npwEa0fojF0B5QRbN+auJ8= +modernc.org/sqlite v1.27.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= +modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= +modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= +modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.7.3 h1:zDJf6iHjrnB+WRD88stbXokugjyc0/pB91ri1gO6LZY= +modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= diff --git a/pkg/config/deepcopy/deepcopy_test.go b/pkg/config/deepcopy/deepcopy_test.go index b0296776..9c40cd97 100644 --- a/pkg/config/deepcopy/deepcopy_test.go +++ b/pkg/config/deepcopy/deepcopy_test.go @@ -9,6 +9,7 @@ import ( ) // just basic is this working stuff +// nolint func TestSimple(t *testing.T) { Strings := []string{"a", "b", "c"} cpyS := Copy(Strings).([]string) @@ -171,6 +172,7 @@ type Basics struct { // These tests test that all supported basic types are copied correctly. This // is done by copying a struct with fields of most of the basic types as []T. +// nolint func TestMostTypes(t *testing.T) { test := Basics{ String: "kimchi", @@ -575,6 +577,7 @@ Interfaces: } // not meant to be exhaustive +// nolint func TestComplexSlices(t *testing.T) { orig3Int := [][][]int{[][]int{[]int{1, 2, 3}, []int{11, 22, 33}}, [][]int{[]int{7, 8, 9}, []int{66, 77, 88, 99}}} cpyI := Copy(orig3Int).([][][]int) @@ -666,6 +669,7 @@ var AStruct = A{ T: time.Now(), } +// nolint func TestStructA(t *testing.T) { cpy := Copy(AStruct).(A) if &cpy == &AStruct { @@ -908,6 +912,7 @@ func TestPointerToStruct(t *testing.T) { } } +// nolint func TestIssue9(t *testing.T) { // simple pointer copy x := 42 diff --git a/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md index 804f5f15..48105a44 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/CHANGELOG.md @@ -1,3 +1,1268 @@ +# Release (2023-11-01) + +## General Highlights +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.74.0](service/connect/CHANGELOG.md#v1740-2023-11-01) + * **Feature**: Adds the BatchGetFlowAssociation API which returns flow associations (flow-resource) corresponding to the list of resourceArns supplied in the request. This release also adds IsDefault, LastModifiedRegion and LastModifiedTime fields to the responses of several Describe and List APIs. +* `github.com/aws/aws-sdk-go-v2/service/globalaccelerator`: [v1.19.0](service/globalaccelerator/CHANGELOG.md#v1190-2023-11-01) + * **Feature**: Global Accelerator now support accelerators with cross account endpoints. +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.61.0](service/rds/CHANGELOG.md#v1610-2023-11-01) + * **Feature**: This release adds support for customized networking resources to Amazon RDS Custom. +* `github.com/aws/aws-sdk-go-v2/service/redshift`: [v1.35.0](service/redshift/CHANGELOG.md#v1350-2023-11-01) + * **Feature**: Added support for Multi-AZ deployments for Provisioned RA3 clusters that provide 99.99% SLA availability. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.115.0](service/sagemaker/CHANGELOG.md#v11150-2023-11-01) + * **Feature**: Support for batch transform input in Model dashboard + +# Release (2023-10-31) + +## General Highlights +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/amplify`: [v1.16.0](service/amplify/CHANGELOG.md#v1160-2023-10-31) + * **Feature**: Add backend field to CreateBranch and UpdateBranch requests. Add pagination support for ListApps, ListDomainAssociations, ListBranches, and ListJobs +* `github.com/aws/aws-sdk-go-v2/service/applicationinsights`: [v1.20.0](service/applicationinsights/CHANGELOG.md#v1200-2023-10-31) + * **Feature**: Automate attaching managed policies +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.129.0](service/ec2/CHANGELOG.md#v11290-2023-10-31) + * **Feature**: Capacity Blocks for ML are a new EC2 purchasing option for reserving GPU instances on a future date to support short duration machine learning (ML) workloads. Capacity Blocks automatically place instances close together inside Amazon EC2 UltraClusters for low-latency, high-throughput networking. +* `github.com/aws/aws-sdk-go-v2/service/m2`: [v1.8.0](service/m2/CHANGELOG.md#v180-2023-10-31) + * **Feature**: Added name filter ability for ListDataSets API, added ForceUpdate for Updating environment and BatchJob submission using S3BatchJobIdentifier +* `github.com/aws/aws-sdk-go-v2/service/neptunedata`: [v1.1.0](service/neptunedata/CHANGELOG.md#v110-2023-10-31) + * **Feature**: Minor change to not retry CancelledByUserException +* `github.com/aws/aws-sdk-go-v2/service/translate`: [v1.20.0](service/translate/CHANGELOG.md#v1200-2023-10-31) + * **Feature**: Added support for Brevity translation settings feature. + +# Release (2023-10-30) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.72.0](service/connect/CHANGELOG.md#v1720-2023-10-30) + * **Feature**: This release adds InstanceId field for phone number APIs. +* `github.com/aws/aws-sdk-go-v2/service/dataexchange`: [v1.22.0](service/dataexchange/CHANGELOG.md#v1220-2023-10-30) + * **Feature**: We added a new API action: SendDataSetNotification. +* `github.com/aws/aws-sdk-go-v2/service/datasync`: [v1.30.0](service/datasync/CHANGELOG.md#v1300-2023-10-30) + * **Feature**: Platform version changes to support AL1 deprecation initiative. +* `github.com/aws/aws-sdk-go-v2/service/finspace`: [v1.14.0](service/finspace/CHANGELOG.md#v1140-2023-10-30) + * **Feature**: Introducing new API UpdateKxClusterCodeConfiguration, introducing new cache types for clusters and introducing new deployment modes for updating clusters. +* `github.com/aws/aws-sdk-go-v2/service/mediapackagev2`: [v1.4.0](service/mediapackagev2/CHANGELOG.md#v140-2023-10-30) + * **Feature**: This feature allows customers to create a combination of manifest filtering, startover and time delay configuration that applies to all egress requests by default. +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.59.0](service/rds/CHANGELOG.md#v1590-2023-10-30) + * **Feature**: This release launches the CreateIntegration, DeleteIntegration, and DescribeIntegrations APIs to manage zero-ETL Integrations. +* `github.com/aws/aws-sdk-go-v2/service/redshiftserverless`: [v1.9.0](service/redshiftserverless/CHANGELOG.md#v190-2023-10-30) + * **Feature**: Added support for custom domain names for Amazon Redshift Serverless workgroups. This feature enables customers to create a custom domain name and use ACM to generate fully secure connections to it. +* `github.com/aws/aws-sdk-go-v2/service/resiliencehub`: [v1.14.0](service/resiliencehub/CHANGELOG.md#v1140-2023-10-30) + * **Feature**: Introduced the ability to filter applications by their last assessment date and time and have included metrics for the application's estimated workload Recovery Time Objective (RTO) and estimated workload Recovery Point Objective (RPO). +* `github.com/aws/aws-sdk-go-v2/service/s3outposts`: [v1.19.0](service/s3outposts/CHANGELOG.md#v1190-2023-10-30) + * **Feature**: Updated ListOutpostsWithS3 API response to include S3OutpostArn for use with AWS RAM. +* `github.com/aws/aws-sdk-go-v2/service/wisdom`: [v1.16.1](service/wisdom/CHANGELOG.md#v1161-2023-10-30) + * **Documentation**: This release added necessary API documents on creating a Wisdom knowledge base to integrate with S3. + +# Release (2023-10-27) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/emr`: [v1.30.0](service/emr/CHANGELOG.md#v1300-2023-10-27) + * **Feature**: Updated CreateCluster API request and DescribeCluster API responses to include EbsRootVolumeIops, and EbsRootVolumeThroughput attributes that specify the user configured root volume IOPS and throughput for Amazon EBS root device volume. This feature will be available from Amazon EMR releases 6.15.0 +* `github.com/aws/aws-sdk-go-v2/service/neptune`: [v1.24.0](service/neptune/CHANGELOG.md#v1240-2023-10-27) + * **Feature**: Update TdeCredentialPassword type to SensitiveString +* `github.com/aws/aws-sdk-go-v2/service/pinpoint`: [v1.23.1](service/pinpoint/CHANGELOG.md#v1231-2023-10-27) + * **Documentation**: Updated documentation to describe the case insensitivity for EndpointIds. +* `github.com/aws/aws-sdk-go-v2/service/redshift`: [v1.33.0](service/redshift/CHANGELOG.md#v1330-2023-10-27) + * **Feature**: added support to create a dual stack cluster +* `github.com/aws/aws-sdk-go-v2/service/wafv2`: [v1.40.1](service/wafv2/CHANGELOG.md#v1401-2023-10-27) + * **Documentation**: Updates the descriptions for the calls that manage web ACL associations, to provide information for customer-managed IAM policies. + +# Release (2023-10-26) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appstream`: [v1.26.0](service/appstream/CHANGELOG.md#v1260-2023-10-26) + * **Feature**: This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.128.0](service/ec2/CHANGELOG.md#v11280-2023-10-26) + * **Feature**: Launching GetSecurityGroupsForVpc API. This API gets security groups that can be associated by the AWS account making the request with network interfaces in the specified VPC. +* `github.com/aws/aws-sdk-go-v2/service/networkfirewall`: [v1.32.0](service/networkfirewall/CHANGELOG.md#v1320-2023-10-26) + * **Feature**: Network Firewall now supports inspection of outbound SSL/TLS traffic. +* `github.com/aws/aws-sdk-go-v2/service/opensearch`: [v1.23.0](service/opensearch/CHANGELOG.md#v1230-2023-10-26) + * **Feature**: You can specify ipv4 or dualstack IPAddressType for cluster endpoints. If you specify IPAddressType as dualstack, the new endpoint will be visible under the 'EndpointV2' parameter and will support IPv4 and IPv6 requests. Whereas, the 'Endpoint' will continue to serve IPv4 requests. +* `github.com/aws/aws-sdk-go-v2/service/redshift`: [v1.32.0](service/redshift/CHANGELOG.md#v1320-2023-10-26) + * **Feature**: Add Redshift APIs GetResourcePolicy, DeleteResourcePolicy, PutResourcePolicy and DescribeInboundIntegrations for the new Amazon Redshift Zero-ETL integration feature, which can be used to control data ingress into Redshift namespace, and view inbound integrations. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.113.0](service/sagemaker/CHANGELOG.md#v11130-2023-10-26) + * **Feature**: Amazon Sagemaker Autopilot now supports Text Generation jobs. +* `github.com/aws/aws-sdk-go-v2/service/sns`: [v1.23.0](service/sns/CHANGELOG.md#v1230-2023-10-26) + * **Feature**: Message Archiving and Replay is now supported in Amazon SNS for FIFO topics. +* `github.com/aws/aws-sdk-go-v2/service/ssmsap`: [v1.6.0](service/ssmsap/CHANGELOG.md#v160-2023-10-26) + * **Feature**: AWS Systems Manager for SAP added support for registration and discovery of SAP ABAP applications +* `github.com/aws/aws-sdk-go-v2/service/transfer`: [v1.35.0](service/transfer/CHANGELOG.md#v1350-2023-10-26) + * **Feature**: No API changes from previous release. This release migrated the model to Smithy keeping all features unchanged. + +# Release (2023-10-25) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/connectcases`: [v1.8.0](service/connectcases/CHANGELOG.md#v180-2023-10-25) + * **Feature**: Increase maximum length of CommentBody to 3000, and increase maximum length of StringValue to 1500 +* `github.com/aws/aws-sdk-go-v2/service/groundstation`: [v1.20.0](service/groundstation/CHANGELOG.md#v1200-2023-10-25) + * **Feature**: This release will allow KMS alias names to be used when creating Mission Profiles +* `github.com/aws/aws-sdk-go-v2/service/iam`: [v1.24.0](service/iam/CHANGELOG.md#v1240-2023-10-25) + * **Feature**: Updates to GetAccessKeyLastUsed action to replace NoSuchEntity error with AccessDeniedException error. + +# Release (2023-10-24) + +## General Highlights +* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162). +* **Feature**: **BREAKFIX**: Correct nullability representation of APIGateway-based services. +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/codepipeline`: [v1.18.0](service/codepipeline/CHANGELOG.md#v1180-2023-10-24) + * **Feature**: Add ability to trigger pipelines from git tags, define variables at pipeline level and new pipeline type V2. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.127.0](service/ec2/CHANGELOG.md#v11270-2023-10-24) + * **Feature**: This release updates the documentation for InstanceInterruptionBehavior and HibernationOptionsRequest to more accurately describe the behavior of these two parameters when using Spot hibernation. +* `github.com/aws/aws-sdk-go-v2/service/eks`: [v1.30.0](service/eks/CHANGELOG.md#v1300-2023-10-24) + * **Feature**: Added support for Cluster Subnet and Security Group mutability. +* `github.com/aws/aws-sdk-go-v2/service/iam`: [v1.23.0](service/iam/CHANGELOG.md#v1230-2023-10-24) + * **Feature**: Add the partitional endpoint for IAM in iso-f. +* `github.com/aws/aws-sdk-go-v2/service/migrationhubconfig`: [v1.16.0](service/migrationhubconfig/CHANGELOG.md#v1160-2023-10-24) + * **Feature**: This release introduces DeleteHomeRegionControl API that customers can use to delete the Migration Hub Home Region configuration +* `github.com/aws/aws-sdk-go-v2/service/migrationhubstrategy`: [v1.12.0](service/migrationhubstrategy/CHANGELOG.md#v1120-2023-10-24) + * **Feature**: This release introduces multi-data-source feature in Migration Hub Strategy Recommendations. This feature now supports vCenter as a data source to fetch inventory in addition to ADS and Import from file workflow that is currently supported with MHSR collector. +* `github.com/aws/aws-sdk-go-v2/service/opensearchserverless`: [v1.6.0](service/opensearchserverless/CHANGELOG.md#v160-2023-10-24) + * **Feature**: This release includes the following new APIs: CreateLifecyclePolicy, UpdateLifecyclePolicy, BatchGetLifecyclePolicy, DeleteLifecyclePolicy, ListLifecyclePolicies and BatchGetEffectiveLifecyclePolicy to support the data lifecycle management feature. + +# Release (2023-10-23) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/marketplacecommerceanalytics`: [v1.15.0](service/marketplacecommerceanalytics/CHANGELOG.md#v1150-2023-10-23) + * **Feature**: The StartSupportDataExport operation has been deprecated as part of the Product Support Connection deprecation. As of December 2022, Product Support Connection is no longer supported. +* `github.com/aws/aws-sdk-go-v2/service/networkmanager`: [v1.20.0](service/networkmanager/CHANGELOG.md#v1200-2023-10-23) + * **Feature**: This release adds API support for Tunnel-less Connect (NoEncap Protocol) for AWS Cloud WAN +* `github.com/aws/aws-sdk-go-v2/service/redshiftserverless`: [v1.8.0](service/redshiftserverless/CHANGELOG.md#v180-2023-10-23) + * **Feature**: This release adds support for customers to see the patch version and workgroup version in Amazon Redshift Serverless. +* `github.com/aws/aws-sdk-go-v2/service/rekognition`: [v1.32.0](service/rekognition/CHANGELOG.md#v1320-2023-10-23) + * **Feature**: Amazon Rekognition introduces StartMediaAnalysisJob, GetMediaAnalysisJob, and ListMediaAnalysisJobs operations to run a bulk analysis of images with a Detect Moderation model. + +# Release (2023-10-20) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appconfig`: [v1.22.0](service/appconfig/CHANGELOG.md#v1220-2023-10-20) + * **Feature**: Update KmsKeyIdentifier constraints to support AWS KMS multi-Region keys. +* `github.com/aws/aws-sdk-go-v2/service/appintegrations`: [v1.19.0](service/appintegrations/CHANGELOG.md#v1190-2023-10-20) + * **Feature**: Updated ScheduleConfig to be an optional input to CreateDataIntegration to support event driven downloading of files from sources such as Amazon s3 using Amazon Connect AppIntegrations. +* `github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice`: [v1.19.0](service/applicationdiscoveryservice/CHANGELOG.md#v1190-2023-10-20) + * **Feature**: This release introduces three new APIs: StartBatchDeleteConfigurationTask, DescribeBatchDeleteConfigurationTask, and BatchDeleteAgents. +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.70.0](service/connect/CHANGELOG.md#v1700-2023-10-20) + * **Feature**: This release adds support for updating phone number metadata, such as phone number description. +* `github.com/aws/aws-sdk-go-v2/service/medicalimaging`: [v1.2.3](service/medicalimaging/CHANGELOG.md#v123-2023-10-20) + * **Documentation**: Updates on documentation links +* `github.com/aws/aws-sdk-go-v2/service/ssm`: [v1.39.0](service/ssm/CHANGELOG.md#v1390-2023-10-20) + * **Feature**: This release introduces a new API: DeleteOpsItem. This allows deletion of an OpsItem. + +# Release (2023-10-19) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.126.0](service/ec2/CHANGELOG.md#v11260-2023-10-19) + * **Feature**: Amazon EC2 C7a instances, powered by 4th generation AMD EPYC processors, are ideal for high performance, compute-intensive workloads such as high performance computing. Amazon EC2 R7i instances are next-generation memory optimized and powered by custom 4th Generation Intel Xeon Scalable processors. +* `github.com/aws/aws-sdk-go-v2/service/managedblockchainquery`: [v1.3.0](service/managedblockchainquery/CHANGELOG.md#v130-2023-10-19) + * **Feature**: This release adds support for Ethereum Sepolia network +* `github.com/aws/aws-sdk-go-v2/service/neptunedata`: [v1.0.4](service/neptunedata/CHANGELOG.md#v104-2023-10-19) + * **Documentation**: Doc changes to add IAM action mappings for the data actions. +* `github.com/aws/aws-sdk-go-v2/service/omics`: [v1.11.0](service/omics/CHANGELOG.md#v1110-2023-10-19) + * **Feature**: This change enables customers to retrieve failure reasons with detailed status messages for their failed runs +* `github.com/aws/aws-sdk-go-v2/service/opensearch`: [v1.21.0](service/opensearch/CHANGELOG.md#v1210-2023-10-19) + * **Feature**: Added Cluster Administrative options for node restart, opensearch process restart and opensearch dashboard restart for Multi-AZ without standby domains +* `github.com/aws/aws-sdk-go-v2/service/quicksight`: [v1.46.0](service/quicksight/CHANGELOG.md#v1460-2023-10-19) + * **Feature**: This release adds the following: 1) Trino and Starburst Database Connectors 2) Custom total for tables and pivot tables 3) Enable restricted folders 4) Add rolling dates for time equality filters 5) Refine DataPathValue and introduce DataPathType 6) Add SeriesType to ReferenceLineDataConfiguration +* `github.com/aws/aws-sdk-go-v2/service/secretsmanager`: [v1.21.6](service/secretsmanager/CHANGELOG.md#v1216-2023-10-19) + * **Documentation**: Documentation updates for Secrets Manager +* `github.com/aws/aws-sdk-go-v2/service/servicecatalog`: [v1.22.0](service/servicecatalog/CHANGELOG.md#v1220-2023-10-19) + * **Feature**: Introduce support for EXTERNAL product and provisioning artifact type in CreateProduct and CreateProvisioningArtifact APIs. +* `github.com/aws/aws-sdk-go-v2/service/verifiedpermissions`: [v1.3.0](service/verifiedpermissions/CHANGELOG.md#v130-2023-10-19) + * **Feature**: Improving Amazon Verified Permissions Create experience +* `github.com/aws/aws-sdk-go-v2/service/workspaces`: [v1.31.3](service/workspaces/CHANGELOG.md#v1313-2023-10-19) + * **Documentation**: Documentation updates for WorkSpaces + +# Release (2023-10-18) + +## General Highlights +* **Feature**: Add handwritten paginators that were present in some services in the v1 SDK. +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cloud9`: [v1.18.11](service/cloud9/CHANGELOG.md#v11811-2023-10-18) + * **Documentation**: Update to imageId parameter behavior and dates updated. +* `github.com/aws/aws-sdk-go-v2/service/dynamodb`: [v1.23.0](service/dynamodb/CHANGELOG.md#v1230-2023-10-18) + * **Documentation**: Updating descriptions for several APIs. +* `github.com/aws/aws-sdk-go-v2/service/kendra`: [v1.44.0](service/kendra/CHANGELOG.md#v1440-2023-10-18) + * **Feature**: Changes for a new feature in Amazon Kendra's Query API to Collapse/Expand query results +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.57.0](service/rds/CHANGELOG.md#v1570-2023-10-18) + * **Feature**: This release adds support for upgrading the storage file system configuration on the DB instance using a blue/green deployment or a read replica. +* `github.com/aws/aws-sdk-go-v2/service/wisdom`: [v1.16.0](service/wisdom/CHANGELOG.md#v1160-2023-10-18) + * **Feature**: This release adds an max limit of 25 recommendation ids for NotifyRecommendationsReceived API. + +# Release (2023-10-17) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice`: [v1.18.0](service/applicationdiscoveryservice/CHANGELOG.md#v1180-2023-10-17) + * **Feature**: This release introduces three new APIs: StartBatchDeleteConfigurationTask, DescribeBatchDeleteConfigurationTask, and BatchDeleteAgents. +* `github.com/aws/aws-sdk-go-v2/service/codepipeline`: [v1.17.0](service/codepipeline/CHANGELOG.md#v1170-2023-10-17) + * **Feature**: Add retryMode ALL_ACTIONS to RetryStageExecution API that retries a failed stage starting from first action in the stage +* `github.com/aws/aws-sdk-go-v2/service/ecs`: [v1.30.4](service/ecs/CHANGELOG.md#v1304-2023-10-17) + * **Documentation**: Documentation only updates to address Amazon ECS tickets. +* `github.com/aws/aws-sdk-go-v2/service/guardduty`: [v1.29.0](service/guardduty/CHANGELOG.md#v1290-2023-10-17) + * **Feature**: Add domainWithSuffix finding field to dnsRequestAction +* `github.com/aws/aws-sdk-go-v2/service/kafka`: [v1.23.0](service/kafka/CHANGELOG.md#v1230-2023-10-17) + * **Feature**: AWS Managed Streaming for Kafka is launching MSK Replicator, a new feature that enables customers to reliably replicate data across Amazon MSK clusters in same or different AWS regions. You can now use SDK to create, list, describe, delete, update, and manage tags of MSK Replicators. +* `github.com/aws/aws-sdk-go-v2/service/route53recoverycluster`: [v1.14.0](service/route53recoverycluster/CHANGELOG.md#v1140-2023-10-17) + * **Feature**: Adds Owner field to ListRoutingControls API. +* `github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig`: [v1.14.0](service/route53recoverycontrolconfig/CHANGELOG.md#v1140-2023-10-17) + * **Feature**: Adds permissions for GetResourcePolicy to support returning details about AWS Resource Access Manager resource policies for shared resources. + +# Release (2023-10-16) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/config`: [v1.19.0](config/CHANGELOG.md#v1190-2023-10-16) + * **Feature**: Modify logic of retrieving user agent appID from env config +* `github.com/aws/aws-sdk-go-v2/feature/cloudfront/sign`: [v1.4.0](feature/cloudfront/sign/CHANGELOG.md#v140-2023-10-16) + * **Feature**: Add support for loading PKCS8-formatted private keys. +* `github.com/aws/aws-sdk-go-v2/service/cloudformation`: [v1.35.0](service/cloudformation/CHANGELOG.md#v1350-2023-10-16) + * **Feature**: SDK and documentation updates for UpdateReplacePolicy +* `github.com/aws/aws-sdk-go-v2/service/drs`: [v1.17.0](service/drs/CHANGELOG.md#v1170-2023-10-16) + * **Feature**: Updated exsiting API to allow AWS Elastic Disaster Recovery support of launching recovery into existing EC2 instances. +* `github.com/aws/aws-sdk-go-v2/service/entityresolution`: [v1.3.0](service/entityresolution/CHANGELOG.md#v130-2023-10-16) + * **Feature**: This launch expands our matching techniques to include provider-based matching to help customer match, link, and enhance records with minimal data movement. With data service providers, we have removed the need for customers to build bespoke integrations,. +* `github.com/aws/aws-sdk-go-v2/service/managedblockchainquery`: [v1.2.0](service/managedblockchainquery/CHANGELOG.md#v120-2023-10-16) + * **Feature**: This release introduces two new APIs: GetAssetContract and ListAssetContracts. This release also adds support for Bitcoin Testnet. +* `github.com/aws/aws-sdk-go-v2/service/mediapackagev2`: [v1.3.0](service/mediapackagev2/CHANGELOG.md#v130-2023-10-16) + * **Feature**: This release allows customers to manage MediaPackage v2 resource using CloudFormation. +* `github.com/aws/aws-sdk-go-v2/service/opensearch`: [v1.20.0](service/opensearch/CHANGELOG.md#v1200-2023-10-16) + * **Feature**: This release allows customers to list and associate optional plugin packages with compatible Amazon OpenSearch Service clusters for enhanced functionality. +* `github.com/aws/aws-sdk-go-v2/service/redshift`: [v1.30.0](service/redshift/CHANGELOG.md#v1300-2023-10-16) + * **Feature**: Added support for managing credentials of provisioned cluster admin using AWS Secrets Manager. +* `github.com/aws/aws-sdk-go-v2/service/redshiftserverless`: [v1.7.0](service/redshiftserverless/CHANGELOG.md#v170-2023-10-16) + * **Feature**: Added support for managing credentials of serverless namespace admin using AWS Secrets Manager. +* `github.com/aws/aws-sdk-go-v2/service/sesv2`: [v1.21.0](service/sesv2/CHANGELOG.md#v1210-2023-10-16) + * **Feature**: This release provides enhanced visibility into your SES identity verification status. This will offer you more actionable insights, enabling you to promptly address any verification-related issues. +* `github.com/aws/aws-sdk-go-v2/service/transfer`: [v1.34.2](service/transfer/CHANGELOG.md#v1342-2023-10-16) + * **Documentation**: Documentation updates for AWS Transfer Family +* `github.com/aws/aws-sdk-go-v2/service/xray`: [v1.19.0](service/xray/CHANGELOG.md#v1190-2023-10-16) + * **Feature**: This releases enhances GetTraceSummaries API to support new TimeRangeType Service to query trace summaries by segment end time. + +# Release (2023-10-12) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2`: v1.21.2 + * **Bug Fix**: Improve recognition of retryable DNS errors. +* `github.com/aws/aws-sdk-go-v2/config`: [v1.18.45](config/CHANGELOG.md#v11845-2023-10-12) + * **Bug Fix**: Fail to load config if an explicitly provided profile doesn't exist. +* `github.com/aws/aws-sdk-go-v2/service/auditmanager`: [v1.27.0](service/auditmanager/CHANGELOG.md#v1270-2023-10-12) + * **Feature**: This release introduces a new limit to the awsAccounts parameter. When you create or update an assessment, there is now a limit of 200 AWS accounts that can be specified in the assessment scope. +* `github.com/aws/aws-sdk-go-v2/service/autoscaling`: [v1.31.0](service/autoscaling/CHANGELOG.md#v1310-2023-10-12) + * **Feature**: Update the NotificationMetadata field to only allow visible ascii characters. Add paginators to DescribeInstanceRefreshes, DescribeLoadBalancers, and DescribeLoadBalancerTargetGroups +* `github.com/aws/aws-sdk-go-v2/service/configservice`: [v1.37.0](service/configservice/CHANGELOG.md#v1370-2023-10-12) + * **Feature**: Add enums for resource types supported by Config +* `github.com/aws/aws-sdk-go-v2/service/controltower`: [v1.4.0](service/controltower/CHANGELOG.md#v140-2023-10-12) + * **Feature**: Added new EnabledControl resource details to ListEnabledControls API and added new GetEnabledControl API. +* `github.com/aws/aws-sdk-go-v2/service/customerprofiles`: [v1.29.0](service/customerprofiles/CHANGELOG.md#v1290-2023-10-12) + * **Feature**: Adds sensitive trait to various shapes in Customer Profiles Calculated Attribute API model. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.125.0](service/ec2/CHANGELOG.md#v11250-2023-10-12) + * **Feature**: This release adds Ubuntu Pro as a supported platform for On-Demand Capacity Reservations and adds support for setting an Amazon Machine Image (AMI) to disabled state. Disabling the AMI makes it private if it was previously shared, and prevents new EC2 instance launches from it. +* `github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2`: [v1.21.6](service/elasticloadbalancingv2/CHANGELOG.md#v1216-2023-10-12) + * **Documentation**: This release enables routing policies with Availability Zone affinity for Network Load Balancers. +* `github.com/aws/aws-sdk-go-v2/service/glue`: [v1.63.0](service/glue/CHANGELOG.md#v1630-2023-10-12) + * **Feature**: Extending version control support to GitLab and Bitbucket from AWSGlue +* `github.com/aws/aws-sdk-go-v2/service/inspector2`: [v1.17.0](service/inspector2/CHANGELOG.md#v1170-2023-10-12) + * **Feature**: Add MacOs ec2 platform support +* `github.com/aws/aws-sdk-go-v2/service/ivsrealtime`: [v1.5.0](service/ivsrealtime/CHANGELOG.md#v150-2023-10-12) + * **Feature**: Update GetParticipant to return additional metadata. +* `github.com/aws/aws-sdk-go-v2/service/lambda`: [v1.40.0](service/lambda/CHANGELOG.md#v1400-2023-10-12) + * **Feature**: Adds support for Lambda functions to access Dual-Stack subnets over IPv6, via an opt-in flag in CreateFunction and UpdateFunctionConfiguration APIs +* `github.com/aws/aws-sdk-go-v2/service/location`: [v1.28.0](service/location/CHANGELOG.md#v1280-2023-10-12) + * **Feature**: This release adds endpoint updates for all AWS Location resource operations. +* `github.com/aws/aws-sdk-go-v2/service/machinelearning`: [v1.18.0](service/machinelearning/CHANGELOG.md#v1180-2023-10-12) + * **Feature**: This release marks Password field as sensitive +* `github.com/aws/aws-sdk-go-v2/service/pricing`: [v1.21.9](service/pricing/CHANGELOG.md#v1219-2023-10-12) + * **Documentation**: Documentation updates for Price List +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.56.0](service/rds/CHANGELOG.md#v1560-2023-10-12) + * **Feature**: This release adds support for adding a dedicated log volume to open-source RDS instances. +* `github.com/aws/aws-sdk-go-v2/service/rekognition`: [v1.31.0](service/rekognition/CHANGELOG.md#v1310-2023-10-12) + * **Feature**: Amazon Rekognition introduces support for Custom Moderation. This allows the enhancement of accuracy for detect moderation labels operations by creating custom adapters tuned on customer data. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.111.0](service/sagemaker/CHANGELOG.md#v11110-2023-10-12) + * **Feature**: Amazon SageMaker Canvas adds KendraSettings and DirectDeploySettings support for CanvasAppSettings +* `github.com/aws/aws-sdk-go-v2/service/textract`: [v1.25.0](service/textract/CHANGELOG.md#v1250-2023-10-12) + * **Feature**: This release adds 9 new APIs for adapter and adapter version management, 3 new APIs for tagging, and updates AnalyzeDocument and StartDocumentAnalysis API parameters for using adapters. +* `github.com/aws/aws-sdk-go-v2/service/transcribe`: [v1.29.0](service/transcribe/CHANGELOG.md#v1290-2023-10-12) + * **Feature**: This release is to enable m4a format to customers +* `github.com/aws/aws-sdk-go-v2/service/workspaces`: [v1.31.2](service/workspaces/CHANGELOG.md#v1312-2023-10-12) + * **Documentation**: Updated the CreateWorkspaces action documentation to clarify that the PCoIP protocol is only available for Windows bundles. + +# Release (2023-10-06) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.124.0](service/ec2/CHANGELOG.md#v11240-2023-10-06) + * **Feature**: Documentation updates for Elastic Compute Cloud (EC2). +* `github.com/aws/aws-sdk-go-v2/service/fsx`: [v1.33.0](service/fsx/CHANGELOG.md#v1330-2023-10-06) + * **Feature**: After performing steps to repair the Active Directory configuration of a file system, use this action to initiate the process of attempting to recover to the file system. +* `github.com/aws/aws-sdk-go-v2/service/marketplacecatalog`: [v1.18.0](service/marketplacecatalog/CHANGELOG.md#v1180-2023-10-06) + * **Feature**: This release adds support for Document type as an alternative for stringified JSON for StartChangeSet, DescribeChangeSet and DescribeEntity APIs +* `github.com/aws/aws-sdk-go-v2/service/quicksight`: [v1.45.0](service/quicksight/CHANGELOG.md#v1450-2023-10-06) + * **Feature**: NullOption in FilterListConfiguration; Dataset schema/table max length increased; Support total placement for pivot table visual; Lenient mode relaxes the validation to create resources with definition; Data sources can be added to folders; Redshift data sources support IAM Role-based authentication +* `github.com/aws/aws-sdk-go-v2/service/transfer`: [v1.34.0](service/transfer/CHANGELOG.md#v1340-2023-10-06) + * **Feature**: This release updates the max character limit of PreAuthenticationLoginBanner and PostAuthenticationLoginBanner to 4096 characters + +# Release (2023-10-05) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/omics`: [v1.10.0](service/omics/CHANGELOG.md#v1100-2023-10-05) + * **Feature**: Add Etag Support for Omics Storage in ListReadSets and GetReadSetMetadata API +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.55.1](service/rds/CHANGELOG.md#v1551-2023-10-05) + * **Documentation**: Updates Amazon RDS documentation for corrections and minor improvements. +* `github.com/aws/aws-sdk-go-v2/service/route53`: [v1.30.0](service/route53/CHANGELOG.md#v1300-2023-10-05) + * **Feature**: Add hostedzonetype filter to ListHostedZones API. +* `github.com/aws/aws-sdk-go-v2/service/securityhub`: [v1.37.0](service/securityhub/CHANGELOG.md#v1370-2023-10-05) + * **Feature**: Added new resource detail objects to ASFF, including resources for AwsEventsEventbus, AwsEventsEndpoint, AwsDmsEndpoint, AwsDmsReplicationTask, AwsDmsReplicationInstance, AwsRoute53HostedZone, and AwsMskCluster +* `github.com/aws/aws-sdk-go-v2/service/storagegateway`: [v1.21.0](service/storagegateway/CHANGELOG.md#v1210-2023-10-05) + * **Feature**: Add SoftwareVersion to response of DescribeGatewayInformation. +* `github.com/aws/aws-sdk-go-v2/service/workspaces`: [v1.31.0](service/workspaces/CHANGELOG.md#v1310-2023-10-05) + * **Feature**: This release introduces Manage applications. This feature allows users to manage their WorkSpaces applications by associating or disassociating their WorkSpaces with applications. The DescribeWorkspaces API will now additionally return OperatingSystemName in its responses. + +# Release (2023-10-04) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appconfig`: [v1.21.0](service/appconfig/CHANGELOG.md#v1210-2023-10-04) + * **Feature**: AWS AppConfig introduces KMS customer-managed key (CMK) encryption support for data saved to AppConfig's hosted configuration store. +* `github.com/aws/aws-sdk-go-v2/service/datazone`: [v1.0.0](service/datazone/CHANGELOG.md#v100-2023-10-04) + * **Release**: New AWS service client module + * **Feature**: Initial release of Amazon DataZone +* `github.com/aws/aws-sdk-go-v2/service/mediatailor`: [v1.28.0](service/mediatailor/CHANGELOG.md#v1280-2023-10-04) + * **Feature**: Updates DescribeVodSource to include a list of ad break opportunities in the response +* `github.com/aws/aws-sdk-go-v2/service/mgn`: [v1.21.0](service/mgn/CHANGELOG.md#v1210-2023-10-04) + * **Feature**: This release includes the following new APIs: ListConnectors, CreateConnector, UpdateConnector, DeleteConnector and UpdateSourceServer to support the source action framework feature. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.110.0](service/sagemaker/CHANGELOG.md#v11100-2023-10-04) + * **Feature**: Adding support for AdditionalS3DataSource, a data source used for training or inference that is in addition to the input dataset or model data. + +# Release (2023-10-03) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.69.0](service/connect/CHANGELOG.md#v1690-2023-10-03) + * **Feature**: GetMetricDataV2 API: Update to include new metrics CONTACTS_RESOLVED_IN_X , AVG_HOLD_TIME_ALL_CONTACTS , AVG_RESOLUTION_TIME , ABANDONMENT_RATE , AGENT_NON_RESPONSE_WITHOUT_CUSTOMER_ABANDONS with added features: Interval Period, TimeZone, Negate MetricFilters, Extended date time range. +* `github.com/aws/aws-sdk-go-v2/service/location`: [v1.27.0](service/location/CHANGELOG.md#v1270-2023-10-03) + * **Feature**: Amazon Location Service adds support for bounding polygon queries. Additionally, the GeofenceCount field has been added to the DescribeGeofenceCollection API response. +* `github.com/aws/aws-sdk-go-v2/service/mediaconvert`: [v1.43.0](service/mediaconvert/CHANGELOG.md#v1430-2023-10-03) + * **Feature**: This release adds the ability to replace video frames without modifying the audio essence. +* `github.com/aws/aws-sdk-go-v2/service/oam`: [v1.4.0](service/oam/CHANGELOG.md#v140-2023-10-03) + * **Feature**: This release adds support for sharing AWS::ApplicationInsights::Application resources. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.109.0](service/sagemaker/CHANGELOG.md#v11090-2023-10-03) + * **Feature**: This release allows users to run Selective Execution in SageMaker Pipelines without SourcePipelineExecutionArn if selected steps do not have any dependent steps. +* `github.com/aws/aws-sdk-go-v2/service/wellarchitected`: [v1.23.0](service/wellarchitected/CHANGELOG.md#v1230-2023-10-03) + * **Feature**: AWS Well-Architected now supports Review Templates that allows you to create templates with pre-filled answers for Well-Architected and Custom Lens best practices. + +# Release (2023-10-02) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/bedrock`: [v1.1.0](service/bedrock/CHANGELOG.md#v110-2023-10-02) + * **Feature**: Provisioned throughput feature with Amazon and third-party base models, and update validators for model identifier and taggable resource ARNs. +* `github.com/aws/aws-sdk-go-v2/service/bedrockruntime`: [v1.1.0](service/bedrockruntime/CHANGELOG.md#v110-2023-10-02) + * **Feature**: Add model timeout exception for InvokeModelWithResponseStream API and update validator for invoke model identifier. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.123.0](service/ec2/CHANGELOG.md#v11230-2023-10-02) + * **Feature**: Introducing Amazon EC2 R7iz instances with 3.9 GHz sustained all-core turbo frequency and deliver up to 20% better performance than previous generation z1d instances. +* `github.com/aws/aws-sdk-go-v2/service/managedblockchain`: [v1.16.6](service/managedblockchain/CHANGELOG.md#v1166-2023-10-02) + * **Documentation**: Remove Rinkeby as option from Ethereum APIs +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.55.0](service/rds/CHANGELOG.md#v1550-2023-10-02) + * **Feature**: Adds DefaultCertificateForNewLaunches field in the DescribeCertificates API response. +* `github.com/aws/aws-sdk-go-v2/service/sso`: [v1.15.0](service/sso/CHANGELOG.md#v1150-2023-10-02) + * **Feature**: Fix FIPS Endpoints in aws-us-gov. +* `github.com/aws/aws-sdk-go-v2/service/sts`: [v1.23.0](service/sts/CHANGELOG.md#v1230-2023-10-02) + * **Feature**: STS API updates for assumeRole +* `github.com/aws/aws-sdk-go-v2/service/transfer`: [v1.33.9](service/transfer/CHANGELOG.md#v1339-2023-10-02) + * **Documentation**: Documentation updates for AWS Transfer Family + +# Release (2023-09-28) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/bedrock`: [v1.0.0](service/bedrock/CHANGELOG.md#v100-2023-09-28) + * **Release**: New AWS service client module + * **Feature**: Model Invocation logging added to enable or disable logs in customer account. Model listing and description support added. Provisioned Throughput feature added. Custom model support added for creating custom models. Also includes list, and delete functions for custom model. +* `github.com/aws/aws-sdk-go-v2/service/bedrockruntime`: [v1.0.0](service/bedrockruntime/CHANGELOG.md#v100-2023-09-28) + * **Release**: New AWS service client module + * **Feature**: Run Inference: Added support to run the inference on models. Includes set of APIs for running inference in streaming and non-streaming mode. +* `github.com/aws/aws-sdk-go-v2/service/budgets`: [v1.17.0](service/budgets/CHANGELOG.md#v1170-2023-09-28) + * **Feature**: Update DescribeBudgets and DescribeBudgetNotificationsForAccount MaxResults limit to 1000. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.122.0](service/ec2/CHANGELOG.md#v11220-2023-09-28) + * **Feature**: Adds support for Customer Managed Key encryption for Amazon Verified Access resources +* `github.com/aws/aws-sdk-go-v2/service/iotfleetwise`: [v1.6.0](service/iotfleetwise/CHANGELOG.md#v160-2023-09-28) + * **Feature**: AWS IoT FleetWise now supports encryption through a customer managed AWS KMS key. The PutEncryptionConfiguration and GetEncryptionConfiguration APIs were added. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.108.0](service/sagemaker/CHANGELOG.md#v11080-2023-09-28) + * **Feature**: Online store feature groups supports Standard and InMemory tier storage types for low latency storage for real-time data retrieval. The InMemory tier supports collection types List, Set, and Vector. +* `github.com/aws/aws-sdk-go-v2/service/sagemakerfeaturestoreruntime`: [v1.18.0](service/sagemakerfeaturestoreruntime/CHANGELOG.md#v1180-2023-09-28) + * **Feature**: Feature Store supports read/write of records with collection type features. +* `github.com/aws/aws-sdk-go-v2/service/wafv2`: [v1.39.1](service/wafv2/CHANGELOG.md#v1391-2023-09-28) + * **Documentation**: Correct and improve the documentation for the FieldToMatch option JA3 fingerprint. + +# Release (2023-09-27) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider`: [v1.27.0](service/cognitoidentityprovider/CHANGELOG.md#v1270-2023-09-27) + * **Feature**: The UserPoolType Status field is no longer used. +* `github.com/aws/aws-sdk-go-v2/service/firehose`: [v1.19.0](service/firehose/CHANGELOG.md#v1190-2023-09-27) + * **Feature**: Features : Adding support for new data ingestion source to Kinesis Firehose - AWS Managed Services Kafka. +* `github.com/aws/aws-sdk-go-v2/service/iot`: [v1.40.0](service/iot/CHANGELOG.md#v1400-2023-09-27) + * **Feature**: Added support for IoT Rules Engine Kafka Action Headers +* `github.com/aws/aws-sdk-go-v2/service/textract`: [v1.24.0](service/textract/CHANGELOG.md#v1240-2023-09-27) + * **Feature**: This release adds new feature - Layout to Analyze Document API which can automatically extract layout elements such as titles, paragraphs, headers, section headers, lists, page numbers, footers, table areas, key-value areas and figure areas and order the elements as a human would read. + +# Release (2023-09-26) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appintegrations`: [v1.18.0](service/appintegrations/CHANGELOG.md#v1180-2023-09-26) + * **Feature**: The Amazon AppIntegrations service adds a set of APIs (in preview) to manage third party applications to be used in Amazon Connect agent workspace. +* `github.com/aws/aws-sdk-go-v2/service/apprunner`: [v1.21.0](service/apprunner/CHANGELOG.md#v1210-2023-09-26) + * **Feature**: This release allows an App Runner customer to specify a custom source directory to run the build & start command. This change allows App Runner to support monorepo based repositories +* `github.com/aws/aws-sdk-go-v2/service/codedeploy`: [v1.18.1](service/codedeploy/CHANGELOG.md#v1181-2023-09-26) + * **Documentation**: CodeDeploy now supports In-place and Blue/Green EC2 deployments with multiple Classic Load Balancers and multiple Target Groups. +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.68.0](service/connect/CHANGELOG.md#v1680-2023-09-26) + * **Feature**: This release updates a set of Amazon Connect APIs that provides the ability to integrate third party applications in the Amazon Connect agent workspace. +* `github.com/aws/aws-sdk-go-v2/service/dynamodb`: [v1.22.0](service/dynamodb/CHANGELOG.md#v1220-2023-09-26) + * **Feature**: Amazon DynamoDB now supports Incremental Export as an enhancement to the existing Export Table +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.121.0](service/ec2/CHANGELOG.md#v11210-2023-09-26) + * **Feature**: The release includes AWS verified access to support FIPs compliance in North America regions +* `github.com/aws/aws-sdk-go-v2/service/lakeformation`: [v1.24.0](service/lakeformation/CHANGELOG.md#v1240-2023-09-26) + * **Feature**: This release adds three new API support "CreateLakeFormationOptIn", "DeleteLakeFormationOptIn" and "ListLakeFormationOptIns", and also updates the corresponding documentation. +* `github.com/aws/aws-sdk-go-v2/service/pinpoint`: [v1.22.6](service/pinpoint/CHANGELOG.md#v1226-2023-09-26) + * **Documentation**: Update documentation for RemoveAttributes to more accurately reflect its behavior when attributes are deleted. +* `github.com/aws/aws-sdk-go-v2/service/s3`: [v1.40.0](service/s3/CHANGELOG.md#v1400-2023-09-26) + * **Feature**: This release adds a new field COMPLETED to the ReplicationStatus Enum. You can now use this field to validate the replication status of S3 objects using the AWS SDK. + +# Release (2023-09-25) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/amplifyuibuilder`: [v1.13.0](service/amplifyuibuilder/CHANGELOG.md#v1130-2023-09-25) + * **Feature**: Support for generating code that is compatible with future versions of amplify project dependencies. +* `github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines`: [v1.9.0](service/chimesdkmediapipelines/CHANGELOG.md#v190-2023-09-25) + * **Feature**: Adds support for sending WebRTC audio to Amazon Kineses Video Streams. +* `github.com/aws/aws-sdk-go-v2/service/emrserverless`: [v1.11.0](service/emrserverless/CHANGELOG.md#v1110-2023-09-25) + * **Feature**: This release adds support for application-wide default job configurations. +* `github.com/aws/aws-sdk-go-v2/service/finspacedata`: [v1.17.0](service/finspacedata/CHANGELOG.md#v1170-2023-09-25) + * **Feature**: Adding sensitive trait to attributes. Change max SessionDuration from 720 to 60. Correct "ApiAccess" attribute to "apiAccess" to maintain consistency between APIs. +* `github.com/aws/aws-sdk-go-v2/service/quicksight`: [v1.44.0](service/quicksight/CHANGELOG.md#v1440-2023-09-25) + * **Feature**: Added ability to tag users upon creation. +* `github.com/aws/aws-sdk-go-v2/service/ssm`: [v1.38.0](service/ssm/CHANGELOG.md#v1380-2023-09-25) + * **Feature**: This release updates the enum values for ResourceType in SSM DescribeInstanceInformation input and ConnectionStatus in GetConnectionStatus output. +* `github.com/aws/aws-sdk-go-v2/service/wafv2`: [v1.39.0](service/wafv2/CHANGELOG.md#v1390-2023-09-25) + * **Feature**: You can now perform an exact match against the web request's JA3 fingerprint. + +# Release (2023-09-22) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/config`: [v1.18.42](config/CHANGELOG.md#v11842-2023-09-22) + * **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. + * **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. +* `github.com/aws/aws-sdk-go-v2/internal/ini`: [v1.3.43](internal/ini/CHANGELOG.md#v1343-2023-09-22) + * **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. + * **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. +* `github.com/aws/aws-sdk-go-v2/service/braket`: [v1.20.0](service/braket/CHANGELOG.md#v1200-2023-09-22) + * **Feature**: This release adds support to view the device queue depth (the number of queued quantum tasks and hybrid jobs on a device) and queue position for a quantum task and hybrid job. +* `github.com/aws/aws-sdk-go-v2/service/cloudwatchevents`: [v1.18.0](service/cloudwatchevents/CHANGELOG.md#v1180-2023-09-22) + * **Feature**: Adds sensitive trait to various shapes in Jetstream Connections API model. +* `github.com/aws/aws-sdk-go-v2/service/databasemigrationservice`: [v1.31.0](service/databasemigrationservice/CHANGELOG.md#v1310-2023-09-22) + * **Feature**: new vendors for DMS CSF: MongoDB, MariaDB, DocumentDb and Redshift +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.120.0](service/ec2/CHANGELOG.md#v11200-2023-09-22) + * **Feature**: EC2 M2 Pro Mac instances are powered by Apple M2 Pro Mac Mini computers featuring 12 core CPU, 19 core GPU, 32 GiB of memory, and 16 core Apple Neural Engine and uniquely enabled by the AWS Nitro System through high-speed Thunderbolt connections. +* `github.com/aws/aws-sdk-go-v2/service/efs`: [v1.21.7](service/efs/CHANGELOG.md#v1217-2023-09-22) + * **Documentation**: Documentation updates for Elastic File System +* `github.com/aws/aws-sdk-go-v2/service/guardduty`: [v1.28.0](service/guardduty/CHANGELOG.md#v1280-2023-09-22) + * **Feature**: Add `EKS_CLUSTER_NAME` to filter and sort key. +* `github.com/aws/aws-sdk-go-v2/service/mediaconvert`: [v1.42.0](service/mediaconvert/CHANGELOG.md#v1420-2023-09-22) + * **Feature**: This release supports the creation of of audio-only tracks in CMAF output groups. + +# Release (2023-09-20) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appconfig`: [v1.20.0](service/appconfig/CHANGELOG.md#v1200-2023-09-20) + * **Feature**: Enabling boto3 paginators for list APIs and adding documentation around ServiceQuotaExceededException errors +* `github.com/aws/aws-sdk-go-v2/service/apprunner`: [v1.20.0](service/apprunner/CHANGELOG.md#v1200-2023-09-20) + * **Feature**: This release adds improvements for managing App Runner auto scaling configuration resources. New APIs: UpdateDefaultAutoScalingConfiguration and ListServicesForAutoScalingConfiguration. Updated API: DeleteAutoScalingConfiguration. +* `github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs`: [v1.24.0](service/cloudwatchlogs/CHANGELOG.md#v1240-2023-09-20) + * **Feature**: Add ClientToken to QueryDefinition CFN Handler in CWL +* `github.com/aws/aws-sdk-go-v2/service/codeartifact`: [v1.20.0](service/codeartifact/CHANGELOG.md#v1200-2023-09-20) + * **Feature**: Add support for the Swift package format. +* `github.com/aws/aws-sdk-go-v2/service/kinesisvideo`: [v1.18.4](service/kinesisvideo/CHANGELOG.md#v1184-2023-09-20) + * **Documentation**: Updated DescribeMediaStorageConfiguration, StartEdgeConfigurationUpdate, ImageGenerationConfiguration$SamplingInterval, and UpdateMediaStorageConfiguration to match AWS Docs. +* `github.com/aws/aws-sdk-go-v2/service/s3`: [v1.39.0](service/s3/CHANGELOG.md#v1390-2023-09-20) + * **Feature**: Fix an issue where the SDK can fail to unmarshall response due to NumberFormatException +* `github.com/aws/aws-sdk-go-v2/service/servicediscovery`: [v1.24.0](service/servicediscovery/CHANGELOG.md#v1240-2023-09-20) + * **Feature**: Adds a new DiscoverInstancesRevision API and also adds InstanceRevision field to the DiscoverInstances API response. +* `github.com/aws/aws-sdk-go-v2/service/ssooidc`: [v1.17.0](service/ssooidc/CHANGELOG.md#v1170-2023-09-20) + * **Feature**: Update FIPS endpoints in aws-us-gov. + +# Release (2023-09-19) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.119.0](service/ec2/CHANGELOG.md#v11190-2023-09-19) + * **Feature**: This release adds support for C7i, and R7a instance types. +* `github.com/aws/aws-sdk-go-v2/service/outposts`: [v1.30.0](service/outposts/CHANGELOG.md#v1300-2023-09-19) + * **Feature**: This release adds the InstanceFamilies field to the ListAssets response. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.107.0](service/sagemaker/CHANGELOG.md#v11070-2023-09-19) + * **Feature**: This release adds support for one-time model monitoring schedules that are executed immediately without delay, explicit data analysis windows for model monitoring schedules and exclude features attributes to remove features from model monitor analysis. + +# Release (2023-09-18) + +## General Highlights +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/accessanalyzer`: [v1.21.0](service/accessanalyzer/CHANGELOG.md#v1210-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/acm`: [v1.19.0](service/acm/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/amplify`: [v1.15.0](service/amplify/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/apigatewaymanagementapi`: [v1.13.0](service/apigatewaymanagementapi/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/appconfig`: [v1.19.0](service/appconfig/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/appconfigdata`: [v1.8.0](service/appconfigdata/CHANGELOG.md#v180-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/appfabric`: [v1.2.0](service/appfabric/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/appintegrations`: [v1.17.0](service/appintegrations/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/applicationcostprofiler`: [v1.12.0](service/applicationcostprofiler/CHANGELOG.md#v1120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/appmesh`: [v1.19.0](service/appmesh/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/arczonalshift`: [v1.3.0](service/arczonalshift/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/autoscalingplans`: [v1.15.0](service/autoscalingplans/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/backupgateway`: [v1.11.0](service/backupgateway/CHANGELOG.md#v1110-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/backupstorage`: [v1.3.0](service/backupstorage/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/braket`: [v1.19.0](service/braket/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/chimesdkvoice`: [v1.9.0](service/chimesdkvoice/CHANGELOG.md#v190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/clouddirectory`: [v1.15.0](service/clouddirectory/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/cloudhsmv2`: [v1.16.0](service/cloudhsmv2/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/cloudsearch`: [v1.16.0](service/cloudsearch/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/cloudsearchdomain`: [v1.14.0](service/cloudsearchdomain/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/cloudtraildata`: [v1.2.0](service/cloudtraildata/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codebuild`: [v1.22.0](service/codebuild/CHANGELOG.md#v1220-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codedeploy`: [v1.18.0](service/codedeploy/CHANGELOG.md#v1180-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codeguruprofiler`: [v1.15.0](service/codeguruprofiler/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codegurureviewer`: [v1.19.0](service/codegurureviewer/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codegurusecurity`: [v1.2.0](service/codegurusecurity/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codestar`: [v1.15.0](service/codestar/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/codestarnotifications`: [v1.16.0](service/codestarnotifications/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/cognitoidentity`: [v1.17.0](service/cognitoidentity/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/cognitosync`: [v1.14.0](service/cognitosync/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/connectcases`: [v1.7.0](service/connectcases/CHANGELOG.md#v170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/connectcontactlens`: [v1.15.0](service/connectcontactlens/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/controltower`: [v1.3.0](service/controltower/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/databrew`: [v1.23.0](service/databrew/CHANGELOG.md#v1230-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/dataexchange`: [v1.21.0](service/dataexchange/CHANGELOG.md#v1210-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/datapipeline`: [v1.16.0](service/datapipeline/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/dax`: [v1.14.0](service/dax/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/devicefarm`: [v1.17.0](service/devicefarm/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/docdbelastic`: [v1.3.0](service/docdbelastic/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ec2instanceconnect`: [v1.17.0](service/ec2instanceconnect/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ecrpublic`: [v1.18.0](service/ecrpublic/CHANGELOG.md#v1180-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk`: [v1.17.0](service/elasticbeanstalk/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing`: [v1.17.0](service/elasticloadbalancing/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/elastictranscoder`: [v1.16.0](service/elastictranscoder/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/evidently`: [v1.13.0](service/evidently/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/finspacedata`: [v1.16.0](service/finspacedata/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/fis`: [v1.16.0](service/fis/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/forecast`: [v1.27.0](service/forecast/CHANGELOG.md#v1270-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/forecastquery`: [v1.15.0](service/forecastquery/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/gamesparks`: [v1.4.0](service/gamesparks/CHANGELOG.md#v140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/glacier`: [v1.16.0](service/glacier/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/greengrass`: [v1.17.0](service/greengrass/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/greengrassv2`: [v1.24.0](service/greengrassv2/CHANGELOG.md#v1240-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/honeycode`: [v1.15.0](service/honeycode/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/inspector`: [v1.15.0](service/inspector/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice`: [v1.13.0](service/iot1clickdevicesservice/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iot1clickprojects`: [v1.14.0](service/iot1clickprojects/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotanalytics`: [v1.16.0](service/iotanalytics/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotevents`: [v1.17.0](service/iotevents/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ioteventsdata`: [v1.15.0](service/ioteventsdata/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotfleethub`: [v1.15.0](service/iotfleethub/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotjobsdataplane`: [v1.14.0](service/iotjobsdataplane/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotroborunner`: [v1.3.0](service/iotroborunner/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotsecuretunneling`: [v1.17.0](service/iotsecuretunneling/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/iotthingsgraph`: [v1.16.0](service/iotthingsgraph/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ivschat`: [v1.6.0](service/ivschat/CHANGELOG.md#v160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kendraranking`: [v1.2.0](service/kendraranking/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kinesis`: [v1.19.0](service/kinesis/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kinesisanalytics`: [v1.16.0](service/kinesisanalytics/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kinesisvideoarchivedmedia`: [v1.17.0](service/kinesisvideoarchivedmedia/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kinesisvideomedia`: [v1.13.0](service/kinesisvideomedia/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kinesisvideosignaling`: [v1.13.0](service/kinesisvideosignaling/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/kinesisvideowebrtcstorage`: [v1.4.0](service/kinesisvideowebrtcstorage/CHANGELOG.md#v140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice`: [v1.19.0](service/lexmodelbuildingservice/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/lexruntimeservice`: [v1.15.0](service/lexruntimeservice/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/lexruntimev2`: [v1.19.0](service/lexruntimev2/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/licensemanager`: [v1.20.0](service/licensemanager/CHANGELOG.md#v1200-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/licensemanagerlinuxsubscriptions`: [v1.3.0](service/licensemanagerlinuxsubscriptions/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/licensemanagerusersubscriptions`: [v1.4.0](service/licensemanagerusersubscriptions/CHANGELOG.md#v140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/lookoutmetrics`: [v1.21.0](service/lookoutmetrics/CHANGELOG.md#v1210-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/lookoutvision`: [v1.17.0](service/lookoutvision/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/machinelearning`: [v1.17.0](service/machinelearning/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/macie`: [v1.17.0](service/macie/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/macie2`: [v1.29.7](service/macie2/CHANGELOG.md#v1297-2023-09-18) + * **Documentation**: This release changes the default managedDataIdentifierSelector setting for new classification jobs to RECOMMENDED. By default, new classification jobs now use the recommended set of managed data identifiers. +* `github.com/aws/aws-sdk-go-v2/service/marketplacecommerceanalytics`: [v1.14.0](service/marketplacecommerceanalytics/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/marketplaceentitlementservice`: [v1.14.0](service/marketplaceentitlementservice/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/marketplacemetering`: [v1.16.0](service/marketplacemetering/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/mediapackagev2`: [v1.2.0](service/mediapackagev2/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/mediapackagevod`: [v1.24.0](service/mediapackagevod/CHANGELOG.md#v1240-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/mediastore`: [v1.15.0](service/mediastore/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/mediastoredata`: [v1.15.0](service/mediastoredata/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/medicalimaging`: [v1.2.0](service/medicalimaging/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/migrationhub`: [v1.15.0](service/migrationhub/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/migrationhubconfig`: [v1.15.0](service/migrationhubconfig/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/migrationhuborchestrator`: [v1.3.0](service/migrationhuborchestrator/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/migrationhubstrategy`: [v1.11.0](service/migrationhubstrategy/CHANGELOG.md#v1110-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/mobile`: [v1.14.0](service/mobile/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/mturk`: [v1.16.0](service/mturk/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/neptune`: [v1.22.0](service/neptune/CHANGELOG.md#v1220-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/networkmanager`: [v1.19.0](service/networkmanager/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/nimble`: [v1.18.0](service/nimble/CHANGELOG.md#v1180-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/oam`: [v1.3.0](service/oam/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/opensearchserverless`: [v1.5.0](service/opensearchserverless/CHANGELOG.md#v150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/opsworks`: [v1.16.0](service/opsworks/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/opsworkscm`: [v1.17.0](service/opsworkscm/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/osis`: [v1.2.0](service/osis/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/panorama`: [v1.13.0](service/panorama/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/paymentcryptography`: [v1.2.0](service/paymentcryptography/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/personalizeevents`: [v1.15.0](service/personalizeevents/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/personalizeruntime`: [v1.15.0](service/personalizeruntime/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/pinpointemail`: [v1.14.0](service/pinpointemail/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoice`: [v1.13.0](service/pinpointsmsvoice/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/pinpointsmsvoicev2`: [v1.3.0](service/pinpointsmsvoicev2/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/pipes`: [v1.4.0](service/pipes/CHANGELOG.md#v140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/qldbsession`: [v1.16.0](service/qldbsession/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/rbin`: [v1.10.0](service/rbin/CHANGELOG.md#v1100-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/rdsdata`: [v1.15.0](service/rdsdata/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/redshiftserverless`: [v1.6.0](service/redshiftserverless/CHANGELOG.md#v160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/resourceexplorer2`: [v1.4.0](service/resourceexplorer2/CHANGELOG.md#v140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/resourcegroups`: [v1.16.0](service/resourcegroups/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi`: [v1.16.0](service/resourcegroupstaggingapi/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/robomaker`: [v1.20.0](service/robomaker/CHANGELOG.md#v1200-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/route53recoverycluster`: [v1.13.0](service/route53recoverycluster/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/route53recoverycontrolconfig`: [v1.13.0](service/route53recoverycontrolconfig/CHANGELOG.md#v1130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/route53recoveryreadiness`: [v1.11.0](service/route53recoveryreadiness/CHANGELOG.md#v1110-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/route53resolver`: [v1.20.0](service/route53resolver/CHANGELOG.md#v1200-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/rum`: [v1.12.0](service/rum/CHANGELOG.md#v1120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/s3outposts`: [v1.18.0](service/s3outposts/CHANGELOG.md#v1180-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sagemakera2iruntime`: [v1.17.0](service/sagemakera2iruntime/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sagemakeredge`: [v1.15.0](service/sagemakeredge/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sagemakergeospatial`: [v1.5.0](service/sagemakergeospatial/CHANGELOG.md#v150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sagemakermetrics`: [v1.2.0](service/sagemakermetrics/CHANGELOG.md#v120-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/scheduler`: [v1.3.0](service/scheduler/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/schemas`: [v1.17.0](service/schemas/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository`: [v1.14.0](service/serverlessapplicationrepository/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/servicecatalogappregistry`: [v1.19.0](service/servicecatalogappregistry/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/servicediscovery`: [v1.23.0](service/servicediscovery/CHANGELOG.md#v1230-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/shield`: [v1.20.0](service/shield/CHANGELOG.md#v1200-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sms`: [v1.15.0](service/sms/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/snowdevicemanagement`: [v1.11.0](service/snowdevicemanagement/CHANGELOG.md#v1110-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sns`: [v1.22.0](service/sns/CHANGELOG.md#v1220-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ssmcontacts`: [v1.17.0](service/ssmcontacts/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ssmincidents`: [v1.23.0](service/ssmincidents/CHANGELOG.md#v1230-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ssmsap`: [v1.5.0](service/ssmsap/CHANGELOG.md#v150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sso`: [v1.14.0](service/sso/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/ssooidc`: [v1.16.0](service/ssooidc/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/storagegateway`: [v1.20.0](service/storagegateway/CHANGELOG.md#v1200-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/sts`: [v1.22.0](service/sts/CHANGELOG.md#v1220-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/supportapp`: [v1.4.0](service/supportapp/CHANGELOG.md#v140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/synthetics`: [v1.19.0](service/synthetics/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/textract`: [v1.23.0](service/textract/CHANGELOG.md#v1230-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/timestreamquery`: [v1.17.0](service/timestreamquery/CHANGELOG.md#v1170-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/timestreamwrite`: [v1.19.0](service/timestreamwrite/CHANGELOG.md#v1190-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/tnb`: [v1.3.0](service/tnb/CHANGELOG.md#v130-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/transcribestreaming`: [v1.11.0](service/transcribestreaming/CHANGELOG.md#v1110-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/voiceid`: [v1.15.0](service/voiceid/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/waf`: [v1.14.0](service/waf/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/wafregional`: [v1.15.0](service/wafregional/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/workdocs`: [v1.16.0](service/workdocs/CHANGELOG.md#v1160-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/worklink`: [v1.15.0](service/worklink/CHANGELOG.md#v1150-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* `github.com/aws/aws-sdk-go-v2/service/workmail`: [v1.20.0](service/workmail/CHANGELOG.md#v1200-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. + * **Feature**: This release includes four new APIs UpdateUser, UpdateGroup, ListGroupsForEntity and DescribeEntity, along with RemoteUsers and some enhancements to existing APIs. +* `github.com/aws/aws-sdk-go-v2/service/workmailmessageflow`: [v1.14.0](service/workmailmessageflow/CHANGELOG.md#v1140-2023-09-18) + * **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. + +# Release (2023-09-15) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appstream`: [v1.24.0](service/appstream/CHANGELOG.md#v1240-2023-09-15) + * **Feature**: This release introduces app block builder, allowing customers to provision a resource to package applications into an app block +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.67.0](service/connect/CHANGELOG.md#v1670-2023-09-15) + * **Feature**: New rule type (OnMetricDataUpdate) has been added +* `github.com/aws/aws-sdk-go-v2/service/datasync`: [v1.29.1](service/datasync/CHANGELOG.md#v1291-2023-09-15) + * **Documentation**: Documentation-only updates for AWS DataSync. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.106.0](service/sagemaker/CHANGELOG.md#v11060-2023-09-15) + * **Feature**: This release introduces Skip Model Validation for Model Packages + +# Release (2023-09-14) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appstream`: [v1.23.0](service/appstream/CHANGELOG.md#v1230-2023-09-14) + * **Feature**: This release introduces multi-session fleets, allowing customers to provision more than one user session on a single fleet instance. +* `github.com/aws/aws-sdk-go-v2/service/cloudformation`: [v1.34.6](service/cloudformation/CHANGELOG.md#v1346-2023-09-14) + * **Documentation**: Documentation updates for AWS CloudFormation +* `github.com/aws/aws-sdk-go-v2/service/entityresolution`: [v1.2.0](service/entityresolution/CHANGELOG.md#v120-2023-09-14) + * **Feature**: Changed "ResolutionTechniques" and "MappedInputFields" in workflow and schema mapping operations to be required fields. +* `github.com/aws/aws-sdk-go-v2/service/lookoutequipment`: [v1.19.0](service/lookoutequipment/CHANGELOG.md#v1190-2023-09-14) + * **Feature**: This release adds APIs for the new scheduled retraining feature. + +# Release (2023-09-13) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cloud9`: [v1.18.8](service/cloud9/CHANGELOG.md#v1188-2023-09-13) + * **Documentation**: Update to include information on Ubuntu 18 deprecation. +* `github.com/aws/aws-sdk-go-v2/service/drs`: [v1.16.0](service/drs/CHANGELOG.md#v1160-2023-09-13) + * **Feature**: Updated existing APIs and added new ones to support using AWS Elastic Disaster Recovery post-launch actions. Added support for new regions. +* `github.com/aws/aws-sdk-go-v2/service/firehose`: [v1.18.0](service/firehose/CHANGELOG.md#v1180-2023-09-13) + * **Feature**: DocumentIdOptions has been added for the Amazon OpenSearch destination. +* `github.com/aws/aws-sdk-go-v2/service/guardduty`: [v1.27.0](service/guardduty/CHANGELOG.md#v1270-2023-09-13) + * **Feature**: Add `managementType` field to ListCoverage API response. +* `github.com/aws/aws-sdk-go-v2/service/internetmonitor`: [v1.6.0](service/internetmonitor/CHANGELOG.md#v160-2023-09-13) + * **Feature**: This release updates the Amazon CloudWatch Internet Monitor API domain name. +* `github.com/aws/aws-sdk-go-v2/service/ivsrealtime`: [v1.4.4](service/ivsrealtime/CHANGELOG.md#v144-2023-09-13) + * **Documentation**: Doc only update that changes description for ParticipantToken. +* `github.com/aws/aws-sdk-go-v2/service/simspaceweaver`: [v1.5.1](service/simspaceweaver/CHANGELOG.md#v151-2023-09-13) + * **Documentation**: Edited the introductory text for the API reference. +* `github.com/aws/aws-sdk-go-v2/service/xray`: [v1.18.0](service/xray/CHANGELOG.md#v1180-2023-09-13) + * **Feature**: Add StartTime field in GetTraceSummaries API response for each TraceSummary. + +# Release (2023-09-12) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.118.0](service/ec2/CHANGELOG.md#v11180-2023-09-12) + * **Feature**: This release adds support for restricting public sharing of AMIs through AMI Block Public Access +* `github.com/aws/aws-sdk-go-v2/service/eventbridge`: [v1.22.0](service/eventbridge/CHANGELOG.md#v1220-2023-09-12) + * **Feature**: Adds sensitive trait to various shapes in Jetstream Connections API model. +* `github.com/aws/aws-sdk-go-v2/service/kendra`: [v1.43.0](service/kendra/CHANGELOG.md#v1430-2023-09-12) + * **Feature**: Amazon Kendra now supports confidence score buckets for retrieved passage results using the Retrieve API. + +# Release (2023-09-11) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/ecr`: [v1.20.0](service/ecr/CHANGELOG.md#v1200-2023-09-11) + * **Feature**: This release will have ValidationException be thrown from ECR LifecyclePolicy APIs in regions LifecyclePolicy is not supported, this includes existing Amazon Dedicated Cloud (ADC) regions. This release will also change Tag: TagValue and Tag: TagKey to required. +* `github.com/aws/aws-sdk-go-v2/service/medialive`: [v1.37.0](service/medialive/CHANGELOG.md#v1370-2023-09-11) + * **Feature**: AWS Elemental Link now supports attaching a Link UHD device to a MediaConnect flow. +* `github.com/aws/aws-sdk-go-v2/service/quicksight`: [v1.43.0](service/quicksight/CHANGELOG.md#v1430-2023-09-11) + * **Feature**: This release launches new updates to QuickSight KPI visuals - support for sparklines, new templated layout and new targets for conditional formatting rules. + +# Release (2023-09-08) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/fsx`: [v1.32.6](service/fsx/CHANGELOG.md#v1326-2023-09-08) + * **Documentation**: Amazon FSx documentation fixes +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.105.0](service/sagemaker/CHANGELOG.md#v11050-2023-09-08) + * **Feature**: Autopilot APIs will now support holiday featurization for Timeseries models. The models will now hold holiday metadata and should be able to accommodate holiday effect during inference. +* `github.com/aws/aws-sdk-go-v2/service/ssoadmin`: [v1.18.0](service/ssoadmin/CHANGELOG.md#v1180-2023-09-08) + * **Feature**: Content updates to IAM Identity Center API for China Regions. +* `github.com/aws/aws-sdk-go-v2/service/workspaces`: [v1.30.0](service/workspaces/CHANGELOG.md#v1300-2023-09-08) + * **Feature**: A new field "ErrorDetails" will be added to the output of "DescribeWorkspaceImages" API call. This field provides in-depth details about the error occurred during image import process. These details include the possible causes of the errors and troubleshooting information. + +# Release (2023-09-07) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/securityhub`: [v1.36.2](service/securityhub/CHANGELOG.md#v1362-2023-09-07) + * **Documentation**: Documentation updates for AWS Security Hub +* `github.com/aws/aws-sdk-go-v2/service/simspaceweaver`: [v1.5.0](service/simspaceweaver/CHANGELOG.md#v150-2023-09-07) + * **Feature**: BucketName and ObjectKey are now required for the S3Location data type. BucketName is now required for the S3Destination data type. + +# Release (2023-09-06) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appflow`: [v1.35.0](service/appflow/CHANGELOG.md#v1350-2023-09-06) + * **Feature**: Adding OAuth2.0 support for servicenow connector. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.117.0](service/ec2/CHANGELOG.md#v11170-2023-09-06) + * **Feature**: This release adds 'outpost' location type to the DescribeInstanceTypeOfferings API, allowing customers that have been allowlisted for outpost to query their offerings in the API. +* `github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2`: [v1.21.4](service/elasticloadbalancingv2/CHANGELOG.md#v1214-2023-09-06) + * **Documentation**: This release enables default UDP connection termination and disabling unhealthy target connection termination for Network Load Balancers. +* `github.com/aws/aws-sdk-go-v2/service/medialive`: [v1.36.0](service/medialive/CHANGELOG.md#v1360-2023-09-06) + * **Feature**: Adds advanced Output Locking options for Epoch Locking: Custom Epoch and Jam Sync Time +* `github.com/aws/aws-sdk-go-v2/service/wafv2`: [v1.38.0](service/wafv2/CHANGELOG.md#v1380-2023-09-06) + * **Feature**: The targeted protection level of the Bot Control managed rule group now provides optional, machine-learning analysis of traffic statistics to detect some bot-related activity. You can enable or disable the machine learning functionality through the API. + +# Release (2023-09-05) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/billingconductor`: [v1.9.0](service/billingconductor/CHANGELOG.md#v190-2023-09-05) + * **Feature**: This release adds support for line item filtering in for the custom line item resource. +* `github.com/aws/aws-sdk-go-v2/service/cloud9`: [v1.18.7](service/cloud9/CHANGELOG.md#v1187-2023-09-05) + * **Documentation**: Added support for Ubuntu 22.04 that was not picked up in a previous Trebuchet request. Doc-only update. +* `github.com/aws/aws-sdk-go-v2/service/computeoptimizer`: [v1.27.0](service/computeoptimizer/CHANGELOG.md#v1270-2023-09-05) + * **Feature**: This release adds support to provide recommendations for G4dn and P3 instances that use NVIDIA GPUs. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.116.0](service/ec2/CHANGELOG.md#v11160-2023-09-05) + * **Feature**: Introducing Amazon EC2 C7gd, M7gd, and R7gd Instances with up to 3.8 TB of local NVMe-based SSD block-level storage. These instances are powered by AWS Graviton3 processors, delivering up to 25% better performance over Graviton2-based instances. +* `github.com/aws/aws-sdk-go-v2/service/ecs`: [v1.30.1](service/ecs/CHANGELOG.md#v1301-2023-09-05) + * **Documentation**: Documentation only update for Amazon ECS. +* `github.com/aws/aws-sdk-go-v2/service/eventbridge`: [v1.21.0](service/eventbridge/CHANGELOG.md#v1210-2023-09-05) + * **Feature**: Improve Endpoint Ruleset test coverage. +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.54.0](service/rds/CHANGELOG.md#v1540-2023-09-05) + * **Feature**: Add support for feature integration with AWS Backup. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.104.0](service/sagemaker/CHANGELOG.md#v11040-2023-09-05) + * **Feature**: SageMaker Neo now supports data input shape derivation for Pytorch 2.0 and XGBoost compilation job for cloud instance targets. You can skip DataInputConfig field during compilation job creation. You can also access derived information from model in DescribeCompilationJob response. +* `github.com/aws/aws-sdk-go-v2/service/vpclattice`: [v1.2.0](service/vpclattice/CHANGELOG.md#v120-2023-09-05) + * **Feature**: This release adds Lambda event structure version config support for LAMBDA target groups. It also adds newline support for auth policies. + +# Release (2023-09-01) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines`: [v1.8.0](service/chimesdkmediapipelines/CHANGELOG.md#v180-2023-09-01) + * **Feature**: This release adds support for the Voice Analytics feature for customer-owned KVS streams as part of the Amazon Chime SDK call analytics. +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.66.0](service/connect/CHANGELOG.md#v1660-2023-09-01) + * **Feature**: Amazon Connect adds the ability to read, create, update, delete, and list view resources, and adds the ability to read, create, delete, and list view versions. +* `github.com/aws/aws-sdk-go-v2/service/identitystore`: [v1.18.0](service/identitystore/CHANGELOG.md#v1180-2023-09-01) + * **Feature**: New Identity Store content for China Region launch +* `github.com/aws/aws-sdk-go-v2/service/neptunedata`: [v1.0.1](service/neptunedata/CHANGELOG.md#v101-2023-09-01) + * **Documentation**: Removed the descriptive text in the introduction. + +# Release (2023-08-31) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/chimesdkmediapipelines`: [v1.7.0](service/chimesdkmediapipelines/CHANGELOG.md#v170-2023-08-31) + * **Feature**: This release adds support for feature Voice Enhancement for Call Recording as part of Amazon Chime SDK call analytics. +* `github.com/aws/aws-sdk-go-v2/service/cloudhsm`: [v1.15.0](service/cloudhsm/CHANGELOG.md#v1150-2023-08-31) + * **Feature**: Deprecating CloudHSM Classic API Service. +* `github.com/aws/aws-sdk-go-v2/service/cloudwatchevents`: [v1.17.0](service/cloudwatchevents/CHANGELOG.md#v1170-2023-08-31) + * **Feature**: Documentation updates for CloudWatch Events. +* `github.com/aws/aws-sdk-go-v2/service/connectcampaigns`: [v1.4.0](service/connectcampaigns/CHANGELOG.md#v140-2023-08-31) + * **Feature**: Amazon Connect outbound campaigns has launched agentless dialing mode which enables customers to make automated outbound calls without agent engagement. This release updates three of the campaign management API's to support the new agentless dialing mode and the new dialing capacity field. +* `github.com/aws/aws-sdk-go-v2/service/connectparticipant`: [v1.17.0](service/connectparticipant/CHANGELOG.md#v1170-2023-08-31) + * **Feature**: Amazon Connect Participant Service adds the ability to get a view resource using a view token, which is provided in a participant message, with the release of the DescribeView API. +* `github.com/aws/aws-sdk-go-v2/service/customerprofiles`: [v1.28.0](service/customerprofiles/CHANGELOG.md#v1280-2023-08-31) + * **Feature**: Adds sensitive trait to various shapes in Customer Profiles API model. +* `github.com/aws/aws-sdk-go-v2/service/ecs`: [v1.30.0](service/ecs/CHANGELOG.md#v1300-2023-08-31) + * **Feature**: This release adds support for an account-level setting that you can use to configure the number of days for AWS Fargate task retirement. +* `github.com/aws/aws-sdk-go-v2/service/health`: [v1.19.0](service/health/CHANGELOG.md#v1190-2023-08-31) + * **Feature**: Adds new API DescribeEntityAggregatesForOrganization that retrieves entity aggregates across your organization. Also adds support for resource status filtering in DescribeAffectedEntitiesForOrganization, resource status aggregates in the DescribeEntityAggregates response, and new resource statuses. +* `github.com/aws/aws-sdk-go-v2/service/ivs`: [v1.26.0](service/ivs/CHANGELOG.md#v1260-2023-08-31) + * **Feature**: Updated "type" description for CreateChannel, UpdateChannel, Channel, and ChannelSummary. +* `github.com/aws/aws-sdk-go-v2/service/kafkaconnect`: [v1.11.0](service/kafkaconnect/CHANGELOG.md#v1110-2023-08-31) + * **Feature**: Minor model changes for Kafka Connect as well as endpoint updates. +* `github.com/aws/aws-sdk-go-v2/service/paymentcryptographydata`: [v1.2.0](service/paymentcryptographydata/CHANGELOG.md#v120-2023-08-31) + * **Feature**: Make KeyCheckValue field optional when using asymmetric keys as Key Check Values typically only apply to symmetric keys +* `github.com/aws/aws-sdk-go-v2/service/sagemakerruntime`: [v1.21.0](service/sagemakerruntime/CHANGELOG.md#v1210-2023-08-31) + * **Feature**: This release adds a new InvokeEndpointWithResponseStream API to support streaming of model responses. + +# Release (2023-08-30) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/appflow`: [v1.34.0](service/appflow/CHANGELOG.md#v1340-2023-08-30) + * **Feature**: Add SAP source connector parallel and pagination feature +* `github.com/aws/aws-sdk-go-v2/service/apprunner`: [v1.19.0](service/apprunner/CHANGELOG.md#v1190-2023-08-30) + * **Feature**: App Runner adds support for Bitbucket. You can now create App Runner connection that connects to your Bitbucket repositories and deploy App Runner service with the source code stored in a Bitbucket repository. +* `github.com/aws/aws-sdk-go-v2/service/cleanrooms`: [v1.4.0](service/cleanrooms/CHANGELOG.md#v140-2023-08-30) + * **Feature**: This release decouples member abilities in a collaboration. With this change, the member who can run queries no longer needs to be the same as the member who can receive results. +* `github.com/aws/aws-sdk-go-v2/service/datasync`: [v1.29.0](service/datasync/CHANGELOG.md#v1290-2023-08-30) + * **Feature**: AWS DataSync introduces Task Reports, a new feature that provides detailed reports of data transfer operations for each task execution. +* `github.com/aws/aws-sdk-go-v2/service/neptunedata`: [v1.0.0](service/neptunedata/CHANGELOG.md#v100-2023-08-30) + * **Release**: New AWS service client module + * **Feature**: Allows customers to execute data plane actions like bulk loading graphs, issuing graph queries using Gremlin and openCypher directly from the SDK. +* `github.com/aws/aws-sdk-go-v2/service/networkfirewall`: [v1.30.0](service/networkfirewall/CHANGELOG.md#v1300-2023-08-30) + * **Feature**: Network Firewall increasing pagination token string length +* `github.com/aws/aws-sdk-go-v2/service/pcaconnectorad`: [v1.0.0](service/pcaconnectorad/CHANGELOG.md#v100-2023-08-30) + * **Release**: New AWS service client module + * **Feature**: The Connector for AD allows you to use a fully-managed AWS Private CA as a drop-in replacement for your self-managed enterprise CAs without local agents or proxy servers. Enterprises that use AD to manage Windows environments can reduce their private certificate authority (CA) costs and complexity. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.103.0](service/sagemaker/CHANGELOG.md#v11030-2023-08-30) + * **Feature**: Amazon SageMaker Canvas adds IdentityProviderOAuthSettings support for CanvasAppSettings + +# Release (2023-08-29) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider`: [v1.26.0](service/cognitoidentityprovider/CHANGELOG.md#v1260-2023-08-29) + * **Feature**: Added API example requests and responses for several operations. Fixed the validation regex for user pools Identity Provider name. +* `github.com/aws/aws-sdk-go-v2/service/fsx`: [v1.32.5](service/fsx/CHANGELOG.md#v1325-2023-08-29) + * **Documentation**: Documentation updates for project quotas. +* `github.com/aws/aws-sdk-go-v2/service/omics`: [v1.9.0](service/omics/CHANGELOG.md#v190-2023-08-29) + * **Feature**: Add RetentionMode support for Runs. +* `github.com/aws/aws-sdk-go-v2/service/sesv2`: [v1.20.0](service/sesv2/CHANGELOG.md#v1200-2023-08-29) + * **Feature**: Adds support for the new Export and Message Insights features: create, get, list and cancel export jobs; get message insights. + +# Release (2023-08-28) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/backup`: [v1.25.0](service/backup/CHANGELOG.md#v1250-2023-08-28) + * **Feature**: Add support for customizing time zone for backup window in backup plan rules. +* `github.com/aws/aws-sdk-go-v2/service/computeoptimizer`: [v1.26.0](service/computeoptimizer/CHANGELOG.md#v1260-2023-08-28) + * **Feature**: This release enables AWS Compute Optimizer to analyze and generate licensing optimization recommendations for sql server running on EC2 instances. +* `github.com/aws/aws-sdk-go-v2/service/organizations`: [v1.20.6](service/organizations/CHANGELOG.md#v1206-2023-08-28) + * **Documentation**: Documentation updates for permissions and links. +* `github.com/aws/aws-sdk-go-v2/service/securitylake`: [v1.7.0](service/securitylake/CHANGELOG.md#v170-2023-08-28) + * **Feature**: Remove incorrect regex enforcement on pagination tokens. +* `github.com/aws/aws-sdk-go-v2/service/servicequotas`: [v1.16.0](service/servicequotas/CHANGELOG.md#v1160-2023-08-28) + * **Feature**: Service Quotas now supports viewing the applied quota value and requesting a quota increase for a specific resource in an AWS account. +* `github.com/aws/aws-sdk-go-v2/service/workspacesweb`: [v1.12.0](service/workspacesweb/CHANGELOG.md#v1120-2023-08-28) + * **Feature**: WorkSpaces Web now enables Admins to configure which cookies are synchronized from an end-user's local browser to the in-session browser. In conjunction with a browser extension, this feature enables enhanced Single-Sign On capability by reducing the number of times an end-user has to authenticate. + +# Release (2023-08-25) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cloudtrail`: [v1.29.0](service/cloudtrail/CHANGELOG.md#v1290-2023-08-25) + * **Feature**: Add ThrottlingException with error code 429 to handle CloudTrail Delegated Admin request rate exceeded on organization resources. +* `github.com/aws/aws-sdk-go-v2/service/cloudwatch`: [v1.27.7](service/cloudwatch/CHANGELOG.md#v1277-2023-08-25) + * **Documentation**: Doc-only update to get doc bug fixes into the SDK docs + +# Release (2023-08-24) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.115.0](service/ec2/CHANGELOG.md#v11150-2023-08-24) + * **Feature**: Amazon EC2 M7a instances, powered by 4th generation AMD EPYC processors, deliver up to 50% higher performance compared to M6a instances. Amazon EC2 Hpc7a instances, powered by 4th Gen AMD EPYC processors, deliver up to 2.5x better performance compared to Amazon EC2 Hpc6a instances. +* `github.com/aws/aws-sdk-go-v2/service/glue`: [v1.62.0](service/glue/CHANGELOG.md#v1620-2023-08-24) + * **Feature**: Added API attributes that help in the monitoring of sessions. +* `github.com/aws/aws-sdk-go-v2/service/mediaconvert`: [v1.41.0](service/mediaconvert/CHANGELOG.md#v1410-2023-08-24) + * **Feature**: This release includes additional audio channel tags in Quicktime outputs, support for film grain synthesis for AV1 outputs, ability to create audio-only FLAC outputs, and ability to specify Amazon S3 destination storage class. +* `github.com/aws/aws-sdk-go-v2/service/medialive`: [v1.35.0](service/medialive/CHANGELOG.md#v1350-2023-08-24) + * **Feature**: MediaLive now supports passthrough of KLV data to a HLS output group with a TS container. MediaLive now supports setting an attenuation mode for AC3 audio when the coding mode is 3/2 LFE. MediaLive now supports specifying whether to include filler NAL units in RTMP output group settings. +* `github.com/aws/aws-sdk-go-v2/service/mediatailor`: [v1.27.0](service/mediatailor/CHANGELOG.md#v1270-2023-08-24) + * **Feature**: Adds new source location AUTODETECT_SIGV4 access type. +* `github.com/aws/aws-sdk-go-v2/service/quicksight`: [v1.42.0](service/quicksight/CHANGELOG.md#v1420-2023-08-24) + * **Feature**: Excel support in Snapshot Export APIs. Removed Required trait for some insight Computations. Namespace-shared Folders support. Global Filters support. Table pin Column support. +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.53.0](service/rds/CHANGELOG.md#v1530-2023-08-24) + * **Feature**: This release updates the supported versions for Percona XtraBackup in Aurora MySQL. +* `github.com/aws/aws-sdk-go-v2/service/s3control`: [v1.33.0](service/s3control/CHANGELOG.md#v1330-2023-08-24) + * **Feature**: Updates to endpoint ruleset tests to address Smithy validation issues and standardize the capitalization of DualStack. +* `github.com/aws/aws-sdk-go-v2/service/verifiedpermissions`: [v1.2.1](service/verifiedpermissions/CHANGELOG.md#v121-2023-08-24) + * **Documentation**: Documentation updates for Amazon Verified Permissions. + +# Release (2023-08-23) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/apigateway`: [v1.18.0](service/apigateway/CHANGELOG.md#v1180-2023-08-23) + * **Feature**: This release adds RootResourceId to GetRestApi response. +* `github.com/aws/aws-sdk-go-v2/service/polly`: [v1.31.0](service/polly/CHANGELOG.md#v1310-2023-08-23) + * **Feature**: Amazon Polly adds 1 new voice - Zayd (ar-AE) + +# Release (2023-08-22) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/costexplorer`: [v1.28.0](service/costexplorer/CHANGELOG.md#v1280-2023-08-22) + * **Feature**: This release adds the LastUpdatedDate and LastUsedDate timestamps to help you manage your cost allocation tags. +* `github.com/aws/aws-sdk-go-v2/service/globalaccelerator`: [v1.17.7](service/globalaccelerator/CHANGELOG.md#v1177-2023-08-22) + * **Documentation**: Global Accelerator now supports Client Ip Preservation for Network Load Balancer endpoints. +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.52.0](service/rds/CHANGELOG.md#v1520-2023-08-22) + * **Feature**: Adding parameters to CreateCustomDbEngineVersion reserved for future use. +* `github.com/aws/aws-sdk-go-v2/service/verifiedpermissions`: [v1.2.0](service/verifiedpermissions/CHANGELOG.md#v120-2023-08-22) + * **Feature**: Documentation updates for Amazon Verified Permissions. Increases max results per page for ListPolicyStores, ListPolicies, and ListPolicyTemplates APIs from 20 to 50. + +# Release (2023-08-21) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2`: v1.21.0 + * **Feature**: Add support for polly SynthesizeSpeech GET request presigner +* `github.com/aws/aws-sdk-go-v2/service/cloud9`: [v1.18.6](service/cloud9/CHANGELOG.md#v1186-2023-08-21) + * **Documentation**: Doc only update to add Ubuntu 22.04 as an Image ID option for Cloud9 +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.114.0](service/ec2/CHANGELOG.md#v11140-2023-08-21) + * **Feature**: The DeleteKeyPair API has been updated to return the keyPairId when an existing key pair is deleted. +* `github.com/aws/aws-sdk-go-v2/service/finspace`: [v1.12.0](service/finspace/CHANGELOG.md#v1120-2023-08-21) + * **Feature**: Allow customers to manage outbound traffic from their Kx Environment when attaching a transit gateway by providing network acl entries. Allow the customer to choose how they want to update the databases on a cluster allowing updates to possibly be faster than usual. +* `github.com/aws/aws-sdk-go-v2/service/polly`: [v1.30.0](service/polly/CHANGELOG.md#v1300-2023-08-21) + * **Feature**: Add support for polly SynthesizeSpeech GET request presigner +* `github.com/aws/aws-sdk-go-v2/service/rds`: [v1.51.0](service/rds/CHANGELOG.md#v1510-2023-08-21) + * **Feature**: Adding support for RDS Aurora Global Database Unplanned Failover +* `github.com/aws/aws-sdk-go-v2/service/route53domains`: [v1.17.3](service/route53domains/CHANGELOG.md#v1173-2023-08-21) + * **Documentation**: Fixed typos in description fields + +# Release (2023-08-18) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/codecommit`: [v1.16.0](service/codecommit/CHANGELOG.md#v1160-2023-08-18) + * **Feature**: Add new ListFileCommitHistory operation to retrieve commits which introduced changes to a specific file. +* `github.com/aws/aws-sdk-go-v2/service/securityhub`: [v1.36.0](service/securityhub/CHANGELOG.md#v1360-2023-08-18) + * **Feature**: Added Inspector Lambda code Vulnerability section to ASFF, including GeneratorDetails, EpssScore, ExploitAvailable, and CodeVulnerabilities. + +# Release (2023-08-17) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2`: v1.20.2 + * **Bug Fix**: Sign `X-Amz-Server-Side-Encryption-Context` header to fix signing for PutObject requests that set `SSEKMSEncryptionContext`. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.113.0](service/ec2/CHANGELOG.md#v11130-2023-08-17) + * **Feature**: Adds support for SubnetConfigurations to allow users to select their own IPv4 and IPv6 addresses for Interface VPC endpoints +* `github.com/aws/aws-sdk-go-v2/service/gamelift`: [v1.22.0](service/gamelift/CHANGELOG.md#v1220-2023-08-17) + * **Feature**: Amazon GameLift updates its instance types support. +* `github.com/aws/aws-sdk-go-v2/service/s3control`: [v1.32.3](service/s3control/CHANGELOG.md#v1323-2023-08-17) + * **Announcement**: BREAKFIX: corrected function spelling in environment config from GetS3DisableMultRegionAccessPoints to GetS3DisableMultiRegionAccessPoints + * **Bug Fix**: Adds DisableMRAP option to config loader, and DisableMRAP client resolver to achieve parity with other S3 options in the config loader. Additionally, added breakfix to correct spelling. + +# Release (2023-08-16) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cloudwatch`: [v1.27.3](service/cloudwatch/CHANGELOG.md#v1273-2023-08-16) + * **Documentation**: Doc-only update to incorporate several doc bug fixes + +# Release (2023-08-15) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/chimesdkmeetings`: [v1.17.0](service/chimesdkmeetings/CHANGELOG.md#v1170-2023-08-15) + * **Feature**: Updated API documentation to include additional exceptions. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.112.0](service/ec2/CHANGELOG.md#v11120-2023-08-15) + * **Feature**: Documentation updates for Elastic Compute Cloud (EC2). +* `github.com/aws/aws-sdk-go-v2/service/glue`: [v1.61.0](service/glue/CHANGELOG.md#v1610-2023-08-15) + * **Feature**: AWS Glue Crawlers can now accept SerDe overrides from a custom csv classifier. The two SerDe options are LazySimpleSerDe and OpenCSVSerDe. In case, the user wants crawler to do the selection, "None" can be selected for this purpose. +* `github.com/aws/aws-sdk-go-v2/service/pi`: [v1.19.0](service/pi/CHANGELOG.md#v1190-2023-08-15) + * **Feature**: AWS Performance Insights for Amazon RDS is launching Performance Analysis On Demand, a new feature that allows you to analyze database performance metrics and find out the performance issues. You can now use SDK to create, list, get, delete, and manage tags of performance analysis reports. +* `github.com/aws/aws-sdk-go-v2/service/route53domains`: [v1.17.0](service/route53domains/CHANGELOG.md#v1170-2023-08-15) + * **Feature**: Provide explanation if CheckDomainTransferability return false. Provide requestId if a request is already submitted. Add sensitive protection for customer information +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.102.0](service/sagemaker/CHANGELOG.md#v11020-2023-08-15) + * **Feature**: SageMaker Inference Recommender now provides SupportedResponseMIMETypes from DescribeInferenceRecommendationsJob response + +# Release (2023-08-14) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/mediapackage`: [v1.23.0](service/mediapackage/CHANGELOG.md#v1230-2023-08-14) + * **Feature**: Fix SDK logging of certain fields. +* `github.com/aws/aws-sdk-go-v2/service/omics`: [v1.8.0](service/omics/CHANGELOG.md#v180-2023-08-14) + * **Feature**: This release provides support for annotation store versioning and cross account sharing for Omics Analytics +* `github.com/aws/aws-sdk-go-v2/service/transfer`: [v1.33.4](service/transfer/CHANGELOG.md#v1334-2023-08-14) + * **Documentation**: Documentation updates for AWS Transfer Family + +# Release (2023-08-11) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/amplifybackend`: [v1.16.0](service/amplifybackend/CHANGELOG.md#v1160-2023-08-11) + * **Feature**: Adds sensitive trait to required input shapes. +* `github.com/aws/aws-sdk-go-v2/service/configservice`: [v1.36.0](service/configservice/CHANGELOG.md#v1360-2023-08-11) + * **Feature**: Updated ResourceType enum with new resource types onboarded by AWS Config in July 2023. +* `github.com/aws/aws-sdk-go-v2/service/ec2`: [v1.111.0](service/ec2/CHANGELOG.md#v11110-2023-08-11) + * **Feature**: Amazon EC2 P5 instances, powered by the latest NVIDIA H100 Tensor Core GPUs, deliver the highest performance in EC2 for deep learning (DL) and HPC applications. M7i-flex and M7i instances are next-generation general purpose instances powered by custom 4th Generation Intel Xeon Scalable processors. +* `github.com/aws/aws-sdk-go-v2/service/quicksight`: [v1.41.0](service/quicksight/CHANGELOG.md#v1410-2023-08-11) + * **Feature**: New Authentication method for Account subscription - IAM Identity Center. Hierarchy layout support, default column width support and related style properties for pivot table visuals. Non-additive topic field aggregations for Topic API +* `github.com/aws/aws-sdk-go-v2/service/ses`: [v1.16.3](service/ses/CHANGELOG.md#v1163-2023-08-11) + * **Documentation**: Doc only updates to include: 1) Clarified which part of an email address where it's okay to have Punycode when it contains non-ASCII characters for the SendRawEmail action and other actions where this is applicable. 2) Updated S3Action description with new MB max bucket size from 30 to 40. +* `github.com/aws/aws-sdk-go-v2/service/swf`: [v1.17.0](service/swf/CHANGELOG.md#v1170-2023-08-11) + * **Feature**: This release adds new API parameters to override workflow task list for workflow executions. + +# Release (2023-08-10) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/cloudtrail`: [v1.28.3](service/cloudtrail/CHANGELOG.md#v1283-2023-08-10) + * **Documentation**: Documentation updates for CloudTrail. +* `github.com/aws/aws-sdk-go-v2/service/connect`: [v1.65.0](service/connect/CHANGELOG.md#v1650-2023-08-10) + * **Feature**: This release adds APIs to provision agents that are global / available in multiple AWS regions and distribute them across these regions by percentage. +* `github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2`: [v1.21.0](service/elasticloadbalancingv2/CHANGELOG.md#v1210-2023-08-10) + * **Feature**: This release enables configuring security groups for Network Load Balancers +* `github.com/aws/aws-sdk-go-v2/service/omics`: [v1.7.0](service/omics/CHANGELOG.md#v170-2023-08-10) + * **Feature**: This release adds instanceType to GetRunTask & ListRunTasks responses. +* `github.com/aws/aws-sdk-go-v2/service/secretsmanager`: [v1.21.0](service/secretsmanager/CHANGELOG.md#v1210-2023-08-10) + * **Feature**: Add additional InvalidRequestException to list of possible exceptions for ListSecret. +* `github.com/aws/aws-sdk-go-v2/service/transfer`: [v1.33.3](service/transfer/CHANGELOG.md#v1333-2023-08-10) + * **Documentation**: Documentation updates for AW Transfer Family + +# Release (2023-08-09) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/chimesdkvoice`: [v1.8.0](service/chimesdkvoice/CHANGELOG.md#v180-2023-08-09) + * **Feature**: Updating CreatePhoneNumberOrder, UpdatePhoneNumber and BatchUpdatePhoneNumbers APIs, adding phone number name +* `github.com/aws/aws-sdk-go-v2/service/fsx`: [v1.32.0](service/fsx/CHANGELOG.md#v1320-2023-08-09) + * **Feature**: For FSx for Lustre, add new data repository task type, RELEASE_DATA_FROM_FILESYSTEM, to release files that have been archived to S3. For FSx for Windows, enable support for configuring and updating SSD IOPS, and for updating storage type. For FSx for OpenZFS, add new deployment type, MULTI_AZ_1. +* `github.com/aws/aws-sdk-go-v2/service/globalaccelerator`: [v1.17.3](service/globalaccelerator/CHANGELOG.md#v1173-2023-08-09) + * **Documentation**: Documentation update for dualstack EC2 endpoint support +* `github.com/aws/aws-sdk-go-v2/service/guardduty`: [v1.26.0](service/guardduty/CHANGELOG.md#v1260-2023-08-09) + * **Feature**: Added autoEnable ALL to UpdateOrganizationConfiguration and DescribeOrganizationConfiguration APIs. +* `github.com/aws/aws-sdk-go-v2/service/sagemaker`: [v1.101.0](service/sagemaker/CHANGELOG.md#v11010-2023-08-09) + * **Feature**: This release adds support for cross account access for SageMaker Model Cards through AWS RAM. + +# Release (2023-08-08) + +## Module Highlights +* `github.com/aws/aws-sdk-go-v2/service/backup`: [v1.24.0](service/backup/CHANGELOG.md#v1240-2023-08-08) + * **Feature**: This release introduces a new logically air-gapped vault (Preview) in AWS Backup that stores immutable backup copies, which are locked by default and isolated with encryption using AWS owned keys. Logically air-gapped vault (Preview) allows secure recovery of application data across accounts. +* `github.com/aws/aws-sdk-go-v2/service/elasticache`: [v1.29.0](service/elasticache/CHANGELOG.md#v1290-2023-08-08) + * **Feature**: Added support for cluster mode in online migration and test migration API +* `github.com/aws/aws-sdk-go-v2/service/servicecatalog`: [v1.21.0](service/servicecatalog/CHANGELOG.md#v1210-2023-08-08) + * **Feature**: Introduce support for HashiCorp Terraform Cloud in Service Catalog by addying TERRAFORM_CLOUD product type in CreateProduct and CreateProvisioningArtifact API. + # Release (2023-08-07) ## General Highlights diff --git a/vendor/github.com/aws/aws-sdk-go-v2/Makefile b/vendor/github.com/aws/aws-sdk-go-v2/Makefile index 996c13e1..e089ad35 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/Makefile +++ b/vendor/github.com/aws/aws-sdk-go-v2/Makefile @@ -10,7 +10,7 @@ BUILD_TAGS=-tags "example,codegen,integration,ec2env,perftest" SMITHY_GO_SRC ?= $(shell pwd)/../smithy-go -SDK_MIN_GO_VERSION ?= 1.15 +SDK_MIN_GO_VERSION ?= 1.19 EACHMODULE_FAILFAST ?= true EACHMODULE_FAILFAST_FLAG=-fail-fast=${EACHMODULE_FAILFAST} @@ -86,7 +86,10 @@ tidy-modules-. add-module-license-files gen-aws-ptrs format generate-tmpreplace-smithy: smithy-generate update-requires gen-repo-mod-replace update-module-metadata smithy-annotate-stable \ gen-config-asserts gen-internal-codegen copy-attributevalue-feature gen-mod-replace-smithy-. min-go-version-. \ -tidy-modules-. add-module-license-files gen-aws-ptrs format gen-mod-dropreplace-smithy-. +tidy-modules-. add-module-license-files gen-aws-ptrs format gen-mod-dropreplace-smithy-. reset-sum + +reset-sum: + find . -name go.sum -exec git checkout -- {} \; smithy-generate: cd codegen && ./gradlew clean build -Plog-tests && ./gradlew clean diff --git a/vendor/github.com/aws/aws-sdk-go-v2/README.md b/vendor/github.com/aws/aws-sdk-go-v2/README.md index 54626706..9a6d0f4f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/README.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/README.md @@ -4,7 +4,7 @@ `aws-sdk-go-v2` is the v2 AWS SDK for the Go programming language. -The v2 SDK requires a minimum version of `Go 1.15`. +The v2 SDK requires a minimum version of `Go 1.19`. Check out the [release notes](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) for information about the latest bug fixes, updates, and features added to the SDK. @@ -23,6 +23,15 @@ following in the AWS SDKs and Tools Shared Configuration and Credentials Referen * [AWS SDKs and Tools Maintenance Policy](https://docs.aws.amazon.com/credref/latest/refdocs/maint-policy.html) * [AWS SDKs and Tools Version Support Matrix](https://docs.aws.amazon.com/credref/latest/refdocs/version-support-matrix.html) +### Go version support policy + +The v2 SDK follows the upstream [release policy](https://go.dev/doc/devel/release#policy) +with an additional six months of support for the most recently deprecated +language version. + +**AWS reserves the right to drop support for unsupported Go versions earlier to +address critical security issues.** + ## Getting started To get started working with the SDK setup your project for Go modules, and retrieve the SDK dependencies with `go get`. This example shows how you can use the v2 SDK to make an API request using the SDK's [Amazon DynamoDB] client. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go index fe7aacbf..b361c138 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/config.go @@ -146,6 +146,10 @@ type Config struct { // See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for // more information on environment variables and shared config settings. AppID string + + // BaseEndpoint is an intermediary transfer location to a service specific + // BaseEndpoint on a service's Options. + BaseEndpoint *string } // NewConfig returns a new Config pointer that can be chained with builder diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index c0af5602..84b19df6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.1" +const goModuleVersion = "1.22.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go index 6a99d4ea..455b9251 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/object.go @@ -41,6 +41,12 @@ func (o *Object) Key(name string) Value { return o.key(name, false) } +// KeyWithValues adds the given named key to the Query object. +// Returns a Value encoder that should be used to encode a Query list of values. +func (o *Object) KeyWithValues(name string) Value { + return o.keyWithValues(name, false) +} + // FlatKey adds the given named key to the Query object. // Returns a Value encoder that should be used to encode a Query value type. The // value will be flattened if it is a map or array. @@ -54,3 +60,10 @@ func (o *Object) key(name string, flatValue bool) Value { } return newValue(o.values, name, flatValue) } + +func (o *Object) keyWithValues(name string, flatValue bool) Value { + if o.prefix != "" { + return newAppendValue(o.values, fmt.Sprintf("%s.%s", o.prefix, name), flatValue) + } + return newAppendValue(o.values, name, flatValue) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go index 302525ab..a9251521 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/query/value.go @@ -27,6 +27,15 @@ func newValue(values url.Values, key string, flat bool) Value { } } +func newAppendValue(values url.Values, key string, flat bool) Value { + return Value{ + values: values, + key: key, + flat: flat, + queryValue: httpbinding.NewQueryValue(values, key, true), + } +} + func newBaseValue(values url.Values) Value { return Value{ values: values, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go index 00d7d3ee..987affdd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/retry/retryable_error.go @@ -97,11 +97,21 @@ func (r RetryableConnectionError) IsErrorRetryable(err error) aws.Ternary { var netOpErr *net.OpError var dnsError *net.DNSError - switch { - case errors.As(err, &dnsError): + if errors.As(err, &dnsError) { // NXDOMAIN errors should not be retried - retryable = !dnsError.IsNotFound && dnsError.IsTemporary + if dnsError.IsNotFound { + return aws.BoolTernary(false) + } + + // if !dnsError.Temporary(), error may or may not be temporary, + // (i.e. !Temporary() =/=> !retryable) so we should fall through to + // remaining checks + if dnsError.Temporary() { + return aws.BoolTernary(true) + } + } + switch { case errors.As(err, &conErr) && conErr.ConnectionError(): retryable = true diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go index 64c4c484..71b1a352 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4/headers.go @@ -48,6 +48,7 @@ var RequiredSignedHeaders = Rules{ "X-Amz-Request-Payer": struct{}{}, "X-Amz-Server-Side-Encryption": struct{}{}, "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, + "X-Amz-Server-Side-Encryption-Context": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh b/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh index a3eb9b31..4da5d09c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh +++ b/vendor/github.com/aws/aws-sdk-go-v2/ci-find-smithy-go.sh @@ -10,8 +10,7 @@ # - feat-foo if [ -z "$SMITHY_GO_REPOSITORY" ]; then - echo env SMITHY_GO_REPOSITORY is required - exit 1 + SMITHY_GO_REPOSITORY=aws/smithy-go fi if [ -z "$RUNNER_TMPDIR" ]; then @@ -19,23 +18,30 @@ if [ -z "$RUNNER_TMPDIR" ]; then exit 1 fi -branch=`git branch --show-current` +branch=$(git branch --show-current) if [ "$branch" == main ]; then echo aws-sdk-go-v2 is on branch main, stop exit 0 fi +# For PR workflows, only the triggering ref is checked out, which in isolation +# is not recognized as a branch by git. Use the specific workflow env instead. +if [ -z "$branch" ]; then + branch=$GITHUB_HEAD_REF +fi + if [ -n "$GIT_PAT" ]; then repository=https://$GIT_PAT@github.com/$SMITHY_GO_REPOSITORY else repository=https://github.com/$SMITHY_GO_REPOSITORY fi +echo on branch \"$branch\" while [ -n "$branch" ] && [[ "$branch" == *-* ]]; do - echo looking for $branch... - git ls-remote --exit-code --heads $repository refs/heads/$branch + echo looking for "$branch"... + git ls-remote --exit-code --heads "$repository" refs/heads/"$branch" if [ "$?" == 0 ]; then - echo found $branch + echo found "$branch" matched_branch=$branch break fi @@ -48,5 +54,5 @@ if [ -z "$matched_branch" ]; then exit 0 fi -git clone -b $matched_branch $repository $RUNNER_TMPDIR/smithy-go +git clone -b "$matched_branch" "$repository" "$RUNNER_TMPDIR"/smithy-go SMITHY_GO_SRC=$RUNNER_TMPDIR/smithy-go make gen-mod-replace-smithy-. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index 5309131d..88593b55 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,77 @@ +# v1.22.0 (2023-11-02) + +* **Feature**: Add env and shared config settings for disabling IMDSv1 fallback. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.20.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2023-10-24) + +* No change notes available for this release. + +# v1.19.0 (2023-10-16) + +* **Feature**: Modify logic of retrieving user agent appID from env config + +# v1.18.45 (2023-10-12) + +* **Bug Fix**: Fail to load config if an explicitly provided profile doesn't exist. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.44 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.43 (2023-10-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.42 (2023-09-22) + +* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. +* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.41 (2023-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.40 (2023-09-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.39 (2023-09-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.38 (2023-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.37 (2023-08-23) + +* No change notes available for this release. + +# v1.18.36 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.35 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.34 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.18.33 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go index 138f8e76..ef9f753d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/config.go @@ -2,18 +2,11 @@ package config import ( "context" + "os" "github.com/aws/aws-sdk-go-v2/aws" ) -// defaultLoaders are a slice of functions that will read external configuration -// sources for configuration values. These values are read by the AWSConfigResolvers -// using interfaces to extract specific information from the external configuration. -var defaultLoaders = []loader{ - loadEnvConfig, - loadSharedConfigIgnoreNotExist, -} - // defaultAWSConfigResolvers are a slice of functions that will resolve external // configuration values into AWS configuration values. // @@ -79,6 +72,8 @@ var defaultAWSConfigResolvers = []awsConfigResolver{ // Sets the sdk app ID if present in shared config profile resolveAppID, + + resolveBaseEndpoint, } // A Config represents a generic configuration value or set of values. This type @@ -190,7 +185,7 @@ func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) // assign Load Options to configs var cfgCpy = configs{options} - cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, defaultLoaders) + cfgCpy, err = cfgCpy.AppendFromLoaders(ctx, resolveConfigLoaders(&options)) if err != nil { return aws.Config{}, err } @@ -202,3 +197,17 @@ func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) return cfg, nil } + +func resolveConfigLoaders(options *LoadOptions) []loader { + loaders := make([]loader, 2) + loaders[0] = loadEnvConfig + + // specification of a profile should cause a load failure if it doesn't exist + if os.Getenv(awsProfileEnvVar) != "" || options.SharedConfigProfile != "" { + loaders[1] = loadSharedConfig + } else { + loaders[1] = loadSharedConfigIgnoreNotExist + } + + return loaders +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go index 18c8e012..78bc1493 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/env_config.go @@ -57,7 +57,8 @@ const ( awsEc2MetadataServiceEndpointEnvVar = "AWS_EC2_METADATA_SERVICE_ENDPOINT" - awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED" + awsEc2MetadataDisabled = "AWS_EC2_METADATA_DISABLED" + awsEc2MetadataV1DisabledEnvVar = "AWS_EC2_METADATA_V1_DISABLED" awsS3DisableMultiRegionAccessPointEnvVar = "AWS_S3_DISABLE_MULTIREGION_ACCESS_POINTS" @@ -69,6 +70,10 @@ const ( awsRetryMaxAttempts = "AWS_MAX_ATTEMPTS" awsRetryMode = "AWS_RETRY_MODE" + awsSdkAppID = "AWS_SDK_UA_APP_ID" + + awsIgnoreConfiguredEndpoints = "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS" + awsEndpointURL = "AWS_ENDPOINT_URL" ) var ( @@ -205,6 +210,11 @@ type EnvConfig struct { // AWS_EC2_METADATA_DISABLED=true EC2IMDSClientEnableState imds.ClientEnableState + // Specifies if EC2 IMDSv1 fallback is disabled. + // + // AWS_EC2_METADATA_V1_DISABLED=true + EC2IMDSv1Disabled *bool + // Specifies the EC2 Instance Metadata Service default endpoint selection mode (IPv4 or IPv6) // // AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE=IPv6 @@ -248,6 +258,16 @@ type EnvConfig struct { // // aws_retry_mode=standard RetryMode aws.RetryMode + + // aws sdk app ID that can be added to user agent header string + AppID string + + // Flag used to disable configured endpoints. + IgnoreConfiguredEndpoints *bool + + // Value to contain configured endpoints to be propagated to + // corresponding endpoint resolution field. + BaseEndpoint string } // loadEnvConfig reads configuration values from the OS's environment variables. @@ -288,6 +308,8 @@ func NewEnvConfig() (EnvConfig, error) { cfg.RoleARN = os.Getenv(awsRoleARNEnvVar) cfg.RoleSessionName = os.Getenv(awsRoleSessionNameEnvVar) + cfg.AppID = os.Getenv(awsSdkAppID) + if err := setEndpointDiscoveryTypeFromEnvVal(&cfg.EnableEndpointDiscovery, []string{awsEnableEndpointDiscoveryEnvVar}); err != nil { return cfg, err } @@ -301,6 +323,9 @@ func NewEnvConfig() (EnvConfig, error) { return cfg, err } cfg.EC2IMDSEndpoint = os.Getenv(awsEc2MetadataServiceEndpointEnvVar) + if err := setBoolPtrFromEnvVal(&cfg.EC2IMDSv1Disabled, []string{awsEc2MetadataV1DisabledEnvVar}); err != nil { + return cfg, err + } if err := setBoolPtrFromEnvVal(&cfg.S3DisableMultiRegionAccessPoints, []string{awsS3DisableMultiRegionAccessPointEnvVar}); err != nil { return cfg, err @@ -325,6 +350,12 @@ func NewEnvConfig() (EnvConfig, error) { return cfg, err } + setStringFromEnvVal(&cfg.BaseEndpoint, []string{awsEndpointURL}) + + if err := setBoolPtrFromEnvVal(&cfg.IgnoreConfiguredEndpoints, []string{awsIgnoreConfiguredEndpoints}); err != nil { + return cfg, err + } + return cfg, nil } @@ -335,6 +366,10 @@ func (c EnvConfig) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, return c.DefaultsMode, true, nil } +func (c EnvConfig) getAppID(context.Context) (string, bool, error) { + return c.AppID, len(c.AppID) > 0, nil +} + // GetRetryMaxAttempts returns the value of AWS_MAX_ATTEMPTS if was specified, // and not 0. func (c EnvConfig) GetRetryMaxAttempts(ctx context.Context) (int, bool, error) { @@ -472,6 +507,34 @@ func (c EnvConfig) getCustomCABundle(context.Context) (io.Reader, bool, error) { return bytes.NewReader(b), true, nil } +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (c EnvConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + if c.IgnoreConfiguredEndpoints == nil { + return false, false, nil + } + + return *c.IgnoreConfiguredEndpoints, true, nil +} + +func (c EnvConfig) getBaseEndpoint(context.Context) (string, bool, error) { + return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (c EnvConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if endpt := os.Getenv(fmt.Sprintf("%s_%s", awsEndpointURL, normalizeEnv(sdkID))); endpt != "" { + return endpt, true, nil + } + return "", false, nil +} + +func normalizeEnv(sdkID string) string { + upper := strings.ToUpper(sdkID) + return strings.ReplaceAll(upper, " ", "_") +} + // GetS3UseARNRegion returns whether to allow ARNs to direct the region // the S3 client's requests are sent to. func (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err error) { @@ -482,9 +545,9 @@ func (c EnvConfig) GetS3UseARNRegion(ctx context.Context) (value, ok bool, err e return *c.S3UseARNRegion, true, nil } -// GetS3DisableMultRegionAccessPoints returns whether to disable multi-region access point +// GetS3DisableMultiRegionAccessPoints returns whether to disable multi-region access point // support for the S3 client. -func (c EnvConfig) GetS3DisableMultRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { +func (c EnvConfig) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (value, ok bool, err error) { if c.S3DisableMultiRegionAccessPoints == nil { return false, false, nil } @@ -663,3 +726,13 @@ func (c EnvConfig) GetEC2IMDSEndpoint() (string, bool, error) { return c.EC2IMDSEndpoint, true, nil } + +// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option +// resolver interface. +func (c EnvConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { + if c.EC2IMDSv1Disabled == nil { + return false, false + } + + return *c.EC2IMDSv1Disabled, true +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 34137c88..1450b496 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.33" +const goModuleVersion = "1.22.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go index d2280dae..7480bb45 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go @@ -172,6 +172,10 @@ type LoadOptions struct { // the region, the client's requests are sent to. S3UseARNRegion *bool + // S3DisableMultiRegionAccessPoints specifies if the S3 service should disable + // the S3 Multi-Region access points feature. + S3DisableMultiRegionAccessPoints *bool + // EnableEndpointDiscovery specifies if endpoint discovery is enable for // the client. EnableEndpointDiscovery aws.EndpointDiscoveryEnableState @@ -876,6 +880,26 @@ func WithS3UseARNRegion(v bool) LoadOptionsFunc { } } +// GetS3DisableMultiRegionAccessPoints returns whether to disable +// the S3 multi-region access points feature. +func (o LoadOptions) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (v bool, found bool, err error) { + if o.S3DisableMultiRegionAccessPoints == nil { + return false, false, nil + } + return *o.S3DisableMultiRegionAccessPoints, true, nil +} + +// WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options +// that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions. +// If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides +// the previous call values. +func WithS3DisableMultiRegionAccessPoints(v bool) LoadOptionsFunc { + return func(o *LoadOptions) error { + o.S3DisableMultiRegionAccessPoints = &v + return nil + } +} + // GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set. func (o LoadOptions) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) { if o.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go index 69e54b77..d5235846 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/provider.go @@ -122,6 +122,58 @@ func getRegion(ctx context.Context, configs configs) (value string, found bool, return } +// IgnoreConfiguredEndpointsProvider is needed to search for all providers +// that provide a flag to disable configured endpoints. +type IgnoreConfiguredEndpointsProvider interface { + GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok { + value, found, err = p.GetIgnoreConfiguredEndpoints(ctx) + if err != nil || found { + break + } + } + } + return +} + +type baseEndpointProvider interface { + getBaseEndpoint(ctx context.Context) (string, bool, error) +} + +func getBaseEndpoint(ctx context.Context, configs configs) (value string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(baseEndpointProvider); ok { + value, found, err = p.getBaseEndpoint(ctx) + if err != nil || found { + break + } + } + } + return +} + +type servicesObjectProvider interface { + getServicesObject(ctx context.Context) (map[string]map[string]string, bool, error) +} + +func getServicesObject(ctx context.Context, configs configs) (value map[string]map[string]string, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(servicesObjectProvider); ok { + value, found, err = p.getServicesObject(ctx) + if err != nil || found { + break + } + } + } + return +} + // appIDProvider provides access to the sdk app ID value type appIDProvider interface { getAppID(ctx context.Context) (string, bool, error) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go index b0370535..b5a74b23 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve.go @@ -106,6 +106,29 @@ func resolveRegion(ctx context.Context, cfg *aws.Config, configs configs) error return nil } +func resolveBaseEndpoint(ctx context.Context, cfg *aws.Config, configs configs) error { + var downcastCfgSources []interface{} + for _, cs := range configs { + downcastCfgSources = append(downcastCfgSources, interface{}(cs)) + } + + if val, found, err := GetIgnoreConfiguredEndpoints(ctx, downcastCfgSources); found && val && err == nil { + cfg.BaseEndpoint = nil + return nil + } + + v, found, err := getBaseEndpoint(ctx, configs) + if err != nil { + return err + } + + if !found { + return nil + } + cfg.BaseEndpoint = aws.String(v) + return nil +} + // resolveAppID extracts the sdk app ID from the configs slice's SharedConfig or env var func resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error { ID, _, err := getAppID(ctx, configs) @@ -113,10 +136,6 @@ func resolveAppID(ctx context.Context, cfg *aws.Config, configs configs) error { return err } - // if app ID is set in env var, it should precedence shared config value - if appID := os.Getenv(`AWS_SDK_UA_APP_ID`); len(appID) > 0 { - ID = appID - } cfg.AppID = ID return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go index e699194d..20683bf5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go @@ -28,6 +28,10 @@ const ( // the shared config file, not the credentials file. ssoSectionPrefix = `sso-session ` + // Prefix for services section. It is referenced in profile via the services + // parameter to configure clients for service-specific parameters. + servicesPrefix = `services` + // string equivalent for boolean endpointDiscoveryDisabled = `false` endpointDiscoveryEnabled = `true` @@ -75,6 +79,8 @@ const ( ec2MetadataServiceEndpointKey = "ec2_metadata_service_endpoint" + ec2MetadataV1DisabledKey = "ec2_metadata_v1_disabled" + // Use DualStack Endpoint Resolution useDualStackEndpoint = "use_dualstack_endpoint" @@ -97,6 +103,10 @@ const ( caBundleKey = "ca_bundle" sdkAppID = "sdk_ua_app_id" + + ignoreConfiguredEndpoints = "ignore_configured_endpoint_urls" + + endpointURL = "endpoint_url" ) // defaultSharedConfigProfile allows for swapping the default profile for testing @@ -150,6 +160,24 @@ func (s *SSOSession) setFromIniSection(section ini.Section) { updateString(&s.SSOStartURL, section, ssoStartURLKey) } +// Services contains values configured in the services section +// of the AWS configuration file. +type Services struct { + // Services section values + // {"serviceId": {"key": "value"}} + // e.g. {"s3": {"endpoint_url": "example.com"}} + ServiceValues map[string]map[string]string +} + +func (s *Services) setFromIniSection(section ini.Section) { + if s.ServiceValues == nil { + s.ServiceValues = make(map[string]map[string]string) + } + for _, service := range section.List() { + s.ServiceValues[service] = section.Map(service) + } +} + // SharedConfig represents the configuration fields of the SDK config files. type SharedConfig struct { Profile string @@ -220,6 +248,12 @@ type SharedConfig struct { // ec2_metadata_service_endpoint=http://fd00:ec2::254 EC2IMDSEndpoint string + // Specifies that IMDS clients should not fallback to IMDSv1 if token + // requests fail. + // + // ec2_metadata_v1_disabled=true + EC2IMDSv1Disabled *bool + // Specifies if the S3 service should disable support for Multi-Region // access-points // @@ -272,6 +306,16 @@ type SharedConfig struct { // aws sdk app ID that can be added to user agent header string AppID string + + // Flag used to disable configured endpoints. + IgnoreConfiguredEndpoints *bool + + // Value to contain configured endpoints to be propagated to + // corresponding endpoint resolution field. + BaseEndpoint string + + // Value to contain services section content. + Services Services } func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) { @@ -361,6 +405,16 @@ func (c SharedConfig) GetEC2IMDSEndpoint() (string, bool, error) { return c.EC2IMDSEndpoint, true, nil } +// GetEC2IMDSV1FallbackDisabled implements an EC2IMDSV1FallbackDisabled option +// resolver interface. +func (c SharedConfig) GetEC2IMDSV1FallbackDisabled() (bool, bool) { + if c.EC2IMDSv1Disabled == nil { + return false, false + } + + return *c.EC2IMDSv1Disabled, true +} + // GetUseDualStackEndpoint returns whether the service's dual-stack endpoint should be // used for requests. func (c SharedConfig) GetUseDualStackEndpoint(ctx context.Context) (value aws.DualStackEndpointState, found bool, err error) { @@ -399,6 +453,40 @@ func (c SharedConfig) getAppID(context.Context) (string, bool, error) { return c.AppID, len(c.AppID) > 0, nil } +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (c SharedConfig) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + if c.IgnoreConfiguredEndpoints == nil { + return false, false, nil + } + + return *c.IgnoreConfiguredEndpoints, true, nil +} + +func (c SharedConfig) getBaseEndpoint(context.Context) (string, bool, error) { + return c.BaseEndpoint, len(c.BaseEndpoint) > 0, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (c SharedConfig) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if service, ok := c.Services.ServiceValues[normalizeShared(sdkID)]; ok { + if endpt, ok := service[endpointURL]; ok { + return endpt, true, nil + } + } + return "", false, nil +} + +func normalizeShared(sdkID string) string { + lower := strings.ToLower(sdkID) + return strings.ReplaceAll(lower, " ", "_") +} + +func (c SharedConfig) getServicesObject(context.Context) (map[string]map[string]string, bool, error) { + return c.Services.ServiceValues, c.Services.ServiceValues != nil, nil +} + // loadSharedConfigIgnoreNotExist is an alias for loadSharedConfig with the // addition of ignoring when none of the files exist or when the profile // is not found in any of the files. @@ -548,6 +636,7 @@ func LoadSharedConfigProfile(ctx context.Context, profile string, optFns ...func cfg := SharedConfig{} profiles := map[string]struct{}{} + if err = cfg.setFromIniSections(profiles, profile, configSections, option.Logger); err != nil { return SharedConfig{}, err } @@ -576,6 +665,7 @@ func processConfigSections(ctx context.Context, sections *ini.Sections, logger l skipSections[newName] = struct{}{} case strings.HasPrefix(section, ssoSectionPrefix): + case strings.HasPrefix(section, servicesPrefix): case strings.EqualFold(section, "default"): default: // drop this section, as invalid profile name @@ -735,11 +825,14 @@ func mergeSections(dst *ini.Sections, src ini.Sections) error { s3DisableMultiRegionAccessPointsKey, ec2MetadataServiceEndpointModeKey, ec2MetadataServiceEndpointKey, + ec2MetadataV1DisabledKey, useDualStackEndpoint, useFIPSEndpointKey, defaultsModeKey, retryModeKey, caBundleKey, + roleDurationSecondsKey, + retryMaxAttemptsKey, ssoSessionNameKey, ssoAccountIDKey, @@ -753,16 +846,6 @@ func mergeSections(dst *ini.Sections, src ini.Sections) error { } } - intKeys := []string{ - roleDurationSecondsKey, - retryMaxAttemptsKey, - } - for i := range intKeys { - if err := mergeIntKey(&srcSection, &dstSection, sectionName, intKeys[i]); err != nil { - return err - } - } - // set srcSection on dst srcSection *dst = dst.SetSection(sectionName, dstSection) } @@ -789,26 +872,6 @@ func mergeStringKey(srcSection *ini.Section, dstSection *ini.Section, sectionNam return nil } -func mergeIntKey(srcSection *ini.Section, dstSection *ini.Section, sectionName, key string) error { - if srcSection.Has(key) { - srcValue := srcSection.Int(key) - v, err := ini.NewIntValue(srcValue) - if err != nil { - return fmt.Errorf("error merging %s, %w", key, err) - } - - if dstSection.Has(key) { - dstSection.Logs = append(dstSection.Logs, newMergeKeyLogMessage(sectionName, key, - dstSection.SourceFile[key], srcSection.SourceFile[key])) - - } - - dstSection.UpdateValue(key, v) - dstSection.UpdateSourceFile(key, srcSection.SourceFile[key]) - } - return nil -} - func newMergeKeyLogMessage(sectionName, key, dstSourceFile, srcSourceFile string) string { return fmt.Sprintf("For profile: %v, overriding %v value, defined in %v "+ "with a %v value found in a duplicate profile defined at file %v. \n", @@ -912,6 +975,17 @@ func (c *SharedConfig) setFromIniSections(profiles map[string]struct{}, profile c.SSOSession = &ssoSession } + for _, sectionName := range sections.List() { + if strings.HasPrefix(sectionName, servicesPrefix) { + section, ok := sections.GetSection(sectionName) + if ok { + var svcs Services + svcs.setFromIniSection(section) + c.Services = svcs + } + } + } + return nil } @@ -962,9 +1036,16 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er updateString(&c.SSOAccountID, section, ssoAccountIDKey) updateString(&c.SSORoleName, section, ssoRoleNameKey) + // we're retaining a behavioral quirk with this field that existed before + // the removal of literal parsing for #2276: + // - if the key is missing, the config field will not be set + // - if the key is set to a non-numeric, the config field will be set to 0 if section.Has(roleDurationSecondsKey) { - d := time.Duration(section.Int(roleDurationSecondsKey)) * time.Second - c.RoleDurationSeconds = &d + if v, ok := section.Int(roleDurationSecondsKey); ok { + c.RoleDurationSeconds = aws.Duration(time.Duration(v) * time.Second) + } else { + c.RoleDurationSeconds = aws.Duration(time.Duration(0)) + } } updateString(&c.CredentialProcess, section, credentialProcessKey) @@ -978,6 +1059,7 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er return fmt.Errorf("failed to load %s from shared config, %v", ec2MetadataServiceEndpointModeKey, err) } updateString(&c.EC2IMDSEndpoint, section, ec2MetadataServiceEndpointKey) + updateBoolPtr(&c.EC2IMDSv1Disabled, section, ec2MetadataV1DisabledKey) updateUseDualStackEndpoint(&c.UseDualStackEndpoint, section, useDualStackEndpoint) updateUseFIPSEndpoint(&c.UseFIPSEndpoint, section, useFIPSEndpointKey) @@ -998,6 +1080,10 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er // user agent app ID added to request User-Agent header updateString(&c.AppID, section, sdkAppID) + updateBoolPtr(&c.IgnoreConfiguredEndpoints, section, ignoreConfiguredEndpoints) + + updateString(&c.BaseEndpoint, section, endpointURL) + // Shared Credentials creds := aws.Credentials{ AccessKeyID: section.String(accessKeyIDKey), @@ -1314,12 +1400,13 @@ func updateInt(dst *int, section ini.Section, key string) error { if !section.Has(key) { return nil } - if vt, _ := section.ValueType(key); vt != ini.IntegerType { - return fmt.Errorf("invalid value %s=%s, expect integer", - key, section.String(key)) + v, ok := section.Int(key) + if !ok { + return fmt.Errorf("invalid value %s=%s, expect integer", key, section.String(key)) } - *dst = int(section.Int(key)) + + *dst = int(v) return nil } @@ -1329,7 +1416,10 @@ func updateBool(dst *bool, section ini.Section, key string) { if !section.Has(key) { return } - *dst = section.Bool(key) + + // retains pre-#2276 behavior where non-bool value would resolve to false + v, _ := section.Bool(key) + *dst = v } // updateBoolPtr will only update the dst with the value in the section key, @@ -1338,8 +1428,11 @@ func updateBoolPtr(dst **bool, section ini.Section, key string) { if !section.Has(key) { return } + + // retains pre-#2276 behavior where non-bool value would resolve to false + v, _ := section.Bool(key) *dst = new(bool) - **dst = section.Bool(key) + **dst = v } // updateEndpointDiscoveryType will only update the dst with the value in the section, if @@ -1371,7 +1464,8 @@ func updateUseDualStackEndpoint(dst *aws.DualStackEndpointState, section ini.Sec return } - if section.Bool(key) { + // retains pre-#2276 behavior where non-bool value would resolve to false + if v, _ := section.Bool(key); v { *dst = aws.DualStackEndpointStateEnabled } else { *dst = aws.DualStackEndpointStateDisabled @@ -1387,7 +1481,8 @@ func updateUseFIPSEndpoint(dst *aws.FIPSEndpointState, section ini.Section, key return } - if section.Bool(key) { + // retains pre-#2276 behavior where non-bool value would resolve to false + if v, _ := section.Bool(key); v { *dst = aws.FIPSEndpointStateEnabled } else { *dst = aws.FIPSEndpointStateDisabled diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index 5c09f58b..6c3ca467 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,61 @@ +# v1.15.1 (2023-11-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.43 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.42 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.41 (2023-10-02) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.40 (2023-09-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.39 (2023-09-20) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.38 (2023-09-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.37 (2023-09-05) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.36 (2023-08-31) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.35 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.34 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.33 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.32 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 38bd167a..e6cba9dc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.32" +const goModuleVersion = "1.15.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index 0c3ea6ef..ba06fb19 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,36 @@ +# v1.14.2 (2023-11-02) + +* No change notes available for this release. + +# v1.14.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.14.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.13 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.12 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.11 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.10 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.9 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.8 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go index e55edd99..46e144d9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/api_client.go @@ -119,6 +119,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveClientEnableState(cfg, &opts) resolveEndpointConfig(cfg, &opts) resolveEndpointModeConfig(cfg, &opts) + resolveEnableFallback(cfg, &opts) return New(opts, optFns...) } @@ -328,3 +329,20 @@ func resolveEndpointConfig(cfg aws.Config, options *Options) error { options.Endpoint = value return nil } + +func resolveEnableFallback(cfg aws.Config, options *Options) { + if options.EnableFallback != aws.UnknownTernary { + return + } + + disabled, ok := internalconfig.ResolveV1FallbackDisabled(cfg.ConfigSources) + if !ok { + return + } + + if disabled { + options.EnableFallback = aws.FalseTernary + } else { + options.EnableFallback = aws.TrueTernary + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index fb22bca6..36432a4f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.8" +const goModuleVersion = "1.14.2" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go index d72fcb56..ce774558 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config/resolvers.go @@ -58,6 +58,10 @@ type EndpointResolver interface { GetEC2IMDSEndpoint() (string, bool, error) } +type v1FallbackDisabledResolver interface { + GetEC2IMDSV1FallbackDisabled() (bool, bool) +} + // ResolveClientEnableState resolves the ClientEnableState from a list of configuration sources. func ResolveClientEnableState(sources []interface{}) (value ClientEnableState, found bool, err error) { for _, source := range sources { @@ -96,3 +100,15 @@ func ResolveEndpointConfig(sources []interface{}) (value string, found bool, err } return value, found, err } + +// ResolveV1FallbackDisabled ... +func ResolveV1FallbackDisabled(sources []interface{}) (bool, bool) { + for _, source := range sources { + if resolver, ok := source.(v1FallbackDisabledResolver); ok { + if v, found := resolver.GetEC2IMDSV1FallbackDisabled(); found { + return v, true + } + } + } + return false, false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index 3c7fb90a..e26f211e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,32 @@ +# v1.2.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.2.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.43 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.42 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.41 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.40 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.1.39 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.1.38 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go new file mode 100644 index 00000000..e7835f85 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/endpoints.go @@ -0,0 +1,57 @@ +package configsources + +import ( + "context" +) + +// ServiceBaseEndpointProvider is needed to search for all providers +// that provide a configured service endpoint +type ServiceBaseEndpointProvider interface { + GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) +} + +// IgnoreConfiguredEndpointsProvider is needed to search for all providers +// that provide a flag to disable configured endpoints. +// +// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because +// service packages cannot import github.com/aws/aws-sdk-go-v2/config +// due to result import cycle error. +type IgnoreConfiguredEndpointsProvider interface { + GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error) +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +// +// Currently duplicated from github.com/aws/aws-sdk-go-v2/config because +// service packages cannot import github.com/aws/aws-sdk-go-v2/config +// due to result import cycle error. +func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []interface{}) (value bool, found bool, err error) { + for _, cfg := range configs { + if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok { + value, found, err = p.GetIgnoreConfiguredEndpoints(ctx) + if err != nil || found { + break + } + } + } + return +} + +// ResolveServiceBaseEndpoint is used to retrieve service endpoints from configured sources +// while allowing for configured endpoints to be disabled +func ResolveServiceBaseEndpoint(ctx context.Context, sdkID string, configs []interface{}) (value string, found bool, err error) { + if val, found, _ := GetIgnoreConfiguredEndpoints(ctx, configs); found && val { + return "", false, nil + } + + for _, cs := range configs { + if p, ok := cs.(ServiceBaseEndpointProvider); ok { + value, found, err = p.GetServiceBaseEndpoint(context.Background(), sdkID) + if err != nil || found { + break + } + } + } + return +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index acf968aa..7766ee91 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.1.38" +const goModuleVersion = "1.2.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json index 4e0c6f12..ab107ca5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json @@ -4,6 +4,7 @@ "outputs" : { "dnsSuffix" : "amazonaws.com", "dualStackDnsSuffix" : "api.aws", + "implicitGlobalRegion" : "us-east-1", "name" : "aws", "supportsDualStack" : true, "supportsFIPS" : true @@ -103,6 +104,7 @@ "outputs" : { "dnsSuffix" : "amazonaws.com.cn", "dualStackDnsSuffix" : "api.amazonwebservices.com.cn", + "implicitGlobalRegion" : "cn-northwest-1", "name" : "aws-cn", "supportsDualStack" : true, "supportsFIPS" : true @@ -124,6 +126,7 @@ "outputs" : { "dnsSuffix" : "amazonaws.com", "dualStackDnsSuffix" : "api.aws", + "implicitGlobalRegion" : "us-gov-west-1", "name" : "aws-us-gov", "supportsDualStack" : true, "supportsFIPS" : true @@ -145,6 +148,7 @@ "outputs" : { "dnsSuffix" : "c2s.ic.gov", "dualStackDnsSuffix" : "c2s.ic.gov", + "implicitGlobalRegion" : "us-iso-east-1", "name" : "aws-iso", "supportsDualStack" : false, "supportsFIPS" : true @@ -166,6 +170,7 @@ "outputs" : { "dnsSuffix" : "sc2s.sgov.gov", "dualStackDnsSuffix" : "sc2s.sgov.gov", + "implicitGlobalRegion" : "us-isob-east-1", "name" : "aws-iso-b", "supportsDualStack" : false, "supportsFIPS" : true @@ -184,6 +189,7 @@ "outputs" : { "dnsSuffix" : "cloud.adc-e.uk", "dualStackDnsSuffix" : "cloud.adc-e.uk", + "implicitGlobalRegion" : "eu-isoe-west-1", "name" : "aws-iso-e", "supportsDualStack" : false, "supportsFIPS" : true @@ -195,6 +201,7 @@ "outputs" : { "dnsSuffix" : "csp.hci.ic.gov", "dualStackDnsSuffix" : "csp.hci.ic.gov", + "implicitGlobalRegion" : "us-isof-south-1", "name" : "aws-iso-f", "supportsDualStack" : false, "supportsFIPS" : true diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 0c49cf68..e19cd663 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,32 @@ +# v2.5.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.5.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.37 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.36 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.35 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.34 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.4.33 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v2.4.32 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index 06c328c9..7128c248 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.4.32" +const goModuleVersion = "2.5.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md index 16ff6332..558a781d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -1,3 +1,38 @@ +# v1.5.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.45 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.44 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.43 (2023-09-22) + +* **Bug Fix**: Fixed a bug where merging `max_attempts` or `duration_seconds` fields across shared config files with invalid values would silently default them to 0. +* **Bug Fix**: Move type assertion of config values out of the parsing stage, which resolves an issue where the contents of a profile would silently be dropped with certain numeric formats. + +# v1.3.42 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.41 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.3.40 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.3.39 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go index b653c051..cd6cdb2d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -3,4 +3,4 @@ package ini // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.3.39" +const goModuleVersion = "1.5.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go index abf1fb03..ab16760d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/ini_lexer.go @@ -67,6 +67,8 @@ func (l *iniLexer) tokenize(b []byte) ([]Token, error) { for len(runes) > 0 && count < tokenAmount { switch { + case isSubProperty(runes): + tokens[count], n, err = newLitToken(runes) case isWhitespace(runes[0]): tokens[count], n, err = newWSToken(runes) case isComma(runes[0]): @@ -101,6 +103,8 @@ func countTokens(runes []rune) int { for len(runes) > 0 { switch { + case isSubProperty(runes): + _, n, err = newLitToken(runes) case isWhitespace(runes[0]): _, n, err = newWSToken(runes) case isComma(runes[0]): diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go index eca42d1b..a2490320 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/literal_tokens.go @@ -12,34 +12,6 @@ var ( runesFalse = []rune("false") ) -var literalValues = [][]rune{ - runesTrue, - runesFalse, -} - -func isBoolValue(b []rune) bool { - for _, lv := range literalValues { - if isCaselessLitValue(lv, b) { - return true - } - } - return false -} - -func isLitValue(want, have []rune) bool { - if len(have) < len(want) { - return false - } - - for i := 0; i < len(want); i++ { - if want[i] != have[i] { - return false - } - } - - return true -} - // isCaselessLitValue is a caseless value comparison, assumes want is already lower-cased for efficiency. func isCaselessLitValue(want, have []rune) bool { if len(have) < len(want) { @@ -55,68 +27,6 @@ func isCaselessLitValue(want, have []rune) bool { return true } -// isNumberValue will return whether not the leading characters in -// a byte slice is a number. A number is delimited by whitespace or -// the newline token. -// -// A number is defined to be in a binary, octal, decimal (int | float), hex format, -// or in scientific notation. -func isNumberValue(b []rune) bool { - negativeIndex := 0 - helper := numberHelper{} - needDigit := false - - for i := 0; i < len(b); i++ { - negativeIndex++ - - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return false - } - helper.Determine(b[i]) - needDigit = true - continue - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return false - } - negativeIndex = 0 - needDigit = true - continue - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - needDigit = true - if i == 0 { - return false - } - - fallthrough - case '.': - if err := helper.Determine(b[i]); err != nil { - return false - } - needDigit = true - continue - } - - if i > 0 && (isNewline(b[i:]) || isWhitespace(b[i])) { - return !needDigit - } - - if !helper.CorrectByte(b[i]) { - return false - } - needDigit = false - } - - return !needDigit -} - func isValid(b []rune) (bool, int, error) { if len(b) == 0 { // TODO: should probably return an error @@ -138,14 +48,8 @@ func (v ValueType) String() string { switch v { case NoneType: return "NONE" - case DecimalType: - return "FLOAT" - case IntegerType: - return "INT" case StringType: return "STRING" - case BoolType: - return "BOOL" } return "" @@ -154,11 +58,8 @@ func (v ValueType) String() string { // ValueType enums const ( NoneType = ValueType(iota) - DecimalType - IntegerType StringType QuotedStringType - BoolType ) // Value is a union container @@ -166,10 +67,8 @@ type Value struct { Type ValueType raw []rune - integer int64 - decimal float64 - boolean bool - str string + str string + mp map[string]string } func newValue(t ValueType, base int, raw []rune) (Value, error) { @@ -177,36 +76,18 @@ func newValue(t ValueType, base int, raw []rune) (Value, error) { Type: t, raw: raw, } - var err error switch t { - case DecimalType: - v.decimal, err = strconv.ParseFloat(string(raw), 64) - case IntegerType: - if base != 10 { - raw = raw[2:] - } - - v.integer, err = strconv.ParseInt(string(raw), base, 64) case StringType: v.str = string(raw) + if isSubProperty(raw) { + v.mp = v.MapValue() + } case QuotedStringType: v.str = string(raw[1 : len(raw)-1]) - case BoolType: - v.boolean = isCaselessLitValue(runesTrue, v.raw) } - // issue 2253 - // - // if the value trying to be parsed is too large, then we will use - // the 'StringType' and raw value instead. - if nerr, ok := err.(*strconv.NumError); ok && nerr.Err == strconv.ErrRange { - v.Type = StringType - v.str = string(raw) - err = nil - } - - return v, err + return v, nil } // NewStringValue returns a Value type generated using a string input. @@ -214,24 +95,12 @@ func NewStringValue(str string) (Value, error) { return newValue(StringType, 10, []rune(str)) } -// NewIntValue returns a Value type generated using an int64 input. -func NewIntValue(i int64) (Value, error) { - v := strconv.FormatInt(i, 10) - return newValue(IntegerType, 10, []rune(v)) -} - func (v Value) String() string { switch v.Type { - case DecimalType: - return fmt.Sprintf("decimal: %f", v.decimal) - case IntegerType: - return fmt.Sprintf("integer: %d", v.integer) case StringType: return fmt.Sprintf("string: %s", string(v.raw)) case QuotedStringType: return fmt.Sprintf("quoted string: %s", string(v.raw)) - case BoolType: - return fmt.Sprintf("bool: %t", v.boolean) default: return "union not set" } @@ -247,26 +116,15 @@ func newLitToken(b []rune) (Token, int, error) { if err != nil { return token, n, err } - token = newToken(TokenLit, b[:n], QuotedStringType) - } else if isNumberValue(b) { - var base int - base, n, err = getNumericalValue(b) + } else if isSubProperty(b) { + offset := 0 + end, err := getSubProperty(b, offset) if err != nil { - return token, 0, err - } - - value := b[:n] - vType := IntegerType - if contains(value, '.') || hasExponent(value) { - vType = DecimalType + return token, n, err } - token = newToken(TokenLit, value, vType) - token.base = base - } else if isBoolValue(b) { - n, err = getBoolValue(b) - - token = newToken(TokenLit, b[:n], BoolType) + token = newToken(TokenLit, b[offset:end], StringType) + n = end } else { n, err = getValue(b) token = newToken(TokenLit, b[:n], StringType) @@ -275,19 +133,91 @@ func newLitToken(b []rune) (Token, int, error) { return token, n, err } +func isSubProperty(runes []rune) bool { + // needs at least + // (1) newline (2) whitespace (3) literal + if len(runes) < 3 { + return false + } + + // must have an equal expression + split := strings.FieldsFunc(string(runes), func(r rune) bool { + return isOp([]rune{r}) + }) + if len(split) < 2 { + return false + } + + // must start with a new line + if !isNewline(runes) { + return false + } + _, n, err := newNewlineToken(runes) + if err != nil { + return false + } + + // whitespace must follow newline + return isWhitespace(runes[n]) +} + +// getSubProperty pulls all subproperties and terminates when +// it hits a newline that is not the start of another subproperty. +// offset allows for removal of leading newline and whitespace +// characters +func getSubProperty(runes []rune, offset int) (int, error) { + for idx, val := range runes[offset:] { + if val == '\n' && !isSubProperty(runes[offset+idx:]) { + return offset + idx, nil + } + } + return 0, fmt.Errorf("no sub property") +} + +// MapValue returns a map value for sub properties +func (v Value) MapValue() map[string]string { + newlineParts := strings.Split(string(v.raw), "\n") + mp := make(map[string]string) + for _, part := range newlineParts { + operandParts := strings.Split(part, "=") + if len(operandParts) < 2 { + continue + } + key := strings.TrimSpace(operandParts[0]) + val := strings.TrimSpace(operandParts[1]) + mp[key] = val + } + return mp +} + // IntValue returns an integer value -func (v Value) IntValue() int64 { - return v.integer +func (v Value) IntValue() (int64, bool) { + i, err := strconv.ParseInt(string(v.raw), 0, 64) + if err != nil { + return 0, false + } + return i, true } // FloatValue returns a float value -func (v Value) FloatValue() float64 { - return v.decimal +func (v Value) FloatValue() (float64, bool) { + f, err := strconv.ParseFloat(string(v.raw), 64) + if err != nil { + return 0, false + } + return f, true } // BoolValue returns a bool value -func (v Value) BoolValue() bool { - return v.boolean +func (v Value) BoolValue() (bool, bool) { + // we don't use ParseBool as it recognizes more than what we've + // historically supported + if isCaselessLitValue(runesTrue, v.raw) { + return true, true + } else if isCaselessLitValue(runesFalse, v.raw) { + return false, true + } + return false, false } func isTrimmable(r rune) bool { @@ -301,6 +231,7 @@ func isTrimmable(r rune) bool { // StringValue returns the string value func (v Value) StringValue() string { switch v.Type { + case StringType: return strings.TrimFunc(string(v.raw), isTrimmable) case QuotedStringType: diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/number_helper.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/number_helper.go deleted file mode 100644 index a45c0bc5..00000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/number_helper.go +++ /dev/null @@ -1,152 +0,0 @@ -package ini - -import ( - "bytes" - "fmt" - "strconv" -) - -const ( - none = numberFormat(iota) - binary - octal - decimal - hex - exponent -) - -type numberFormat int - -// numberHelper is used to dictate what format a number is in -// and what to do for negative values. Since -1e-4 is a valid -// number, we cannot just simply check for duplicate negatives. -type numberHelper struct { - numberFormat numberFormat - - negative bool - negativeExponent bool -} - -func (b numberHelper) Exists() bool { - return b.numberFormat != none -} - -func (b numberHelper) IsNegative() bool { - return b.negative || b.negativeExponent -} - -func (b *numberHelper) Determine(c rune) error { - if b.Exists() { - return NewParseError(fmt.Sprintf("multiple number formats: 0%v", string(c))) - } - - switch c { - case 'b': - b.numberFormat = binary - case 'o': - b.numberFormat = octal - case 'x': - b.numberFormat = hex - case 'e', 'E': - b.numberFormat = exponent - case '-': - if b.numberFormat != exponent { - b.negative = true - } else { - b.negativeExponent = true - } - case '.': - b.numberFormat = decimal - default: - return NewParseError(fmt.Sprintf("invalid number character: %v", string(c))) - } - - return nil -} - -func (b numberHelper) CorrectByte(c rune) bool { - switch { - case b.numberFormat == binary: - if !isBinaryByte(c) { - return false - } - case b.numberFormat == octal: - if !isOctalByte(c) { - return false - } - case b.numberFormat == hex: - if !isHexByte(c) { - return false - } - case b.numberFormat == decimal: - if !isDigit(c) { - return false - } - case b.numberFormat == exponent: - if !isDigit(c) { - return false - } - case b.negativeExponent: - if !isDigit(c) { - return false - } - case b.negative: - if !isDigit(c) { - return false - } - default: - if !isDigit(c) { - return false - } - } - - return true -} - -func (b numberHelper) Base() int { - switch b.numberFormat { - case binary: - return 2 - case octal: - return 8 - case hex: - return 16 - default: - return 10 - } -} - -func (b numberHelper) String() string { - buf := bytes.Buffer{} - i := 0 - - switch b.numberFormat { - case binary: - i++ - buf.WriteString(strconv.Itoa(i) + ": binary format\n") - case octal: - i++ - buf.WriteString(strconv.Itoa(i) + ": octal format\n") - case hex: - i++ - buf.WriteString(strconv.Itoa(i) + ": hex format\n") - case exponent: - i++ - buf.WriteString(strconv.Itoa(i) + ": exponent format\n") - default: - i++ - buf.WriteString(strconv.Itoa(i) + ": integer format\n") - } - - if b.negative { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative format\n") - } - - if b.negativeExponent { - i++ - buf.WriteString(strconv.Itoa(i) + ": negative exponent format\n") - } - - return buf.String() -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go index b5480fde..d38a9cd4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/value_util.go @@ -41,149 +41,6 @@ func getStringValue(b []rune) (int, error) { return i + 1, nil } -// getBoolValue will return a boolean and the amount -// of bytes read -// -// an error will be returned if the boolean is not of a correct -// value -func getBoolValue(b []rune) (int, error) { - if len(b) < 4 { - return 0, NewParseError("invalid boolean value") - } - - n := 0 - for _, lv := range literalValues { - if len(lv) > len(b) { - continue - } - - if isCaselessLitValue(lv, b) { - n = len(lv) - } - } - - if n == 0 { - return 0, NewParseError("invalid boolean value") - } - - return n, nil -} - -// getNumericalValue will return a numerical string, the amount -// of bytes read, and the base of the number -// -// an error will be returned if the number is not of a correct -// value -func getNumericalValue(b []rune) (int, int, error) { - if !isDigit(b[0]) { - return 0, 0, NewParseError("invalid digit value") - } - - i := 0 - helper := numberHelper{} - -loop: - for negativeIndex := 0; i < len(b); i++ { - negativeIndex++ - - if !isDigit(b[i]) { - switch b[i] { - case '-': - if helper.IsNegative() || negativeIndex != 1 { - return 0, 0, NewParseError("parse error '-'") - } - - n := getNegativeNumber(b[i:]) - i += (n - 1) - helper.Determine(b[i]) - continue - case '.': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - case 'e', 'E': - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - - negativeIndex = 0 - case 'b': - if helper.numberFormat == hex { - break - } - fallthrough - case 'o', 'x': - if i == 0 && b[i] != '0' { - return 0, 0, NewParseError("incorrect base format, expected leading '0'") - } - - if i != 1 { - return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string(b[i]), i)) - } - - if err := helper.Determine(b[i]); err != nil { - return 0, 0, err - } - default: - if isWhitespace(b[i]) { - break loop - } - - if isNewline(b[i:]) { - break loop - } - - if !(helper.numberFormat == hex && isHexByte(b[i])) { - if i+2 < len(b) && !isNewline(b[i:i+2]) { - return 0, 0, NewParseError("invalid numerical character") - } else if !isNewline([]rune{b[i]}) { - return 0, 0, NewParseError("invalid numerical character") - } - - break loop - } - } - } - } - - return helper.Base(), i, nil -} - -// isDigit will return whether or not something is an integer -func isDigit(b rune) bool { - return b >= '0' && b <= '9' -} - -func hasExponent(v []rune) bool { - return contains(v, 'e') || contains(v, 'E') -} - -func isBinaryByte(b rune) bool { - switch b { - case '0', '1': - return true - default: - return false - } -} - -func isOctalByte(b rune) bool { - switch b { - case '0', '1', '2', '3', '4', '5', '6', '7': - return true - default: - return false - } -} - -func isHexByte(b rune) bool { - if isDigit(b) { - return true - } - return (b >= 'A' && b <= 'F') || - (b >= 'a' && b <= 'f') -} - func getValue(b []rune) (int, error) { i := 0 @@ -211,24 +68,6 @@ func getValue(b []rune) (int, error) { return i, nil } -// getNegativeNumber will return a negative number from a -// byte slice. This will iterate through all characters until -// a non-digit has been found. -func getNegativeNumber(b []rune) int { - if b[0] != '-' { - return 0 - } - - i := 1 - for ; i < len(b); i++ { - if !isDigit(b[i]) { - return i - } - } - - return i -} - // isEscaped will return whether or not the character is an escaped // character. func isEscaped(value []rune, b rune) bool { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go index a07a6373..c124ad61 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/visitor.go @@ -220,6 +220,20 @@ func NewSection(name string) Section { } } +// List will return a list of all +// services in values +func (t Section) List() []string { + keys := make([]string, len(t.values)) + i := 0 + for k := range t.values { + keys[i] = k + i++ + } + + sort.Strings(keys) + return keys +} + // UpdateSourceFile updates source file for a property to provided filepath. func (t Section) UpdateSourceFile(property string, filepath string) { t.SourceFile[property] = filepath @@ -245,17 +259,22 @@ func (t Section) ValueType(k string) (ValueType, bool) { } // Bool returns a bool value at k -func (t Section) Bool(k string) bool { +func (t Section) Bool(k string) (bool, bool) { return t.values[k].BoolValue() } // Int returns an integer value at k -func (t Section) Int(k string) int64 { +func (t Section) Int(k string) (int64, bool) { return t.values[k].IntValue() } +// Map returns a map value at k +func (t Section) Map(k string) map[string]string { + return t.values[k].MapValue() +} + // Float64 returns a float value at k -func (t Section) Float64(k string) float64 { +func (t Section) Float64(k string) (float64, bool) { return t.values[k].FloatValue() } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/modman.toml b/vendor/github.com/aws/aws-sdk-go-v2/modman.toml index a4a34367..61c8da5c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/modman.toml +++ b/vendor/github.com/aws/aws-sdk-go-v2/modman.toml @@ -1,7 +1,7 @@ [dependencies] "github.com/aws/aws-sdk-go" = "v1.44.28" - "github.com/aws/smithy-go" = "v1.14.1" + "github.com/aws/smithy-go" = "v1.16.0" "github.com/google/go-cmp" = "v0.5.8" "github.com/jmespath/go-jmespath" = "v0.4.0" "golang.org/x/net" = "v0.1.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index ad424432..b8338d32 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,32 @@ +# v1.10.1 (2023-11-01) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.10.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.37 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.36 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.35 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.34 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.9.33 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.9.32 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index 7cd0b2d8..d4d780e2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.9.32" +const goModuleVersion = "1.10.1" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md index 855d4ac4..de100b1c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/CHANGELOG.md @@ -1,3 +1,41 @@ +# v1.23.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.22.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.6 (2023-10-19) + +* **Documentation**: Documentation updates for Secrets Manager + +# v1.21.5 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.4 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.2 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.1 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.0 (2023-08-10) + +* **Feature**: Add additional InvalidRequestException to list of possible exceptions for ListSecret. + # v1.20.2 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go index 9024fa31..e5f9ef45 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_client.go @@ -303,6 +303,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go index eeb1e087..8cee9ee8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_CreateSecret.go @@ -86,13 +86,12 @@ type CreateSecretInput struct { // identifier for the new version. If you use the Amazon Web Services CLI or one of // the Amazon Web Services SDKs to call this operation, then you can leave this // parameter empty. The CLI or SDK generates a random UUID for you and includes it - // as the value for this parameter in the request. If you don't use the SDK and - // instead generate a raw HTTP request to the Secrets Manager service endpoint, - // then you must generate a ClientRequestToken yourself for the new version and - // include the value in the request. This value helps ensure idempotency. Secrets - // Manager uses this value to prevent the accidental creation of duplicate versions - // if there are failures and retries during a rotation. We recommend that you - // generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) + // as the value for this parameter in the request. If you generate a raw HTTP + // request to the Secrets Manager service endpoint, then you must generate a + // ClientRequestToken and include it in the request. This value helps ensure + // idempotency. Secrets Manager uses this value to prevent the accidental creation + // of duplicate versions if there are failures and retries during a rotation. We + // recommend that you generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) // value to ensure uniqueness of your versions within the specified secret. // - If the ClientRequestToken value isn't already associated with a version of // the secret then a new version of the secret is created. @@ -156,19 +155,9 @@ type CreateSecretInput struct { // line tool environments, see Using JSON for Parameters (https://docs.aws.amazon.com/cli/latest/userguide/cli-using-param.html#cli-using-param-json) // . If your command-line tool or SDK requires quotation marks around the // parameter, you should use single quotes to avoid confusion with the double - // quotes required in the JSON text. The following restrictions apply to tags: - // - Maximum number of tags per secret: 50 - // - Maximum key length: 127 Unicode characters in UTF-8 - // - Maximum value length: 255 Unicode characters in UTF-8 - // - Tag keys and values are case sensitive. - // - Do not use the aws: prefix in your tag names or values because Amazon Web - // Services reserves it for Amazon Web Services use. You can't edit or delete tag - // names or values with this prefix. Tags with this prefix do not count against - // your tags per secret limit. - // - If you use your tagging schema across multiple services and resources, - // other services might have restrictions on allowed characters. Generally allowed - // characters: letters, spaces, and numbers representable in UTF-8, plus the - // following special characters: + - = . _ : / @. + // quotes required in the JSON text. For tag quotas and naming restrictions, see + // Service quotas for Tagging (https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas) + // in the Amazon Web Services General Reference guide. Tags []types.Tag noSmithyDocumentSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go index f901ddd9..4d9973dd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_PutSecretValue.go @@ -70,15 +70,14 @@ type PutSecretValueInput struct { // A unique identifier for the new version of the secret. If you use the Amazon // Web Services CLI or one of the Amazon Web Services SDKs to call this operation, - // then you can leave this parameter empty because they generate a random UUID for - // you. If you don't use the SDK and instead generate a raw HTTP request to the - // Secrets Manager service endpoint, then you must generate a ClientRequestToken - // yourself for new versions and include that value in the request. This value + // then you can leave this parameter empty. The CLI or SDK generates a random UUID + // for you and includes it as the value for this parameter in the request. If you + // generate a raw HTTP request to the Secrets Manager service endpoint, then you + // must generate a ClientRequestToken and include it in the request. This value // helps ensure idempotency. Secrets Manager uses this value to prevent the // accidental creation of duplicate versions if there are failures and retries - // during the Lambda rotation function processing. We recommend that you generate a - // UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) value to - // ensure uniqueness within the specified secret. + // during a rotation. We recommend that you generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) + // value to ensure uniqueness of your versions within the specified secret. // - If the ClientRequestToken value isn't already associated with a version of // the secret then a new version of the secret is created. // - If a version with this value already exists and that version's SecretString diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go index 248d0d77..6afe63e7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_RotateSecret.go @@ -64,20 +64,18 @@ type RotateSecretInput struct { // This member is required. SecretId *string - // A unique identifier for the new version of the secret that helps ensure - // idempotency. Secrets Manager uses this value to prevent the accidental creation - // of duplicate versions if there are failures and retries during rotation. This - // value becomes the VersionId of the new version. If you use the Amazon Web - // Services CLI or one of the Amazon Web Services SDK to call this operation, then - // you can leave this parameter empty. The CLI or SDK generates a random UUID for - // you and includes that in the request for this parameter. If you don't use the - // SDK and instead generate a raw HTTP request to the Secrets Manager service - // endpoint, then you must generate a ClientRequestToken yourself for new versions - // and include that value in the request. You only need to specify this value if - // you implement your own retry logic and you want to ensure that Secrets Manager - // doesn't attempt to create a secret version twice. We recommend that you generate - // a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) value to - // ensure uniqueness within the specified secret. + // A unique identifier for the new version of the secret. You only need to specify + // this value if you implement your own retry logic and you want to ensure that + // Secrets Manager doesn't attempt to create a secret version twice. If you use the + // Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this + // operation, then you can leave this parameter empty. The CLI or SDK generates a + // random UUID for you and includes it as the value for this parameter in the + // request. If you generate a raw HTTP request to the Secrets Manager service + // endpoint, then you must generate a ClientRequestToken and include it in the + // request. This value helps ensure idempotency. Secrets Manager uses this value to + // prevent the accidental creation of duplicate versions if there are failures and + // retries during a rotation. We recommend that you generate a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) + // value to ensure uniqueness of your versions within the specified secret. ClientRequestToken *string // Specifies whether to rotate the secret immediately or wait until the next diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go index 908e6901..d4f6bd28 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_TagResource.go @@ -18,28 +18,16 @@ import ( // Attaches tags to a secret. Tags consist of a key name and a value. Tags are // part of the secret's metadata. They are not associated with specific versions of -// the secret. This operation appends tags to the existing list of tags. The -// following restrictions apply to tags: -// - Maximum number of tags per secret: 50 -// - Maximum key length: 127 Unicode characters in UTF-8 -// - Maximum value length: 255 Unicode characters in UTF-8 -// - Tag keys and values are case sensitive. -// - Do not use the aws: prefix in your tag names or values because Amazon Web -// Services reserves it for Amazon Web Services use. You can't edit or delete tag -// names or values with this prefix. Tags with this prefix do not count against -// your tags per secret limit. -// - If you use your tagging schema across multiple services and resources, -// other services might have restrictions on allowed characters. Generally allowed -// characters: letters, spaces, and numbers representable in UTF-8, plus the -// following special characters: + - = . _ : / @. -// -// If you use tags as part of your security strategy, then adding or removing a -// tag can change permissions. If successfully completing this operation would -// result in you losing your permissions for this secret, then the operation is -// blocked and returns an Access Denied error. Secrets Manager generates a -// CloudTrail log entry when you call this action. Do not include sensitive -// information in request parameters because it might be logged. For more -// information, see Logging Secrets Manager events with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) +// the secret. This operation appends tags to the existing list of tags. For tag +// quotas and naming restrictions, see Service quotas for Tagging (https://docs.aws.amazon.com/general/latest/gr/arg.html#taged-reference-quotas) +// in the Amazon Web Services General Reference guide. If you use tags as part of +// your security strategy, then adding or removing a tag can change permissions. If +// successfully completing this operation would result in you losing your +// permissions for this secret, then the operation is blocked and returns an Access +// Denied error. Secrets Manager generates a CloudTrail log entry when you call +// this action. Do not include sensitive information in request parameters because +// it might be logged. For more information, see Logging Secrets Manager events +// with CloudTrail (https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html) // . Required permissions: secretsmanager:TagResource . For more information, see // IAM policy actions for Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions) // and Authentication and access control in Secrets Manager (https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go index 2f8be4da..2af37a19 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/api_op_UpdateSecret.go @@ -76,10 +76,13 @@ type UpdateSecretInput struct { // the new version. If you use the Amazon Web Services CLI or one of the Amazon Web // Services SDKs to call this operation, then you can leave this parameter empty. // The CLI or SDK generates a random UUID for you and includes it as the value for - // this parameter in the request. If you don't use the SDK and instead generate a - // raw HTTP request to the Secrets Manager service endpoint, then you must generate - // a ClientRequestToken yourself for the new version and include the value in the - // request. This value becomes the VersionId of the new version. + // this parameter in the request. If you generate a raw HTTP request to the Secrets + // Manager service endpoint, then you must generate a ClientRequestToken and + // include it in the request. This value helps ensure idempotency. Secrets Manager + // uses this value to prevent the accidental creation of duplicate versions if + // there are failures and retries during a rotation. We recommend that you generate + // a UUID-type (https://wikipedia.org/wiki/Universally_unique_identifier) value to + // ensure uniqueness of your versions within the specified secret. ClientRequestToken *string // The description of the secret. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go index b2248c65..40edb2de 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/deserializers.go @@ -1103,6 +1103,9 @@ func awsAwsjson11_deserializeOpErrorListSecrets(response *smithyhttp.Response, m case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go index 77ce4759..2f4fbd96 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints" smithyendpoints "github.com/aws/smithy-go/endpoints" @@ -16,6 +17,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -194,6 +196,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SECRETS_MANAGER") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Secrets Manager", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // Utility function to aid with translating pseudo-regions to classical regions // with the appropriate setting indicated by the pseudo-region func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) { @@ -410,7 +430,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://secretsmanager-fips.") diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json index d166471f..70ed3b92 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/generated.json @@ -34,6 +34,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go index 03db5366..e9a3e477 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/secretsmanager/go_module_metadata.go @@ -3,4 +3,4 @@ package secretsmanager // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.20.2" +const goModuleVersion = "1.23.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index 58aa3ecc..04222cda 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,50 @@ +# v1.17.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.16.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.0 (2023-10-02) + +* **Feature**: Fix FIPS Endpoints in aws-us-gov. + +# v1.14.1 (2023-09-22) + +* No change notes available for this release. + +# v1.14.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.13.6 (2023-08-31) + +* No change notes available for this release. + +# v1.13.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.2 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index da4e470a..a2579227 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -295,6 +295,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go index 9395e91e..11538705 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints" smithyendpoints "github.com/aws/smithy-go/endpoints" @@ -16,6 +17,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -194,6 +196,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // Utility function to aid with translating pseudo-regions to classical regions // with the appropriate setting indicated by the pseudo-region func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) { @@ -411,6 +431,25 @@ func (r *resolver) ResolveEndpoint( } if _UseFIPS == true { if true == _PartitionResult.SupportsFIPS { + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://portal.sso.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } uriString := func() string { var out strings.Builder out.WriteString("https://portal.sso-fips.") @@ -455,279 +494,6 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") } - if _Region == "ap-east-1" { - uriString := "https://portal.sso.ap-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-1" { - uriString := "https://portal.sso.ap-northeast-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-2" { - uriString := "https://portal.sso.ap-northeast-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-3" { - uriString := "https://portal.sso.ap-northeast-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-south-1" { - uriString := "https://portal.sso.ap-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-1" { - uriString := "https://portal.sso.ap-southeast-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-2" { - uriString := "https://portal.sso.ap-southeast-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ca-central-1" { - uriString := "https://portal.sso.ca-central-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-central-1" { - uriString := "https://portal.sso.eu-central-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-north-1" { - uriString := "https://portal.sso.eu-north-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-south-1" { - uriString := "https://portal.sso.eu-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-1" { - uriString := "https://portal.sso.eu-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-2" { - uriString := "https://portal.sso.eu-west-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-3" { - uriString := "https://portal.sso.eu-west-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "me-south-1" { - uriString := "https://portal.sso.me-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "sa-east-1" { - uriString := "https://portal.sso.sa-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-east-1" { - uriString := "https://portal.sso.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-east-2" { - uriString := "https://portal.sso.us-east-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-west-2" { - uriString := "https://portal.sso.us-west-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-gov-east-1" { - uriString := "https://portal.sso.us-gov-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-gov-west-1" { - uriString := "https://portal.sso.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://portal.sso.") diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json index ab6af36e..8e618418 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json @@ -16,6 +16,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index ac980ae3..d5611c5c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.2" +const goModuleVersion = "1.17.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go index 1da26791..f044afde 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go @@ -227,6 +227,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-central-1", }, }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{ @@ -267,6 +275,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-west-3", }, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{ @@ -351,6 +367,24 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, }, { ID: "aws-iso", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index d38e9455..057f9a25 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,50 @@ +# v1.19.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.3 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.2 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.17.1 (2023-09-22) + +* No change notes available for this release. + +# v1.17.0 (2023-09-20) + +* **Feature**: Update FIPS endpoints in aws-us-gov. + +# v1.16.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.15.6 (2023-09-05) + +* No change notes available for this release. + +# v1.15.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.15.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.15.2 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go index 24a69227..6a56093d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -295,6 +295,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go index 282d078b..50b490cb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints" smithyendpoints "github.com/aws/smithy-go/endpoints" @@ -16,6 +17,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -194,6 +196,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO_OIDC") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO OIDC", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // Utility function to aid with translating pseudo-regions to classical regions // with the appropriate setting indicated by the pseudo-region func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) { @@ -411,6 +431,25 @@ func (r *resolver) ResolveEndpoint( } if _UseFIPS == true { if true == _PartitionResult.SupportsFIPS { + if "aws-us-gov" == _PartitionResult.Name { + uriString := func() string { + var out strings.Builder + out.WriteString("https://oidc.") + out.WriteString(_Region) + out.WriteString(".amazonaws.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } uriString := func() string { var out strings.Builder out.WriteString("https://oidc-fips.") @@ -455,279 +494,6 @@ func (r *resolver) ResolveEndpoint( } return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") } - if _Region == "ap-east-1" { - uriString := "https://oidc.ap-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-1" { - uriString := "https://oidc.ap-northeast-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-2" { - uriString := "https://oidc.ap-northeast-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-northeast-3" { - uriString := "https://oidc.ap-northeast-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-south-1" { - uriString := "https://oidc.ap-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-1" { - uriString := "https://oidc.ap-southeast-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ap-southeast-2" { - uriString := "https://oidc.ap-southeast-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "ca-central-1" { - uriString := "https://oidc.ca-central-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-central-1" { - uriString := "https://oidc.eu-central-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-north-1" { - uriString := "https://oidc.eu-north-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-south-1" { - uriString := "https://oidc.eu-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-1" { - uriString := "https://oidc.eu-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-2" { - uriString := "https://oidc.eu-west-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "eu-west-3" { - uriString := "https://oidc.eu-west-3.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "me-south-1" { - uriString := "https://oidc.me-south-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "sa-east-1" { - uriString := "https://oidc.sa-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-east-1" { - uriString := "https://oidc.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-east-2" { - uriString := "https://oidc.us-east-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-west-2" { - uriString := "https://oidc.us-west-2.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-gov-east-1" { - uriString := "https://oidc.us-gov-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if _Region == "us-gov-west-1" { - uriString := "https://oidc.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } uriString := func() string { var out strings.Builder out.WriteString("https://oidc.") diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json index fe2d075a..403fac7c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json @@ -15,6 +15,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index f6d15660..85614170 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.15.2" +const goModuleVersion = "1.19.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go index 8df344e9..c48da8b8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go @@ -227,6 +227,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-central-1", }, }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "oidc.eu-central-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-2", + }, + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{ @@ -267,6 +275,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-west-3", }, }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "oidc.il-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "il-central-1", + }, + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{ @@ -351,6 +367,24 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "oidc.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "oidc.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + }, }, { ID: "aws-iso", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index 2804b794..2e5ca8f8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,42 @@ +# v1.25.0 (2023-11-01) + +* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.24.0 (2023-10-31) + +* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.2 (2023-10-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.1 (2023-10-06) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.23.0 (2023-10-02) + +* **Feature**: STS API updates for assumeRole + +# v1.22.0 (2023-09-18) + +* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. +* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. + +# v1.21.5 (2023-08-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.4 (2023-08-18) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.21.3 (2023-08-17) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.21.2 (2023-08-07) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 22ac6904..c29d8cad 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -298,6 +298,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { resolveAWSEndpointResolver(cfg, &opts) resolveUseDualStackEndpoint(cfg, &opts) resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) return New(opts, optFns...) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go index ef1caae8..cb5d56fd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go @@ -8,6 +8,7 @@ import ( "fmt" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" internalendpoints "github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints" smithy "github.com/aws/smithy-go" @@ -17,6 +18,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "net/url" + "os" "strings" ) @@ -195,6 +197,24 @@ func resolveEndpointResolverV2(options *Options) { } } +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_STS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "STS", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + // Utility function to aid with translating pseudo-regions to classical regions // with the appropriate setting indicated by the pseudo-region func mapPseudoRegion(pr string) (region string, fips aws.FIPSEndpointState) { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json index 2ae7a9b2..e44e7d14 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json @@ -21,6 +21,7 @@ "deserializers.go", "doc.go", "endpoints.go", + "endpoints_config_test.go", "endpoints_test.go", "generated.json", "internal/endpoints/endpoints.go", diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index 5312046b..dac009e1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.21.2" +const goModuleVersion = "1.25.0" diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index a1754c22..9cca07b5 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,19 @@ +# Release (2023-10-31) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.16.0 + * **Feature**: **LANG**: Bump minimum go version to 1.19. + +# Release (2023-10-06) + +## Module Highlights +* `github.com/aws/smithy-go`: v1.15.0 + * **Feature**: Add `http.WithHeaderComment` middleware. + +# Release (2023-08-18) + +* No change notes available for this release. + # Release (2023-08-07) ## Module Highlights diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md index a4bb43fb..c374f692 100644 --- a/vendor/github.com/aws/smithy-go/README.md +++ b/vendor/github.com/aws/smithy-go/README.md @@ -6,6 +6,21 @@ **WARNING: All interfaces are subject to change.** +## Can I use this? + +In order to generate a usable smithy client you must provide a [protocol definition](https://github.com/aws/smithy-go/blob/main/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java), +such as [AWS restJson1](https://smithy.io/2.0/aws/protocols/aws-restjson1-protocol.html), +in order to generate transport mechanisms and serialization/deserialization +code ("serde") accordingly. + +The code generator does not currently support any protocols out of the box, +therefore the useability of this project on its own is currently limited. +Support for all [AWS protocols](https://smithy.io/2.0/aws/protocols/index.html) +exists in [aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2). We are +tracking the movement of those out of the SDK into smithy-go in +[#458](https://github.com/aws/smithy-go/issues/458), but there's currently no +timeline for doing so. + ## License This project is licensed under the Apache-2.0 License. diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index 5dffb636..d96be806 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.14.1" +const goModuleVersion = "1.16.0" diff --git a/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go b/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go new file mode 100644 index 00000000..855c2272 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/transport/http/middleware_header_comment.go @@ -0,0 +1,81 @@ +package http + +import ( + "context" + "fmt" + "net/http" + + "github.com/aws/smithy-go/middleware" +) + +// WithHeaderComment instruments a middleware stack to append an HTTP field +// comment to the given header as specified in RFC 9110 +// (https://www.rfc-editor.org/rfc/rfc9110#name-comments). +// +// The header is case-insensitive. If the provided header exists when the +// middleware runs, the content will be inserted as-is enclosed in parentheses. +// +// Note that per the HTTP specification, comments are only allowed in fields +// containing "comment" as part of their field value definition, but this API +// will NOT verify whether the provided header is one of them. +// +// WithHeaderComment MAY be applied more than once to a middleware stack and/or +// more than once per header. +func WithHeaderComment(header, content string) func(*middleware.Stack) error { + return func(s *middleware.Stack) error { + m, err := getOrAddHeaderComment(s) + if err != nil { + return fmt.Errorf("get or add header comment: %v", err) + } + + m.values.Add(header, content) + return nil + } +} + +type headerCommentMiddleware struct { + values http.Header // hijack case-insensitive access APIs +} + +func (*headerCommentMiddleware) ID() string { + return "headerComment" +} + +func (m *headerCommentMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + r, ok := in.Request.(*Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + for h, contents := range m.values { + for _, c := range contents { + if existing := r.Header.Get(h); existing != "" { + r.Header.Set(h, fmt.Sprintf("%s (%s)", existing, c)) + } + } + } + + return next.HandleBuild(ctx, in) +} + +func getOrAddHeaderComment(s *middleware.Stack) (*headerCommentMiddleware, error) { + id := (*headerCommentMiddleware)(nil).ID() + m, ok := s.Build.Get(id) + if !ok { + m := &headerCommentMiddleware{values: http.Header{}} + if err := s.Build.Add(m, middleware.After); err != nil { + return nil, fmt.Errorf("add build: %v", err) + } + + return m, nil + } + + hc, ok := m.(*headerCommentMiddleware) + if !ok { + return nil, fmt.Errorf("existing middleware w/ id %s is not *headerCommentMiddleware", id) + } + + return hc, nil +} diff --git a/vendor/github.com/go-pkgz/lgr/options.go b/vendor/github.com/go-pkgz/lgr/options.go index af63b3df..16fadacb 100644 --- a/vendor/github.com/go-pkgz/lgr/options.go +++ b/vendor/github.com/go-pkgz/lgr/options.go @@ -1,6 +1,9 @@ package lgr -import "io" +import ( + "io" + "strings" +) // Option func type type Option func(l *Logger) @@ -74,6 +77,9 @@ func Msec(l *Logger) { func Secret(vals ...string) Option { return func(l *Logger) { for _, v := range vals { + if strings.TrimSpace(v) == "" { + continue // skip empty secrets + } l.secrets = append(l.secrets, []byte(v)) } } diff --git a/vendor/github.com/google/uuid/.travis.yml b/vendor/github.com/google/uuid/.travis.yml deleted file mode 100644 index d8156a60..00000000 --- a/vendor/github.com/google/uuid/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - 1.4.3 - - 1.5.3 - - tip - -script: - - go test -v ./... diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md new file mode 100644 index 00000000..7ed347d3 --- /dev/null +++ b/vendor/github.com/google/uuid/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) + + +### Features + +* UUIDs slice type with Strings() convenience method ([#133](https://github.com/google/uuid/issues/133)) ([cd5fbbd](https://github.com/google/uuid/commit/cd5fbbdd02f3e3467ac18940e07e062be1f864b4)) + +### Fixes + +* Clarify that Parse's job is to parse but not necessarily validate strings. (Documents current behavior) + +## [1.3.1](https://github.com/google/uuid/compare/v1.3.0...v1.3.1) (2023-08-18) + + +### Bug Fixes + +* Use .EqualFold() to parse urn prefixed UUIDs ([#118](https://github.com/google/uuid/issues/118)) ([574e687](https://github.com/google/uuid/commit/574e6874943741fb99d41764c705173ada5293f0)) + +## Changelog diff --git a/vendor/github.com/google/uuid/CONTRIBUTING.md b/vendor/github.com/google/uuid/CONTRIBUTING.md index 04fdf09f..a502fdc5 100644 --- a/vendor/github.com/google/uuid/CONTRIBUTING.md +++ b/vendor/github.com/google/uuid/CONTRIBUTING.md @@ -2,6 +2,22 @@ We definitely welcome patches and contribution to this project! +### Tips + +Commits must be formatted according to the [Conventional Commits Specification](https://www.conventionalcommits.org). + +Always try to include a test case! If it is not possible or not necessary, +please explain why in the pull request description. + +### Releasing + +Commits that would precipitate a SemVer change, as described in the Conventional +Commits Specification, will trigger [`release-please`](https://github.com/google-github-actions/release-please-action) +to create a release candidate pull request. Once submitted, `release-please` +will create a release. + +For tips on how to work with `release-please`, see its documentation. + ### Legal requirements In order to protect both you and ourselves, you will need to sign the diff --git a/vendor/github.com/google/uuid/README.md b/vendor/github.com/google/uuid/README.md index f765a46f..3e9a6188 100644 --- a/vendor/github.com/google/uuid/README.md +++ b/vendor/github.com/google/uuid/README.md @@ -1,6 +1,6 @@ -# uuid ![build status](https://travis-ci.org/google/uuid.svg?branch=master) +# uuid The uuid package generates and inspects UUIDs based on -[RFC 4122](http://tools.ietf.org/html/rfc4122) +[RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122) and DCE 1.1: Authentication and Security Services. This package is based on the github.com/pborman/uuid package (previously named @@ -9,10 +9,12 @@ a UUID is a 16 byte array rather than a byte slice. One loss due to this change is the ability to represent an invalid UUID (vs a NIL UUID). ###### Install -`go get github.com/google/uuid` +```sh +go get github.com/google/uuid +``` ###### Documentation -[![GoDoc](https://godoc.org/github.com/google/uuid?status.svg)](http://godoc.org/github.com/google/uuid) +[![Go Reference](https://pkg.go.dev/badge/github.com/google/uuid.svg)](https://pkg.go.dev/github.com/google/uuid) Full `go doc` style documentation for the package can be viewed online without installing this package by using the GoDoc site here: diff --git a/vendor/github.com/google/uuid/node_js.go b/vendor/github.com/google/uuid/node_js.go index 24b78edc..b2a0bc87 100644 --- a/vendor/github.com/google/uuid/node_js.go +++ b/vendor/github.com/google/uuid/node_js.go @@ -7,6 +7,6 @@ package uuid // getHardwareInterface returns nil values for the JS version of the code. -// This remvoves the "net" dependency, because it is not used in the browser. +// This removes the "net" dependency, because it is not used in the browser. // Using the "net" library inflates the size of the transpiled JS code by 673k bytes. func getHardwareInterface(name string) (string, []byte) { return "", nil } diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index a57207ae..dc75f7d9 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -56,11 +56,15 @@ func IsInvalidLengthError(err error) bool { return ok } -// Parse decodes s into a UUID or returns an error. Both the standard UUID -// forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and -// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx are decoded as well as the -// Microsoft encoding {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} and the raw hex -// encoding: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. +// Parse decodes s into a UUID or returns an error if it cannot be parsed. Both +// the standard UUID forms defined in RFC 4122 +// (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and +// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) are decoded. In addition, +// Parse accepts non-standard strings such as the raw hex encoding +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and 38 byte "Microsoft style" encodings, +// e.g. {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}. Only the middle 36 bytes are +// examined in the latter case. Parse should not be used to validate strings as +// it parses non-standard encodings as indicated above. func Parse(s string) (UUID, error) { var uuid UUID switch len(s) { @@ -69,7 +73,7 @@ func Parse(s string) (UUID, error) { // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx case 36 + 9: - if strings.ToLower(s[:9]) != "urn:uuid:" { + if !strings.EqualFold(s[:9], "urn:uuid:") { return uuid, fmt.Errorf("invalid urn prefix: %q", s[:9]) } s = s[9:] @@ -101,7 +105,8 @@ func Parse(s string) (UUID, error) { 9, 11, 14, 16, 19, 21, - 24, 26, 28, 30, 32, 34} { + 24, 26, 28, 30, 32, 34, + } { v, ok := xtob(s[x], s[x+1]) if !ok { return uuid, errors.New("invalid UUID format") @@ -117,7 +122,7 @@ func ParseBytes(b []byte) (UUID, error) { switch len(b) { case 36: // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx case 36 + 9: // urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx - if !bytes.Equal(bytes.ToLower(b[:9]), []byte("urn:uuid:")) { + if !bytes.EqualFold(b[:9], []byte("urn:uuid:")) { return uuid, fmt.Errorf("invalid urn prefix: %q", b[:9]) } b = b[9:] @@ -145,7 +150,8 @@ func ParseBytes(b []byte) (UUID, error) { 9, 11, 14, 16, 19, 21, - 24, 26, 28, 30, 32, 34} { + 24, 26, 28, 30, 32, 34, + } { v, ok := xtob(b[x], b[x+1]) if !ok { return uuid, errors.New("invalid UUID format") @@ -292,3 +298,15 @@ func DisableRandPool() { poolMu.Lock() poolPos = randPoolSize } + +// UUIDs is a slice of UUID types. +type UUIDs []UUID + +// Strings returns a string slice containing the string form of each UUID in uuids. +func (uuids UUIDs) Strings() []string { + var uuidStrs = make([]string, len(uuids)) + for i, uuid := range uuids { + uuidStrs[i] = uuid.String() + } + return uuidStrs +} diff --git a/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/LICENSE b/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/LICENSE index e87a115e..7c5baa45 100644 --- a/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/LICENSE +++ b/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2020 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parsepath.go b/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parsepath.go index d59ecbb2..ec812367 100644 --- a/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parsepath.go +++ b/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parsepath.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package parseutil import ( diff --git a/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parseutil.go b/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parseutil.go index e469499b..eb3c0a50 100644 --- a/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parseutil.go +++ b/vendor/github.com/hashicorp/go-secure-stdlib/parseutil/parseutil.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package parseutil import ( diff --git a/vendor/github.com/hashicorp/go-sockaddr/LICENSE b/vendor/github.com/hashicorp/go-sockaddr/LICENSE index a612ad98..be467e38 100644 --- a/vendor/github.com/hashicorp/go-sockaddr/LICENSE +++ b/vendor/github.com/hashicorp/go-sockaddr/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2016 HashiCorp, Inc. + Mozilla Public License Version 2.0 ================================== diff --git a/vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go b/vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go index 80f61bef..d2713afb 100644 --- a/vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go +++ b/vendor/github.com/hashicorp/go-sockaddr/ifaddrs.go @@ -16,8 +16,10 @@ var ( // Centralize all regexps and regexp.Copy() where necessary. signRE *regexp.Regexp = regexp.MustCompile(`^[\s]*[+-]`) whitespaceRE *regexp.Regexp = regexp.MustCompile(`[\s]+`) - ifNameRE *regexp.Regexp = regexp.MustCompile(`^(?:Ethernet|Wireless LAN) adapter ([^:]+):`) - ipAddrRE *regexp.Regexp = regexp.MustCompile(`^ IPv[46] Address\. \. \. \. \. \. \. \. \. \. \. : ([^\s]+)`) + // These regular expressions enable the deprecated parseDefaultIfNameWindows + // and should be removed when those functions are. + ifNameRE *regexp.Regexp = regexp.MustCompile(`^(?:Ethernet|Wireless LAN) adapter ([^:]+):`) + ipAddrRE *regexp.Regexp = regexp.MustCompile(`^ IPv[46] Address\. \. \. \. \. \. \. \. \. \. \. : ([^\s]+)`) ) // IfAddrs is a slice of IfAddr @@ -1214,7 +1216,7 @@ func parseDefaultIfNameFromIPCmd(routeOut string) (string, error) { // Android. func parseDefaultIfNameFromIPCmdAndroid(routeOut string) (string, error) { parsedLines := parseIfNameFromIPCmd(routeOut) - if (len(parsedLines) > 0) { + if len(parsedLines) > 0 { ifName := strings.TrimSpace(parsedLines[0][4]) return ifName, nil } @@ -1222,7 +1224,6 @@ func parseDefaultIfNameFromIPCmdAndroid(routeOut string) (string, error) { return "", errors.New("No default interface found") } - // parseIfNameFromIPCmd parses interfaces from ip(8) for // Linux. func parseIfNameFromIPCmd(routeOut string) [][]string { @@ -1241,6 +1242,10 @@ func parseIfNameFromIPCmd(routeOut string) [][]string { // parseDefaultIfNameWindows parses the default interface from `netstat -rn` and // `ipconfig` on Windows. +// +// This has been deprecated in favor of a Powershell-based solution because of +// issues with localized Windows versions, but is currently retained for backward +// compatibility func parseDefaultIfNameWindows(routeOut, ipconfigOut string) (string, error) { defaultIPAddr, err := parseDefaultIPAddrWindowsRoute(routeOut) if err != nil { @@ -1262,6 +1267,10 @@ func parseDefaultIfNameWindows(routeOut, ipconfigOut string) (string, error) { // IPv6 connected host, submit an issue on github.com/hashicorp/go-sockaddr with // the output from `netstat -rn`, `ipconfig`, and version of Windows to see IPv6 // support added. +// +// This has been deprecated in favor of a Powershell-based solution because of +// issues with localized Windows versions, but is currently retained for backward +// compatibility. func parseDefaultIPAddrWindowsRoute(routeOut string) (string, error) { lines := strings.Split(routeOut, "\n") re := whitespaceRE.Copy() @@ -1282,6 +1291,10 @@ func parseDefaultIPAddrWindowsRoute(routeOut string) (string, error) { // parseDefaultIfNameWindowsIPConfig parses the output of `ipconfig` to find the // interface name forwarding traffic to the default gateway. +// +// This has been deprecated in favor of a Powershell-based solution because of +// issues with localized Windows versions, but is currently retained for backward +// compatibility func parseDefaultIfNameWindowsIPConfig(defaultIPAddr, routeOut string) (string, error) { lines := strings.Split(routeOut, "\n") ifNameRe := ifNameRE.Copy() diff --git a/vendor/github.com/hashicorp/go-sockaddr/route_info_test_windows.go b/vendor/github.com/hashicorp/go-sockaddr/route_info_test_windows.go new file mode 100644 index 00000000..a6eacdb2 --- /dev/null +++ b/vendor/github.com/hashicorp/go-sockaddr/route_info_test_windows.go @@ -0,0 +1,25 @@ +package sockaddr + +import "testing" + +func Test_parseWindowsDefaultIfName_new_vs_old(t *testing.T) { + if !hasPowershell() { + t.Skip("this test requires powershell.") + return + } + ri, err := NewRouteInfo() + if err != nil { + t.Fatalf("bad: %v", err) + } + psVer, err1 := ri.GetDefaultInterfaceName() + legacyVer, err2 := ri.GetDefaultInterfaceNameLegacy() + if err1 != nil { + t.Errorf("err != nil for GetDefaultInterfaceName - %v", err1) + } + if err2 != nil { + t.Errorf("err != nil for GetDefaultInterfaceNameLegacy - %v", err2) + } + if psVer != legacyVer { + t.Errorf("got %s; want %s", psVer, legacyVer) + } +} diff --git a/vendor/github.com/hashicorp/go-sockaddr/route_info_windows.go b/vendor/github.com/hashicorp/go-sockaddr/route_info_windows.go index 3da97288..087fad95 100644 --- a/vendor/github.com/hashicorp/go-sockaddr/route_info_windows.go +++ b/vendor/github.com/hashicorp/go-sockaddr/route_info_windows.go @@ -1,8 +1,14 @@ package sockaddr -import "os/exec" +import ( + "os/exec" + "strings" +) var cmds map[string][]string = map[string][]string{ + "defaultInterface": {"powershell", "Get-NetRoute -DestinationPrefix '0.0.0.0/0' | select -ExpandProperty InterfaceAlias"}, + // These commands enable GetDefaultInterfaceNameLegacy and should be removed + // when it is. "netstat": {"netstat", "-rn"}, "ipconfig": {"ipconfig"}, } @@ -22,6 +28,23 @@ func NewRouteInfo() (routeInfo, error) { // GetDefaultInterfaceName returns the interface name attached to the default // route on the default interface. func (ri routeInfo) GetDefaultInterfaceName() (string, error) { + if !hasPowershell() { + // No powershell, fallback to legacy method + return ri.GetDefaultInterfaceNameLegacy() + } + + ifNameOut, err := exec.Command(cmds["defaultInterface"][0], cmds["defaultInterface"][1:]...).Output() + if err != nil { + return "", err + } + + ifName := strings.TrimSpace(string(ifNameOut[:])) + return ifName, nil +} + +// GetDefaultInterfaceNameLegacy provides legacy behavior for GetDefaultInterfaceName +// on Windows machines without powershell. +func (ri routeInfo) GetDefaultInterfaceNameLegacy() (string, error) { ifNameOut, err := exec.Command(cmds["netstat"][0], cmds["netstat"][1:]...).Output() if err != nil { return "", err @@ -39,3 +62,8 @@ func (ri routeInfo) GetDefaultInterfaceName() (string, error) { return ifName, nil } + +func hasPowershell() bool { + _, err := exec.LookPath("powershell") + return (err != nil) +} diff --git a/vendor/github.com/hashicorp/go-sockaddr/unixsock.go b/vendor/github.com/hashicorp/go-sockaddr/unixsock.go index f3be3f67..17aed98a 100644 --- a/vendor/github.com/hashicorp/go-sockaddr/unixsock.go +++ b/vendor/github.com/hashicorp/go-sockaddr/unixsock.go @@ -27,6 +27,16 @@ func NewUnixSock(s string) (ret UnixSock, err error) { return ret, nil } +// Contains returns true if sa and us have the same path +func (us UnixSock) Contains(sa SockAddr) bool { + usb, ok := sa.(UnixSock) + if !ok { + return false + } + + return usb.path == us.path +} + // CmpAddress follows the Cmp() standard protocol and returns: // // - -1 If the receiver should sort first because its name lexically sorts before arg @@ -41,6 +51,9 @@ func (us UnixSock) CmpAddress(sa SockAddr) int { return strings.Compare(us.Path(), usb.Path()) } +// CmpRFC doesn't make sense for a Unix socket, so just return defer decision +func (us UnixSock) CmpRFC(rfcNum uint, sa SockAddr) int { return sortDeferDecision } + // DialPacketArgs returns the arguments required to be passed to net.DialUnix() // with the `unixgram` network type. func (us UnixSock) DialPacketArgs() (network, dialArgs string) { diff --git a/vendor/github.com/hashicorp/vault/api/README.md b/vendor/github.com/hashicorp/vault/api/README.md index 7230ce77..d21458c1 100644 --- a/vendor/github.com/hashicorp/vault/api/README.md +++ b/vendor/github.com/hashicorp/vault/api/README.md @@ -4,6 +4,6 @@ Vault API This provides the `github.com/hashicorp/vault/api` package which contains code useful for interacting with a Vault server. For examples of how to use this module, see the [vault-examples](https://github.com/hashicorp/vault-examples) repo. -For a step-by-step walkthrough on using these client libraries, see the [developer quickstart](https://www.vaultproject.io/docs/get-started/developer-qs). +For a step-by-step walkthrough on using these client libraries, see the [developer quickstart](https://developer.hashicorp.com/vault/docs/get-started/developer-qs). [![GoDoc](https://godoc.org/github.com/hashicorp/vault/api?status.png)](https://godoc.org/github.com/hashicorp/vault/api) \ No newline at end of file diff --git a/vendor/github.com/hashicorp/vault/api/client.go b/vendor/github.com/hashicorp/vault/api/client.go index d20477e1..1ba9da48 100644 --- a/vendor/github.com/hashicorp/vault/api/client.go +++ b/vendor/github.com/hashicorp/vault/api/client.go @@ -185,6 +185,9 @@ type Config struct { // CloneToken from parent. CloneToken bool + // CloneTLSConfig from parent (tls.Config). + CloneTLSConfig bool + // ReadYourWrites ensures isolated read-after-write semantics by // providing discovered cluster replication states in each request. // The shared state is automatically propagated to all Client clones. @@ -290,7 +293,14 @@ func (c *Config) configureTLS(t *TLSConfig) error { if c.HttpClient == nil { c.HttpClient = DefaultConfig().HttpClient } - clientTLSConfig := c.HttpClient.Transport.(*http.Transport).TLSClientConfig + + transport, ok := c.HttpClient.Transport.(*http.Transport) + if !ok { + return fmt.Errorf( + "unsupported HTTPClient transport type %T", c.HttpClient.Transport) + } + + clientTLSConfig := transport.TLSClientConfig var clientCert tls.Certificate foundClientCert := false @@ -535,7 +545,7 @@ func (c *Config) ParseAddress(address string) (*url.URL, error) { // be pointing to the protocol used in the application layer and not to // the transport layer. Hence, setting the fields accordingly. u.Scheme = "http" - u.Host = socket + u.Host = "localhost" u.Path = "" } else { return nil, fmt.Errorf("attempting to specify unix:// address with non-transport transport") @@ -988,7 +998,9 @@ func (c *Client) Namespace() string { func (c *Client) WithNamespace(namespace string) *Client { c2 := *c c2.modifyLock = sync.RWMutex{} - c2.headers = c.Headers() + c.modifyLock.RLock() + c2.headers = c.headersInternal() + c.modifyLock.RUnlock() if namespace == "" { c2.ClearNamespace() } else { @@ -1025,7 +1037,12 @@ func (c *Client) ClearToken() { func (c *Client) Headers() http.Header { c.modifyLock.RLock() defer c.modifyLock.RUnlock() + return c.headersInternal() +} +// headersInternal gets the current set of headers used for requests. Must be called +// with the read modifyLock held. +func (c *Client) headersInternal() http.Header { if c.headers == nil { return nil } @@ -1143,6 +1160,26 @@ func (c *Client) ReadYourWrites() bool { return c.config.ReadYourWrites } +// SetCloneTLSConfig from parent. +func (c *Client) SetCloneTLSConfig(clone bool) { + c.modifyLock.Lock() + defer c.modifyLock.Unlock() + c.config.modifyLock.Lock() + defer c.config.modifyLock.Unlock() + + c.config.CloneTLSConfig = clone +} + +// CloneTLSConfig gets the configured CloneTLSConfig value. +func (c *Client) CloneTLSConfig() bool { + c.modifyLock.RLock() + defer c.modifyLock.RUnlock() + c.config.modifyLock.RLock() + defer c.config.modifyLock.RUnlock() + + return c.config.CloneTLSConfig +} + // Clone creates a new client with the same configuration. Note that the same // underlying http.Client is used; modifying the client from more than one // goroutine at once may not be safe, so modify the client as needed and then @@ -1153,24 +1190,28 @@ func (c *Client) ReadYourWrites() bool { // the api.Config struct, such as policy override and wrapping function // behavior, must currently then be set as desired on the new client. func (c *Client) Clone() (*Client, error) { + c.modifyLock.RLock() + defer c.modifyLock.RUnlock() + c.config.modifyLock.RLock() + defer c.config.modifyLock.RUnlock() return c.clone(c.config.CloneHeaders) } // CloneWithHeaders creates a new client similar to Clone, with the difference -// being that the headers are always cloned +// being that the headers are always cloned func (c *Client) CloneWithHeaders() (*Client, error) { + c.modifyLock.RLock() + defer c.modifyLock.RUnlock() + c.config.modifyLock.RLock() + defer c.config.modifyLock.RUnlock() return c.clone(true) } // clone creates a new client, with the headers being cloned based on the -// passed in cloneheaders boolean +// passed in cloneheaders boolean. +// Must be called with the read lock and config read lock held. func (c *Client) clone(cloneHeaders bool) (*Client, error) { - c.modifyLock.RLock() - defer c.modifyLock.RUnlock() - config := c.config - config.modifyLock.RLock() - defer config.modifyLock.RUnlock() newConfig := &Config{ Address: config.Address, @@ -1189,13 +1230,18 @@ func (c *Client) clone(cloneHeaders bool) (*Client, error) { CloneToken: config.CloneToken, ReadYourWrites: config.ReadYourWrites, } + + if config.CloneTLSConfig { + newConfig.clientTLSConfig = config.clientTLSConfig + } + client, err := NewClient(newConfig) if err != nil { return nil, err } if cloneHeaders { - client.SetHeaders(c.Headers().Clone()) + client.SetHeaders(c.headersInternal().Clone()) } if config.CloneToken { @@ -1226,6 +1272,7 @@ func (c *Client) NewRequest(method, requestPath string) *Request { mfaCreds := c.mfaCreds wrappingLookupFunc := c.wrappingLookupFunc policyOverride := c.policyOverride + headers := c.headersInternal() c.modifyLock.RUnlock() host := addr.Host @@ -1270,7 +1317,7 @@ func (c *Client) NewRequest(method, requestPath string) *Request { req.WrapTTL = DefaultWrappingLookupFunc(method, lookupPath) } - req.Headers = c.Headers() + req.Headers = headers req.PolicyOverride = policyOverride return req diff --git a/vendor/github.com/hashicorp/vault/api/kv.go b/vendor/github.com/hashicorp/vault/api/kv.go index 20862fbf..72039325 100644 --- a/vendor/github.com/hashicorp/vault/api/kv.go +++ b/vendor/github.com/hashicorp/vault/api/kv.go @@ -38,7 +38,7 @@ type KVSecret struct { // by default when a server is started in -dev mode. See the kvv2 struct. // // Learn more about the KV secrets engine here: -// https://www.vaultproject.io/docs/secrets/kv +// https://developer.hashicorp.com/vault/docs/secrets/kv func (c *Client) KVv1(mountPath string) *KVv1 { return &KVv1{c: c, mountPath: mountPath} } @@ -53,7 +53,7 @@ func (c *Client) KVv1(mountPath string) *KVv1 { // as these are the default settings when a server is started in -dev mode. // // Learn more about the KV secrets engine here: -// https://www.vaultproject.io/docs/secrets/kv +// https://developer.hashicorp.com/vault/docs/secrets/kv func (c *Client) KVv2(mountPath string) *KVv2 { return &KVv2{c: c, mountPath: mountPath} } diff --git a/vendor/github.com/hashicorp/vault/api/plugin_helpers.go b/vendor/github.com/hashicorp/vault/api/plugin_helpers.go index 507b72c4..a8d23252 100644 --- a/vendor/github.com/hashicorp/vault/api/plugin_helpers.go +++ b/vendor/github.com/hashicorp/vault/api/plugin_helpers.go @@ -12,13 +12,23 @@ import ( "flag" "net/url" "os" - "regexp" "github.com/go-jose/go-jose/v3/jwt" "github.com/hashicorp/errwrap" ) +// This file contains helper code used when writing Vault auth method or secrets engine plugins. +// +// As such, it would be better located in the sdk module with the rest of the code which is only to support plugins, +// rather than api, but is here for historical reasons. (The api module used to depend on the sdk module, this code +// calls NewClient within the api package, so placing it in the sdk would have created a dependency cycle. This reason +// is now historical, as the dependency between sdk and api has since been reversed in direction.) +// Moving this code to the sdk would be appropriate if an api v2.0.0 release is ever planned. +// +// This helper code is used when a plugin is hosted by Vault 1.11 and earlier. Vault 1.12 and sdk v0.6.0 introduced +// version 5 of the backend plugin interface, which uses go-plugin's AutoMTLS feature instead of this code. + const ( // PluginAutoMTLSEnv is used to ensure AutoMTLS is used. This will override // setting a TLSProviderFunc for a plugin. @@ -33,50 +43,6 @@ const ( PluginUnwrapTokenEnv = "VAULT_UNWRAP_TOKEN" ) -// sudoPaths is a map containing the paths that require a token's policy -// to have the "sudo" capability. The keys are the paths as strings, in -// the same format as they are returned by the OpenAPI spec. The values -// are the regular expressions that can be used to test whether a given -// path matches that path or not (useful specifically for the paths that -// contain templated fields.) -var sudoPaths = map[string]*regexp.Regexp{ - "/auth/token/accessors/": regexp.MustCompile(`^/auth/token/accessors/?$`), - "/pki/root": regexp.MustCompile(`^/pki/root$`), - "/pki/root/sign-self-issued": regexp.MustCompile(`^/pki/root/sign-self-issued$`), - "/sys/audit": regexp.MustCompile(`^/sys/audit$`), - "/sys/audit/{path}": regexp.MustCompile(`^/sys/audit/.+$`), - "/sys/auth/{path}": regexp.MustCompile(`^/sys/auth/.+$`), - "/sys/auth/{path}/tune": regexp.MustCompile(`^/sys/auth/.+/tune$`), - "/sys/config/auditing/request-headers": regexp.MustCompile(`^/sys/config/auditing/request-headers$`), - "/sys/config/auditing/request-headers/{header}": regexp.MustCompile(`^/sys/config/auditing/request-headers/.+$`), - "/sys/config/cors": regexp.MustCompile(`^/sys/config/cors$`), - "/sys/config/ui/headers/": regexp.MustCompile(`^/sys/config/ui/headers/?$`), - "/sys/config/ui/headers/{header}": regexp.MustCompile(`^/sys/config/ui/headers/.+$`), - "/sys/leases": regexp.MustCompile(`^/sys/leases$`), - "/sys/leases/lookup/": regexp.MustCompile(`^/sys/leases/lookup/?$`), - "/sys/leases/lookup/{prefix}": regexp.MustCompile(`^/sys/leases/lookup/.+$`), - "/sys/leases/revoke-force/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-force/.+$`), - "/sys/leases/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-prefix/.+$`), - "/sys/plugins/catalog/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[^/]+$`), - "/sys/plugins/catalog/{type}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+$`), - "/sys/plugins/catalog/{type}/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+/[^/]+$`), - "/sys/raw": regexp.MustCompile(`^/sys/raw$`), - "/sys/raw/{path}": regexp.MustCompile(`^/sys/raw/.+$`), - "/sys/remount": regexp.MustCompile(`^/sys/remount$`), - "/sys/revoke-force/{prefix}": regexp.MustCompile(`^/sys/revoke-force/.+$`), - "/sys/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/revoke-prefix/.+$`), - "/sys/rotate": regexp.MustCompile(`^/sys/rotate$`), - "/sys/internal/inspect/router/{tag}": regexp.MustCompile(`^/sys/internal/inspect/router/.+$`), - - // enterprise-only paths - "/sys/replication/dr/primary/secondary-token": regexp.MustCompile(`^/sys/replication/dr/primary/secondary-token$`), - "/sys/replication/performance/primary/secondary-token": regexp.MustCompile(`^/sys/replication/performance/primary/secondary-token$`), - "/sys/replication/primary/secondary-token": regexp.MustCompile(`^/sys/replication/primary/secondary-token$`), - "/sys/replication/reindex": regexp.MustCompile(`^/sys/replication/reindex$`), - "/sys/storage/raft/snapshot-auto/config/": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/?$`), - "/sys/storage/raft/snapshot-auto/config/{name}": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/[^/]+$`), -} - // PluginAPIClientMeta is a helper that plugins can use to configure TLS connections // back to Vault. type PluginAPIClientMeta struct { @@ -244,28 +210,3 @@ func VaultPluginTLSProviderContext(ctx context.Context, apiTLSConfig *TLSConfig) return tlsConfig, nil } } - -func SudoPaths() map[string]*regexp.Regexp { - return sudoPaths -} - -// Determine whether the given path requires the sudo capability -func IsSudoPath(path string) bool { - // Return early if the path is any of the non-templated sudo paths. - if _, ok := sudoPaths[path]; ok { - return true - } - - // Some sudo paths have templated fields in them. - // (e.g. /sys/revoke-prefix/{prefix}) - // The values in the sudoPaths map are actually regular expressions, - // so we can check if our path matches against them. - for _, sudoPathRegexp := range sudoPaths { - match := sudoPathRegexp.MatchString(path) - if match { - return true - } - } - - return false -} diff --git a/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go b/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go new file mode 100644 index 00000000..d3acd0d0 --- /dev/null +++ b/vendor/github.com/hashicorp/vault/api/plugin_runtime_types.go @@ -0,0 +1,41 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package api + +// NOTE: this file was copied from +// https://github.com/hashicorp/vault/blob/main/sdk/helper/consts/plugin_runtime_types.go +// Any changes made should be made to both files at the same time. + +import "fmt" + +var PluginRuntimeTypes = []PluginRuntimeType{ + PluginRuntimeTypeUnsupported, + PluginRuntimeTypeContainer, +} + +type PluginRuntimeType uint32 + +// This is a list of PluginRuntimeTypes used by Vault. +const ( + PluginRuntimeTypeUnsupported PluginRuntimeType = iota + PluginRuntimeTypeContainer +) + +func (r PluginRuntimeType) String() string { + switch r { + case PluginRuntimeTypeContainer: + return "container" + default: + return "unsupported" + } +} + +func ParsePluginRuntimeType(PluginRuntimeType string) (PluginRuntimeType, error) { + switch PluginRuntimeType { + case "container": + return PluginRuntimeTypeContainer, nil + default: + return PluginRuntimeTypeUnsupported, fmt.Errorf("%q is not a supported plugin runtime type", PluginRuntimeType) + } +} diff --git a/vendor/github.com/hashicorp/vault/api/replication_status.go b/vendor/github.com/hashicorp/vault/api/replication_status.go new file mode 100644 index 00000000..1668daf1 --- /dev/null +++ b/vendor/github.com/hashicorp/vault/api/replication_status.go @@ -0,0 +1,130 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package api + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + + "github.com/mitchellh/mapstructure" +) + +const ( + apiRepPerformanceStatusPath = "/v1/sys/replication/performance/status" + apiRepDRStatusPath = "/v1/sys/replication/dr/status" + apiRepStatusPath = "/v1/sys/replication/status" +) + +type ClusterInfo struct { + APIAddr string `json:"api_address,omitempty" mapstructure:"api_address"` + ClusterAddress string `json:"cluster_address,omitempty" mapstructure:"cluster_address"` + ConnectionStatus string `json:"connection_status,omitempty" mapstructure:"connection_status"` + LastHeartBeat string `json:"last_heartbeat,omitempty" mapstructure:"last_heartbeat"` + NodeID string `json:"node_id,omitempty" mapstructure:"node_id"` +} + +type ReplicationStatusGenericResponse struct { + LastDRWAL uint64 `json:"last_dr_wal,omitempty" mapstructure:"last_dr_wal"` + LastReindexEpoch string `json:"last_reindex_epoch,omitempty" mapstructure:"last_reindex_epoch"` + ClusterID string `json:"cluster_id,omitempty" mapstructure:"cluster_id"` + LastWAL uint64 `json:"last_wal,omitempty" mapstructure:"last_wal"` + MerkleRoot string `json:"merkle_root,omitempty" mapstructure:"merkle_root"` + Mode string `json:"mode,omitempty" mapstructure:"mode"` + PrimaryClusterAddr string `json:"primary_cluster_addr,omitempty" mapstructure:"primary_cluster_addr"` + LastPerformanceWAL uint64 `json:"last_performance_wal,omitempty" mapstructure:"last_performance_wal"` + State string `json:"state,omitempty" mapstructure:"state"` + LastRemoteWAL uint64 `json:"last_remote_wal,omitempty" mapstructure:"last_remote_wal"` + SecondaryID string `json:"secondary_id,omitempty" mapstructure:"secondary_id"` + SSCTGenerationCounter uint64 `json:"ssct_generation_counter,omitempty" mapstructure:"ssct_generation_counter"` + + KnownSecondaries []string `json:"known_secondaries,omitempty" mapstructure:"known_secondaries"` + KnownPrimaryClusterAddrs []string `json:"known_primary_cluster_addrs,omitempty" mapstructure:"known_primary_cluster_addrs"` + Primaries []ClusterInfo `json:"primaries,omitempty" mapstructure:"primaries"` + Secondaries []ClusterInfo `json:"secondaries,omitempty" mapstructure:"secondaries"` +} + +type ReplicationStatusResponse struct { + DR ReplicationStatusGenericResponse `json:"dr,omitempty" mapstructure:"dr"` + Performance ReplicationStatusGenericResponse `json:"performance,omitempty" mapstructure:"performance"` +} + +func (c *Sys) ReplicationStatus() (*ReplicationStatusResponse, error) { + return c.ReplicationStatusWithContext(context.Background(), apiRepStatusPath) +} + +func (c *Sys) ReplicationPerformanceStatusWithContext(ctx context.Context) (*ReplicationStatusGenericResponse, error) { + s, err := c.ReplicationStatusWithContext(ctx, apiRepPerformanceStatusPath) + if err != nil { + return nil, err + } + + return &s.Performance, nil +} + +func (c *Sys) ReplicationDRStatusWithContext(ctx context.Context) (*ReplicationStatusGenericResponse, error) { + s, err := c.ReplicationStatusWithContext(ctx, apiRepDRStatusPath) + if err != nil { + return nil, err + } + + return &s.DR, nil +} + +func (c *Sys) ReplicationStatusWithContext(ctx context.Context, path string) (*ReplicationStatusResponse, error) { + // default to replication/status + if path == "" { + path = apiRepStatusPath + } + + ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) + defer cancelFunc() + + r := c.c.NewRequest(http.MethodGet, path) + + resp, err := c.c.rawRequestWithContext(ctx, r) + if err != nil { + return nil, err + } + defer func() { _ = resp.Body.Close() }() + + // First decode response into a map[string]interface{} + data := make(map[string]interface{}) + dec := json.NewDecoder(resp.Body) + dec.UseNumber() + if err := dec.Decode(&data); err != nil { + return nil, err + } + + rawData, ok := data["data"] + if !ok { + return nil, fmt.Errorf("empty data in replication status response") + } + + s := &ReplicationStatusResponse{} + g := &ReplicationStatusGenericResponse{} + switch { + case path == apiRepPerformanceStatusPath: + err = mapstructure.Decode(rawData, g) + if err != nil { + return nil, err + } + s.Performance = *g + case path == apiRepDRStatusPath: + err = mapstructure.Decode(rawData, g) + if err != nil { + return nil, err + } + s.DR = *g + default: + err = mapstructure.Decode(rawData, s) + if err != nil { + return nil, err + } + return s, err + } + + return s, err +} diff --git a/vendor/github.com/hashicorp/vault/api/sudo_paths.go b/vendor/github.com/hashicorp/vault/api/sudo_paths.go new file mode 100644 index 00000000..24beb4bb --- /dev/null +++ b/vendor/github.com/hashicorp/vault/api/sudo_paths.go @@ -0,0 +1,87 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package api + +import ( + "regexp" +) + +// sudoPaths is a map containing the paths that require a token's policy +// to have the "sudo" capability. The keys are the paths as strings, in +// the same format as they are returned by the OpenAPI spec. The values +// are the regular expressions that can be used to test whether a given +// path matches that path or not (useful specifically for the paths that +// contain templated fields.) +var sudoPaths = map[string]*regexp.Regexp{ + "/auth/token/accessors": regexp.MustCompile(`^/auth/token/accessors/?$`), + "/auth/token/revoke-orphan": regexp.MustCompile(`^/auth/token/revoke-orphan$`), + "/pki/root": regexp.MustCompile(`^/pki/root$`), + "/pki/root/sign-self-issued": regexp.MustCompile(`^/pki/root/sign-self-issued$`), + "/sys/audit": regexp.MustCompile(`^/sys/audit$`), + "/sys/audit/{path}": regexp.MustCompile(`^/sys/audit/.+$`), + "/sys/auth/{path}": regexp.MustCompile(`^/sys/auth/.+$`), + "/sys/auth/{path}/tune": regexp.MustCompile(`^/sys/auth/.+/tune$`), + "/sys/config/auditing/request-headers": regexp.MustCompile(`^/sys/config/auditing/request-headers$`), + "/sys/config/auditing/request-headers/{header}": regexp.MustCompile(`^/sys/config/auditing/request-headers/.+$`), + "/sys/config/cors": regexp.MustCompile(`^/sys/config/cors$`), + "/sys/config/ui/headers": regexp.MustCompile(`^/sys/config/ui/headers/?$`), + "/sys/config/ui/headers/{header}": regexp.MustCompile(`^/sys/config/ui/headers/.+$`), + "/sys/internal/inspect/router/{tag}": regexp.MustCompile(`^/sys/internal/inspect/router/.+$`), + "/sys/leases": regexp.MustCompile(`^/sys/leases$`), + // This entry is a bit wrong... sys/leases/lookup does NOT require sudo. But sys/leases/lookup/ with a trailing + // slash DOES require sudo. But the part of the Vault CLI that uses this logic doesn't pass operation-appropriate + // trailing slashes, it always strips them off, so we end up giving the wrong answer for one of these. + "/sys/leases/lookup/{prefix}": regexp.MustCompile(`^/sys/leases/lookup(?:/.+)?$`), + "/sys/leases/revoke-force/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-force/.+$`), + "/sys/leases/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/leases/revoke-prefix/.+$`), + "/sys/plugins/catalog/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[^/]+$`), + "/sys/plugins/catalog/{type}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+$`), + "/sys/plugins/catalog/{type}/{name}": regexp.MustCompile(`^/sys/plugins/catalog/[\w-]+/[^/]+$`), + "/sys/plugins/runtimes/catalog": regexp.MustCompile(`^/sys/plugins/runtimes/catalog/?$`), + "/sys/plugins/runtimes/catalog/{type}/{name}": regexp.MustCompile(`^/sys/plugins/runtimes/catalog/[\w-]+/[^/]+$`), + "/sys/raw/{path}": regexp.MustCompile(`^/sys/raw(?:/.+)?$`), + "/sys/remount": regexp.MustCompile(`^/sys/remount$`), + "/sys/revoke-force/{prefix}": regexp.MustCompile(`^/sys/revoke-force/.+$`), + "/sys/revoke-prefix/{prefix}": regexp.MustCompile(`^/sys/revoke-prefix/.+$`), + "/sys/rotate": regexp.MustCompile(`^/sys/rotate$`), + "/sys/seal": regexp.MustCompile(`^/sys/seal$`), + "/sys/step-down": regexp.MustCompile(`^/sys/step-down$`), + + // enterprise-only paths + "/sys/replication/dr/primary/secondary-token": regexp.MustCompile(`^/sys/replication/dr/primary/secondary-token$`), + "/sys/replication/performance/primary/secondary-token": regexp.MustCompile(`^/sys/replication/performance/primary/secondary-token$`), + "/sys/replication/primary/secondary-token": regexp.MustCompile(`^/sys/replication/primary/secondary-token$`), + "/sys/replication/reindex": regexp.MustCompile(`^/sys/replication/reindex$`), + "/sys/storage/raft/snapshot-auto/config": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/?$`), + "/sys/storage/raft/snapshot-auto/config/{name}": regexp.MustCompile(`^/sys/storage/raft/snapshot-auto/config/[^/]+$`), +} + +func SudoPaths() map[string]*regexp.Regexp { + return sudoPaths +} + +// Determine whether the given path requires the sudo capability. +// Note that this uses hardcoded static path information, so will return incorrect results for paths in namespaces, +// or for secret engines mounted at non-default paths. +// Expects to receive a path with an initial slash, but no trailing slashes, as the Vault CLI (the only known and +// expected user of this function) sanitizes its paths that way. +func IsSudoPath(path string) bool { + // Return early if the path is any of the non-templated sudo paths. + if _, ok := sudoPaths[path]; ok { + return true + } + + // Some sudo paths have templated fields in them. + // (e.g. /sys/revoke-prefix/{prefix}) + // The values in the sudoPaths map are actually regular expressions, + // so we can check if our path matches against them. + for _, sudoPathRegexp := range sudoPaths { + match := sudoPathRegexp.MatchString(path) + if match { + return true + } + } + + return false +} diff --git a/vendor/github.com/hashicorp/vault/api/sys_plugins.go b/vendor/github.com/hashicorp/vault/api/sys_plugins.go index 2ee024d9..68320d2d 100644 --- a/vendor/github.com/hashicorp/vault/api/sys_plugins.go +++ b/vendor/github.com/hashicorp/vault/api/sys_plugins.go @@ -144,6 +144,7 @@ type GetPluginResponse struct { Args []string `json:"args"` Builtin bool `json:"builtin"` Command string `json:"command"` + OCIImage string `json:"oci_image"` Name string `json:"name"` SHA256 string `json:"sha256"` DeprecationStatus string `json:"deprecation_status,omitempty"` @@ -201,6 +202,13 @@ type RegisterPluginInput struct { // Version is the optional version of the plugin being registered Version string `json:"version,omitempty"` + + // OCIImage specifies the container image to run as a plugin. + OCIImage string `json:"oci_image,omitempty"` + + // Env specifies a list of key=value pairs to add to the plugin's environment + // variables. + Env []string `json:"env,omitempty"` } // RegisterPlugin wraps RegisterPluginWithContext using context.Background. diff --git a/vendor/github.com/hashicorp/vault/api/sys_plugins_runtimes.go b/vendor/github.com/hashicorp/vault/api/sys_plugins_runtimes.go new file mode 100644 index 00000000..c3380a85 --- /dev/null +++ b/vendor/github.com/hashicorp/vault/api/sys_plugins_runtimes.go @@ -0,0 +1,189 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package api + +import ( + "context" + "errors" + "fmt" + "net/http" + + "github.com/mitchellh/mapstructure" +) + +// GetPluginRuntimeInput is used as input to the GetPluginRuntime function. +type GetPluginRuntimeInput struct { + Name string `json:"-"` + + // Type of the plugin runtime. Required. + Type PluginRuntimeType `json:"type"` +} + +// GetPluginRuntimeResponse is the response from the GetPluginRuntime call. +type GetPluginRuntimeResponse struct { + Type string `json:"type"` + Name string `json:"name"` + OCIRuntime string `json:"oci_runtime"` + CgroupParent string `json:"cgroup_parent"` + CPU int64 `json:"cpu_nanos"` + Memory int64 `json:"memory_bytes"` +} + +// GetPluginRuntime retrieves information about the plugin. +func (c *Sys) GetPluginRuntime(ctx context.Context, i *GetPluginRuntimeInput) (*GetPluginRuntimeResponse, error) { + ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) + defer cancelFunc() + + path := pluginRuntimeCatalogPathByType(i.Type, i.Name) + req := c.c.NewRequest(http.MethodGet, path) + + resp, err := c.c.rawRequestWithContext(ctx, req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + var result struct { + Data *GetPluginRuntimeResponse + } + err = resp.DecodeJSON(&result) + if err != nil { + return nil, err + } + return result.Data, err +} + +// RegisterPluginRuntimeInput is used as input to the RegisterPluginRuntime function. +type RegisterPluginRuntimeInput struct { + // Name is the name of the plugin. Required. + Name string `json:"-"` + + // Type of the plugin. Required. + Type PluginRuntimeType `json:"type"` + + OCIRuntime string `json:"oci_runtime,omitempty"` + CgroupParent string `json:"cgroup_parent,omitempty"` + CPU int64 `json:"cpu,omitempty"` + Memory int64 `json:"memory,omitempty"` +} + +// RegisterPluginRuntime registers the plugin with the given information. +func (c *Sys) RegisterPluginRuntime(ctx context.Context, i *RegisterPluginRuntimeInput) error { + ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) + defer cancelFunc() + + path := pluginRuntimeCatalogPathByType(i.Type, i.Name) + req := c.c.NewRequest(http.MethodPut, path) + + if err := req.SetJSONBody(i); err != nil { + return err + } + + resp, err := c.c.rawRequestWithContext(ctx, req) + if err == nil { + defer resp.Body.Close() + } + return err +} + +// DeregisterPluginRuntimeInput is used as input to the DeregisterPluginRuntime function. +type DeregisterPluginRuntimeInput struct { + // Name is the name of the plugin runtime. Required. + Name string `json:"-"` + + // Type of the plugin. Required. + Type PluginRuntimeType `json:"type"` +} + +// DeregisterPluginRuntime removes the plugin with the given name from the plugin +// catalog. +func (c *Sys) DeregisterPluginRuntime(ctx context.Context, i *DeregisterPluginRuntimeInput) error { + ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) + defer cancelFunc() + + path := pluginRuntimeCatalogPathByType(i.Type, i.Name) + req := c.c.NewRequest(http.MethodDelete, path) + resp, err := c.c.rawRequestWithContext(ctx, req) + if err == nil { + defer resp.Body.Close() + } + return err +} + +type PluginRuntimeDetails struct { + Type string `json:"type" mapstructure:"type"` + Name string `json:"name" mapstructure:"name"` + OCIRuntime string `json:"oci_runtime" mapstructure:"oci_runtime"` + CgroupParent string `json:"cgroup_parent" mapstructure:"cgroup_parent"` + CPU int64 `json:"cpu_nanos" mapstructure:"cpu_nanos"` + Memory int64 `json:"memory_bytes" mapstructure:"memory_bytes"` +} + +// ListPluginRuntimesInput is used as input to the ListPluginRuntimes function. +type ListPluginRuntimesInput struct { + // Type of the plugin. Required. + Type PluginRuntimeType `json:"type"` +} + +// ListPluginRuntimesResponse is the response from the ListPluginRuntimes call. +type ListPluginRuntimesResponse struct { + // RuntimesByType is the list of plugin runtimes by type. + Runtimes []PluginRuntimeDetails `json:"runtimes"` +} + +// ListPluginRuntimes lists all plugin runtimes in the catalog and returns their names as a +// list of strings. +func (c *Sys) ListPluginRuntimes(ctx context.Context, input *ListPluginRuntimesInput) (*ListPluginRuntimesResponse, error) { + ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) + defer cancelFunc() + + if input != nil && input.Type == PluginRuntimeTypeUnsupported { + return nil, fmt.Errorf("%q is not a supported runtime type", input.Type.String()) + } + + resp, err := c.c.rawRequestWithContext(ctx, c.c.NewRequest(http.MethodGet, "/v1/sys/plugins/runtimes/catalog")) + if err != nil && resp == nil { + return nil, err + } + if resp == nil { + return nil, nil + } + defer resp.Body.Close() + + secret, err := ParseSecret(resp.Body) + if err != nil { + return nil, err + } + if secret == nil || secret.Data == nil { + return nil, errors.New("data from server response is empty") + } + if _, ok := secret.Data["runtimes"]; !ok { + return nil, fmt.Errorf("data from server response does not contain runtimes") + } + + var runtimes []PluginRuntimeDetails + if err = mapstructure.Decode(secret.Data["runtimes"], &runtimes); err != nil { + return nil, err + } + + // return all runtimes in the catalog + if input == nil { + return &ListPluginRuntimesResponse{Runtimes: runtimes}, nil + } + + result := &ListPluginRuntimesResponse{ + Runtimes: []PluginRuntimeDetails{}, + } + for _, runtime := range runtimes { + if runtime.Type == input.Type.String() { + result.Runtimes = append(result.Runtimes, runtime) + } + } + return result, nil +} + +// pluginRuntimeCatalogPathByType is a helper to construct the proper API path by plugin type +func pluginRuntimeCatalogPathByType(runtimeType PluginRuntimeType, name string) string { + return fmt.Sprintf("/v1/sys/plugins/runtimes/catalog/%s/%s", runtimeType, name) +} diff --git a/vendor/github.com/hashicorp/vault/api/sys_raft.go b/vendor/github.com/hashicorp/vault/api/sys_raft.go index 29bfed0f..4b9487c6 100644 --- a/vendor/github.com/hashicorp/vault/api/sys_raft.go +++ b/vendor/github.com/hashicorp/vault/api/sys_raft.go @@ -276,11 +276,19 @@ func (c *Sys) RaftAutopilotState() (*AutopilotState, error) { return c.RaftAutopilotStateWithContext(context.Background()) } +// RaftAutopilotStateWithToken wraps RaftAutopilotStateWithContext using the given token. +func (c *Sys) RaftAutopilotStateWithDRToken(drToken string) (*AutopilotState, error) { + return c.RaftAutopilotStateWithContext(context.WithValue(context.Background(), "dr-token", drToken)) +} + // RaftAutopilotStateWithContext returns the state of the raft cluster as seen by autopilot. func (c *Sys) RaftAutopilotStateWithContext(ctx context.Context) (*AutopilotState, error) { ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) defer cancelFunc() + if ctx.Value("dr-token") != nil { + c.c.SetToken(ctx.Value("dr-token").(string)) + } r := c.c.NewRequest(http.MethodGet, "/v1/sys/storage/raft/autopilot/state") resp, err := c.c.rawRequestWithContext(ctx, r) @@ -316,11 +324,20 @@ func (c *Sys) RaftAutopilotConfiguration() (*AutopilotConfig, error) { return c.RaftAutopilotConfigurationWithContext(context.Background()) } +// RaftAutopilotConfigurationWithDRToken wraps RaftAutopilotConfigurationWithContext using the given token. +func (c *Sys) RaftAutopilotConfigurationWithDRToken(drToken string) (*AutopilotConfig, error) { + return c.RaftAutopilotConfigurationWithContext(context.WithValue(context.Background(), "dr-token", drToken)) +} + // RaftAutopilotConfigurationWithContext fetches the autopilot config. func (c *Sys) RaftAutopilotConfigurationWithContext(ctx context.Context) (*AutopilotConfig, error) { ctx, cancelFunc := c.c.withConfiguredTimeout(ctx) defer cancelFunc() + if ctx.Value("dr-token") != nil { + c.c.SetToken(ctx.Value("dr-token").(string)) + } + r := c.c.NewRequest(http.MethodGet, "/v1/sys/storage/raft/autopilot/configuration") resp, err := c.c.rawRequestWithContext(ctx, r) diff --git a/vendor/github.com/mattn/go-isatty/isatty_bsd.go b/vendor/github.com/mattn/go-isatty/isatty_bsd.go index d569c0c9..d0ea68f4 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_bsd.go +++ b/vendor/github.com/mattn/go-isatty/isatty_bsd.go @@ -1,6 +1,7 @@ -//go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine +//go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo // +build darwin freebsd openbsd netbsd dragonfly hurd // +build !appengine +// +build !tinygo package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index 31503226..7402e061 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,5 +1,6 @@ -//go:build appengine || js || nacl || wasm -// +build appengine js nacl wasm +//go:build (appengine || js || nacl || tinygo || wasm) && !windows +// +build appengine js nacl tinygo wasm +// +build !windows package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go index 67787657..0337d8cf 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go +++ b/vendor/github.com/mattn/go-isatty/isatty_tcgets.go @@ -1,6 +1,7 @@ -//go:build (linux || aix || zos) && !appengine +//go:build (linux || aix || zos) && !appengine && !tinygo // +build linux aix zos // +build !appengine +// +build !tinygo package isatty diff --git a/vendor/github.com/pelletier/go-toml/v2/.goreleaser.yaml b/vendor/github.com/pelletier/go-toml/v2/.goreleaser.yaml index 3aa1840e..1d8b69e6 100644 --- a/vendor/github.com/pelletier/go-toml/v2/.goreleaser.yaml +++ b/vendor/github.com/pelletier/go-toml/v2/.goreleaser.yaml @@ -18,6 +18,7 @@ builds: - linux_amd64 - linux_arm64 - linux_arm + - linux_riscv64 - windows_amd64 - windows_arm64 - windows_arm @@ -37,6 +38,7 @@ builds: - linux_amd64 - linux_arm64 - linux_arm + - linux_riscv64 - windows_amd64 - windows_arm64 - windows_arm @@ -55,6 +57,7 @@ builds: targets: - linux_amd64 - linux_arm64 + - linux_riscv64 - linux_arm - windows_amd64 - windows_arm64 diff --git a/vendor/github.com/pelletier/go-toml/v2/LICENSE b/vendor/github.com/pelletier/go-toml/v2/LICENSE index 6839d51c..991e2ae9 100644 --- a/vendor/github.com/pelletier/go-toml/v2/LICENSE +++ b/vendor/github.com/pelletier/go-toml/v2/LICENSE @@ -1,6 +1,7 @@ The MIT License (MIT) -Copyright (c) 2013 - 2022 Thomas Pelletier, Eric Anderton +go-toml v2 +Copyright (c) 2021 - 2023 Thomas Pelletier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/github.com/pelletier/go-toml/v2/README.md b/vendor/github.com/pelletier/go-toml/v2/README.md index d53f4397..63b92f3b 100644 --- a/vendor/github.com/pelletier/go-toml/v2/README.md +++ b/vendor/github.com/pelletier/go-toml/v2/README.md @@ -45,16 +45,15 @@ to check for typos. [See example in the documentation][strict]. ### Contextualized errors -When most decoding errors occur, go-toml returns [`DecodeError`][decode-err]), +When most decoding errors occur, go-toml returns [`DecodeError`][decode-err], which contains a human readable contextualized version of the error. For example: ``` -2| key1 = "value1" -3| key2 = "missing2" - | ~~~~ missing field -4| key3 = "missing3" -5| key4 = "value4" +1| [server] +2| path = 100 + | ~~~ cannot decode TOML integer into struct field toml_test.Server.Path of type string +3| port = 50 ``` [decode-err]: https://pkg.go.dev/github.com/pelletier/go-toml/v2#DecodeError @@ -73,6 +72,26 @@ representation. [tlt]: https://pkg.go.dev/github.com/pelletier/go-toml/v2#LocalTime [tldt]: https://pkg.go.dev/github.com/pelletier/go-toml/v2#LocalDateTime +### Commented config + +Since TOML is often used for configuration files, go-toml can emit documents +annotated with [comments and commented-out values][comments-example]. For +example, it can generate the following file: + +```toml +# Host IP to connect to. +host = '127.0.0.1' +# Port of the remote server. +port = 4242 + +# Encryption parameters (optional) +# [TLS] +# cipher = 'AEAD-AES128-GCM-SHA256' +# version = 'TLS 1.3' +``` + +[comments-example]: https://pkg.go.dev/github.com/pelletier/go-toml/v2#example-Marshal-Commented + ## Getting started Given the following struct, let's see how to read it and write it as TOML: @@ -497,27 +516,20 @@ is not necessary anymore. V1 used to provide multiple struct tags: `comment`, `commented`, `multiline`, `toml`, and `omitempty`. To behave more like the standard library, v2 has merged -`toml`, `multiline`, and `omitempty`. For example: +`toml`, `multiline`, `commented`, and `omitempty`. For example: ```go type doc struct { // v1 - F string `toml:"field" multiline:"true" omitempty:"true"` + F string `toml:"field" multiline:"true" omitempty:"true" commented:"true"` // v2 - F string `toml:"field,multiline,omitempty"` + F string `toml:"field,multiline,omitempty,commented"` } ``` Has a result, the `Encoder.SetTag*` methods have been removed, as there is just one tag now. - -#### `commented` tag has been removed - -There is no replacement for the `commented` tag. This feature would be better -suited in a proper document model for go-toml v2, which has been [cut from -scope][nodoc] at the moment. - #### `Encoder.ArraysWithOneElementPerLine` has been renamed The new name is `Encoder.SetArraysMultiline`. The behavior should be the same. diff --git a/vendor/github.com/pelletier/go-toml/v2/decode.go b/vendor/github.com/pelletier/go-toml/v2/decode.go index 3a860d0f..f0ec3b17 100644 --- a/vendor/github.com/pelletier/go-toml/v2/decode.go +++ b/vendor/github.com/pelletier/go-toml/v2/decode.go @@ -318,7 +318,7 @@ func parseFloat(b []byte) (float64, error) { if cleaned[0] == '+' || cleaned[0] == '-' { start = 1 } - if cleaned[start] == '0' && isDigit(cleaned[start+1]) { + if cleaned[start] == '0' && len(cleaned) > start+1 && isDigit(cleaned[start+1]) { return 0, unstable.NewParserError(b, "float integer part cannot have leading zeroes") } diff --git a/vendor/github.com/pelletier/go-toml/v2/marshaler.go b/vendor/github.com/pelletier/go-toml/v2/marshaler.go index 83875260..6fe78533 100644 --- a/vendor/github.com/pelletier/go-toml/v2/marshaler.go +++ b/vendor/github.com/pelletier/go-toml/v2/marshaler.go @@ -148,6 +148,9 @@ func (enc *Encoder) SetIndentTables(indent bool) *Encoder { // // The "omitempty" option prevents empty values or groups from being emitted. // +// The "commented" option prefixes the value and all its children with a comment +// symbol. +// // In addition to the "toml" tag struct tag, a "comment" tag can be used to emit // a TOML comment before the value being annotated. Comments are ignored inside // inline tables. For array tables, the comment is only present before the first @@ -180,6 +183,7 @@ func (enc *Encoder) Encode(v interface{}) error { type valueOptions struct { multiline bool omitempty bool + commented bool comment string } @@ -205,6 +209,9 @@ type encoderCtx struct { // Indentation level indent int + // Prefix the current value with a comment. + commented bool + // Options coming from struct tags options valueOptions } @@ -357,6 +364,7 @@ func (enc *Encoder) encodeKv(b []byte, ctx encoderCtx, options valueOptions, v r if !ctx.inline { b = enc.encodeComment(ctx.indent, options.comment, b) + b = enc.commented(ctx.commented, b) b = enc.indent(ctx.indent, b) } @@ -378,6 +386,13 @@ func (enc *Encoder) encodeKv(b []byte, ctx encoderCtx, options valueOptions, v r return b, nil } +func (enc *Encoder) commented(commented bool, b []byte) []byte { + if commented { + return append(b, "# "...) + } + return b +} + func isEmptyValue(v reflect.Value) bool { switch v.Kind() { case reflect.Struct: @@ -526,6 +541,8 @@ func (enc *Encoder) encodeTableHeader(ctx encoderCtx, b []byte) ([]byte, error) b = enc.encodeComment(ctx.indent, ctx.options.comment, b) + b = enc.commented(ctx.commented, b) + b = enc.indent(ctx.indent, b) b = append(b, '[') @@ -704,6 +721,7 @@ func walkStruct(ctx encoderCtx, t *table, v reflect.Value) { options := valueOptions{ multiline: opts.multiline, omitempty: opts.omitempty, + commented: opts.commented, comment: fieldType.Tag.Get("comment"), } @@ -763,6 +781,7 @@ type tagOptions struct { multiline bool inline bool omitempty bool + commented bool } func parseTag(tag string) (string, tagOptions) { @@ -790,6 +809,8 @@ func parseTag(tag string) (string, tagOptions) { opts.inline = true case "omitempty": opts.omitempty = true + case "commented": + opts.commented = true } } @@ -825,8 +846,10 @@ func (enc *Encoder) encodeTable(b []byte, ctx encoderCtx, t table) ([]byte, erro hasNonEmptyKV = true ctx.setKey(kv.Key) + ctx2 := ctx + ctx2.commented = kv.Options.commented || ctx2.commented - b, err = enc.encodeKv(b, ctx, kv.Options, kv.Value) + b, err = enc.encodeKv(b, ctx2, kv.Options, kv.Value) if err != nil { return nil, err } @@ -851,8 +874,10 @@ func (enc *Encoder) encodeTable(b []byte, ctx encoderCtx, t table) ([]byte, erro ctx.setKey(table.Key) ctx.options = table.Options + ctx2 := ctx + ctx2.commented = ctx2.commented || ctx.options.commented - b, err = enc.encode(b, ctx, table.Value) + b, err = enc.encode(b, ctx2, table.Value) if err != nil { return nil, err } @@ -970,6 +995,9 @@ func (enc *Encoder) encodeSliceAsArrayTable(b []byte, ctx encoderCtx, v reflect. ctx.shiftKey() scratch := make([]byte, 0, 64) + + scratch = enc.commented(ctx.commented, scratch) + scratch = append(scratch, "[["...) for i, k := range ctx.parentKey { @@ -985,6 +1013,10 @@ func (enc *Encoder) encodeSliceAsArrayTable(b []byte, ctx encoderCtx, v reflect. b = enc.encodeComment(ctx.indent, ctx.options.comment, b) + if enc.indentTables { + ctx.indent++ + } + for i := 0; i < v.Len(); i++ { if i != 0 { b = append(b, "\n"...) diff --git a/vendor/github.com/pelletier/go-toml/v2/unmarshaler.go b/vendor/github.com/pelletier/go-toml/v2/unmarshaler.go index 5cede081..868c74c1 100644 --- a/vendor/github.com/pelletier/go-toml/v2/unmarshaler.go +++ b/vendor/github.com/pelletier/go-toml/v2/unmarshaler.go @@ -149,12 +149,16 @@ type errorContext struct { } func (d *decoder) typeMismatchError(toml string, target reflect.Type) error { + return fmt.Errorf("toml: %s", d.typeMismatchString(toml, target)) +} + +func (d *decoder) typeMismatchString(toml string, target reflect.Type) string { if d.errorContext != nil && d.errorContext.Struct != nil { ctx := d.errorContext f := ctx.Struct.FieldByIndex(ctx.Field) - return fmt.Errorf("toml: cannot decode TOML %s into struct field %s.%s of type %s", toml, ctx.Struct, f.Name, f.Type) + return fmt.Sprintf("cannot decode TOML %s into struct field %s.%s of type %s", toml, ctx.Struct, f.Name, f.Type) } - return fmt.Errorf("toml: cannot decode TOML %s into a Go value of type %s", toml, target) + return fmt.Sprintf("cannot decode TOML %s into a Go value of type %s", toml, target) } func (d *decoder) expr() *unstable.Node { @@ -963,7 +967,7 @@ func (d *decoder) unmarshalInteger(value *unstable.Node, v reflect.Value) error case reflect.Interface: r = reflect.ValueOf(i) default: - return d.typeMismatchError("integer", v.Type()) + return unstable.NewParserError(d.p.Raw(value.Raw), d.typeMismatchString("integer", v.Type())) } if !r.Type().AssignableTo(v.Type()) { @@ -982,7 +986,7 @@ func (d *decoder) unmarshalString(value *unstable.Node, v reflect.Value) error { case reflect.Interface: v.Set(reflect.ValueOf(string(value.Data))) default: - return unstable.NewParserError(d.p.Raw(value.Raw), "cannot store TOML string into a Go %s", v.Kind()) + return unstable.NewParserError(d.p.Raw(value.Raw), d.typeMismatchString("string", v.Type())) } return nil diff --git a/vendor/github.com/pelletier/go-toml/v2/unstable/parser.go b/vendor/github.com/pelletier/go-toml/v2/unstable/parser.go index a8eb0529..50358a44 100644 --- a/vendor/github.com/pelletier/go-toml/v2/unstable/parser.go +++ b/vendor/github.com/pelletier/go-toml/v2/unstable/parser.go @@ -1013,6 +1013,7 @@ func (p *Parser) parseIntOrFloatOrDateTime(b []byte) (reference, []byte, error) return p.builder.Push(Node{ Kind: Float, Data: b[:3], + Raw: p.Range(b[:3]), }), b[3:], nil case 'n': if !scanFollowsNan(b) { @@ -1022,6 +1023,7 @@ func (p *Parser) parseIntOrFloatOrDateTime(b []byte) (reference, []byte, error) return p.builder.Push(Node{ Kind: Float, Data: b[:3], + Raw: p.Range(b[:3]), }), b[3:], nil case '+', '-': return p.scanIntOrFloat(b) @@ -1146,6 +1148,7 @@ func (p *Parser) scanIntOrFloat(b []byte) (reference, []byte, error) { return p.builder.Push(Node{ Kind: Integer, Data: b[:i], + Raw: p.Range(b[:i]), }), b[i:], nil } @@ -1169,6 +1172,7 @@ func (p *Parser) scanIntOrFloat(b []byte) (reference, []byte, error) { return p.builder.Push(Node{ Kind: Float, Data: b[:i+3], + Raw: p.Range(b[:i+3]), }), b[i+3:], nil } @@ -1180,6 +1184,7 @@ func (p *Parser) scanIntOrFloat(b []byte) (reference, []byte, error) { return p.builder.Push(Node{ Kind: Float, Data: b[:i+3], + Raw: p.Range(b[:i+3]), }), b[i+3:], nil } @@ -1202,6 +1207,7 @@ func (p *Parser) scanIntOrFloat(b []byte) (reference, []byte, error) { return p.builder.Push(Node{ Kind: kind, Data: b[:i], + Raw: p.Range(b[:i]), }), b[i:], nil } diff --git a/vendor/github.com/pkg/sftp/attrs.go b/vendor/github.com/pkg/sftp/attrs.go index 2bb2d576..758cd4ff 100644 --- a/vendor/github.com/pkg/sftp/attrs.go +++ b/vendor/github.com/pkg/sftp/attrs.go @@ -1,7 +1,7 @@ package sftp // ssh_FXP_ATTRS support -// see http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-5 +// see https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-5 import ( "os" @@ -69,6 +69,20 @@ func fileInfoFromStat(stat *FileStat, name string) os.FileInfo { } } +// FileInfoUidGid extends os.FileInfo and adds callbacks for Uid and Gid retrieval, +// as an alternative to *syscall.Stat_t objects on unix systems. +type FileInfoUidGid interface { + os.FileInfo + Uid() uint32 + Gid() uint32 +} + +// FileInfoUidGid extends os.FileInfo and adds a callbacks for extended data retrieval. +type FileInfoExtendedData interface { + os.FileInfo + Extended() []StatExtended +} + func fileStatFromInfo(fi os.FileInfo) (uint32, *FileStat) { mtime := fi.ModTime().Unix() atime := mtime @@ -86,5 +100,22 @@ func fileStatFromInfo(fi os.FileInfo) (uint32, *FileStat) { // os specific file stat decoding fileStatFromInfoOs(fi, &flags, fileStat) + // The call above will include the sshFileXferAttrUIDGID in case + // the os.FileInfo can be casted to *syscall.Stat_t on unix. + // If fi implements FileInfoUidGid, retrieve Uid, Gid from it instead. + if fiExt, ok := fi.(FileInfoUidGid); ok { + flags |= sshFileXferAttrUIDGID + fileStat.UID = fiExt.Uid() + fileStat.GID = fiExt.Gid() + } + + // if fi implements FileInfoExtendedData, retrieve extended data from it + if fiExt, ok := fi.(FileInfoExtendedData); ok { + fileStat.Extended = fiExt.Extended() + if len(fileStat.Extended) > 0 { + flags |= sshFileXferAttrExtended + } + } + return flags, fileStat } diff --git a/vendor/github.com/pkg/sftp/attrs_stubs.go b/vendor/github.com/pkg/sftp/attrs_stubs.go index c01f3367..d20348c1 100644 --- a/vendor/github.com/pkg/sftp/attrs_stubs.go +++ b/vendor/github.com/pkg/sftp/attrs_stubs.go @@ -1,3 +1,4 @@ +//go:build plan9 || windows || android // +build plan9 windows android package sftp diff --git a/vendor/github.com/pkg/sftp/attrs_unix.go b/vendor/github.com/pkg/sftp/attrs_unix.go index d1f44524..371ae9b9 100644 --- a/vendor/github.com/pkg/sftp/attrs_unix.go +++ b/vendor/github.com/pkg/sftp/attrs_unix.go @@ -1,3 +1,4 @@ +//go:build darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || aix || js // +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris aix js package sftp diff --git a/vendor/github.com/pkg/sftp/client.go b/vendor/github.com/pkg/sftp/client.go index 9e0b6164..0df125e1 100644 --- a/vendor/github.com/pkg/sftp/client.go +++ b/vendor/github.com/pkg/sftp/client.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/binary" "errors" + "fmt" "io" "math" "os" @@ -226,15 +227,22 @@ func NewClientPipe(rd io.Reader, wr io.WriteCloser, opts ...ClientOption) (*Clie if err := sftp.sendInit(); err != nil { wr.Close() - return nil, err + return nil, fmt.Errorf("error sending init packet to server: %w", err) } + if err := sftp.recvVersion(); err != nil { wr.Close() - return nil, err + return nil, fmt.Errorf("error receiving version packet from server: %w", err) } sftp.clientConn.wg.Add(1) - go sftp.loop() + go func() { + defer sftp.clientConn.wg.Done() + + if err := sftp.clientConn.recv(); err != nil { + sftp.clientConn.broadcastErr(err) + } + }() return sftp, nil } @@ -251,11 +259,11 @@ func (c *Client) Create(path string) (*File, error) { return c.open(path, flags(os.O_RDWR|os.O_CREATE|os.O_TRUNC)) } -const sftpProtocolVersion = 3 // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 +const sftpProtocolVersion = 3 // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt func (c *Client) sendInit() error { return c.clientConn.conn.sendPacket(&sshFxInitPacket{ - Version: sftpProtocolVersion, // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 + Version: sftpProtocolVersion, // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt }) } @@ -267,8 +275,13 @@ func (c *Client) nextID() uint32 { func (c *Client) recvVersion() error { typ, data, err := c.recvPacket(0) if err != nil { + if err == io.EOF { + return fmt.Errorf("server unexpectedly closed connection: %w", io.ErrUnexpectedEOF) + } + return err } + if typ != sshFxpVersion { return &unexpectedPacketErr{sshFxpVersion, typ} } @@ -277,6 +290,7 @@ func (c *Client) recvVersion() error { if err != nil { return err } + if version != sftpProtocolVersion { return &unexpectedVersionErr{sftpProtocolVersion, version} } @@ -910,6 +924,45 @@ func (c *Client) MkdirAll(path string) error { return nil } +// RemoveAll delete files recursively in the directory and Recursively delete subdirectories. +// An error will be returned if no file or directory with the specified path exists +func (c *Client) RemoveAll(path string) error { + + // Get the file/directory information + fi, err := c.Stat(path) + if err != nil { + return err + } + + if fi.IsDir() { + // Delete files recursively in the directory + files, err := c.ReadDir(path) + if err != nil { + return err + } + + for _, file := range files { + if file.IsDir() { + // Recursively delete subdirectories + err = c.RemoveAll(path + "/" + file.Name()) + if err != nil { + return err + } + } else { + // Delete individual files + err = c.Remove(path + "/" + file.Name()) + if err != nil { + return err + } + } + } + + } + + return c.Remove(path) + +} + // File represents a remote file. type File struct { c *Client @@ -1660,7 +1713,7 @@ func (f *File) ReadFromWithConcurrency(r io.Reader, concurrency int) (read int64 Handle: f.handle, Offset: uint64(off), Length: uint32(n), - Data: b, + Data: b[:n], }) select { diff --git a/vendor/github.com/pkg/sftp/conn.go b/vendor/github.com/pkg/sftp/conn.go index 7d951423..3bb2ba15 100644 --- a/vendor/github.com/pkg/sftp/conn.go +++ b/vendor/github.com/pkg/sftp/conn.go @@ -18,7 +18,9 @@ type conn struct { } // the orderID is used in server mode if the allocator is enabled. -// For the client mode just pass 0 +// For the client mode just pass 0. +// It returns io.EOF if the connection is closed and +// there are no more packets to read. func (c *conn) recvPacket(orderID uint32) (uint8, []byte, error) { return recvPacket(c, c.alloc, orderID) } @@ -61,14 +63,6 @@ func (c *clientConn) Close() error { return c.conn.Close() } -func (c *clientConn) loop() { - defer c.wg.Done() - err := c.recv() - if err != nil { - c.broadcastErr(err) - } -} - // recv continuously reads from the server and forwards responses to the // appropriate channel. func (c *clientConn) recv() error { diff --git a/vendor/github.com/pkg/sftp/debug.go b/vendor/github.com/pkg/sftp/debug.go index 3e264abe..f0db14d3 100644 --- a/vendor/github.com/pkg/sftp/debug.go +++ b/vendor/github.com/pkg/sftp/debug.go @@ -1,3 +1,4 @@ +//go:build debug // +build debug package sftp diff --git a/vendor/github.com/pkg/sftp/fuzz.go b/vendor/github.com/pkg/sftp/fuzz.go index 169aebc2..f2f1fc31 100644 --- a/vendor/github.com/pkg/sftp/fuzz.go +++ b/vendor/github.com/pkg/sftp/fuzz.go @@ -1,3 +1,4 @@ +//go:build gofuzz // +build gofuzz package sftp diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/attrs.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/attrs.go index eed61bfc..3aec937f 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/attrs.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/attrs.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // Attributes related flags. const ( @@ -12,7 +12,7 @@ const ( // Attributes defines the file attributes type defined in draft-ietf-secsh-filexfer-02 // -// Defined in: https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-5 +// Defined in: https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-5 type Attributes struct { Flags uint32 @@ -116,32 +116,32 @@ func (a *Attributes) Len() int { } // MarshalInto marshals e onto the end of the given Buffer. -func (a *Attributes) MarshalInto(b *Buffer) { - b.AppendUint32(a.Flags) +func (a *Attributes) MarshalInto(buf *Buffer) { + buf.AppendUint32(a.Flags) if a.Flags&AttrSize != 0 { - b.AppendUint64(a.Size) + buf.AppendUint64(a.Size) } if a.Flags&AttrUIDGID != 0 { - b.AppendUint32(a.UID) - b.AppendUint32(a.GID) + buf.AppendUint32(a.UID) + buf.AppendUint32(a.GID) } if a.Flags&AttrPermissions != 0 { - b.AppendUint32(uint32(a.Permissions)) + buf.AppendUint32(uint32(a.Permissions)) } if a.Flags&AttrACModTime != 0 { - b.AppendUint32(a.ATime) - b.AppendUint32(a.MTime) + buf.AppendUint32(a.ATime) + buf.AppendUint32(a.MTime) } if a.Flags&AttrExtended != 0 { - b.AppendUint32(uint32(len(a.ExtendedAttributes))) + buf.AppendUint32(uint32(len(a.ExtendedAttributes))) for _, ext := range a.ExtendedAttributes { - ext.MarshalInto(b) + ext.MarshalInto(buf) } } } @@ -156,74 +156,51 @@ func (a *Attributes) MarshalBinary() ([]byte, error) { // UnmarshalFrom unmarshals an Attributes from the given Buffer into e. // // NOTE: The values of fields not covered in the a.Flags are explicitly undefined. -func (a *Attributes) UnmarshalFrom(b *Buffer) (err error) { - flags, err := b.ConsumeUint32() - if err != nil { - return err - } +func (a *Attributes) UnmarshalFrom(buf *Buffer) (err error) { + flags := buf.ConsumeUint32() - return a.XXX_UnmarshalByFlags(flags, b) + return a.XXX_UnmarshalByFlags(flags, buf) } // XXX_UnmarshalByFlags uses the pre-existing a.Flags field to determine which fields to decode. // DO NOT USE THIS: it is an anti-corruption function to implement existing internal usage in pkg/sftp. // This function is not a part of any compatibility promise. -func (a *Attributes) XXX_UnmarshalByFlags(flags uint32, b *Buffer) (err error) { +func (a *Attributes) XXX_UnmarshalByFlags(flags uint32, buf *Buffer) (err error) { a.Flags = flags // Short-circuit dummy attributes. if a.Flags == 0 { - return nil + return buf.Err } if a.Flags&AttrSize != 0 { - if a.Size, err = b.ConsumeUint64(); err != nil { - return err - } + a.Size = buf.ConsumeUint64() } if a.Flags&AttrUIDGID != 0 { - if a.UID, err = b.ConsumeUint32(); err != nil { - return err - } - - if a.GID, err = b.ConsumeUint32(); err != nil { - return err - } + a.UID = buf.ConsumeUint32() + a.GID = buf.ConsumeUint32() } if a.Flags&AttrPermissions != 0 { - m, err := b.ConsumeUint32() - if err != nil { - return err - } - - a.Permissions = FileMode(m) + a.Permissions = FileMode(buf.ConsumeUint32()) } if a.Flags&AttrACModTime != 0 { - if a.ATime, err = b.ConsumeUint32(); err != nil { - return err - } - - if a.MTime, err = b.ConsumeUint32(); err != nil { - return err - } + a.ATime = buf.ConsumeUint32() + a.MTime = buf.ConsumeUint32() } if a.Flags&AttrExtended != 0 { - count, err := b.ConsumeUint32() - if err != nil { - return err - } + count := buf.ConsumeCount() a.ExtendedAttributes = make([]ExtendedAttribute, count) for i := range a.ExtendedAttributes { - a.ExtendedAttributes[i].UnmarshalFrom(b) + a.ExtendedAttributes[i].UnmarshalFrom(buf) } } - return nil + return buf.Err } // UnmarshalBinary decodes the binary encoding of Attributes into e. @@ -233,7 +210,7 @@ func (a *Attributes) UnmarshalBinary(data []byte) error { // ExtendedAttribute defines the extended file attribute type defined in draft-ietf-secsh-filexfer-02 // -// Defined in: https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-5 +// Defined in: https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-5 type ExtendedAttribute struct { Type string Data string @@ -245,9 +222,9 @@ func (e *ExtendedAttribute) Len() int { } // MarshalInto marshals e onto the end of the given Buffer. -func (e *ExtendedAttribute) MarshalInto(b *Buffer) { - b.AppendString(e.Type) - b.AppendString(e.Data) +func (e *ExtendedAttribute) MarshalInto(buf *Buffer) { + buf.AppendString(e.Type) + buf.AppendString(e.Data) } // MarshalBinary returns e as the binary encoding of e. @@ -258,16 +235,13 @@ func (e *ExtendedAttribute) MarshalBinary() ([]byte, error) { } // UnmarshalFrom unmarshals an ExtendedAattribute from the given Buffer into e. -func (e *ExtendedAttribute) UnmarshalFrom(b *Buffer) (err error) { - if e.Type, err = b.ConsumeString(); err != nil { - return err +func (e *ExtendedAttribute) UnmarshalFrom(buf *Buffer) (err error) { + *e = ExtendedAttribute{ + Type: buf.ConsumeString(), + Data: buf.ConsumeString(), } - if e.Data, err = b.ConsumeString(); err != nil { - return err - } - - return nil + return buf.Err } // UnmarshalBinary decodes the binary encoding of ExtendedAttribute into e. @@ -290,11 +264,11 @@ func (e *NameEntry) Len() int { } // MarshalInto marshals e onto the end of the given Buffer. -func (e *NameEntry) MarshalInto(b *Buffer) { - b.AppendString(e.Filename) - b.AppendString(e.Longname) +func (e *NameEntry) MarshalInto(buf *Buffer) { + buf.AppendString(e.Filename) + buf.AppendString(e.Longname) - e.Attrs.MarshalInto(b) + e.Attrs.MarshalInto(buf) } // MarshalBinary returns e as the binary encoding of e. @@ -307,16 +281,13 @@ func (e *NameEntry) MarshalBinary() ([]byte, error) { // UnmarshalFrom unmarshals an NameEntry from the given Buffer into e. // // NOTE: The values of fields not covered in the a.Flags are explicitly undefined. -func (e *NameEntry) UnmarshalFrom(b *Buffer) (err error) { - if e.Filename, err = b.ConsumeString(); err != nil { - return err - } - - if e.Longname, err = b.ConsumeString(); err != nil { - return err +func (e *NameEntry) UnmarshalFrom(buf *Buffer) (err error) { + *e = NameEntry{ + Filename: buf.ConsumeString(), + Longname: buf.ConsumeString(), } - return e.Attrs.UnmarshalFrom(b) + return e.Attrs.UnmarshalFrom(buf) } // UnmarshalBinary decodes the binary encoding of NameEntry into e. diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/buffer.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/buffer.go index a6086036..bd4783bb 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/buffer.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/buffer.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx import ( "encoding/binary" @@ -17,6 +17,7 @@ var ( type Buffer struct { b []byte off int + Err error } // NewBuffer creates and initializes a new buffer using buf as its initial contents. @@ -51,14 +52,17 @@ func (b *Buffer) Cap() int { return cap(b.b) } // Reset resets the buffer to be empty, but it retains the underlying storage for use by future Appends. func (b *Buffer) Reset() { - b.b = b.b[:0] - b.off = 0 + *b = Buffer{ + b: b.b[:0], + } } // StartPacket resets and initializes the buffer to be ready to start marshaling a packet into. // It truncates the buffer, reserves space for uint32(length), then appends the given packetType and requestID. func (b *Buffer) StartPacket(packetType PacketType, requestID uint32) { - b.b, b.off = append(b.b[:0], make([]byte, 4)...), 0 + *b = Buffer{ + b: append(b.b[:0], make([]byte, 4)...), + } b.AppendUint8(uint8(packetType)) b.AppendUint32(requestID) @@ -81,15 +85,21 @@ func (b *Buffer) Packet(payload []byte) (header, payloadPassThru []byte, err err } // ConsumeUint8 consumes a single byte from the buffer. -// If the buffer does not have enough data, it will return ErrShortPacket. -func (b *Buffer) ConsumeUint8() (uint8, error) { +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeUint8() uint8 { + if b.Err != nil { + return 0 + } + if b.Len() < 1 { - return 0, ErrShortPacket + b.off = len(b.b) + b.Err = ErrShortPacket + return 0 } var v uint8 v, b.off = b.b[b.off], b.off+1 - return v, nil + return v } // AppendUint8 appends a single byte into the buffer. @@ -98,14 +108,9 @@ func (b *Buffer) AppendUint8(v uint8) { } // ConsumeBool consumes a single byte from the buffer, and returns true if that byte is non-zero. -// If the buffer does not have enough data, it will return ErrShortPacket. -func (b *Buffer) ConsumeBool() (bool, error) { - v, err := b.ConsumeUint8() - if err != nil { - return false, err - } - - return v != 0, nil +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeBool() bool { + return b.ConsumeUint8() != 0 } // AppendBool appends a single bool into the buffer. @@ -119,15 +124,21 @@ func (b *Buffer) AppendBool(v bool) { } // ConsumeUint16 consumes a single uint16 from the buffer, in network byte order (big-endian). -// If the buffer does not have enough data, it will return ErrShortPacket. -func (b *Buffer) ConsumeUint16() (uint16, error) { +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeUint16() uint16 { + if b.Err != nil { + return 0 + } + if b.Len() < 2 { - return 0, ErrShortPacket + b.off = len(b.b) + b.Err = ErrShortPacket + return 0 } v := binary.BigEndian.Uint16(b.b[b.off:]) b.off += 2 - return v, nil + return v } // AppendUint16 appends single uint16 into the buffer, in network byte order (big-endian). @@ -146,15 +157,21 @@ func unmarshalUint32(b []byte) uint32 { } // ConsumeUint32 consumes a single uint32 from the buffer, in network byte order (big-endian). -// If the buffer does not have enough data, it will return ErrShortPacket. -func (b *Buffer) ConsumeUint32() (uint32, error) { +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeUint32() uint32 { + if b.Err != nil { + return 0 + } + if b.Len() < 4 { - return 0, ErrShortPacket + b.off = len(b.b) + b.Err = ErrShortPacket + return 0 } v := binary.BigEndian.Uint32(b.b[b.off:]) b.off += 4 - return v, nil + return v } // AppendUint32 appends a single uint32 into the buffer, in network byte order (big-endian). @@ -167,16 +184,33 @@ func (b *Buffer) AppendUint32(v uint32) { ) } +// ConsumeCount consumes a single uint32 count from the buffer, in network byte order (big-endian) as an int. +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeCount() int { + return int(b.ConsumeUint32()) +} + +// AppendCount appends a single int length as a uint32 into the buffer, in network byte order (big-endian). +func (b *Buffer) AppendCount(v int) { + b.AppendUint32(uint32(v)) +} + // ConsumeUint64 consumes a single uint64 from the buffer, in network byte order (big-endian). -// If the buffer does not have enough data, it will return ErrShortPacket. -func (b *Buffer) ConsumeUint64() (uint64, error) { +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeUint64() uint64 { + if b.Err != nil { + return 0 + } + if b.Len() < 8 { - return 0, ErrShortPacket + b.off = len(b.b) + b.Err = ErrShortPacket + return 0 } v := binary.BigEndian.Uint64(b.b[b.off:]) b.off += 8 - return v, nil + return v } // AppendUint64 appends a single uint64 into the buffer, in network byte order (big-endian). @@ -194,14 +228,9 @@ func (b *Buffer) AppendUint64(v uint64) { } // ConsumeInt64 consumes a single int64 from the buffer, in network byte order (big-endian) with two’s complement. -// If the buffer does not have enough data, it will return ErrShortPacket. -func (b *Buffer) ConsumeInt64() (int64, error) { - u, err := b.ConsumeUint64() - if err != nil { - return 0, err - } - - return int64(u), err +// If the buffer does not have enough data, it will set Err to ErrShortPacket. +func (b *Buffer) ConsumeInt64() int64 { + return int64(b.ConsumeUint64()) } // AppendInt64 appends a single int64 into the buffer, in network byte order (big-endian) with two’s complement. @@ -211,29 +240,52 @@ func (b *Buffer) AppendInt64(v int64) { // ConsumeByteSlice consumes a single string of raw binary data from the buffer. // A string is a uint32 length, followed by that number of raw bytes. -// If the buffer does not have enough data, or defines a length larger than available, it will return ErrShortPacket. +// If the buffer does not have enough data, or defines a length larger than available, it will set Err to ErrShortPacket. // // The returned slice aliases the buffer contents, and is valid only as long as the buffer is not reused // (that is, only until the next call to Reset, PutLength, StartPacket, or UnmarshalBinary). // // In no case will any Consume calls return overlapping slice aliases, // and Append calls are guaranteed to not disturb this slice alias. -func (b *Buffer) ConsumeByteSlice() ([]byte, error) { - length, err := b.ConsumeUint32() - if err != nil { - return nil, err +func (b *Buffer) ConsumeByteSlice() []byte { + length := int(b.ConsumeUint32()) + if b.Err != nil { + return nil } - if b.Len() < int(length) { - return nil, ErrShortPacket + if b.Len() < length || length < 0 { + b.off = len(b.b) + b.Err = ErrShortPacket + return nil } v := b.b[b.off:] - if len(v) > int(length) { + if len(v) > length || cap(v) > length { v = v[:length:length] } b.off += int(length) - return v, nil + return v +} + +// ConsumeByteSliceCopy consumes a single string of raw binary data as a copy from the buffer. +// A string is a uint32 length, followed by that number of raw bytes. +// If the buffer does not have enough data, or defines a length larger than available, it will set Err to ErrShortPacket. +// +// The returned slice does not alias any buffer contents, +// and will therefore be valid even if the buffer is later reused. +// +// If hint has sufficient capacity to hold the data, it will be reused and overwritten, +// otherwise a new backing slice will be allocated and returned. +func (b *Buffer) ConsumeByteSliceCopy(hint []byte) []byte { + data := b.ConsumeByteSlice() + + if grow := len(data) - len(hint); grow > 0 { + hint = append(hint, make([]byte, grow)...) + } + + n := copy(hint, data) + hint = hint[:n] + return hint } // AppendByteSlice appends a single string of raw binary data into the buffer. @@ -245,17 +297,12 @@ func (b *Buffer) AppendByteSlice(v []byte) { // ConsumeString consumes a single string of binary data from the buffer. // A string is a uint32 length, followed by that number of raw bytes. -// If the buffer does not have enough data, or defines a length larger than available, it will return ErrShortPacket. +// If the buffer does not have enough data, or defines a length larger than available, it will set Err to ErrShortPacket. // // NOTE: Go implicitly assumes that strings contain UTF-8 encoded data. // All caveats on using arbitrary binary data in Go strings applies. -func (b *Buffer) ConsumeString() (string, error) { - v, err := b.ConsumeByteSlice() - if err != nil { - return "", err - } - - return string(v), nil +func (b *Buffer) ConsumeString() string { + return string(b.ConsumeByteSlice()) } // AppendString appends a single string of binary data into the buffer. diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extended_packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extended_packets.go index 6b7b2cef..f7174253 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extended_packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extended_packets.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx import ( "encoding" @@ -86,8 +86,9 @@ func (p *ExtendedPacket) MarshalPacket(reqid uint32, b []byte) (header, payload // If the extension has not been registered, then a new Buffer will be allocated. // Then the request-specific-data will be unmarshaled from the rest of the buffer. func (p *ExtendedPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.ExtendedRequest, err = buf.ConsumeString(); err != nil { - return err + p.ExtendedRequest = buf.ConsumeString() + if buf.Err != nil { + return buf.Err } if p.Data == nil { diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extensions.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extensions.go index 11c0b99c..c425780c 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extensions.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/extensions.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // ExtensionPair defines the extension-pair type defined in draft-ietf-secsh-filexfer-13. // This type is backwards-compatible with how draft-ietf-secsh-filexfer-02 defines extensions. @@ -29,15 +29,12 @@ func (e *ExtensionPair) MarshalBinary() ([]byte, error) { // UnmarshalFrom unmarshals an ExtensionPair from the given Buffer into e. func (e *ExtensionPair) UnmarshalFrom(buf *Buffer) (err error) { - if e.Name, err = buf.ConsumeString(); err != nil { - return err + *e = ExtensionPair{ + Name: buf.ConsumeString(), + Data: buf.ConsumeString(), } - if e.Data, err = buf.ConsumeString(); err != nil { - return err - } - - return nil + return buf.Err } // UnmarshalBinary decodes the binary encoding of ExtensionPair into e. diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/filexfer.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/filexfer.go index 1e5abf74..d3009994 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/filexfer.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/filexfer.go @@ -1,5 +1,5 @@ -// Package filexfer implements the wire encoding for secsh-filexfer as described in https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 -package filexfer +// Package sshfx implements the wire encoding for secsh-filexfer as described in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt +package sshfx // PacketMarshaller narrowly defines packets that will only be transmitted. // diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fx.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fx.go index 48f86986..9abcbafc 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fx.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fx.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx import ( "fmt" @@ -10,7 +10,7 @@ type Status uint32 // Defines the various SSH_FX_* values. const ( // see draft-ietf-secsh-filexfer-02 - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-7 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-7 StatusOK = Status(iota) StatusEOF StatusNoSuchFile @@ -21,28 +21,28 @@ const ( StatusConnectionLost StatusOPUnsupported - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-03#section-7 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-03.txt#section-7 StatusV4InvalidHandle StatusV4NoSuchPath StatusV4FileAlreadyExists StatusV4WriteProtect - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-7 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-04.txt#section-7 StatusV4NoMedia - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-05#section-7 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-05.txt#section-7 StatusV5NoSpaceOnFilesystem StatusV5QuotaExceeded StatusV5UnknownPrincipal StatusV5LockConflict - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-06#section-8 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-06.txt#section-8 StatusV6DirNotEmpty StatusV6NotADirectory StatusV6InvalidFilename StatusV6LinkLoop - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-07#section-8 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-07.txt#section-8 StatusV6CannotDelete StatusV6InvalidParameter StatusV6FileIsADirectory @@ -50,10 +50,10 @@ const ( StatusV6ByteRangeLockRefused StatusV6DeletePending - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-08#section-8.1 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-08.txt#section-8.1 StatusV6FileCorrupt - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-10#section-9.1 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-10.txt#section-9.1 StatusV6OwnerInvalid StatusV6GroupInvalid diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fxp.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fxp.go index 15caf6d2..78080021 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fxp.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/fxp.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx import ( "fmt" @@ -9,7 +9,7 @@ type PacketType uint8 // Request packet types. const ( - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-3 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-3 PacketTypeInit = PacketType(iota + 1) PacketTypeVersion PacketTypeOpen @@ -31,17 +31,17 @@ const ( PacketTypeReadLink PacketTypeSymlink - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-07#section-3.3 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-07.txt#section-3.3 PacketTypeV6Link - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-08#section-3.3 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-08.txt#section-3.3 PacketTypeV6Block PacketTypeV6Unblock ) // Response packet types. const ( - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-3 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-3 PacketTypeStatus = PacketType(iota + 101) PacketTypeHandle PacketTypeData @@ -51,7 +51,7 @@ const ( // Extended packet types. const ( - // https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-3 + // https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-3 PacketTypeExtended = PacketType(iota + 200) PacketTypeExtendedReply ) @@ -122,3 +122,48 @@ func (f PacketType) String() string { return fmt.Sprintf("SSH_FXP_UNKNOWN(%d)", f) } } + +func newPacketFromType(typ PacketType) (Packet, error) { + switch typ { + case PacketTypeOpen: + return new(OpenPacket), nil + case PacketTypeClose: + return new(ClosePacket), nil + case PacketTypeRead: + return new(ReadPacket), nil + case PacketTypeWrite: + return new(WritePacket), nil + case PacketTypeLStat: + return new(LStatPacket), nil + case PacketTypeFStat: + return new(FStatPacket), nil + case PacketTypeSetstat: + return new(SetstatPacket), nil + case PacketTypeFSetstat: + return new(FSetstatPacket), nil + case PacketTypeOpenDir: + return new(OpenDirPacket), nil + case PacketTypeReadDir: + return new(ReadDirPacket), nil + case PacketTypeRemove: + return new(RemovePacket), nil + case PacketTypeMkdir: + return new(MkdirPacket), nil + case PacketTypeRmdir: + return new(RmdirPacket), nil + case PacketTypeRealPath: + return new(RealPathPacket), nil + case PacketTypeStat: + return new(StatPacket), nil + case PacketTypeRename: + return new(RenamePacket), nil + case PacketTypeReadLink: + return new(ReadLinkPacket), nil + case PacketTypeSymlink: + return new(SymlinkPacket), nil + case PacketTypeExtended: + return new(ExtendedPacket), nil + default: + return nil, fmt.Errorf("unexpected request packet type: %v", typ) + } +} diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/handle_packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/handle_packets.go index a1427712..44594acf 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/handle_packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/handle_packets.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // ClosePacket defines the SSH_FXP_CLOSE packet. type ClosePacket struct { @@ -27,18 +27,18 @@ func (p *ClosePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []b // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *ClosePacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err + *p = ClosePacket{ + Handle: buf.ConsumeString(), } - return nil + return buf.Err } // ReadPacket defines the SSH_FXP_READ packet. type ReadPacket struct { Handle string Offset uint64 - Len uint32 + Length uint32 } // Type returns the SSH_FXP_xy value associated with this packet type. @@ -58,7 +58,7 @@ func (p *ReadPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []by buf.StartPacket(PacketTypeRead, reqid) buf.AppendString(p.Handle) buf.AppendUint64(p.Offset) - buf.AppendUint32(p.Len) + buf.AppendUint32(p.Length) return buf.Packet(payload) } @@ -66,19 +66,13 @@ func (p *ReadPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []by // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *ReadPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err + *p = ReadPacket{ + Handle: buf.ConsumeString(), + Offset: buf.ConsumeUint64(), + Length: buf.ConsumeUint32(), } - if p.Offset, err = buf.ConsumeUint64(); err != nil { - return err - } - - if p.Len, err = buf.ConsumeUint32(); err != nil { - return err - } - - return nil + return buf.Err } // WritePacket defines the SSH_FXP_WRITE packet. @@ -121,26 +115,13 @@ func (p *WritePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []b // // This means this _does not_ alias any of the data buffer that is passed in. func (p *WritePacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err - } - - if p.Offset, err = buf.ConsumeUint64(); err != nil { - return err - } - - data, err := buf.ConsumeByteSlice() - if err != nil { - return err - } - - if len(p.Data) < len(data) { - p.Data = make([]byte, len(data)) + *p = WritePacket{ + Handle: buf.ConsumeString(), + Offset: buf.ConsumeUint64(), + Data: buf.ConsumeByteSliceCopy(p.Data), } - n := copy(p.Data, data) - p.Data = p.Data[:n] - return nil + return buf.Err } // FStatPacket defines the SSH_FXP_FSTAT packet. @@ -170,11 +151,11 @@ func (p *FStatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []b // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *FStatPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err + *p = FStatPacket{ + Handle: buf.ConsumeString(), } - return nil + return buf.Err } // FSetstatPacket defines the SSH_FXP_FSETSTAT packet. @@ -207,8 +188,8 @@ func (p *FSetstatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *FSetstatPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err + *p = FSetstatPacket{ + Handle: buf.ConsumeString(), } return p.Attrs.UnmarshalFrom(buf) @@ -241,9 +222,9 @@ func (p *ReadDirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload [ // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *ReadDirPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err + *p = ReadDirPacket{ + Handle: buf.ConsumeString(), } - return nil + return buf.Err } diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/init_packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/init_packets.go index b0bc6f50..c553ee2e 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/init_packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/init_packets.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // InitPacket defines the SSH_FXP_INIT packet. type InitPacket struct { @@ -33,8 +33,8 @@ func (p *InitPacket) MarshalBinary() ([]byte, error) { func (p *InitPacket) UnmarshalBinary(data []byte) (err error) { buf := NewBuffer(data) - if p.Version, err = buf.ConsumeUint32(); err != nil { - return err + *p = InitPacket{ + Version: buf.ConsumeUint32(), } for buf.Len() > 0 { @@ -46,7 +46,7 @@ func (p *InitPacket) UnmarshalBinary(data []byte) (err error) { p.Extensions = append(p.Extensions, &ext) } - return nil + return buf.Err } // VersionPacket defines the SSH_FXP_VERSION packet. @@ -82,8 +82,8 @@ func (p *VersionPacket) MarshalBinary() ([]byte, error) { func (p *VersionPacket) UnmarshalBinary(data []byte) (err error) { buf := NewBuffer(data) - if p.Version, err = buf.ConsumeUint32(); err != nil { - return err + *p = VersionPacket{ + Version: buf.ConsumeUint32(), } for buf.Len() > 0 { diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/open_packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/open_packets.go index 13587114..896ba16e 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/open_packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/open_packets.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // SSH_FXF_* flags. const ( @@ -43,12 +43,9 @@ func (p *OpenPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []by // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *OpenPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Filename, err = buf.ConsumeString(); err != nil { - return err - } - - if p.PFlags, err = buf.ConsumeUint32(); err != nil { - return err + *p = OpenPacket{ + Filename: buf.ConsumeString(), + PFlags: buf.ConsumeUint32(), } return p.Attrs.UnmarshalFrom(buf) @@ -81,9 +78,9 @@ func (p *OpenDirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload [ // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *OpenDirPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = OpenDirPacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/packets.go index 3f24e9c2..fdf65d05 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/packets.go @@ -1,59 +1,13 @@ -package filexfer +package sshfx import ( "errors" - "fmt" "io" ) // smallBufferSize is an initial allocation minimal capacity. const smallBufferSize = 64 -func newPacketFromType(typ PacketType) (Packet, error) { - switch typ { - case PacketTypeOpen: - return new(OpenPacket), nil - case PacketTypeClose: - return new(ClosePacket), nil - case PacketTypeRead: - return new(ReadPacket), nil - case PacketTypeWrite: - return new(WritePacket), nil - case PacketTypeLStat: - return new(LStatPacket), nil - case PacketTypeFStat: - return new(FStatPacket), nil - case PacketTypeSetstat: - return new(SetstatPacket), nil - case PacketTypeFSetstat: - return new(FSetstatPacket), nil - case PacketTypeOpenDir: - return new(OpenDirPacket), nil - case PacketTypeReadDir: - return new(ReadDirPacket), nil - case PacketTypeRemove: - return new(RemovePacket), nil - case PacketTypeMkdir: - return new(MkdirPacket), nil - case PacketTypeRmdir: - return new(RmdirPacket), nil - case PacketTypeRealPath: - return new(RealPathPacket), nil - case PacketTypeStat: - return new(StatPacket), nil - case PacketTypeRename: - return new(RenamePacket), nil - case PacketTypeReadLink: - return new(ReadLinkPacket), nil - case PacketTypeSymlink: - return new(SymlinkPacket), nil - case PacketTypeExtended: - return new(ExtendedPacket), nil - default: - return nil, fmt.Errorf("unexpected request packet type: %v", typ) - } -} - // RawPacket implements the general packet format from draft-ietf-secsh-filexfer-02 // // RawPacket is intended for use in clients receiving responses, @@ -63,7 +17,7 @@ func newPacketFromType(typ PacketType) (Packet, error) { // For servers expecting to receive arbitrary request packet types, // use RequestPacket. // -// Defined in https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-3 +// Defined in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-3 type RawPacket struct { PacketType PacketType RequestID uint32 @@ -110,19 +64,14 @@ func (p *RawPacket) MarshalBinary() ([]byte, error) { // The Data field will alias the passed in Buffer, // so the buffer passed in should not be reused before RawPacket.Reset(). func (p *RawPacket) UnmarshalFrom(buf *Buffer) error { - typ, err := buf.ConsumeUint8() - if err != nil { - return err - } - - p.PacketType = PacketType(typ) - - if p.RequestID, err = buf.ConsumeUint32(); err != nil { - return err + *p = RawPacket{ + PacketType: PacketType(buf.ConsumeUint8()), + RequestID: buf.ConsumeUint32(), } p.Data = *buf - return nil + + return buf.Err } // UnmarshalBinary decodes a full raw packet out of the given data. @@ -225,7 +174,7 @@ func (p *RawPacket) ReadFrom(r io.Reader, b []byte, maxPacketLength uint32) erro // where automatic unmarshaling of the packet body does not make sense, // use RawPacket. // -// Defined in https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-3 +// Defined in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-3 type RequestPacket struct { RequestID uint32 @@ -268,18 +217,19 @@ func (p *RequestPacket) MarshalBinary() ([]byte, error) { // The Request field may alias the passed in Buffer, (e.g. SSH_FXP_WRITE), // so the buffer passed in should not be reused before RequestPacket.Reset(). func (p *RequestPacket) UnmarshalFrom(buf *Buffer) error { - typ, err := buf.ConsumeUint8() - if err != nil { - return err + typ := PacketType(buf.ConsumeUint8()) + if buf.Err != nil { + return buf.Err } - p.Request, err = newPacketFromType(PacketType(typ)) + req, err := newPacketFromType(typ) if err != nil { return err } - if p.RequestID, err = buf.ConsumeUint32(); err != nil { - return err + *p = RequestPacket{ + RequestID: buf.ConsumeUint32(), + Request: req, } return p.Request.UnmarshalPacketBody(buf) diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/path_packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/path_packets.go index e6f692d9..0180326f 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/path_packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/path_packets.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // LStatPacket defines the SSH_FXP_LSTAT packet. type LStatPacket struct { @@ -27,11 +27,11 @@ func (p *LStatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []b // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *LStatPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = LStatPacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } // SetstatPacket defines the SSH_FXP_SETSTAT packet. @@ -64,8 +64,8 @@ func (p *SetstatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload [ // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *SetstatPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = SetstatPacket{ + Path: buf.ConsumeString(), } return p.Attrs.UnmarshalFrom(buf) @@ -98,11 +98,11 @@ func (p *RemovePacket) MarshalPacket(reqid uint32, b []byte) (header, payload [] // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *RemovePacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = RemovePacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } // MkdirPacket defines the SSH_FXP_MKDIR packet. @@ -135,8 +135,8 @@ func (p *MkdirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []b // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *MkdirPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = MkdirPacket{ + Path: buf.ConsumeString(), } return p.Attrs.UnmarshalFrom(buf) @@ -169,11 +169,11 @@ func (p *RmdirPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []b // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *RmdirPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = RmdirPacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } // RealPathPacket defines the SSH_FXP_REALPATH packet. @@ -203,11 +203,11 @@ func (p *RealPathPacket) MarshalPacket(reqid uint32, b []byte) (header, payload // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *RealPathPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = RealPathPacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } // StatPacket defines the SSH_FXP_STAT packet. @@ -237,11 +237,11 @@ func (p *StatPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []by // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *StatPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = StatPacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } // RenamePacket defines the SSH_FXP_RENAME packet. @@ -274,15 +274,12 @@ func (p *RenamePacket) MarshalPacket(reqid uint32, b []byte) (header, payload [] // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *RenamePacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.OldPath, err = buf.ConsumeString(); err != nil { - return err + *p = RenamePacket{ + OldPath: buf.ConsumeString(), + NewPath: buf.ConsumeString(), } - if p.NewPath, err = buf.ConsumeString(); err != nil { - return err - } - - return nil + return buf.Err } // ReadLinkPacket defines the SSH_FXP_READLINK packet. @@ -312,18 +309,18 @@ func (p *ReadLinkPacket) MarshalPacket(reqid uint32, b []byte) (header, payload // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *ReadLinkPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Path, err = buf.ConsumeString(); err != nil { - return err + *p = ReadLinkPacket{ + Path: buf.ConsumeString(), } - return nil + return buf.Err } // SymlinkPacket defines the SSH_FXP_SYMLINK packet. // // The order of the arguments to the SSH_FXP_SYMLINK method was inadvertently reversed. // Unfortunately, the reversal was not noticed until the server was widely deployed. -// Covered in Section 3.1 of https://github.com/openssh/openssh-portable/blob/master/PROTOCOL +// Covered in Section 4.1 of https://github.com/openssh/openssh-portable/blob/master/PROTOCOL type SymlinkPacket struct { LinkPath string TargetPath string @@ -355,14 +352,11 @@ func (p *SymlinkPacket) MarshalPacket(reqid uint32, b []byte) (header, payload [ // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *SymlinkPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - // Arguments were inadvertently reversed. - if p.TargetPath, err = buf.ConsumeString(); err != nil { - return err - } - - if p.LinkPath, err = buf.ConsumeString(); err != nil { - return err + *p = SymlinkPacket{ + // Arguments were inadvertently reversed. + TargetPath: buf.ConsumeString(), + LinkPath: buf.ConsumeString(), } - return nil + return buf.Err } diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/permissions.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/permissions.go index 2fe63d59..0143ec0c 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/permissions.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/permissions.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx // FileMode represents a file’s mode and permission bits. // The bits are defined according to POSIX standards, diff --git a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/response_packets.go b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/response_packets.go index 7a9b3eae..311708ff 100644 --- a/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/response_packets.go +++ b/vendor/github.com/pkg/sftp/internal/encoding/ssh/filexfer/response_packets.go @@ -1,4 +1,4 @@ -package filexfer +package sshfx import ( "fmt" @@ -6,7 +6,7 @@ import ( // StatusPacket defines the SSH_FXP_STATUS packet. // -// Specified in https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-7 +// Specified in https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-7 type StatusPacket struct { StatusCode Status ErrorMessage string @@ -19,7 +19,7 @@ func (p *StatusPacket) Error() string { return "sftp: " + p.StatusCode.String() } - return fmt.Sprintf("sftp: %q (%s)", p.ErrorMessage, p.StatusCode) + return fmt.Sprintf("sftp: %s: %q", p.StatusCode, p.ErrorMessage) } // Is returns true if target is a StatusPacket with the same StatusCode, @@ -57,21 +57,13 @@ func (p *StatusPacket) MarshalPacket(reqid uint32, b []byte) (header, payload [] // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *StatusPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - statusCode, err := buf.ConsumeUint32() - if err != nil { - return err + *p = StatusPacket{ + StatusCode: Status(buf.ConsumeUint32()), + ErrorMessage: buf.ConsumeString(), + LanguageTag: buf.ConsumeString(), } - p.StatusCode = Status(statusCode) - if p.ErrorMessage, err = buf.ConsumeString(); err != nil { - return err - } - - if p.LanguageTag, err = buf.ConsumeString(); err != nil { - return err - } - - return nil + return buf.Err } // HandlePacket defines the SSH_FXP_HANDLE packet. @@ -101,11 +93,11 @@ func (p *HandlePacket) MarshalPacket(reqid uint32, b []byte) (header, payload [] // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *HandlePacket) UnmarshalPacketBody(buf *Buffer) (err error) { - if p.Handle, err = buf.ConsumeString(); err != nil { - return err + *p = HandlePacket{ + Handle: buf.ConsumeString(), } - return nil + return buf.Err } // DataPacket defines the SSH_FXP_DATA packet. @@ -143,18 +135,11 @@ func (p *DataPacket) MarshalPacket(reqid uint32, b []byte) (header, payload []by // // This means this _does not_ alias any of the data buffer that is passed in. func (p *DataPacket) UnmarshalPacketBody(buf *Buffer) (err error) { - data, err := buf.ConsumeByteSlice() - if err != nil { - return err + *p = DataPacket{ + Data: buf.ConsumeByteSliceCopy(p.Data), } - if len(p.Data) < len(data) { - p.Data = make([]byte, len(data)) - } - - n := copy(p.Data, data) - p.Data = p.Data[:n] - return nil + return buf.Err } // NamePacket defines the SSH_FXP_NAME packet. @@ -193,14 +178,16 @@ func (p *NamePacket) MarshalPacket(reqid uint32, b []byte) (header, payload []by // UnmarshalPacketBody unmarshals the packet body from the given Buffer. // It is assumed that the uint32(request-id) has already been consumed. func (p *NamePacket) UnmarshalPacketBody(buf *Buffer) (err error) { - count, err := buf.ConsumeUint32() - if err != nil { - return err + count := buf.ConsumeCount() + if buf.Err != nil { + return buf.Err } - p.Entries = make([]*NameEntry, 0, count) + *p = NamePacket{ + Entries: make([]*NameEntry, 0, count), + } - for i := uint32(0); i < count; i++ { + for i := 0; i < count; i++ { var e NameEntry if err := e.UnmarshalFrom(buf); err != nil { return err @@ -209,7 +196,7 @@ func (p *NamePacket) UnmarshalPacketBody(buf *Buffer) (err error) { p.Entries = append(p.Entries, &e) } - return nil + return buf.Err } // AttrsPacket defines the SSH_FXP_ATTRS packet. diff --git a/vendor/github.com/pkg/sftp/ls_formatting.go b/vendor/github.com/pkg/sftp/ls_formatting.go index e083e22a..19271ad7 100644 --- a/vendor/github.com/pkg/sftp/ls_formatting.go +++ b/vendor/github.com/pkg/sftp/ls_formatting.go @@ -60,6 +60,13 @@ func runLs(idLookup NameLookupFileLister, dirent os.FileInfo) string { uid = lsFormatID(sys.UID) gid = lsFormatID(sys.GID) default: + if fiExt, ok := dirent.(FileInfoUidGid); ok { + uid = lsFormatID(fiExt.Uid()) + gid = lsFormatID(fiExt.Gid()) + + break + } + numLinks, uid, gid = lsLinksUIDGID(dirent) } diff --git a/vendor/github.com/pkg/sftp/ls_plan9.go b/vendor/github.com/pkg/sftp/ls_plan9.go index a16a3ea0..b70b2942 100644 --- a/vendor/github.com/pkg/sftp/ls_plan9.go +++ b/vendor/github.com/pkg/sftp/ls_plan9.go @@ -1,3 +1,4 @@ +//go:build plan9 // +build plan9 package sftp diff --git a/vendor/github.com/pkg/sftp/ls_stub.go b/vendor/github.com/pkg/sftp/ls_stub.go index 6dec3937..f58abf78 100644 --- a/vendor/github.com/pkg/sftp/ls_stub.go +++ b/vendor/github.com/pkg/sftp/ls_stub.go @@ -1,3 +1,4 @@ +//go:build windows || android // +build windows android package sftp diff --git a/vendor/github.com/pkg/sftp/ls_unix.go b/vendor/github.com/pkg/sftp/ls_unix.go index 59ccffde..0beba32b 100644 --- a/vendor/github.com/pkg/sftp/ls_unix.go +++ b/vendor/github.com/pkg/sftp/ls_unix.go @@ -1,3 +1,4 @@ +//go:build aix || darwin || dragonfly || freebsd || (!android && linux) || netbsd || openbsd || solaris || js // +build aix darwin dragonfly freebsd !android,linux netbsd openbsd solaris js package sftp diff --git a/vendor/github.com/pkg/sftp/packet-manager.go b/vendor/github.com/pkg/sftp/packet-manager.go index c740c4c8..647836ba 100644 --- a/vendor/github.com/pkg/sftp/packet-manager.go +++ b/vendor/github.com/pkg/sftp/packet-manager.go @@ -40,7 +40,7 @@ func newPktMgr(sender packetSender) *packetManager { return s } -//// packet ordering +// // packet ordering func (s *packetManager) newOrderID() uint32 { s.packetCount++ return s.packetCount @@ -89,7 +89,7 @@ func (o orderedPackets) Sort() { }) } -//// packet registry +// // packet registry // register incoming packets to be handled func (s *packetManager) incomingPacket(pkt orderedRequest) { s.working.Add(1) diff --git a/vendor/github.com/pkg/sftp/packet-typing.go b/vendor/github.com/pkg/sftp/packet-typing.go index f4f90529..fec88e7b 100644 --- a/vendor/github.com/pkg/sftp/packet-typing.go +++ b/vendor/github.com/pkg/sftp/packet-typing.go @@ -31,7 +31,7 @@ type notReadOnly interface { notReadOnly() } -//// define types by adding methods +// // define types by adding methods // hasPath func (p *sshFxpLstatPacket) getPath() string { return p.Path } func (p *sshFxpStatPacket) getPath() string { return p.Path } diff --git a/vendor/github.com/pkg/sftp/packet.go b/vendor/github.com/pkg/sftp/packet.go index 4059cf8e..1232ff1e 100644 --- a/vendor/github.com/pkg/sftp/packet.go +++ b/vendor/github.com/pkg/sftp/packet.go @@ -71,6 +71,15 @@ func marshalFileInfo(b []byte, fi os.FileInfo) []byte { b = marshalUint32(b, fileStat.Mtime) } + if flags&sshFileXferAttrExtended != 0 { + b = marshalUint32(b, uint32(len(fileStat.Extended))) + + for _, attr := range fileStat.Extended { + b = marshalString(b, attr.ExtType) + b = marshalString(b, attr.ExtData) + } + } + return b } @@ -281,6 +290,11 @@ func recvPacket(r io.Reader, alloc *allocator, orderID uint32) (uint8, []byte, e b = make([]byte, length) } if _, err := io.ReadFull(r, b[:length]); err != nil { + // ReadFull only returns EOF if it has read no bytes. + // In this case, that means a partial packet, and thus unexpected. + if err == io.EOF { + err = io.ErrUnexpectedEOF + } debug("recv packet %d bytes: err %v", length, err) return 0, nil, err } @@ -522,7 +536,12 @@ func (p *sshFxpRmdirPacket) UnmarshalBinary(b []byte) error { } type sshFxpSymlinkPacket struct { - ID uint32 + ID uint32 + + // The order of the arguments to the SSH_FXP_SYMLINK method was inadvertently reversed. + // Unfortunately, the reversal was not noticed until the server was widely deployed. + // Covered in Section 4.1 of https://github.com/openssh/openssh-portable/blob/master/PROTOCOL + Targetpath string Linkpath string } @@ -1242,7 +1261,7 @@ func (p *sshFxpExtendedPacketPosixRename) UnmarshalBinary(b []byte) error { } func (p *sshFxpExtendedPacketPosixRename) respond(s *Server) responsePacket { - err := os.Rename(toLocalPath(p.Oldpath), toLocalPath(p.Newpath)) + err := os.Rename(s.toLocalPath(p.Oldpath), s.toLocalPath(p.Newpath)) return statusFromError(p.ID, err) } @@ -1271,6 +1290,6 @@ func (p *sshFxpExtendedPacketHardlink) UnmarshalBinary(b []byte) error { } func (p *sshFxpExtendedPacketHardlink) respond(s *Server) responsePacket { - err := os.Link(toLocalPath(p.Oldpath), toLocalPath(p.Newpath)) + err := os.Link(s.toLocalPath(p.Oldpath), s.toLocalPath(p.Newpath)) return statusFromError(p.ID, err) } diff --git a/vendor/github.com/pkg/sftp/release.go b/vendor/github.com/pkg/sftp/release.go index b695528f..9ecedc44 100644 --- a/vendor/github.com/pkg/sftp/release.go +++ b/vendor/github.com/pkg/sftp/release.go @@ -1,3 +1,4 @@ +//go:build !debug // +build !debug package sftp diff --git a/vendor/github.com/pkg/sftp/request-example.go b/vendor/github.com/pkg/sftp/request-example.go index ba22bcd0..519b3b76 100644 --- a/vendor/github.com/pkg/sftp/request-example.go +++ b/vendor/github.com/pkg/sftp/request-example.go @@ -391,21 +391,6 @@ func (fs *root) Filelist(r *Request) (ListerAt, error) { return nil, err } return listerat{file}, nil - - case "Readlink": - symlink, err := fs.readlink(r.Filepath) - if err != nil { - return nil, err - } - - // SFTP-v2: The server will respond with a SSH_FXP_NAME packet containing only - // one name and a dummy attributes value. - return listerat{ - &memFile{ - name: symlink, - err: os.ErrNotExist, // prevent accidental use as a reader/writer. - }, - }, nil } return nil, errors.New("unsupported") @@ -434,7 +419,7 @@ func (fs *root) readdir(pathname string) ([]os.FileInfo, error) { return files, nil } -func (fs *root) readlink(pathname string) (string, error) { +func (fs *root) Readlink(pathname string) (string, error) { file, err := fs.lfetch(pathname) if err != nil { return "", err @@ -464,19 +449,10 @@ func (fs *root) Lstat(r *Request) (ListerAt, error) { return listerat{file}, nil } -// implements RealpathFileLister interface -func (fs *root) Realpath(p string) string { - if fs.startDirectory == "" || fs.startDirectory == "/" { - return cleanPath(p) - } - return cleanPathWithBase(fs.startDirectory, p) -} - // In memory file-system-y thing that the Hanlders live on type root struct { - rootFile *memFile - mockErr error - startDirectory string + rootFile *memFile + mockErr error mu sync.Mutex files map[string]*memFile @@ -534,8 +510,8 @@ func (fs *root) exists(path string) bool { return err != os.ErrNotExist } -func (fs *root) fetch(path string) (*memFile, error) { - file, err := fs.lfetch(path) +func (fs *root) fetch(pathname string) (*memFile, error) { + file, err := fs.lfetch(pathname) if err != nil { return nil, err } @@ -546,7 +522,12 @@ func (fs *root) fetch(path string) (*memFile, error) { return nil, errTooManySymlinks } - file, err = fs.lfetch(file.symlink) + linkTarget := file.symlink + if !path.IsAbs(linkTarget) { + linkTarget = path.Join(path.Dir(file.name), linkTarget) + } + + file, err = fs.lfetch(linkTarget) if err != nil { return nil, err } diff --git a/vendor/github.com/pkg/sftp/request-interfaces.go b/vendor/github.com/pkg/sftp/request-interfaces.go index e5dc49bb..2090e316 100644 --- a/vendor/github.com/pkg/sftp/request-interfaces.go +++ b/vendor/github.com/pkg/sftp/request-interfaces.go @@ -74,6 +74,11 @@ type StatVFSFileCmder interface { // FileLister should return an object that fulfils the ListerAt interface // Note in cases of an error, the error text will be sent to the client. // Called for Methods: List, Stat, Readlink +// +// Since Filelist returns an os.FileInfo, this can make it non-ideal for implementing Readlink. +// This is because the Name receiver method defined by that interface defines that it should only return the base name. +// However, Readlink is required to be capable of returning essentially any arbitrary valid path relative or absolute. +// In order to implement this more expressive requirement, implement [ReadlinkFileLister] which will then be used instead. type FileLister interface { Filelist(*Request) (ListerAt, error) } @@ -87,12 +92,33 @@ type LstatFileLister interface { } // RealPathFileLister is a FileLister that implements the Realpath method. -// We use "/" as start directory for relative paths, implementing this -// interface you can customize the start directory. +// The built-in RealPath implementation does not resolve symbolic links. +// By implementing this interface you can customize the returned path +// and, for example, resolve symbolinc links if needed for your use case. // You have to return an absolute POSIX path. // -// Deprecated: if you want to set a start directory use WithStartDirectory RequestServerOption instead. +// Up to v1.13.5 the signature for the RealPath method was: +// +// # RealPath(string) string +// +// we have added a legacyRealPathFileLister that implements the old method +// to ensure that your code does not break. +// You should use the new method signature to avoid future issues type RealPathFileLister interface { + FileLister + RealPath(string) (string, error) +} + +// ReadlinkFileLister is a FileLister that implements the Readlink method. +// By implementing the Readlink method, it is possible to return any arbitrary valid path relative or absolute. +// This allows giving a better response than via the default FileLister (which is limited to os.FileInfo, whose Name method should only return the base name of a file) +type ReadlinkFileLister interface { + FileLister + Readlink(string) (string, error) +} + +// This interface is here for backward compatibility only +type legacyRealPathFileLister interface { FileLister RealPath(string) string } @@ -105,11 +131,19 @@ type NameLookupFileLister interface { LookupGroupName(string) string } -// ListerAt does for file lists what io.ReaderAt does for files. -// ListAt should return the number of entries copied and an io.EOF -// error if at end of list. This is testable by comparing how many you -// copied to how many could be copied (eg. n < len(ls) below). +// ListerAt does for file lists what io.ReaderAt does for files, i.e. a []os.FileInfo buffer is passed to the ListAt function +// and the entries that are populated in the buffer will be passed to the client. +// +// ListAt should return the number of entries copied and an io.EOF error if at end of list. +// This is testable by comparing how many you copied to how many could be copied (eg. n < len(ls) below). // The copy() builtin is best for the copying. +// +// Uid and gid information will on unix systems be retrieved from [os.FileInfo.Sys] +// if this function returns a [syscall.Stat_t] when called on a populated entry. +// Alternatively, if the entry implements [FileInfoUidGid], it will be used for uid and gid information. +// +// If a populated entry implements [FileInfoExtendedData], extended attributes will also be returned to the client. +// // Note in cases of an error, the error text will be sent to the client. type ListerAt interface { ListAt([]os.FileInfo, int64) (int, error) diff --git a/vendor/github.com/pkg/sftp/request-plan9.go b/vendor/github.com/pkg/sftp/request-plan9.go index 2444da59..38f91bcd 100644 --- a/vendor/github.com/pkg/sftp/request-plan9.go +++ b/vendor/github.com/pkg/sftp/request-plan9.go @@ -1,10 +1,9 @@ +//go:build plan9 // +build plan9 package sftp import ( - "path" - "path/filepath" "syscall" ) @@ -15,20 +14,3 @@ func fakeFileInfoSys() interface{} { func testOsSys(sys interface{}) error { return nil } - -func toLocalPath(p string) string { - lp := filepath.FromSlash(p) - - if path.IsAbs(p) { - tmp := lp[1:] - - if filepath.IsAbs(tmp) { - // If the FromSlash without any starting slashes is absolute, - // then we have a filepath encoded with a prefix '/'. - // e.g. "/#s/boot" to "#s/boot" - return tmp - } - } - - return lp -} diff --git a/vendor/github.com/pkg/sftp/request-readme.md b/vendor/github.com/pkg/sftp/request-readme.md index f887274d..f8b81f3a 100644 --- a/vendor/github.com/pkg/sftp/request-readme.md +++ b/vendor/github.com/pkg/sftp/request-readme.md @@ -28,7 +28,7 @@ then sends to the client. Handler for "Put" method and returns an io.Writer for the file which the server then writes the uploaded file to. The file opening "pflags" are currently preserved in the Request.Flags field as a 32bit bitmask value. See the [SFTP -spec](https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-6.3) for +spec](https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt#section-6.3) for details. ### Filecmd(*Request) error diff --git a/vendor/github.com/pkg/sftp/request-server.go b/vendor/github.com/pkg/sftp/request-server.go index b7dadd6c..7a99db64 100644 --- a/vendor/github.com/pkg/sftp/request-server.go +++ b/vendor/github.com/pkg/sftp/request-server.go @@ -219,12 +219,21 @@ func (rs *RequestServer) packetWorker(ctx context.Context, pktChan chan orderedR rpkt = statusFromError(pkt.ID, rs.closeRequest(handle)) case *sshFxpRealpathPacket: var realPath string - if realPather, ok := rs.Handlers.FileList.(RealPathFileLister); ok { - realPath = realPather.RealPath(pkt.getPath()) - } else { + var err error + + switch pather := rs.Handlers.FileList.(type) { + case RealPathFileLister: + realPath, err = pather.RealPath(pkt.getPath()) + case legacyRealPathFileLister: + realPath = pather.RealPath(pkt.getPath()) + default: realPath = cleanPathWithBase(rs.startDirectory, pkt.getPath()) } - rpkt = cleanPacketPath(pkt, realPath) + if err != nil { + rpkt = statusFromError(pkt.ID, err) + } else { + rpkt = cleanPacketPath(pkt, realPath) + } case *sshFxpOpendirPacket: request := requestFromPacket(ctx, pkt, rs.startDirectory) handle := rs.nextRequest(request) diff --git a/vendor/github.com/pkg/sftp/request-unix.go b/vendor/github.com/pkg/sftp/request-unix.go index 50b08a38..e3e037d6 100644 --- a/vendor/github.com/pkg/sftp/request-unix.go +++ b/vendor/github.com/pkg/sftp/request-unix.go @@ -1,3 +1,4 @@ +//go:build !windows && !plan9 // +build !windows,!plan9 package sftp @@ -21,7 +22,3 @@ func testOsSys(sys interface{}) error { } return nil } - -func toLocalPath(p string) string { - return p -} diff --git a/vendor/github.com/pkg/sftp/request.go b/vendor/github.com/pkg/sftp/request.go index 116c27aa..57d788df 100644 --- a/vendor/github.com/pkg/sftp/request.go +++ b/vendor/github.com/pkg/sftp/request.go @@ -187,6 +187,7 @@ func requestFromPacket(ctx context.Context, pkt hasPath, baseDir string) *Reques // NOTE: given a POSIX compliant signature: symlink(target, linkpath string) // this makes Request.Target the linkpath, and Request.Filepath the target. request.Target = cleanPathWithBase(baseDir, p.Linkpath) + request.Filepath = p.Targetpath case *sshFxpExtendedPacketHardlink: request.Target = cleanPathWithBase(baseDir, p.Newpath) } @@ -294,7 +295,12 @@ func (r *Request) call(handlers Handlers, pkt requestPacket, alloc *allocator, o return filecmd(handlers.FileCmd, r, pkt) case "List": return filelist(handlers.FileList, r, pkt) - case "Stat", "Lstat", "Readlink": + case "Stat", "Lstat": + return filestat(handlers.FileList, r, pkt) + case "Readlink": + if readlinkFileLister, ok := handlers.FileList.(ReadlinkFileLister); ok { + return readlink(readlinkFileLister, r, pkt) + } return filestat(handlers.FileList, r, pkt) default: return statusFromError(pkt.id(), fmt.Errorf("unexpected method: %s", r.Method)) @@ -598,6 +604,23 @@ func filestat(h FileLister, r *Request, pkt requestPacket) responsePacket { } } +func readlink(readlinkFileLister ReadlinkFileLister, r *Request, pkt requestPacket) responsePacket { + resolved, err := readlinkFileLister.Readlink(r.Filepath) + if err != nil { + return statusFromError(pkt.id(), err) + } + return &sshFxpNamePacket{ + ID: pkt.id(), + NameAttrs: []*sshFxpNameAttr{ + { + Name: resolved, + LongName: resolved, + Attrs: emptyFileStat, + }, + }, + } +} + // init attributes of request object from packet data func requestMethod(p requestPacket) (method string) { switch p.(type) { diff --git a/vendor/github.com/pkg/sftp/request_windows.go b/vendor/github.com/pkg/sftp/request_windows.go index 1f6d3df1..bd1d6864 100644 --- a/vendor/github.com/pkg/sftp/request_windows.go +++ b/vendor/github.com/pkg/sftp/request_windows.go @@ -1,8 +1,6 @@ package sftp import ( - "path" - "path/filepath" "syscall" ) @@ -13,32 +11,3 @@ func fakeFileInfoSys() interface{} { func testOsSys(sys interface{}) error { return nil } - -func toLocalPath(p string) string { - lp := filepath.FromSlash(p) - - if path.IsAbs(p) { - tmp := lp - for len(tmp) > 0 && tmp[0] == '\\' { - tmp = tmp[1:] - } - - if filepath.IsAbs(tmp) { - // If the FromSlash without any starting slashes is absolute, - // then we have a filepath encoded with a prefix '/'. - // e.g. "/C:/Windows" to "C:\\Windows" - return tmp - } - - tmp += "\\" - - if filepath.IsAbs(tmp) { - // If the FromSlash without any starting slashes but with extra end slash is absolute, - // then we have a filepath encoded with a prefix '/' and a dropped '/' at the end. - // e.g. "/C:" to "C:\\" - return tmp - } - } - - return lp -} diff --git a/vendor/github.com/pkg/sftp/server.go b/vendor/github.com/pkg/sftp/server.go index 529052b4..2e419f59 100644 --- a/vendor/github.com/pkg/sftp/server.go +++ b/vendor/github.com/pkg/sftp/server.go @@ -24,7 +24,7 @@ const ( // Server is an SSH File Transfer Protocol (sftp) server. // This is intended to provide the sftp subsystem to an ssh server daemon. // This implementation currently supports most of sftp server protocol version 3, -// as specified at http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 +// as specified at https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt type Server struct { *serverConn debugStream io.Writer @@ -33,6 +33,7 @@ type Server struct { openFiles map[string]*os.File openFilesLock sync.RWMutex handleCount int + workDir string } func (svr *Server) nextHandle(f *os.File) string { @@ -128,6 +129,16 @@ func WithAllocator() ServerOption { } } +// WithServerWorkingDirectory sets a working directory to use as base +// for relative paths. +// If unset the default is current working directory (os.Getwd). +func WithServerWorkingDirectory(workDir string) ServerOption { + return func(s *Server) error { + s.workDir = cleanPath(workDir) + return nil + } +} + type rxPacket struct { pktType fxp pktBytes []byte @@ -174,7 +185,7 @@ func handlePacket(s *Server, p orderedRequest) error { } case *sshFxpStatPacket: // stat the requested file - info, err := os.Stat(toLocalPath(p.Path)) + info, err := os.Stat(s.toLocalPath(p.Path)) rpkt = &sshFxpStatResponse{ ID: p.ID, info: info, @@ -184,7 +195,7 @@ func handlePacket(s *Server, p orderedRequest) error { } case *sshFxpLstatPacket: // stat the requested file - info, err := os.Lstat(toLocalPath(p.Path)) + info, err := os.Lstat(s.toLocalPath(p.Path)) rpkt = &sshFxpStatResponse{ ID: p.ID, info: info, @@ -208,24 +219,24 @@ func handlePacket(s *Server, p orderedRequest) error { } case *sshFxpMkdirPacket: // TODO FIXME: ignore flags field - err := os.Mkdir(toLocalPath(p.Path), 0755) + err := os.Mkdir(s.toLocalPath(p.Path), 0o755) rpkt = statusFromError(p.ID, err) case *sshFxpRmdirPacket: - err := os.Remove(toLocalPath(p.Path)) + err := os.Remove(s.toLocalPath(p.Path)) rpkt = statusFromError(p.ID, err) case *sshFxpRemovePacket: - err := os.Remove(toLocalPath(p.Filename)) + err := os.Remove(s.toLocalPath(p.Filename)) rpkt = statusFromError(p.ID, err) case *sshFxpRenamePacket: - err := os.Rename(toLocalPath(p.Oldpath), toLocalPath(p.Newpath)) + err := os.Rename(s.toLocalPath(p.Oldpath), s.toLocalPath(p.Newpath)) rpkt = statusFromError(p.ID, err) case *sshFxpSymlinkPacket: - err := os.Symlink(toLocalPath(p.Targetpath), toLocalPath(p.Linkpath)) + err := os.Symlink(s.toLocalPath(p.Targetpath), s.toLocalPath(p.Linkpath)) rpkt = statusFromError(p.ID, err) case *sshFxpClosePacket: rpkt = statusFromError(p.ID, s.closeHandle(p.Handle)) case *sshFxpReadlinkPacket: - f, err := os.Readlink(toLocalPath(p.Path)) + f, err := os.Readlink(s.toLocalPath(p.Path)) rpkt = &sshFxpNamePacket{ ID: p.ID, NameAttrs: []*sshFxpNameAttr{ @@ -240,7 +251,7 @@ func handlePacket(s *Server, p orderedRequest) error { rpkt = statusFromError(p.ID, err) } case *sshFxpRealpathPacket: - f, err := filepath.Abs(toLocalPath(p.Path)) + f, err := filepath.Abs(s.toLocalPath(p.Path)) f = cleanPath(f) rpkt = &sshFxpNamePacket{ ID: p.ID, @@ -256,13 +267,14 @@ func handlePacket(s *Server, p orderedRequest) error { rpkt = statusFromError(p.ID, err) } case *sshFxpOpendirPacket: - p.Path = toLocalPath(p.Path) + lp := s.toLocalPath(p.Path) - if stat, err := os.Stat(p.Path); err != nil { + if stat, err := os.Stat(lp); err != nil { rpkt = statusFromError(p.ID, err) } else if !stat.IsDir() { rpkt = statusFromError(p.ID, &os.PathError{ - Path: p.Path, Err: syscall.ENOTDIR}) + Path: lp, Err: syscall.ENOTDIR, + }) } else { rpkt = (&sshFxpOpenPacket{ ID: p.ID, @@ -315,7 +327,7 @@ func handlePacket(s *Server, p orderedRequest) error { } // Serve serves SFTP connections until the streams stop or the SFTP subsystem -// is stopped. +// is stopped. It returns nil if the server exits cleanly. func (svr *Server) Serve() error { defer func() { if svr.pktMgr.alloc != nil { @@ -341,6 +353,10 @@ func (svr *Server) Serve() error { for { pktType, pktBytes, err = svr.serverConn.recvPacket(svr.pktMgr.getNextOrderID()) if err != nil { + // Check whether the connection terminated cleanly in-between packets. + if err == io.EOF { + err = nil + } // we don't care about releasing allocated pages here, the server will quit and the allocator freed break } @@ -446,7 +462,7 @@ func (p *sshFxpOpenPacket) respond(svr *Server) responsePacket { osFlags |= os.O_EXCL } - f, err := os.OpenFile(toLocalPath(p.Path), osFlags, 0644) + f, err := os.OpenFile(svr.toLocalPath(p.Path), osFlags, 0o644) if err != nil { return statusFromError(p.ID, err) } @@ -484,7 +500,7 @@ func (p *sshFxpSetstatPacket) respond(svr *Server) responsePacket { b := p.Attrs.([]byte) var err error - p.Path = toLocalPath(p.Path) + p.Path = svr.toLocalPath(p.Path) debug("setstat name \"%s\"", p.Path) if (p.Flags & sshFileXferAttrSize) != 0 { @@ -603,13 +619,15 @@ func statusFromError(id uint32, err error) *sshFxpStatusPacket { return ret } - switch e := err.(type) { - case fxerr: + if errors.Is(err, io.EOF) { + ret.StatusError.Code = sshFxEOF + return ret + } + + var e fxerr + if errors.As(err, &e) { ret.StatusError.Code = uint32(e) - default: - if e == io.EOF { - ret.StatusError.Code = sshFxEOF - } + return ret } return ret diff --git a/vendor/github.com/pkg/sftp/server_plan9.go b/vendor/github.com/pkg/sftp/server_plan9.go new file mode 100644 index 00000000..4e8ed067 --- /dev/null +++ b/vendor/github.com/pkg/sftp/server_plan9.go @@ -0,0 +1,27 @@ +package sftp + +import ( + "path" + "path/filepath" +) + +func (s *Server) toLocalPath(p string) string { + if s.workDir != "" && !path.IsAbs(p) { + p = path.Join(s.workDir, p) + } + + lp := filepath.FromSlash(p) + + if path.IsAbs(p) { + tmp := lp[1:] + + if filepath.IsAbs(tmp) { + // If the FromSlash without any starting slashes is absolute, + // then we have a filepath encoded with a prefix '/'. + // e.g. "/#s/boot" to "#s/boot" + return tmp + } + } + + return lp +} diff --git a/vendor/github.com/pkg/sftp/server_statvfs_impl.go b/vendor/github.com/pkg/sftp/server_statvfs_impl.go index 94b6d832..a5470798 100644 --- a/vendor/github.com/pkg/sftp/server_statvfs_impl.go +++ b/vendor/github.com/pkg/sftp/server_statvfs_impl.go @@ -1,3 +1,4 @@ +//go:build darwin || linux // +build darwin linux // fill in statvfs structure with OS specific values diff --git a/vendor/github.com/pkg/sftp/server_statvfs_linux.go b/vendor/github.com/pkg/sftp/server_statvfs_linux.go index 1d180d47..615c4157 100644 --- a/vendor/github.com/pkg/sftp/server_statvfs_linux.go +++ b/vendor/github.com/pkg/sftp/server_statvfs_linux.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package sftp diff --git a/vendor/github.com/pkg/sftp/server_statvfs_stubs.go b/vendor/github.com/pkg/sftp/server_statvfs_stubs.go index fbf49068..dd4705bb 100644 --- a/vendor/github.com/pkg/sftp/server_statvfs_stubs.go +++ b/vendor/github.com/pkg/sftp/server_statvfs_stubs.go @@ -1,3 +1,4 @@ +//go:build !darwin && !linux && !plan9 // +build !darwin,!linux,!plan9 package sftp diff --git a/vendor/github.com/pkg/sftp/server_unix.go b/vendor/github.com/pkg/sftp/server_unix.go new file mode 100644 index 00000000..495b397c --- /dev/null +++ b/vendor/github.com/pkg/sftp/server_unix.go @@ -0,0 +1,16 @@ +//go:build !windows && !plan9 +// +build !windows,!plan9 + +package sftp + +import ( + "path" +) + +func (s *Server) toLocalPath(p string) string { + if s.workDir != "" && !path.IsAbs(p) { + p = path.Join(s.workDir, p) + } + + return p +} diff --git a/vendor/github.com/pkg/sftp/server_windows.go b/vendor/github.com/pkg/sftp/server_windows.go new file mode 100644 index 00000000..b35be730 --- /dev/null +++ b/vendor/github.com/pkg/sftp/server_windows.go @@ -0,0 +1,39 @@ +package sftp + +import ( + "path" + "path/filepath" +) + +func (s *Server) toLocalPath(p string) string { + if s.workDir != "" && !path.IsAbs(p) { + p = path.Join(s.workDir, p) + } + + lp := filepath.FromSlash(p) + + if path.IsAbs(p) { + tmp := lp + for len(tmp) > 0 && tmp[0] == '\\' { + tmp = tmp[1:] + } + + if filepath.IsAbs(tmp) { + // If the FromSlash without any starting slashes is absolute, + // then we have a filepath encoded with a prefix '/'. + // e.g. "/C:/Windows" to "C:\\Windows" + return tmp + } + + tmp += "\\" + + if filepath.IsAbs(tmp) { + // If the FromSlash without any starting slashes but with extra end slash is absolute, + // then we have a filepath encoded with a prefix '/' and a dropped '/' at the end. + // e.g. "/C:" to "C:\\" + return tmp + } + } + + return lp +} diff --git a/vendor/github.com/pkg/sftp/sftp.go b/vendor/github.com/pkg/sftp/sftp.go index 9a63c39d..778c8f3d 100644 --- a/vendor/github.com/pkg/sftp/sftp.go +++ b/vendor/github.com/pkg/sftp/sftp.go @@ -1,5 +1,5 @@ // Package sftp implements the SSH File Transfer Protocol as described in -// https://tools.ietf.org/html/draft-ietf-secsh-filexfer-02 +// https://filezilla-project.org/specs/draft-ietf-secsh-filexfer-02.txt package sftp import ( diff --git a/vendor/github.com/pkg/sftp/syscall_fixed.go b/vendor/github.com/pkg/sftp/syscall_fixed.go index d4045777..e8443083 100644 --- a/vendor/github.com/pkg/sftp/syscall_fixed.go +++ b/vendor/github.com/pkg/sftp/syscall_fixed.go @@ -1,3 +1,4 @@ +//go:build plan9 || windows || (js && wasm) // +build plan9 windows js,wasm // Go defines S_IFMT on windows, plan9 and js/wasm as 0x1f000 instead of diff --git a/vendor/github.com/pkg/sftp/syscall_good.go b/vendor/github.com/pkg/sftp/syscall_good.go index 4c2b240c..50052189 100644 --- a/vendor/github.com/pkg/sftp/syscall_good.go +++ b/vendor/github.com/pkg/sftp/syscall_good.go @@ -1,4 +1,6 @@ -// +build !plan9,!windows +//go:build !plan9 && !windows && (!js || !wasm) +// +build !plan9 +// +build !windows // +build !js !wasm package sftp diff --git a/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s b/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s index db9171c2..269e173c 100644 --- a/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s +++ b/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/cpu/cpu_aix.go b/vendor/golang.org/x/sys/cpu/cpu_aix.go index 8aaeef54..9bf0c32e 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_aix.go +++ b/vendor/golang.org/x/sys/cpu/cpu_aix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix -// +build aix package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.s b/vendor/golang.org/x/sys/cpu/cpu_arm64.s index c61f95a0..fcb9a388 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.s +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go index ccf542a7..a8acd3e3 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go index 0af2f248..c8ae6ddc 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go index fa7cdb9b..910728fb 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gc -// +build 386 amd64 amd64p32 -// +build gc package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go index 2aff3189..7f194678 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gccgo -// +build gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go index 4bfbda61..9526d2ce 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gccgo -// +build gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c index 6cc73109..3f73a05d 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gccgo -// +build 386 amd64 amd64p32 -// +build gccgo #include #include diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go index 863d415a..99c60fe9 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gccgo -// +build 386 amd64 amd64p32 -// +build gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux.go b/vendor/golang.org/x/sys/cpu/cpu_linux.go index 159a686f..743eb543 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !386 && !amd64 && !amd64p32 && !arm64 -// +build !386,!amd64,!amd64p32,!arm64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go index 6000db4c..4686c1d5 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (mips64 || mips64le) -// +build linux -// +build mips64 mips64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go index f4992b1a..cd63e733 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x -// +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go index 021356d6..197188e6 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (ppc64 || ppc64le) -// +build linux -// +build ppc64 ppc64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_loong64.go index 0f57b05b..55863585 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_loong64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_loong64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build loong64 -// +build loong64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go index f4063c66..fedb00cc 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build mips64 || mips64le -// +build mips64 mips64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go index 07c4e36d..ffb4ec7e 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go +++ b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build mips || mipsle -// +build mips mipsle package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm.go index d7b4fb4c..e9ecf2a4 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_arm.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !linux && arm -// +build !linux,arm package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go index f3cde129..5341e7f8 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !linux && !netbsd && !openbsd && arm64 -// +build !linux,!netbsd,!openbsd,arm64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go index 0dafe964..5f8f2419 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build !linux && (mips64 || mips64le) -// +build !linux -// +build mips64 mips64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go index 060d46b6..89608fba 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build !aix && !linux && (ppc64 || ppc64le) -// +build !aix -// +build !linux -// +build ppc64 ppc64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go index dd10eb79..5ab87808 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !linux && riscv64 -// +build !linux,riscv64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go index 4e8acd16..c14f12b1 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go +++ b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ppc64 || ppc64le -// +build ppc64 ppc64le package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go index ff7da60e..7f0c79c0 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build riscv64 -// +build riscv64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_s390x.s b/vendor/golang.org/x/sys/cpu/cpu_s390x.s index 96f81e20..1fb4b701 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_s390x.s +++ b/vendor/golang.org/x/sys/cpu/cpu_s390x.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/cpu/cpu_wasm.go b/vendor/golang.org/x/sys/cpu/cpu_wasm.go index 7747d888..384787ea 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_wasm.go +++ b/vendor/golang.org/x/sys/cpu/cpu_wasm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build wasm -// +build wasm package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go index 2dcde828..c29f5e4c 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_x86.go +++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 || amd64 || amd64p32 -// +build 386 amd64 amd64p32 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.s b/vendor/golang.org/x/sys/cpu/cpu_x86.s index 39acab2f..7d7ba33e 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_x86.s +++ b/vendor/golang.org/x/sys/cpu/cpu_x86.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (386 || amd64 || amd64p32) && gc -// +build 386 amd64 amd64p32 -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/cpu/endian_big.go b/vendor/golang.org/x/sys/cpu/endian_big.go index 93ce03a3..7fe04b0a 100644 --- a/vendor/golang.org/x/sys/cpu/endian_big.go +++ b/vendor/golang.org/x/sys/cpu/endian_big.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 -// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/endian_little.go b/vendor/golang.org/x/sys/cpu/endian_little.go index 55db853e..48eccc4c 100644 --- a/vendor/golang.org/x/sys/cpu/endian_little.go +++ b/vendor/golang.org/x/sys/cpu/endian_little.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm -// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh wasm package cpu diff --git a/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go b/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go index d87bd6b3..4cd64c70 100644 --- a/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go +++ b/vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && arm64 -// +build linux,arm64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go b/vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go index b975ea2a..4c9788ea 100644 --- a/vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go +++ b/vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build go1.21 -// +build go1.21 package cpu diff --git a/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go b/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go index 96134157..1b9ccb09 100644 --- a/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go +++ b/vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go @@ -9,7 +9,6 @@ // gccgo's libgo and thus must not used a CGo method. //go:build aix && gccgo -// +build aix,gccgo package cpu diff --git a/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go b/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go index 904be42f..e8b6cdbe 100644 --- a/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go +++ b/vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go @@ -7,7 +7,6 @@ // (See golang.org/issue/32102) //go:build aix && ppc64 && gc -// +build aix,ppc64,gc package cpu diff --git a/vendor/golang.org/x/sys/execabs/execabs_go118.go b/vendor/golang.org/x/sys/execabs/execabs_go118.go index 2000064a..5627d70e 100644 --- a/vendor/golang.org/x/sys/execabs/execabs_go118.go +++ b/vendor/golang.org/x/sys/execabs/execabs_go118.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !go1.19 -// +build !go1.19 package execabs diff --git a/vendor/golang.org/x/sys/execabs/execabs_go119.go b/vendor/golang.org/x/sys/execabs/execabs_go119.go index f364b341..d60ab1b4 100644 --- a/vendor/golang.org/x/sys/execabs/execabs_go119.go +++ b/vendor/golang.org/x/sys/execabs/execabs_go119.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build go1.19 -// +build go1.19 package execabs diff --git a/vendor/golang.org/x/sys/unix/aliases.go b/vendor/golang.org/x/sys/unix/aliases.go index abc89c10..e7d3df4b 100644 --- a/vendor/golang.org/x/sys/unix/aliases.go +++ b/vendor/golang.org/x/sys/unix/aliases.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos -// +build go1.9 package unix diff --git a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s index db9171c2..269e173c 100644 --- a/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s +++ b/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_386.s b/vendor/golang.org/x/sys/unix/asm_bsd_386.s index e0fcd9b3..a4fcef0e 100644 --- a/vendor/golang.org/x/sys/unix/asm_bsd_386.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_386.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (freebsd || netbsd || openbsd) && gc -// +build freebsd netbsd openbsd -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s b/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s index 2b99c349..1e63615c 100644 --- a/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc -// +build darwin dragonfly freebsd netbsd openbsd -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_arm.s b/vendor/golang.org/x/sys/unix/asm_bsd_arm.s index d702d4ad..6496c310 100644 --- a/vendor/golang.org/x/sys/unix/asm_bsd_arm.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_arm.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (freebsd || netbsd || openbsd) && gc -// +build freebsd netbsd openbsd -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s b/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s index fe36a739..4fd1f54d 100644 --- a/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || freebsd || netbsd || openbsd) && gc -// +build darwin freebsd netbsd openbsd -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s b/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s index e5b9a848..42f7eb9e 100644 --- a/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || freebsd || netbsd || openbsd) && gc -// +build darwin freebsd netbsd openbsd -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s b/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s index d560019e..f8902667 100644 --- a/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || freebsd || netbsd || openbsd) && gc -// +build darwin freebsd netbsd openbsd -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_386.s b/vendor/golang.org/x/sys/unix/asm_linux_386.s index 8fd101d0..3b473487 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_386.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_386.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s index 7ed38e43..67e29f31 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_amd64.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_amd64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm.s b/vendor/golang.org/x/sys/unix/asm_linux_arm.s index 8ef1d514..d6ae269c 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_arm.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_arm.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s index 98ae0276..01e5e253 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_arm64.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_arm64.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && arm64 && gc -// +build linux -// +build arm64 -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_loong64.s b/vendor/golang.org/x/sys/unix/asm_linux_loong64.s index 56535728..2abf12f6 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_loong64.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_loong64.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && loong64 && gc -// +build linux -// +build loong64 -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s index 21231d2c..f84bae71 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (mips64 || mips64le) && gc -// +build linux -// +build mips64 mips64le -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s index 6783b26c..f08f6280 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (mips || mipsle) && gc -// +build linux -// +build mips mipsle -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s index 19d49893..bdfc024d 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (ppc64 || ppc64le) && gc -// +build linux -// +build ppc64 ppc64le -// +build gc #include "textflag.h" 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 e42eb81d..2e8c9961 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build riscv64 && gc -// +build riscv64 -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s index c46aab33..2c394b11 100644 --- a/vendor/golang.org/x/sys/unix/asm_linux_s390x.s +++ b/vendor/golang.org/x/sys/unix/asm_linux_s390x.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && s390x && gc -// +build linux -// +build s390x -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s index 5e7a1169..fab586a2 100644 --- a/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s b/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s index f8c5394c..f949ec54 100644 --- a/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s +++ b/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gc -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s index 3b54e185..2f67ba86 100644 --- a/vendor/golang.org/x/sys/unix/asm_zos_s390x.s +++ b/vendor/golang.org/x/sys/unix/asm_zos_s390x.s @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x && gc -// +build zos -// +build s390x -// +build gc #include "textflag.h" diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/vendor/golang.org/x/sys/unix/cap_freebsd.go index 0b7c6adb..a0865789 100644 --- a/vendor/golang.org/x/sys/unix/cap_freebsd.go +++ b/vendor/golang.org/x/sys/unix/cap_freebsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build freebsd -// +build freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/constants.go b/vendor/golang.org/x/sys/unix/constants.go index 394a3965..6fb7cb77 100644 --- a/vendor/golang.org/x/sys/unix/constants.go +++ b/vendor/golang.org/x/sys/unix/constants.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go index 65a99850..d7851346 100644 --- a/vendor/golang.org/x/sys/unix/dev_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/dev_aix_ppc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix && ppc -// +build aix,ppc // Functions to access/create device major and minor numbers matching the // encoding used by AIX. diff --git a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go index 8fc08ad0..623a5e69 100644 --- a/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix && ppc64 -// +build aix,ppc64 // Functions to access/create device major and minor numbers matching the // encoding used AIX. diff --git a/vendor/golang.org/x/sys/unix/dev_zos.go b/vendor/golang.org/x/sys/unix/dev_zos.go index a388e59a..bb6a64fe 100644 --- a/vendor/golang.org/x/sys/unix/dev_zos.go +++ b/vendor/golang.org/x/sys/unix/dev_zos.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x // Functions to access/create device major and minor numbers matching the // encoding used by z/OS. diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go index 2499f977..1ebf1178 100644 --- a/vendor/golang.org/x/sys/unix/dirent.go +++ b/vendor/golang.org/x/sys/unix/dirent.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/endian_big.go b/vendor/golang.org/x/sys/unix/endian_big.go index a5202655..1095fd31 100644 --- a/vendor/golang.org/x/sys/unix/endian_big.go +++ b/vendor/golang.org/x/sys/unix/endian_big.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. // //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 -// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 package unix diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go index b0f2bc4a..b9f0e277 100644 --- a/vendor/golang.org/x/sys/unix/endian_little.go +++ b/vendor/golang.org/x/sys/unix/endian_little.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. // //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh -// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh package unix diff --git a/vendor/golang.org/x/sys/unix/env_unix.go b/vendor/golang.org/x/sys/unix/env_unix.go index 29ccc4d1..a96da71f 100644 --- a/vendor/golang.org/x/sys/unix/env_unix.go +++ b/vendor/golang.org/x/sys/unix/env_unix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // Unix environment variables. diff --git a/vendor/golang.org/x/sys/unix/epoll_zos.go b/vendor/golang.org/x/sys/unix/epoll_zos.go index cedaf7e0..7753fdde 100644 --- a/vendor/golang.org/x/sys/unix/epoll_zos.go +++ b/vendor/golang.org/x/sys/unix/epoll_zos.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go index e9b99125..58c6bfc7 100644 --- a/vendor/golang.org/x/sys/unix/fcntl.go +++ b/vendor/golang.org/x/sys/unix/fcntl.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build dragonfly || freebsd || linux || netbsd || openbsd -// +build dragonfly freebsd linux netbsd openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go b/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go index 29d44808..13b4acd5 100644 --- a/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +++ b/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) -// +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc package unix diff --git a/vendor/golang.org/x/sys/unix/fdset.go b/vendor/golang.org/x/sys/unix/fdset.go index a8068f94..9e83d18c 100644 --- a/vendor/golang.org/x/sys/unix/fdset.go +++ b/vendor/golang.org/x/sys/unix/fdset.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/fstatfs_zos.go b/vendor/golang.org/x/sys/unix/fstatfs_zos.go index e377cc9f..c8bde601 100644 --- a/vendor/golang.org/x/sys/unix/fstatfs_zos.go +++ b/vendor/golang.org/x/sys/unix/fstatfs_zos.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go index b06f52d7..aca5721d 100644 --- a/vendor/golang.org/x/sys/unix/gccgo.go +++ b/vendor/golang.org/x/sys/unix/gccgo.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gccgo && !aix && !hurd -// +build gccgo,!aix,!hurd package unix diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/vendor/golang.org/x/sys/unix/gccgo_c.c index f98a1c54..d468b7b4 100644 --- a/vendor/golang.org/x/sys/unix/gccgo_c.c +++ b/vendor/golang.org/x/sys/unix/gccgo_c.c @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gccgo && !aix && !hurd -// +build gccgo,!aix,!hurd #include #include diff --git a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go index e60e49a3..972d61bd 100644 --- a/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build gccgo && linux && amd64 -// +build gccgo,linux,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go index 15721a51..848840ae 100644 --- a/vendor/golang.org/x/sys/unix/ifreq_linux.go +++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux -// +build linux package unix diff --git a/vendor/golang.org/x/sys/unix/ioctl_signed.go b/vendor/golang.org/x/sys/unix/ioctl_signed.go index 7def9580..5b0759bd 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_signed.go +++ b/vendor/golang.org/x/sys/unix/ioctl_signed.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || solaris -// +build aix solaris package unix diff --git a/vendor/golang.org/x/sys/unix/ioctl_unsigned.go b/vendor/golang.org/x/sys/unix/ioctl_unsigned.go index 649913d1..20f470b9 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_unsigned.go +++ b/vendor/golang.org/x/sys/unix/ioctl_unsigned.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd -// +build darwin dragonfly freebsd hurd linux netbsd openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ioctl_zos.go b/vendor/golang.org/x/sys/unix/ioctl_zos.go index cdc21bf7..c8b2a750 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_zos.go +++ b/vendor/golang.org/x/sys/unix/ioctl_zos.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 47fa6a7e..cbe24150 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -663,7 +663,6 @@ echo '// mkerrors.sh' "$@" echo '// Code generated by the command above; see README.md. DO NOT EDIT.' echo echo "//go:build ${GOARCH} && ${GOOS}" -echo "// +build ${GOARCH},${GOOS}" echo go tool cgo -godefs -- "$@" _const.go >_error.out cat _error.out | grep -vf _error.grep | grep -vf _signal.grep diff --git a/vendor/golang.org/x/sys/unix/mmap_nomremap.go b/vendor/golang.org/x/sys/unix/mmap_nomremap.go index ca051363..4b68e597 100644 --- a/vendor/golang.org/x/sys/unix/mmap_nomremap.go +++ b/vendor/golang.org/x/sys/unix/mmap_nomremap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris -// +build aix darwin dragonfly freebsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/mremap.go b/vendor/golang.org/x/sys/unix/mremap.go index fa93d0aa..fd45fe52 100644 --- a/vendor/golang.org/x/sys/unix/mremap.go +++ b/vendor/golang.org/x/sys/unix/mremap.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux || netbsd -// +build linux netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/pagesize_unix.go b/vendor/golang.org/x/sys/unix/pagesize_unix.go index 53f1b4c5..4d0a3430 100644 --- a/vendor/golang.org/x/sys/unix/pagesize_unix.go +++ b/vendor/golang.org/x/sys/unix/pagesize_unix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris // For Unix, get the pagesize from the runtime. diff --git a/vendor/golang.org/x/sys/unix/pledge_openbsd.go b/vendor/golang.org/x/sys/unix/pledge_openbsd.go index eb48294b..6a09af53 100644 --- a/vendor/golang.org/x/sys/unix/pledge_openbsd.go +++ b/vendor/golang.org/x/sys/unix/pledge_openbsd.go @@ -8,54 +8,31 @@ import ( "errors" "fmt" "strconv" - "syscall" - "unsafe" ) // Pledge implements the pledge syscall. // -// The pledge syscall does not accept execpromises on OpenBSD releases -// before 6.3. -// -// execpromises must be empty when Pledge is called on OpenBSD -// releases predating 6.3, otherwise an error will be returned. +// This changes both the promises and execpromises; use PledgePromises or +// PledgeExecpromises to only change the promises or execpromises +// respectively. // // For more information see pledge(2). func Pledge(promises, execpromises string) error { - maj, min, err := majmin() - if err != nil { + if err := pledgeAvailable(); err != nil { return err } - err = pledgeAvailable(maj, min, execpromises) + pptr, err := BytePtrFromString(promises) if err != nil { return err } - pptr, err := syscall.BytePtrFromString(promises) + exptr, err := BytePtrFromString(execpromises) if err != nil { return err } - // This variable will hold either a nil unsafe.Pointer or - // an unsafe.Pointer to a string (execpromises). - var expr unsafe.Pointer - - // If we're running on OpenBSD > 6.2, pass execpromises to the syscall. - if maj > 6 || (maj == 6 && min > 2) { - exptr, err := syscall.BytePtrFromString(execpromises) - if err != nil { - return err - } - expr = unsafe.Pointer(exptr) - } - - _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0) - if e != 0 { - return e - } - - return nil + return pledge(pptr, exptr) } // PledgePromises implements the pledge syscall. @@ -64,30 +41,16 @@ func Pledge(promises, execpromises string) error { // // For more information see pledge(2). func PledgePromises(promises string) error { - maj, min, err := majmin() - if err != nil { - return err - } - - err = pledgeAvailable(maj, min, "") - if err != nil { + if err := pledgeAvailable(); err != nil { return err } - // This variable holds the execpromises and is always nil. - var expr unsafe.Pointer - - pptr, err := syscall.BytePtrFromString(promises) + pptr, err := BytePtrFromString(promises) if err != nil { return err } - _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(unsafe.Pointer(pptr)), uintptr(expr), 0) - if e != 0 { - return e - } - - return nil + return pledge(pptr, nil) } // PledgeExecpromises implements the pledge syscall. @@ -96,30 +59,16 @@ func PledgePromises(promises string) error { // // For more information see pledge(2). func PledgeExecpromises(execpromises string) error { - maj, min, err := majmin() - if err != nil { + if err := pledgeAvailable(); err != nil { return err } - err = pledgeAvailable(maj, min, execpromises) + exptr, err := BytePtrFromString(execpromises) if err != nil { return err } - // This variable holds the promises and is always nil. - var pptr unsafe.Pointer - - exptr, err := syscall.BytePtrFromString(execpromises) - if err != nil { - return err - } - - _, _, e := syscall.Syscall(SYS_PLEDGE, uintptr(pptr), uintptr(unsafe.Pointer(exptr)), 0) - if e != 0 { - return e - } - - return nil + return pledge(nil, exptr) } // majmin returns major and minor version number for an OpenBSD system. @@ -147,16 +96,15 @@ func majmin() (major int, minor int, err error) { // pledgeAvailable checks for availability of the pledge(2) syscall // based on the running OpenBSD version. -func pledgeAvailable(maj, min int, execpromises string) error { - // If OpenBSD <= 5.9, pledge is not available. - if (maj == 5 && min != 9) || maj < 5 { - return fmt.Errorf("pledge syscall is not available on OpenBSD %d.%d", maj, min) +func pledgeAvailable() error { + maj, min, err := majmin() + if err != nil { + return err } - // If OpenBSD <= 6.2 and execpromises is not empty, - // return an error - execpromises is not available before 6.3 - if (maj < 6 || (maj == 6 && min <= 2)) && execpromises != "" { - return fmt.Errorf("cannot use execpromises on OpenBSD %d.%d", maj, min) + // Require OpenBSD 6.4 as a minimum. + if maj < 6 || (maj == 6 && min <= 3) { + return fmt.Errorf("cannot call Pledge on OpenBSD %d.%d", maj, min) } return nil diff --git a/vendor/golang.org/x/sys/unix/ptrace_darwin.go b/vendor/golang.org/x/sys/unix/ptrace_darwin.go index 463c3eff..3f0975f3 100644 --- a/vendor/golang.org/x/sys/unix/ptrace_darwin.go +++ b/vendor/golang.org/x/sys/unix/ptrace_darwin.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && !ios -// +build darwin,!ios package unix diff --git a/vendor/golang.org/x/sys/unix/ptrace_ios.go b/vendor/golang.org/x/sys/unix/ptrace_ios.go index ed0509a0..a4d35db5 100644 --- a/vendor/golang.org/x/sys/unix/ptrace_ios.go +++ b/vendor/golang.org/x/sys/unix/ptrace_ios.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ios -// +build ios package unix diff --git a/vendor/golang.org/x/sys/unix/race.go b/vendor/golang.org/x/sys/unix/race.go index 6f6c5fec..714d2aae 100644 --- a/vendor/golang.org/x/sys/unix/race.go +++ b/vendor/golang.org/x/sys/unix/race.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin && race) || (linux && race) || (freebsd && race) -// +build darwin,race linux,race freebsd,race package unix diff --git a/vendor/golang.org/x/sys/unix/race0.go b/vendor/golang.org/x/sys/unix/race0.go index 706e1322..4a9f6634 100644 --- a/vendor/golang.org/x/sys/unix/race0.go +++ b/vendor/golang.org/x/sys/unix/race0.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos -// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos package unix diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdents.go b/vendor/golang.org/x/sys/unix/readdirent_getdents.go index 4d625756..dbd2b6cc 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdents.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdents.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd -// +build aix dragonfly freebsd linux netbsd openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go index 2a4ba47c..130398b6 100644 --- a/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +++ b/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin -// +build darwin package unix diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go index 3865943f..c3a62dbb 100644 --- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // Socket control messages diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go index 0840fe4a..4a1eab37 100644 --- a/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go index 63e8c838..5ea74da9 100644 --- a/vendor/golang.org/x/sys/unix/syscall.go +++ b/vendor/golang.org/x/sys/unix/syscall.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos // Package unix contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go index e94e6cda..67ce6cef 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix -// +build aix // Aix system calls. // This file is compiled as ordinary Go code, @@ -107,7 +106,8 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { if n > 0 { sl += _Socklen(n) + 1 } - if sa.raw.Path[0] == '@' { + if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { + // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go index f2871fa9..1fdaa476 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix && ppc -// +build aix,ppc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go index 75718ec0..c87f9a9f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix && ppc64 -// +build aix,ppc64 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index 4217de51..6f328e3a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || netbsd || openbsd -// +build darwin dragonfly freebsd netbsd openbsd // BSD system call wrappers shared by *BSD based systems // including OS X (Darwin) and FreeBSD. Like the other diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go index b37310ce..0eaecf5f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && darwin -// +build amd64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go index d51ec996..f36c6707 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm64 && darwin -// +build arm64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go index 53c96641..16dc6993 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && go1.12 -// +build darwin,go1.12 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go index 4e2d3212..14bab6b2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && dragonfly -// +build amd64,dragonfly package unix 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 b8da5100..3967bca7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 && freebsd -// +build 386,freebsd package unix 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 47155c48..eff19ada 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && freebsd -// +build amd64,freebsd package unix 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 08932093..4f24b517 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm && freebsd -// +build arm,freebsd package unix 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 d151a0d0..ac30759e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm64 && freebsd -// +build arm64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go index d5cd64b3..aab725ca 100644 --- a/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build riscv64 && freebsd -// +build riscv64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd.go b/vendor/golang.org/x/sys/unix/syscall_hurd.go index 381fd467..ba46651f 100644 --- a/vendor/golang.org/x/sys/unix/syscall_hurd.go +++ b/vendor/golang.org/x/sys/unix/syscall_hurd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build hurd -// +build hurd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd_386.go b/vendor/golang.org/x/sys/unix/syscall_hurd_386.go index 7cf54a3e..df89f9e6 100644 --- a/vendor/golang.org/x/sys/unix/syscall_hurd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_hurd_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 && hurd -// +build 386,hurd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go index 87db5a6a..a863f705 100644 --- a/vendor/golang.org/x/sys/unix/syscall_illumos.go +++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go @@ -5,7 +5,6 @@ // illumos system calls not present on Solaris. //go:build amd64 && illumos -// +build amd64,illumos package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index fb4e5022..a5e1c10e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -417,7 +417,8 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { if n > 0 { sl += _Socklen(n) + 1 } - if sa.raw.Path[0] == '@' { + if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { + // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- @@ -2482,3 +2483,5 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { } return attr, nil } + +//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) 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 c7d9945e..506dafa7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 && linux -// +build 386,linux package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go b/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go index 08086ac6..38d55641 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) -// +build linux -// +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64 package unix 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 70601ce3..d557cf8d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && linux -// +build amd64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go index 8b0f0f3a..facdb83b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && linux && gc -// +build amd64,linux,gc package unix 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 da298641..cd2dd797 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm && linux -// +build arm,linux package unix 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 f5266689..cf2ee6c7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm64 && linux -// +build arm64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go index 2b1168d7..ffc4c2b6 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && gc -// +build linux,gc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go index 9843fb48..9ebfdcf4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && gc && 386 -// +build linux,gc,386 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go index a6008fcc..5f2b57c4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm && gc && linux -// +build arm,gc,linux package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go index 7740af24..d1a3ad82 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && gccgo && 386 -// +build linux,gccgo,386 package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go index e16a1229..f2f67423 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && gccgo && arm -// +build linux,gccgo,arm package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go index f6ab02ec..3d0e9845 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build loong64 && linux -// +build loong64,linux package unix 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 93fe59d2..70963a95 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (mips64 || mips64le) -// +build linux -// +build mips64 mips64le package unix 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 aae7f0ff..c218ebd2 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (mips || mipsle) -// +build linux -// +build mips mipsle package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go index 66eff19a..e6c48500 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && ppc -// +build linux,ppc package unix 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 806aa257..7286a9aa 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (ppc64 || ppc64le) -// +build linux -// +build ppc64 ppc64le package unix 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 5e6ceee1..6f5a2889 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build riscv64 && linux -// +build riscv64,linux package unix 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 2f89e8f5..66f31210 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build s390x && linux -// +build s390x,linux package unix 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 7ca064ae..11d1f169 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build sparc64 && linux -// +build sparc64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go index 5199d282..7a5eb574 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 && netbsd -// +build 386,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go index 70a9c52e..62d8957a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && netbsd -// +build amd64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go index 3eb5942f..ce6a0688 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm && netbsd -// +build arm,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go index fc6ccfd8..d46d689d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm64 && netbsd -// +build arm64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 6f34479b..d2882ee0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -137,18 +137,13 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e } func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { - var _p0 unsafe.Pointer + var bufptr *Statfs_t var bufsize uintptr if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) + bufptr = &buf[0] bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } - r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) - n = int(r0) - if e1 != 0 { - err = e1 - } - return + return getfsstat(bufptr, bufsize, flags) } //sysnb getresuid(ruid *_C_int, euid *_C_int, suid *_C_int) @@ -326,4 +321,7 @@ func Uname(uname *Utsname) error { //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) +//sys getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) //sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) +//sys pledge(promises *byte, execpromises *byte) (err error) +//sys unveil(path *byte, flags *byte) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go index 6baabcdc..9ddc89f4 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build 386 && openbsd -// +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go index bab25360..70a3c96e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && openbsd -// +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go index 8eed3c4d..265caa87 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm && openbsd -// +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go index 483dde99..ac4fda17 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build arm64 && openbsd -// +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go index 04aa43f4..0a451e6d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build openbsd -// +build openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go index c2796139..30a308cb 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ppc64 && openbsd -// +build ppc64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go index 23199a7f..ea954330 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build riscv64 && openbsd -// +build riscv64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index b99cfa13..60c8142d 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -128,7 +128,8 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { if n > 0 { sl += _Socklen(n) + 1 } - if sa.raw.Path[0] == '@' { + if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { + // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go index 0bd25ef8..e02d8cea 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build amd64 && solaris -// +build amd64,solaris package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go index f6eda270..77081de8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go index b6919ca5..05c95bcc 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go @@ -3,8 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc -// +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris -// +build gc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go index f6f707ac..23f39b7a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go @@ -3,9 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux && (ppc64le || ppc64) && gc -// +build linux -// +build ppc64le ppc64 -// +build gc package unix diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go index 4596d041..d99d05f1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/sysvshm_linux.go b/vendor/golang.org/x/sys/unix/sysvshm_linux.go index 2c3a4437..4fcd38de 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_linux.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build linux -// +build linux package unix diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/vendor/golang.org/x/sys/unix/sysvshm_unix.go index 5bb41d17..79a84f18 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_unix.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_unix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build (darwin && !ios) || linux -// +build darwin,!ios linux package unix diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go b/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go index 71bddefd..9eb0db66 100644 --- a/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go +++ b/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin && !ios -// +build darwin,!ios package unix diff --git a/vendor/golang.org/x/sys/unix/timestruct.go b/vendor/golang.org/x/sys/unix/timestruct.go index 616b1b28..7997b190 100644 --- a/vendor/golang.org/x/sys/unix/timestruct.go +++ b/vendor/golang.org/x/sys/unix/timestruct.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos -// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos package unix diff --git a/vendor/golang.org/x/sys/unix/unveil_openbsd.go b/vendor/golang.org/x/sys/unix/unveil_openbsd.go index 168d5ae7..cb7e598c 100644 --- a/vendor/golang.org/x/sys/unix/unveil_openbsd.go +++ b/vendor/golang.org/x/sys/unix/unveil_openbsd.go @@ -4,39 +4,48 @@ package unix -import ( - "syscall" - "unsafe" -) +import "fmt" // Unveil implements the unveil syscall. // For more information see unveil(2). // Note that the special case of blocking further // unveil calls is handled by UnveilBlock. func Unveil(path string, flags string) error { - pathPtr, err := syscall.BytePtrFromString(path) - if err != nil { + if err := supportsUnveil(); err != nil { return err } - flagsPtr, err := syscall.BytePtrFromString(flags) + pathPtr, err := BytePtrFromString(path) if err != nil { return err } - _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) - if e != 0 { - return e + flagsPtr, err := BytePtrFromString(flags) + if err != nil { + return err } - return nil + return unveil(pathPtr, flagsPtr) } // UnveilBlock blocks future unveil calls. // For more information see unveil(2). func UnveilBlock() error { - // Both pointers must be nil. - var pathUnsafe, flagsUnsafe unsafe.Pointer - _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) - if e != 0 { - return e + if err := supportsUnveil(); err != nil { + return err } + return unveil(nil, nil) +} + +// supportsUnveil checks for availability of the unveil(2) system call based +// on the running OpenBSD version. +func supportsUnveil() error { + maj, min, err := majmin() + if err != nil { + return err + } + + // unveil is not available before 6.4 + if maj < 6 || (maj == 6 && min <= 3) { + return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) + } + return nil } diff --git a/vendor/golang.org/x/sys/unix/xattr_bsd.go b/vendor/golang.org/x/sys/unix/xattr_bsd.go index f5f8e9f3..e1687939 100644 --- a/vendor/golang.org/x/sys/unix/xattr_bsd.go +++ b/vendor/golang.org/x/sys/unix/xattr_bsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build freebsd || netbsd -// +build freebsd netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go index ca9799b7..2fb219d7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && aix -// +build ppc,aix // Created by cgo -godefs - DO NOT EDIT // cgo -godefs -- -maix32 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go index 200c8c26..b0e6f5c8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && aix -// +build ppc64,aix // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -maix64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go index 14300762..e40fa852 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && darwin -// +build amd64,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go index ab044a74..bb02aa6c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && darwin -// +build arm64,darwin // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go index 17bba0e4..c0e0f869 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && dragonfly -// +build amd64,dragonfly // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go index f8c2c513..6c692390 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && freebsd -// +build 386,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go index 96310c3b..dd9163f8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && freebsd -// +build amd64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go index 777b69de..493a2a79 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && freebsd -// +build arm,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go index c557ac2d..8b437b30 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && freebsd -// +build arm64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go index 341b4d96..67c02dd5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && freebsd -// +build riscv64,freebsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index f9c7f479..9c00cbf5 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -1,7 +1,6 @@ // Code generated by mkmerge; DO NOT EDIT. //go:build linux -// +build linux package unix @@ -481,10 +480,14 @@ const ( BPF_FROM_BE = 0x8 BPF_FROM_LE = 0x0 BPF_FS_MAGIC = 0xcafe4a11 + BPF_F_AFTER = 0x10 BPF_F_ALLOW_MULTI = 0x2 BPF_F_ALLOW_OVERRIDE = 0x1 BPF_F_ANY_ALIGNMENT = 0x2 - BPF_F_KPROBE_MULTI_RETURN = 0x1 + BPF_F_BEFORE = 0x8 + BPF_F_ID = 0x20 + BPF_F_LINK = 0x2000 + BPF_F_NETFILTER_IP_DEFRAG = 0x1 BPF_F_QUERY_EFFECTIVE = 0x1 BPF_F_REPLACE = 0x4 BPF_F_SLEEPABLE = 0x10 @@ -521,6 +524,7 @@ const ( BPF_MAJOR_VERSION = 0x1 BPF_MAXINSNS = 0x1000 BPF_MEM = 0x60 + BPF_MEMSX = 0x80 BPF_MEMWORDS = 0x10 BPF_MINOR_VERSION = 0x1 BPF_MISC = 0x7 @@ -776,6 +780,8 @@ const ( DEVLINK_GENL_MCGRP_CONFIG_NAME = "config" DEVLINK_GENL_NAME = "devlink" DEVLINK_GENL_VERSION = 0x1 + DEVLINK_PORT_FN_CAP_IPSEC_CRYPTO = 0x4 + DEVLINK_PORT_FN_CAP_IPSEC_PACKET = 0x8 DEVLINK_PORT_FN_CAP_MIGRATABLE = 0x2 DEVLINK_PORT_FN_CAP_ROCE = 0x1 DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14 @@ -1698,6 +1704,7 @@ const ( KEXEC_ON_CRASH = 0x1 KEXEC_PRESERVE_CONTEXT = 0x2 KEXEC_SEGMENT_MAX = 0x10 + KEXEC_UPDATE_ELFCOREHDR = 0x4 KEYCTL_ASSUME_AUTHORITY = 0x10 KEYCTL_CAPABILITIES = 0x1f KEYCTL_CAPS0_BIG_KEY = 0x10 @@ -2275,6 +2282,7 @@ const ( PERF_MEM_LVLNUM_PMEM = 0xe PERF_MEM_LVLNUM_RAM = 0xd PERF_MEM_LVLNUM_SHIFT = 0x21 + PERF_MEM_LVLNUM_UNC = 0x8 PERF_MEM_LVL_HIT = 0x2 PERF_MEM_LVL_IO = 0x1000 PERF_MEM_LVL_L1 = 0x8 @@ -3461,6 +3469,7 @@ const ( XDP_PACKET_HEADROOM = 0x100 XDP_PGOFF_RX_RING = 0x0 XDP_PGOFF_TX_RING = 0x80000000 + XDP_PKT_CONTD = 0x1 XDP_RING_NEED_WAKEUP = 0x1 XDP_RX_RING = 0x2 XDP_SHARED_UMEM = 0x1 @@ -3473,6 +3482,7 @@ const ( XDP_UMEM_REG = 0x4 XDP_UMEM_UNALIGNED_CHUNK_FLAG = 0x1 XDP_USE_NEED_WAKEUP = 0x8 + XDP_USE_SG = 0x10 XDP_ZEROCOPY = 0x4 XENFS_SUPER_MAGIC = 0xabba1974 XFS_SUPER_MAGIC = 0x58465342 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 30aee00a..4920821c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux -// +build 386,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/386/include -m32 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 8ebfa512..a0c1e411 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux -// +build amd64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/amd64/include -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 271a21cd..c6398556 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux -// +build arm,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/arm/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 910c330a..47cc62e2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux -// +build arm64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index a640798c..27ac4a09 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build loong64 && linux -// +build loong64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/loong64/include _const.go @@ -119,6 +118,7 @@ const ( IXOFF = 0x1000 IXON = 0x400 LASX_CTX_MAGIC = 0x41535801 + LBT_CTX_MAGIC = 0x42540001 LSX_CTX_MAGIC = 0x53580001 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 0d5925d3..54694642 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux -// +build mips,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mips/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index d72a00e0..3adb81d7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux -// +build mips64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mips64/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 02ba129f..2dfe98f0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux -// +build mips64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mips64le/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 8daa6dd9..f5398f84 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux -// +build mipsle,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/mipsle/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index 63c8fa2f..c54f152d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux -// +build ppc,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/ppc/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 930799ec..76057dc7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux -// +build ppc64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 8605a7dd..e0c3725e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux -// +build ppc64le,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64le/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 95a016f1..18f2813e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux -// +build riscv64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/riscv64/include _const.go @@ -228,6 +227,9 @@ const ( PPPIOCUNBRIDGECHAN = 0x7434 PPPIOCXFERUNIT = 0x744e PR_SET_PTRACER_ANY = 0xffffffffffffffff + PTRACE_GETFDPIC = 0x21 + PTRACE_GETFDPIC_EXEC = 0x0 + PTRACE_GETFDPIC_INTERP = 0x1 RLIMIT_AS = 0x9 RLIMIT_MEMLOCK = 0x8 RLIMIT_NOFILE = 0x7 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 1ae0108f..11619d4e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux -// +build s390x,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 1bb7c633..396d994d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux -// +build sparc64,linux // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -Wall -Werror -static -I/tmp/sparc64/include _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go index 72f7420d..130085df 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && netbsd -// +build 386,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go index 8d4eb0c0..84769a1a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && netbsd -// +build amd64,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go index 9eef9749..602ded00 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && netbsd -// +build arm,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -marm _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go index 3b62ba19..efc0406e 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && netbsd -// +build arm64,netbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go index af20e474..5a6500f8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && openbsd -// +build 386,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m32 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go index 6015fcb2..a5aeeb97 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && openbsd -// +build amd64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go index 8d44955e..0e9748a7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && openbsd -// +build arm,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go index ae16fe75..4f4449ab 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && openbsd -// +build arm64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go index 03d90fe3..76a363f0 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && openbsd -// +build mips64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go index 8e2c51b1..43ca0cdf 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && openbsd -// +build ppc64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go index 13d40303..b1b8bb20 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && openbsd -// +build riscv64,openbsd // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go index 1afee6a0..d2ddd317 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && solaris -// +build amd64,solaris // Code generated by cmd/cgo -godefs; DO NOT EDIT. // cgo -godefs -- -m64 _const.go diff --git a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go index fc7d0506..4dfd2e05 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x // Hand edited based on zerrors_linux_s390x.go // TODO: auto-generate. diff --git a/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go b/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go index 97f20ca2..586317c7 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go @@ -1,8 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. //go:build linux && (arm || arm64) -// +build linux -// +build arm arm64 package unix diff --git a/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go b/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go index 0b5f7943..d7c881be 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go @@ -1,8 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. //go:build linux && (mips || mips64) -// +build linux -// +build mips mips64 package unix diff --git a/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go b/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go index 2807f7e6..2d2de5d2 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go @@ -1,8 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. //go:build linux && (mipsle || mips64le) -// +build linux -// +build mipsle mips64le package unix diff --git a/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go b/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go index 281ea64e..5adc79fb 100644 --- a/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go +++ b/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go @@ -1,8 +1,6 @@ // Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT. //go:build linux && (386 || amd64) -// +build linux -// +build 386 amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go index d1d1d233..6ea64a3c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc -// +build aix,ppc package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go index f99a18ad..99ee4399 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc64 -// +build aix,ppc64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go index c4d50ae5..b68a7836 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc64 && gc -// +build aix,ppc64,gc package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go index 6903d3b0..0a87450b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build aix && ppc64 && gccgo -// +build aix,ppc64,gccgo package unix 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 1cad561e..ccb02f24 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build darwin && amd64 -// +build darwin,amd64 package unix 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 b18edbd0..1b40b997 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build darwin && arm64 -// +build darwin,arm64 package unix 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 0c67df64..aad65fc7 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build dragonfly && amd64 -// +build dragonfly,amd64 package unix 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 e6e05d14..c0096391 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && 386 -// +build freebsd,386 package unix 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 7508acca..7664df74 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && amd64 -// +build freebsd,amd64 package unix 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 7b56aead..ae099182 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && arm -// +build freebsd,arm package unix 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 cc623dca..11fd5d45 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && arm64 -// +build freebsd,arm64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go index 58184919..c3d2d653 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build freebsd && riscv64 -// +build freebsd,riscv64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go index 6be25cd1..c698cbc0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build illumos && amd64 -// +build illumos,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 1ff3aec7..faca7a55 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -1,7 +1,6 @@ // Code generated by mkmerge; DO NOT EDIT. //go:build linux -// +build linux package unix @@ -2195,3 +2194,13 @@ func schedGetattr(pid int, attr *SchedAttr, size uint, flags uint) (err error) { } return } + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) { + _, _, e1 := Syscall6(SYS_CACHESTAT, uintptr(fd), uintptr(unsafe.Pointer(crange)), uintptr(unsafe.Pointer(cstat)), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} 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 07b549cc..4def3e9f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && 386 -// +build linux,386 package unix 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 5f481bf8..fef2bc8b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && amd64 -// +build linux,amd64 package unix 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 824cd52c..a9fd76a8 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && arm -// +build linux,arm package unix 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 e77aecfe..46006502 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && arm64 -// +build linux,arm64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go index 806ffd1e..c8987d26 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && loong64 -// +build linux,loong64 package unix 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 961a3afb..921f4306 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mips -// +build linux,mips package unix 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 ed05005e..44f06782 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mips64 -// +build linux,mips64 package unix 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 d365b718..e7fa0abf 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mips64le -// +build linux,mips64le package unix 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 c3f1b8bb..8c512567 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && mipsle -// +build linux,mipsle package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go index a6574cf9..7392fd45 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && ppc -// +build linux,ppc package unix 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 f4099026..41180434 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && ppc64 -// +build linux,ppc64 package unix 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 9dfcc299..40c6ce7a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && ppc64le -// +build linux,ppc64le package unix 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 0ab4f2ed..2cfe34ad 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && riscv64 -// +build linux,riscv64 package unix 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 6cde3223..61e6f070 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && s390x -// +build linux,s390x package unix 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 5253d65b..834b8420 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build linux && sparc64 -// +build linux,sparc64 package unix 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 2df3c5ba..e91ebc14 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && 386 -// +build netbsd,386 package unix 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 a60556ba..be28babb 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && amd64 -// +build netbsd,amd64 package unix 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 9f788917..fb587e82 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && arm -// +build netbsd,arm package unix 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 82a4cb2d..d576438b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build netbsd && arm64 -// +build netbsd,arm64 package unix 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 66b3b645..88bfc288 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && 386 -// +build openbsd,386 package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 3dcacd30..4cbeff17 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -668,7 +668,22 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $4 +DATA ·libc_getfsstat_trampoline_addr(SB)/4, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pledge(SB) +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $4 +DATA ·libc_pledge_trampoline_addr(SB)/4, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unveil(SB) +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $4 +DATA ·libc_unveil_trampoline_addr(SB)/4, $libc_unveil_trampoline<>(SB) 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 c5c4cc11..b8a67b99 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && amd64 -// +build openbsd,amd64 package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 2763620b..1123f275 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -668,7 +668,22 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pledge(SB) +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unveil(SB) +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) 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 93bfbb32..af50a65c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && arm -// +build openbsd,arm package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index c9223140..82badae3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -668,7 +668,22 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $4 DATA ·libc_munmap_trampoline_addr(SB)/4, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $4 +DATA ·libc_getfsstat_trampoline_addr(SB)/4, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $4 DATA ·libc_utimensat_trampoline_addr(SB)/4, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pledge(SB) +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $4 +DATA ·libc_pledge_trampoline_addr(SB)/4, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unveil(SB) +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $4 +DATA ·libc_unveil_trampoline_addr(SB)/4, $libc_unveil_trampoline<>(SB) 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 a107b8fd..8fb4ff36 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && arm64 -// +build openbsd,arm64 package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index a6bc32c9..24d7eecb 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -668,7 +668,22 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pledge(SB) +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unveil(SB) +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index c427de50..f469a83e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && mips64 -// +build openbsd,mips64 package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index b4e7bcea..9a498a06 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -668,7 +668,22 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pledge(SB) +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unveil(SB) +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 60c1a99a..c26ca2e1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && ppc64 -// +build openbsd,ppc64 package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index ca3f7660..1f224aa4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -801,8 +801,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_getfsstat(SB) + RET +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_utimensat(SB) RET GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_pledge(SB) + RET +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_unveil(SB) + RET +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 52eba360..bcc920dd 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build openbsd && riscv64 -// +build openbsd,riscv64 package unix @@ -2213,6 +2212,21 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func getfsstat(stat *Statfs_t, bufsize uintptr, flags int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_getfsstat_trampoline_addr, uintptr(unsafe.Pointer(stat)), uintptr(bufsize), uintptr(flags)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_getfsstat_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_getfsstat getfsstat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) @@ -2229,3 +2243,33 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error var libc_utimensat_trampoline_addr uintptr //go:cgo_import_dynamic libc_utimensat utimensat "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pledge(promises *byte, execpromises *byte) (err error) { + _, _, e1 := syscall_syscall(libc_pledge_trampoline_addr, uintptr(unsafe.Pointer(promises)), uintptr(unsafe.Pointer(execpromises)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pledge_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pledge pledge "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func unveil(path *byte, flags *byte) (err error) { + _, _, e1 := syscall_syscall(libc_unveil_trampoline_addr, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(flags)), 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_unveil_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_unveil unveil "libc.so" + + diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 477a7d5b..87a79c70 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -668,7 +668,22 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_getfsstat_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_getfsstat(SB) +GLOBL ·libc_getfsstat_trampoline_addr(SB), RODATA, $8 +DATA ·libc_getfsstat_trampoline_addr(SB)/8, $libc_getfsstat_trampoline<>(SB) + TEXT libc_utimensat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_utimensat(SB) GLOBL ·libc_utimensat_trampoline_addr(SB), RODATA, $8 DATA ·libc_utimensat_trampoline_addr(SB)/8, $libc_utimensat_trampoline<>(SB) + +TEXT libc_pledge_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pledge(SB) +GLOBL ·libc_pledge_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pledge_trampoline_addr(SB)/8, $libc_pledge_trampoline<>(SB) + +TEXT libc_unveil_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_unveil(SB) +GLOBL ·libc_unveil_trampoline_addr(SB), RODATA, $8 +DATA ·libc_unveil_trampoline_addr(SB)/8, $libc_unveil_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index b4018946..829b87fe 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build solaris && amd64 -// +build solaris,amd64 package unix diff --git a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go index 1d8fe1d4..94f01123 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build zos && s390x -// +build zos,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go index 55e04847..3a58ae81 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build 386 && openbsd -// +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go index d2243cf8..dcb7a0eb 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build amd64 && openbsd -// +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go index 82dc51bd..db5a7bf1 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build arm && openbsd -// +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go index cbdda1a4..7be575a7 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build arm64 && openbsd -// +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go index f55eae1a..d6e3174c 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build mips64 && openbsd -// +build mips64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go index e4405447..ee97157d 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build ppc64 && openbsd -// +build ppc64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go index a0db82fc..35c3b91d 100644 --- a/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build riscv64 && openbsd -// +build riscv64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go index f8298ff9..5edda768 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && darwin -// +build amd64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go index 5eb433bb..0dc9e8b4 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && darwin -// +build arm64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go index 703675c0..308ddf3a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && dragonfly -// +build amd64,dragonfly package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go index 4e0d9610..418664e3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && freebsd -// +build 386,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go index 01636b83..34d0b86d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && freebsd -// +build amd64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go index ad99bc10..b71cf45e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && freebsd -// +build arm,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go index 89dcc427..e32df1c1 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && freebsd -// +build arm64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go index ee37aaa0..15ad6111 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && freebsd -// +build riscv64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index 9862853d..fcf3ecbd 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux -// +build 386,linux package unix @@ -448,4 +447,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 8901f0f4..f56dc250 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux -// +build amd64,linux package unix @@ -370,4 +369,6 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 + SYS_MAP_SHADOW_STACK = 453 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 6902c37e..974bf246 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux -// +build arm,linux package unix @@ -412,4 +411,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index a6d3dff8..39a2739e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux -// +build arm64,linux package unix @@ -315,4 +314,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index b18f3f71..cf9c9d77 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build loong64 && linux -// +build loong64,linux package unix @@ -309,4 +308,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 0302e5e3..10b7362e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux -// +build mips,linux package unix @@ -432,4 +431,5 @@ const ( SYS_FUTEX_WAITV = 4449 SYS_SET_MEMPOLICY_HOME_NODE = 4450 SYS_CACHESTAT = 4451 + SYS_FCHMODAT2 = 4452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 6693ba4a..cd4d8b4f 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux -// +build mips64,linux package unix @@ -362,4 +361,5 @@ const ( SYS_FUTEX_WAITV = 5449 SYS_SET_MEMPOLICY_HOME_NODE = 5450 SYS_CACHESTAT = 5451 + SYS_FCHMODAT2 = 5452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index fd93f498..2c0efca8 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux -// +build mips64le,linux package unix @@ -362,4 +361,5 @@ const ( SYS_FUTEX_WAITV = 5449 SYS_SET_MEMPOLICY_HOME_NODE = 5450 SYS_CACHESTAT = 5451 + SYS_FCHMODAT2 = 5452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 760ddcad..a72e31d3 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux -// +build mipsle,linux package unix @@ -432,4 +431,5 @@ const ( SYS_FUTEX_WAITV = 4449 SYS_SET_MEMPOLICY_HOME_NODE = 4450 SYS_CACHESTAT = 4451 + SYS_FCHMODAT2 = 4452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index cff2b255..c7d1e374 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux -// +build ppc,linux package unix @@ -439,4 +438,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index a4b2405d..f4d4838c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux -// +build ppc64,linux package unix @@ -411,4 +410,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index aca54b4e..b64f0e59 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux -// +build ppc64le,linux package unix @@ -411,4 +410,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 9d1738d6..95711195 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux -// +build riscv64,linux package unix @@ -316,4 +315,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 022878dc..f94e943b 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux -// +build s390x,linux package unix @@ -377,4 +376,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 4100a761..ba0c2bc5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux -// +build sparc64,linux package unix @@ -390,4 +389,5 @@ const ( SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 SYS_CACHESTAT = 451 + SYS_FCHMODAT2 = 452 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go index 3a6699eb..b2aa8cd4 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && netbsd -// +build 386,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go index 5677cd4f..524a1b1c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && netbsd -// +build amd64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go index e784cb6d..d59b943a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && netbsd -// +build arm,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go index bd4952ef..31e771d5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; DO NOT EDIT. //go:build arm64 && netbsd -// +build arm64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go index 59773381..9fd77c6c 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && openbsd -// +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go index 16af2918..af10af28 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && openbsd -// +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go index f59b18a9..cc2028af 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && openbsd -// +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go index 721ef591..c06dd441 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && openbsd -// +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go index 01c43a01..9ddbf3e0 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && openbsd -// +build mips64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go index f258cfa2..19a6ee41 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && openbsd -// +build ppc64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go index 07919e0e..05192a78 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && openbsd -// +build riscv64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go index 073daad4..b2e30858 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go index 7a8161c1..3e6d57ca 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && aix -// +build ppc,aix package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go index 07ed733c..3a219bdc 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && aix -// +build ppc64,aix package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go index 690cefc3..091d107f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && darwin -// +build amd64,darwin package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go index 5bffc10e..28ff4ef7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && darwin -// +build arm64,darwin package unix 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 d0ba8e9b..30e405bb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && dragonfly -// +build amd64,dragonfly package unix 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 29dc4833..6cbd094a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && freebsd -// +build 386,freebsd package unix 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 0a89b289..7c03b6ee 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && freebsd -// +build amd64,freebsd package unix 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 c8666bb1..422107ee 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && freebsd -// +build arm,freebsd package unix 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 88fb48a8..505a12ac 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && freebsd -// +build arm64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go index 698dc975..cc986c79 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && freebsd -// +build riscv64,freebsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 18aa70b4..997bcd55 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -1,7 +1,6 @@ // Code generated by mkmerge; DO NOT EDIT. //go:build linux -// +build linux package unix @@ -5883,3 +5882,15 @@ type SchedAttr struct { } const SizeofSchedAttr = 0x38 + +type Cachestat_t struct { + Cache uint64 + Dirty uint64 + Writeback uint64 + Evicted uint64 + Recently_evicted uint64 +} +type CachestatRange struct { + Off uint64 + Len uint64 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 6d8acbcc..438a30af 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && linux -// +build 386,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 59293c68..adceca35 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && linux -// +build amd64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 40cfa38c..eeaa00a3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && linux -// +build arm,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 055bc421..6739aa91 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && linux -// +build arm64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index f28affbc..9920ef63 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build loong64 && linux -// +build loong64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 9d71e7cc..2923b799 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips && linux -// +build mips,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index fd5ccd33..ce2750ee 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && linux -// +build mips64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 7704de77..3038811d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64le && linux -// +build mips64le,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index df00b875..efc6fed1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mipsle && linux -// +build mipsle,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 0942840d..9a654b75 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc && linux -// +build ppc,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 03487439..40d358e3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && linux -// +build ppc64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index bad06704..148c6ceb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64le && linux -// +build ppc64le,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index 1b4c97c3..72ba8154 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && linux -// +build riscv64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index aa268d02..71e76550 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build s390x && linux -// +build s390x,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 444045b6..4abbdb9d 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build sparc64 && linux -// +build sparc64,linux package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go index 9bc4c8f9..f22e7947 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && netbsd -// +build 386,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go index bb05f655..066a7d83 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && netbsd -// +build amd64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go index db40e3a1..439548ec 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && netbsd -// +build arm,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go index 11121151..16085d3b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && netbsd -// +build arm64,netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go index 26eba23b..afd13a3a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build 386 && openbsd -// +build 386,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go index 5a547988..5d97f1f9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && openbsd -// +build amd64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go index be58c4e1..34871cdc 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm && openbsd -// +build arm,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go index 52338266..5911bceb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build arm64 && openbsd -// +build arm64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go index 605cfdb1..e4f24f3b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build mips64 && openbsd -// +build mips64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go index d6724c01..ca50a793 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build ppc64 && openbsd -// +build ppc64,openbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go index ddfd27a4..d7d7f790 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build riscv64 && openbsd -// +build riscv64,openbsd package unix 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 0400747c..14160576 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go @@ -2,7 +2,6 @@ // Code generated by the command above; see README.md. DO NOT EDIT. //go:build amd64 && solaris -// +build amd64,solaris package unix diff --git a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go index aec1efcb..54f31be6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build zos && s390x -// +build zos,s390x // Hand edited based on ztypes_linux_s390x.go // TODO: auto-generate. diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go index a20ebea6..ce2d713d 100644 --- a/vendor/golang.org/x/sys/windows/aliases.go +++ b/vendor/golang.org/x/sys/windows/aliases.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows && go1.9 -// +build windows,go1.9 package windows diff --git a/vendor/golang.org/x/sys/windows/empty.s b/vendor/golang.org/x/sys/windows/empty.s index fdbbbcd3..ba64caca 100644 --- a/vendor/golang.org/x/sys/windows/empty.s +++ b/vendor/golang.org/x/sys/windows/empty.s @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !go1.12 -// +build !go1.12 // This file is here to allow bodyless functions with go:linkname for Go 1.11 // and earlier (see https://golang.org/issue/23311). diff --git a/vendor/golang.org/x/sys/windows/eventlog.go b/vendor/golang.org/x/sys/windows/eventlog.go index 2cd60645..6c366955 100644 --- a/vendor/golang.org/x/sys/windows/eventlog.go +++ b/vendor/golang.org/x/sys/windows/eventlog.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows -// +build windows package windows diff --git a/vendor/golang.org/x/sys/windows/mksyscall.go b/vendor/golang.org/x/sys/windows/mksyscall.go index 8563f79c..dbcdb090 100644 --- a/vendor/golang.org/x/sys/windows/mksyscall.go +++ b/vendor/golang.org/x/sys/windows/mksyscall.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build generate -// +build generate package windows diff --git a/vendor/golang.org/x/sys/windows/race.go b/vendor/golang.org/x/sys/windows/race.go index 9196b089..0f1bdc38 100644 --- a/vendor/golang.org/x/sys/windows/race.go +++ b/vendor/golang.org/x/sys/windows/race.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows && race -// +build windows,race package windows diff --git a/vendor/golang.org/x/sys/windows/race0.go b/vendor/golang.org/x/sys/windows/race0.go index 7bae4817..0c78da78 100644 --- a/vendor/golang.org/x/sys/windows/race0.go +++ b/vendor/golang.org/x/sys/windows/race0.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows && !race -// +build windows,!race package windows diff --git a/vendor/golang.org/x/sys/windows/service.go b/vendor/golang.org/x/sys/windows/service.go index c44a1b96..a9dc6308 100644 --- a/vendor/golang.org/x/sys/windows/service.go +++ b/vendor/golang.org/x/sys/windows/service.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows -// +build windows package windows diff --git a/vendor/golang.org/x/sys/windows/str.go b/vendor/golang.org/x/sys/windows/str.go index 4fc01434..6a4f9ce6 100644 --- a/vendor/golang.org/x/sys/windows/str.go +++ b/vendor/golang.org/x/sys/windows/str.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows -// +build windows package windows diff --git a/vendor/golang.org/x/sys/windows/syscall.go b/vendor/golang.org/x/sys/windows/syscall.go index 8732cdb9..e85ed6b9 100644 --- a/vendor/golang.org/x/sys/windows/syscall.go +++ b/vendor/golang.org/x/sys/windows/syscall.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build windows -// +build windows // Package windows contains an interface to the low-level operating system // primitives. OS details vary depending on the underlying system, and diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 35cfc57c..fb6cfd04 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -233,6 +233,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) = userenv.CreateEnvironmentBlock //sys DestroyEnvironmentBlock(block *uint16) (err error) = userenv.DestroyEnvironmentBlock //sys getTickCount64() (ms uint64) = kernel32.GetTickCount64 +//sys GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) //sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) //sys GetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW //sys SetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW @@ -969,7 +970,8 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, int32, error) { if n > 0 { sl += int32(n) + 1 } - if sa.raw.Path[0] == '@' { + if sa.raw.Path[0] == '@' || (sa.raw.Path[0] == 0 && sl > 3) { + // Check sl > 3 so we don't change unnamed socket behavior. sa.raw.Path[0] = 0 // Don't count trailing NUL for abstract address. sl-- diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index b88dc7c8..359780f6 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1094,7 +1094,33 @@ const ( SOMAXCONN = 0x7fffffff - TCP_NODELAY = 1 + TCP_NODELAY = 1 + TCP_EXPEDITED_1122 = 2 + TCP_KEEPALIVE = 3 + TCP_MAXSEG = 4 + TCP_MAXRT = 5 + TCP_STDURG = 6 + TCP_NOURG = 7 + TCP_ATMARK = 8 + TCP_NOSYNRETRIES = 9 + TCP_TIMESTAMPS = 10 + TCP_OFFLOAD_PREFERENCE = 11 + TCP_CONGESTION_ALGORITHM = 12 + TCP_DELAY_FIN_ACK = 13 + TCP_MAXRTMS = 14 + TCP_FASTOPEN = 15 + TCP_KEEPCNT = 16 + TCP_KEEPIDLE = TCP_KEEPALIVE + TCP_KEEPINTVL = 17 + TCP_FAIL_CONNECT_ON_ICMP_ERROR = 18 + TCP_ICMP_ERROR_INFO = 19 + + UDP_NOCHECKSUM = 1 + UDP_SEND_MSG_SIZE = 2 + UDP_RECV_MAX_COALESCED_SIZE = 3 + UDP_CHECKSUM_COVERAGE = 20 + + UDP_COALESCED_INFO = 3 SHUT_RD = 0 SHUT_WR = 1 diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 8b1688de..db6282e0 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -253,6 +253,7 @@ var ( procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW") procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle") procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx") + procGetFileTime = modkernel32.NewProc("GetFileTime") procGetFileType = modkernel32.NewProc("GetFileType") procGetFinalPathNameByHandleW = modkernel32.NewProc("GetFinalPathNameByHandleW") procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW") @@ -2185,6 +2186,14 @@ func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, return } +func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { + r1, _, e1 := syscall.Syscall6(procGetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func GetFileType(filehandle Handle) (n uint32, err error) { r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0) n = uint32(r0) diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go b/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go index 8a7392c4..784bb880 100644 --- a/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +++ b/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build go1.10 -// +build go1.10 package bidirule diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go b/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go index bb0a9200..8e1e9439 100644 --- a/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +++ b/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !go1.10 -// +build !go1.10 package bidirule diff --git a/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go b/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go index 42fa8d72..d2bd7118 100644 --- a/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +++ b/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.10 && !go1.13 -// +build go1.10,!go1.13 package bidi diff --git a/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go b/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go index 56a0e1ea..f76bdca2 100644 --- a/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +++ b/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.13 && !go1.14 -// +build go1.13,!go1.14 package bidi diff --git a/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go b/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go index baacf32b..3aa2c3bd 100644 --- a/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +++ b/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.14 && !go1.16 -// +build go1.14,!go1.16 package bidi diff --git a/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go b/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go index ffadb7be..a7137579 100644 --- a/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +++ b/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.16 && !go1.21 -// +build go1.16,!go1.21 package bidi diff --git a/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go b/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go index 92cce580..f15746f7 100644 --- a/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +++ b/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.21 -// +build go1.21 package bidi diff --git a/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go b/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go index f517fdb2..c164d379 100644 --- a/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +++ b/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build !go1.10 -// +build !go1.10 package bidi diff --git a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go index f5a07882..1af161c7 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.10 && !go1.13 -// +build go1.10,!go1.13 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go index cb7239c4..eb73ecc3 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.13 && !go1.14 -// +build go1.13,!go1.14 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go index 11b27330..276cb8d8 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.14 && !go1.16 -// +build go1.14,!go1.16 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go index f65785e8..0cceffd7 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.16 && !go1.21 -// +build go1.16,!go1.21 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go index e1858b87..b0819e42 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build go1.21 -// +build go1.21 package norm diff --git a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go index 0175eae5..bf65457d 100644 --- a/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +++ b/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go @@ -1,7 +1,6 @@ // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. //go:build !go1.10 -// +build !go1.10 package norm diff --git a/vendor/golang.org/x/tools/cmd/stringer/stringer.go b/vendor/golang.org/x/tools/cmd/stringer/stringer.go index 998d1a51..2b19c93e 100644 --- a/vendor/golang.org/x/tools/cmd/stringer/stringer.go +++ b/vendor/golang.org/x/tools/cmd/stringer/stringer.go @@ -188,6 +188,8 @@ type Generator struct { trimPrefix string lineComment bool + + logf func(format string, args ...interface{}) // test logging hook; nil when not testing } func (g *Generator) Printf(format string, args ...interface{}) { @@ -221,13 +223,14 @@ func (g *Generator) parsePackage(patterns []string, tags []string) { // in a separate pass? For later. Tests: false, BuildFlags: []string{fmt.Sprintf("-tags=%s", strings.Join(tags, " "))}, + Logf: g.logf, } pkgs, err := packages.Load(cfg, patterns...) if err != nil { log.Fatal(err) } if len(pkgs) != 1 { - log.Fatalf("error: %d packages found", len(pkgs)) + log.Fatalf("error: %d packages matching %v", len(pkgs), strings.Join(patterns, " ")) } g.addPackage(pkgs[0]) } diff --git a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go index 18a002f8..0454cdd7 100644 --- a/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go +++ b/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go @@ -8,7 +8,6 @@ package packagesdriver import ( "context" "fmt" - "go/types" "strings" "golang.org/x/tools/internal/gocommand" @@ -16,7 +15,7 @@ import ( var debug = false -func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (types.Sizes, error) { +func GetSizesForArgsGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (string, string, error) { inv.Verb = "list" inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) @@ -29,21 +28,21 @@ func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner * inv.Args = []string{"GOARCH"} envout, enverr := gocmdRunner.Run(ctx, inv) if enverr != nil { - return nil, enverr + return "", "", enverr } goarch = strings.TrimSpace(envout.String()) compiler = "gc" } else { - return nil, friendlyErr + return "", "", friendlyErr } } else { fields := strings.Fields(stdout.String()) if len(fields) < 2 { - return nil, fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", + return "", "", fmt.Errorf("could not parse GOARCH and Go compiler in format \" \":\nstdout: <<%s>>\nstderr: <<%s>>", stdout.String(), stderr.String()) } goarch = fields[0] compiler = fields[1] } - return types.SizesFor(compiler, goarch), nil + return compiler, goarch, nil } diff --git a/vendor/golang.org/x/tools/go/packages/doc.go b/vendor/golang.org/x/tools/go/packages/doc.go index da4ab89f..a7a8f73e 100644 --- a/vendor/golang.org/x/tools/go/packages/doc.go +++ b/vendor/golang.org/x/tools/go/packages/doc.go @@ -35,7 +35,7 @@ The Package struct provides basic information about the package, including - Imports, a map from source import strings to the Packages they name; - Types, the type information for the package's exported symbols; - Syntax, the parsed syntax trees for the package's source code; and - - TypeInfo, the result of a complete type-check of the package syntax trees. + - TypesInfo, the result of a complete type-check of the package syntax trees. (See the documentation for type Package for the complete list of fields and more detailed descriptions.) diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go index 58230038..1f1eade0 100644 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ b/vendor/golang.org/x/tools/go/packages/golist.go @@ -9,8 +9,6 @@ import ( "context" "encoding/json" "fmt" - "go/types" - "io/ioutil" "log" "os" "path" @@ -153,10 +151,10 @@ func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { if cfg.Mode&NeedTypesSizes != 0 || cfg.Mode&NeedTypes != 0 { sizeswg.Add(1) go func() { - var sizes types.Sizes - sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) - // types.SizesFor always returns nil or a *types.StdSizes. - response.dr.Sizes, _ = sizes.(*types.StdSizes) + compiler, arch, err := packagesdriver.GetSizesForArgsGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) + sizeserr = err + response.dr.Compiler = compiler + response.dr.Arch = arch sizeswg.Done() }() } @@ -1110,7 +1108,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err if len(state.cfg.Overlay) == 0 { return "", func() {}, nil } - dir, err := ioutil.TempDir("", "gopackages-*") + dir, err := os.MkdirTemp("", "gopackages-*") if err != nil { return "", nil, err } @@ -1129,7 +1127,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err // Create a unique filename for the overlaid files, to avoid // creating nested directories. noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") - f, err := ioutil.TempFile(dir, fmt.Sprintf("*-%s", noSeparator)) + f, err := os.CreateTemp(dir, fmt.Sprintf("*-%s", noSeparator)) if err != nil { return "", func() {}, err } @@ -1147,7 +1145,7 @@ func (state *golistState) writeOverlays() (filename string, cleanup func(), err } // Write out the overlay file that contains the filepath mappings. filename = filepath.Join(dir, "overlay.json") - if err := ioutil.WriteFile(filename, b, 0665); err != nil { + if err := os.WriteFile(filename, b, 0665); err != nil { return "", func() {}, err } return filename, cleanup, nil diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go index da1a27ee..ece0e7c6 100644 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -16,7 +16,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "log" "os" "path/filepath" @@ -220,8 +219,10 @@ type driverResponse struct { // lists of multiple drivers, go/packages will fall back to the next driver. NotHandled bool - // Sizes, if not nil, is the types.Sizes to use when type checking. - Sizes *types.StdSizes + // Compiler and Arch are the arguments pass of types.SizesFor + // to get a types.Sizes to use when type checking. + Compiler string + Arch string // Roots is the set of package IDs that make up the root packages. // We have to encode this separately because when we encode a single package @@ -262,7 +263,7 @@ func Load(cfg *Config, patterns ...string) ([]*Package, error) { if err != nil { return nil, err } - l.sizes = response.Sizes + l.sizes = types.SizesFor(response.Compiler, response.Arch) return l.refine(response) } @@ -1125,7 +1126,7 @@ func (ld *loader) parseFile(filename string) (*ast.File, error) { var err error if src == nil { ioLimit <- true // wait - src, err = ioutil.ReadFile(filename) + src, err = os.ReadFile(filename) <-ioLimit // signal } if err != nil { diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go index c725d839..fa5834ba 100644 --- a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go @@ -32,6 +32,7 @@ import ( _ "unsafe" "golang.org/x/tools/internal/typeparams" + "golang.org/x/tools/internal/typesinternal" ) // A Path is an opaque name that identifies a types.Object @@ -127,12 +128,15 @@ type Encoder struct { skipMethodSorting bool } -// Exposed to gopls via golang.org/x/tools/internal/typesinternal -// TODO(golang/go#61443): eliminate this parameter one way or the other. +// Expose back doors so that gopls can avoid method sorting, which can dominate +// analysis on certain repositories. // -//go:linkname skipMethodSorting -func skipMethodSorting(enc *Encoder) { - enc.skipMethodSorting = true +// TODO(golang/go#61443): remove this. +func init() { + typesinternal.SkipEncoderMethodSorting = func(enc interface{}) { + enc.(*Encoder).skipMethodSorting = true + } + typesinternal.ObjectpathObject = object } // For returns the path to an object relative to its package, @@ -572,17 +576,16 @@ func findTypeParam(obj types.Object, list *typeparams.TypeParamList, path []byte // Object returns the object denoted by path p within the package pkg. func Object(pkg *types.Package, p Path) (types.Object, error) { - return object(pkg, p, false) + return object(pkg, string(p), false) } // Note: the skipMethodSorting parameter must match the value of // Encoder.skipMethodSorting used during encoding. -func object(pkg *types.Package, p Path, skipMethodSorting bool) (types.Object, error) { - if p == "" { +func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.Object, error) { + if pathstr == "" { return nil, fmt.Errorf("empty path") } - pathstr := string(p) var pkgobj, suffix string if dot := strings.IndexByte(pathstr, opType); dot < 0 { pkgobj = pathstr diff --git a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go index b1223713..2d078ccb 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/gcimporter.go @@ -29,7 +29,6 @@ import ( "go/token" "go/types" "io" - "io/ioutil" "os" "os/exec" "path/filepath" @@ -221,7 +220,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func switch hdr { case "$$B\n": var data []byte - data, err = ioutil.ReadAll(buf) + data, err = io.ReadAll(buf) if err != nil { break } diff --git a/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/vendor/golang.org/x/tools/internal/typeparams/coretype.go index 993135ec..71248209 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/coretype.go +++ b/vendor/golang.org/x/tools/internal/typeparams/coretype.go @@ -81,13 +81,13 @@ func CoreType(T types.Type) types.Type { // restrictions may be arbitrarily complex. For example, consider the // following: // -// type A interface{ ~string|~[]byte } +// type A interface{ ~string|~[]byte } // -// type B interface{ int|string } +// type B interface{ int|string } // -// type C interface { ~string|~int } +// type C interface { ~string|~int } // -// type T[P interface{ A|B; C }] int +// type T[P interface{ A|B; C }] int // // In this example, the structural type restriction of P is ~string|int: A|B // expands to ~string|~[]byte|int|string, which reduces to ~string|~[]byte|int, diff --git a/vendor/golang.org/x/tools/internal/typeparams/termlist.go b/vendor/golang.org/x/tools/internal/typeparams/termlist.go index 933106a2..cbd12f80 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/termlist.go +++ b/vendor/golang.org/x/tools/internal/typeparams/termlist.go @@ -30,7 +30,7 @@ func (xl termlist) String() string { var buf bytes.Buffer for i, x := range xl { if i > 0 { - buf.WriteString(" ∪ ") + buf.WriteString(" | ") } buf.WriteString(x.String()) } diff --git a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go b/vendor/golang.org/x/tools/internal/typeparams/typeterm.go index 7ddee28d..7350bb70 100644 --- a/vendor/golang.org/x/tools/internal/typeparams/typeterm.go +++ b/vendor/golang.org/x/tools/internal/typeparams/typeterm.go @@ -10,11 +10,10 @@ import "go/types" // A term describes elementary type sets: // -// ∅: (*term)(nil) == ∅ // set of no types (empty set) -// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse) -// T: &term{false, T} == {T} // set of type T -// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t -// +// ∅: (*term)(nil) == ∅ // set of no types (empty set) +// 𝓤: &term{} == 𝓤 // set of all types (𝓤niverse) +// T: &term{false, T} == {T} // set of type T +// ~t: &term{true, t} == {t' | under(t') == t} // set of types with underlying type t type term struct { tilde bool // valid if typ != nil typ types.Type diff --git a/vendor/golang.org/x/tools/internal/typesinternal/objectpath.go b/vendor/golang.org/x/tools/internal/typesinternal/objectpath.go new file mode 100644 index 00000000..5e96e895 --- /dev/null +++ b/vendor/golang.org/x/tools/internal/typesinternal/objectpath.go @@ -0,0 +1,24 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package typesinternal + +import "go/types" + +// This file contains back doors that allow gopls to avoid method sorting when +// using the objectpath package. +// +// This is performance-critical in certain repositories, but changing the +// behavior of the objectpath package is still being discussed in +// golang/go#61443. If we decide to remove the sorting in objectpath we can +// simply delete these back doors. Otherwise, we should add a new API to +// objectpath that allows controlling the sorting. + +// SkipEncoderMethodSorting marks enc (which must be an *objectpath.Encoder) as +// not requiring sorted methods. +var SkipEncoderMethodSorting func(enc interface{}) + +// ObjectpathObject is like objectpath.Object, but allows suppressing method +// sorting. +var ObjectpathObject func(pkg *types.Package, p string, skipMethodSorting bool) (types.Object, error) diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go index 66e8b099..ce7d4351 100644 --- a/vendor/golang.org/x/tools/internal/typesinternal/types.go +++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go @@ -11,8 +11,6 @@ import ( "go/types" "reflect" "unsafe" - - "golang.org/x/tools/go/types/objectpath" ) func SetUsesCgo(conf *types.Config) bool { @@ -52,17 +50,3 @@ func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, } var SetGoVersion = func(conf *types.Config, version string) bool { return false } - -// SkipEncoderMethodSorting marks the encoder as not requiring sorted methods, -// as an optimization for gopls (which guarantees the order of parsed source files). -// -// TODO(golang/go#61443): eliminate this parameter one way or the other. -// -//go:linkname SkipEncoderMethodSorting golang.org/x/tools/go/types/objectpath.skipMethodSorting -func SkipEncoderMethodSorting(enc *objectpath.Encoder) - -// ObjectpathObject is like objectpath.Object, but allows suppressing method -// sorting (which is not necessary for gopls). -// -//go:linkname ObjectpathObject golang.org/x/tools/go/types/objectpath.object -func ObjectpathObject(pkg *types.Package, p objectpath.Path, skipMethodSorting bool) (types.Object, error) diff --git a/vendor/modernc.org/ccgo/v3/lib/util.go b/vendor/modernc.org/ccgo/v3/lib/util.go index f11e439c..258df4f8 100644 --- a/vendor/modernc.org/ccgo/v3/lib/util.go +++ b/vendor/modernc.org/ccgo/v3/lib/util.go @@ -141,6 +141,36 @@ func CopyDir(dst, src string, canOverwrite func(fn string, fi os.FileInfo) bool) return err } + if info.Mode()&os.ModeSymlink != 0 { + target, err := filepath.EvalSymlinks(path) + if err != nil { + return fmt.Errorf("cannot evaluate symlink %s: %v", path, err) + } + + if info, err = os.Stat(target); err != nil { + return fmt.Errorf("cannot stat %s: %v", target, err) + } + + if info.IsDir() { + rel, err := filepath.Rel(src, path) + if err != nil { + return err + } + + dst2 := filepath.Join(dst, rel) + if err := os.MkdirAll(dst2, 0770); err != nil { + return err + } + + f, b, err := CopyDir(dst2, target, canOverwrite) + files += f + bytes += b + return err + } + + path = target + } + rel, err := filepath.Rel(src, path) if err != nil { return err diff --git a/vendor/modernc.org/libc/Makefile b/vendor/modernc.org/libc/Makefile index 8664cd6d..1b87fd28 100644 --- a/vendor/modernc.org/libc/Makefile +++ b/vendor/modernc.org/libc/Makefile @@ -2,13 +2,14 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -.PHONY: all bench build_all_targets clean cover cpu editor internalError later mem nuke todo edit devbench \ +.PHONY: all bench build_all_targets clean cover cpu editor internalError later mem nuke todo edit work devbench \ darwin_amd64 \ darwin_arm64 \ linux_386 \ linux_amd64 \ linux_arm \ linux_arm64 \ + strace \ grep=--include=*.go --include=*.l --include=*.y --include=*.yy --include=*.qbe --include=*.ssa @@ -164,13 +165,15 @@ cpu: clean edit: @touch log - @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile *.go & fi + @if [ -f "Session.vim" ]; then novim -S & else novim -p Makefile libc.go & fi editor: # go generate 2>&1 | tee log gofmt -l -s -w *.go go test -short 2>&1 | tee -a log go install -v ./... + go build -o /dev/null generate.go + go build -o /dev/null strace.go later: @grep -n $(grep) LATER * || true @@ -189,3 +192,15 @@ todo: @grep -nr $(grep) BUG * | grep -v $(ngrep) || true @grep -nr $(grep) [^[:alpha:]]println * | grep -v $(ngrep) || true @grep -nir $(grep) 'work.*progress' || true + +work: + rm -f go.work* + go work init + go work use . + go work use ../ccgo/v4 + go work use ../ccgo/v3 + go work use ../cc/v4 + +strace: + go run strace.go + go build -v ./... diff --git a/vendor/modernc.org/libc/build_all_targets.sh b/vendor/modernc.org/libc/build_all_targets.sh index 6d278e41..37db4f53 100644 --- a/vendor/modernc.org/libc/build_all_targets.sh +++ b/vendor/modernc.org/libc/build_all_targets.sh @@ -1,5 +1,5 @@ set -e -for tag in none dmesg libc.membrk libc.memgrind +for tag in none libc.dmesg libc.membrk libc.memgrind libc.strace do echo "-tags=$tag" echo "GOOS=darwin GOARCH=amd64" diff --git a/vendor/modernc.org/libc/etc.go b/vendor/modernc.org/libc/etc.go index ca188072..c8a64bd7 100644 --- a/vendor/modernc.org/libc/etc.go +++ b/vendor/modernc.org/libc/etc.go @@ -9,6 +9,7 @@ import ( "io" "os" "path/filepath" + "reflect" "runtime" "runtime/debug" "sort" @@ -436,7 +437,10 @@ func VaList(p uintptr, args ...interface{}) (r uintptr) { case uintptr: *(*uintptr)(unsafe.Pointer(p)) = x default: - panic(todo("invalid VaList argument type: %T", x)) + sz := reflect.TypeOf(v).Size() + copy(unsafe.Slice((*byte)(unsafe.Pointer(p)), sz), unsafe.Slice((*byte)(unsafe.Pointer((*[2]uintptr)(unsafe.Pointer(&v))[1])), sz)) + p += roundup(sz, 8) + continue } p += 8 } @@ -459,6 +463,18 @@ func NewVaList(args ...interface{}) (va_list uintptr) { return VaList(NewVaListN(len(args)), args...) } +func VaOther(app *uintptr, sz uint64) (r uintptr) { + ap := *(*uintptr)(unsafe.Pointer(app)) + if ap == 0 { + return 0 + } + + r = ap + ap = roundup(ap+uintptr(sz), 8) + *(*uintptr)(unsafe.Pointer(app)) = ap + return r +} + func VaInt32(app *uintptr) int32 { ap := *(*uintptr)(unsafe.Pointer(app)) if ap == 0 { @@ -584,6 +600,8 @@ func GoBytes(s uintptr, len int) []byte { return (*RawMem)(unsafe.Pointer(s))[:len:len] } +func Bool(v bool) bool { return v } + func Bool32(b bool) int32 { if b { return 1 diff --git a/vendor/modernc.org/libc/libc.go b/vendor/modernc.org/libc/libc.go index 01d6793a..87f4c660 100644 --- a/vendor/modernc.org/libc/libc.go +++ b/vendor/modernc.org/libc/libc.go @@ -40,6 +40,10 @@ import ( "modernc.org/mathutil" ) +const ( + ENOENT = errno.ENOENT +) + type ( // RawMem64 represents the biggest uint64 array the runtime can handle. RawMem64 [unsafe.Sizeof(RawMem{}) / unsafe.Sizeof(uint64(0))]uint64 @@ -76,11 +80,17 @@ func EnvironP() uintptr { } func X___errno_location(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return X__errno_location(t) } // int * __errno_location(void); func X__errno_location(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return t.errnop } @@ -126,7 +136,12 @@ func Start(main func(*TLS, int32, uintptr) int32) { exit(t, rc, audit) } -func Xexit(t *TLS, status int32) { exit(t, status, false) } +func Xexit(t *TLS, status int32) { + if __ccgo_strace { + trc("t=%v status=%v, (%v:)", t, status, origin(2)) + } + exit(t, status, false) +} func exit(t *TLS, status int32, audit bool) { if len(Covered) != 0 { @@ -186,16 +201,25 @@ func SetEnviron(t *TLS, env []string) { // void setbuf(FILE *stream, char *buf); func Xsetbuf(t *TLS, stream, buf uintptr) { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } //TODO panic(todo("")) } // size_t confstr(int name, char *buf, size_t len); func Xconfstr(t *TLS, name int32, buf uintptr, len types.Size_t) types.Size_t { + if __ccgo_strace { + trc("t=%v name=%v buf=%v len=%v, (%v:)", t, name, buf, len, origin(2)) + } panic(todo("")) } // int puts(const char *s); func Xputs(t *TLS, s uintptr) int32 { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } n, err := fmt.Printf("%s\n", GoString(s)) if err != nil { return stdio.EOF @@ -211,6 +235,9 @@ var ( // long int random(void); func Xrandom(t *TLS) long { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } randomMu.Lock() r := randomGen.Int63n(math.MaxInt32 + 1) randomMu.Unlock() @@ -228,73 +255,310 @@ func write(b []byte) (int, error) { return len(b), nil } -func X__builtin_bzero(t *TLS, s uintptr, n types.Size_t) { Xbzero(t, s, n) } -func X__builtin_abort(t *TLS) { Xabort(t) } -func X__builtin_abs(t *TLS, j int32) int32 { return Xabs(t, j) } -func X__builtin_clz(t *TLS, n uint32) int32 { return int32(mbits.LeadingZeros32(n)) } -func X__builtin_clzl(t *TLS, n ulong) int32 { return int32(mbits.LeadingZeros64(uint64(n))) } -func X__builtin_clzll(t *TLS, n uint64) int32 { return int32(mbits.LeadingZeros64(n)) } -func X__builtin_constant_p_impl() { panic(todo("internal error: should never be called")) } -func X__builtin_copysign(t *TLS, x, y float64) float64 { return Xcopysign(t, x, y) } -func X__builtin_copysignf(t *TLS, x, y float32) float32 { return Xcopysignf(t, x, y) } -func X__builtin_copysignl(t *TLS, x, y float64) float64 { return Xcopysign(t, x, y) } -func X__builtin_exit(t *TLS, status int32) { Xexit(t, status) } -func X__builtin_expect(t *TLS, exp, c long) long { return exp } -func X__builtin_fabs(t *TLS, x float64) float64 { return Xfabs(t, x) } -func X__builtin_fabsf(t *TLS, x float32) float32 { return Xfabsf(t, x) } -func X__builtin_fabsl(t *TLS, x float64) float64 { return Xfabsl(t, x) } -func X__builtin_free(t *TLS, ptr uintptr) { Xfree(t, ptr) } -func X__builtin_getentropy(t *TLS, buf uintptr, n types.Size_t) int32 { return Xgetentropy(t, buf, n) } -func X__builtin_huge_val(t *TLS) float64 { return math.Inf(1) } -func X__builtin_huge_valf(t *TLS) float32 { return float32(math.Inf(1)) } -func X__builtin_inf(t *TLS) float64 { return math.Inf(1) } -func X__builtin_inff(t *TLS) float32 { return float32(math.Inf(1)) } -func X__builtin_infl(t *TLS) float64 { return math.Inf(1) } -func X__builtin_malloc(t *TLS, size types.Size_t) uintptr { return Xmalloc(t, size) } -func X__builtin_memcmp(t *TLS, s1, s2 uintptr, n types.Size_t) int32 { return Xmemcmp(t, s1, s2, n) } -func X__builtin_nan(t *TLS, s uintptr) float64 { return math.NaN() } -func X__builtin_nanf(t *TLS, s uintptr) float32 { return float32(math.NaN()) } -func X__builtin_nanl(t *TLS, s uintptr) float64 { return math.NaN() } -func X__builtin_prefetch(t *TLS, addr, args uintptr) {} -func X__builtin_printf(t *TLS, s, args uintptr) int32 { return Xprintf(t, s, args) } -func X__builtin_strchr(t *TLS, s uintptr, c int32) uintptr { return Xstrchr(t, s, c) } -func X__builtin_strcmp(t *TLS, s1, s2 uintptr) int32 { return Xstrcmp(t, s1, s2) } -func X__builtin_strcpy(t *TLS, dest, src uintptr) uintptr { return Xstrcpy(t, dest, src) } -func X__builtin_strlen(t *TLS, s uintptr) types.Size_t { return Xstrlen(t, s) } -func X__builtin_trap(t *TLS) { Xabort(t) } -func X__isnan(t *TLS, arg float64) int32 { return X__builtin_isnan(t, arg) } -func X__isnanf(t *TLS, arg float32) int32 { return Xisnanf(t, arg) } -func X__isnanl(t *TLS, arg float64) int32 { return Xisnanl(t, arg) } - -func Xvfprintf(t *TLS, stream, format, ap uintptr) int32 { return Xfprintf(t, stream, format, ap) } +func X__builtin_bzero(t *TLS, s uintptr, n types.Size_t) { + if __ccgo_strace { + trc("t=%v s=%v n=%v, (%v:)", t, s, n, origin(2)) + } + Xbzero(t, s, n) +} + +func X__builtin_abort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + Xabort(t) +} + +func X__builtin_abs(t *TLS, j int32) int32 { + if __ccgo_strace { + trc("t=%v j=%v, (%v:)", t, j, origin(2)) + } + return Xabs(t, j) +} + +func X__builtin_clz(t *TLS, n uint32) int32 { + if __ccgo_strace { + trc("t=%v n=%v, (%v:)", t, n, origin(2)) + } + return int32(mbits.LeadingZeros32(n)) +} + +func X__builtin_clzl(t *TLS, n ulong) int32 { + if __ccgo_strace { + trc("t=%v n=%v, (%v:)", t, n, origin(2)) + } + return int32(mbits.LeadingZeros64(uint64(n))) +} + +func X__builtin_clzll(t *TLS, n uint64) int32 { + if __ccgo_strace { + trc("t=%v n=%v, (%v:)", t, n, origin(2)) + } + return int32(mbits.LeadingZeros64(n)) +} +func X__builtin_constant_p_impl() { panic(todo("internal error: should never be called")) } + +func X__builtin_copysign(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return Xcopysign(t, x, y) +} + +func X__builtin_copysignf(t *TLS, x, y float32) float32 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return Xcopysignf(t, x, y) +} + +func X__builtin_copysignl(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return Xcopysign(t, x, y) +} + +func X__builtin_exit(t *TLS, status int32) { + if __ccgo_strace { + trc("t=%v status=%v, (%v:)", t, status, origin(2)) + } + Xexit(t, status) +} + +func X__builtin_expect(t *TLS, exp, c long) long { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } + return exp +} + +func X__builtin_fabs(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Xfabs(t, x) +} + +func X__builtin_fabsf(t *TLS, x float32) float32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Xfabsf(t, x) +} + +func X__builtin_fabsl(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Xfabsl(t, x) +} + +func X__builtin_free(t *TLS, ptr uintptr) { + if __ccgo_strace { + trc("t=%v ptr=%v, (%v:)", t, ptr, origin(2)) + } + Xfree(t, ptr) +} + +func X__builtin_getentropy(t *TLS, buf uintptr, n types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v n=%v, (%v:)", t, buf, n, origin(2)) + } + return Xgetentropy(t, buf, n) +} + +func X__builtin_huge_val(t *TLS) float64 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + return math.Inf(1) +} + +func X__builtin_huge_valf(t *TLS) float32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + return float32(math.Inf(1)) +} + +func X__builtin_inf(t *TLS) float64 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + return math.Inf(1) +} + +func X__builtin_inff(t *TLS) float32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + return float32(math.Inf(1)) +} + +func X__builtin_infl(t *TLS) float64 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + return math.Inf(1) +} + +func X__builtin_malloc(t *TLS, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v size=%v, (%v:)", t, size, origin(2)) + } + return Xmalloc(t, size) +} + +func X__builtin_memcmp(t *TLS, s1, s2 uintptr, n types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v s2=%v n=%v, (%v:)", t, s2, n, origin(2)) + } + return Xmemcmp(t, s1, s2, n) +} + +func X__builtin_nan(t *TLS, s uintptr) float64 { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } + return math.NaN() +} + +func X__builtin_nanf(t *TLS, s uintptr) float32 { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } + return float32(math.NaN()) +} + +func X__builtin_nanl(t *TLS, s uintptr) float64 { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } + return math.NaN() +} + +func X__builtin_prefetch(t *TLS, addr, args uintptr) { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } +} + +func X__builtin_printf(t *TLS, s, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } + return Xprintf(t, s, args) +} + +func X__builtin_strchr(t *TLS, s uintptr, c int32) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v, (%v:)", t, s, c, origin(2)) + } + return Xstrchr(t, s, c) +} + +func X__builtin_strcmp(t *TLS, s1, s2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v s2=%v, (%v:)", t, s2, origin(2)) + } + return Xstrcmp(t, s1, s2) +} + +func X__builtin_strcpy(t *TLS, dest, src uintptr) uintptr { + if __ccgo_strace { + trc("t=%v src=%v, (%v:)", t, src, origin(2)) + } + return Xstrcpy(t, dest, src) +} + +func X__builtin_strlen(t *TLS, s uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } + return Xstrlen(t, s) +} + +func X__builtin_trap(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + Xabort(t) +} + +func X__isnan(t *TLS, arg float64) int32 { + if __ccgo_strace { + trc("t=%v arg=%v, (%v:)", t, arg, origin(2)) + } + return X__builtin_isnan(t, arg) +} + +func X__isnanf(t *TLS, arg float32) int32 { + if __ccgo_strace { + trc("t=%v arg=%v, (%v:)", t, arg, origin(2)) + } + return Xisnanf(t, arg) +} + +func X__isnanl(t *TLS, arg float64) int32 { + if __ccgo_strace { + trc("t=%v arg=%v, (%v:)", t, arg, origin(2)) + } + return Xisnanl(t, arg) +} + +func Xvfprintf(t *TLS, stream, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } + return Xfprintf(t, stream, format, ap) +} // int __builtin_popcount (unsigned int x) func X__builtin_popcount(t *TLS, x uint32) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return int32(mbits.OnesCount32(x)) } // int __builtin_popcountl (unsigned long x) func X__builtin_popcountl(t *TLS, x ulong) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return int32(mbits.OnesCount64(uint64(x))) } // char * __builtin___strcpy_chk (char *dest, const char *src, size_t os); func X__builtin___strcpy_chk(t *TLS, dest, src uintptr, os types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v src=%v os=%v, (%v:)", t, src, os, origin(2)) + } return Xstrcpy(t, dest, src) } func X__builtin_mmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap(t, addr, length, prot, flags, fd, offset) } // uint16_t __builtin_bswap16 (uint32_t x) func X__builtin_bswap16(t *TLS, x uint16) uint16 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return x<<8 | x>>8 } // uint32_t __builtin_bswap32 (uint32_t x) func X__builtin_bswap32(t *TLS, x uint32) uint32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return x<<24 | x&0xff00<<8 | x&0xff0000>>8 | @@ -303,6 +567,9 @@ func X__builtin_bswap32(t *TLS, x uint32) uint32 { // uint64_t __builtin_bswap64 (uint64_t x) func X__builtin_bswap64(t *TLS, x uint64) uint64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return x<<56 | x&0xff00<<40 | x&0xff0000<<24 | @@ -315,6 +582,9 @@ func X__builtin_bswap64(t *TLS, x uint64) uint64 { // bool __builtin_add_overflow (type1 a, type2 b, type3 *res) func X__builtin_add_overflowInt64(t *TLS, a, b int64, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } r, ovf := mathutil.AddOverflowInt64(a, b) *(*int64)(unsafe.Pointer(res)) = r return Bool32(ovf) @@ -322,6 +592,9 @@ func X__builtin_add_overflowInt64(t *TLS, a, b int64, res uintptr) int32 { // bool __builtin_add_overflow (type1 a, type2 b, type3 *res) func X__builtin_add_overflowUint32(t *TLS, a, b uint32, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } r := a + b *(*uint32)(unsafe.Pointer(res)) = r return Bool32(r < a) @@ -329,6 +602,9 @@ func X__builtin_add_overflowUint32(t *TLS, a, b uint32, res uintptr) int32 { // bool __builtin_add_overflow (type1 a, type2 b, type3 *res) func X__builtin_add_overflowUint64(t *TLS, a, b uint64, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } r := a + b *(*uint64)(unsafe.Pointer(res)) = r return Bool32(r < a) @@ -336,6 +612,9 @@ func X__builtin_add_overflowUint64(t *TLS, a, b uint64, res uintptr) int32 { // bool __builtin_sub_overflow (type1 a, type2 b, type3 *res) func X__builtin_sub_overflowInt64(t *TLS, a, b int64, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } r, ovf := mathutil.SubOverflowInt64(a, b) *(*int64)(unsafe.Pointer(res)) = r return Bool32(ovf) @@ -343,6 +622,9 @@ func X__builtin_sub_overflowInt64(t *TLS, a, b int64, res uintptr) int32 { // bool __builtin_mul_overflow (type1 a, type2 b, type3 *res) func X__builtin_mul_overflowInt64(t *TLS, a, b int64, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } r, ovf := mathutil.MulOverflowInt64(a, b) *(*int64)(unsafe.Pointer(res)) = r return Bool32(ovf) @@ -350,6 +632,9 @@ func X__builtin_mul_overflowInt64(t *TLS, a, b int64, res uintptr) int32 { // bool __builtin_mul_overflow (type1 a, type2 b, type3 *res) func X__builtin_mul_overflowUint64(t *TLS, a, b uint64, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } hi, lo := mbits.Mul64(a, b) *(*uint64)(unsafe.Pointer(res)) = lo return Bool32(hi != 0) @@ -357,31 +642,52 @@ func X__builtin_mul_overflowUint64(t *TLS, a, b uint64, res uintptr) int32 { // bool __builtin_mul_overflow (type1 a, type2 b, type3 *res) func X__builtin_mul_overflowUint128(t *TLS, a, b Uint128, res uintptr) int32 { + if __ccgo_strace { + trc("t=%v b=%v res=%v, (%v:)", t, b, res, origin(2)) + } r, ovf := a.mulOvf(b) *(*Uint128)(unsafe.Pointer(res)) = r return Bool32(ovf) } func X__builtin_unreachable(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } fmt.Fprintf(os.Stderr, "unrechable\n") os.Stderr.Sync() Xexit(t, 1) } func X__builtin_snprintf(t *TLS, str uintptr, size types.Size_t, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v size=%v args=%v, (%v:)", t, str, size, args, origin(2)) + } return Xsnprintf(t, str, size, format, args) } func X__builtin_sprintf(t *TLS, str, format, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + defer func() { trc("-> %v", r) }() + } return Xsprintf(t, str, format, args) } func X__builtin_memcpy(t *TLS, dest, src uintptr, n types.Size_t) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v n=%v, (%v:)", t, src, n, origin(2)) + defer func() { trc("-> %v", r) }() + } return Xmemcpy(t, dest, src, n) } // void * __builtin___memcpy_chk (void *dest, const void *src, size_t n, size_t os); func X__builtin___memcpy_chk(t *TLS, dest, src uintptr, n, os types.Size_t) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v os=%v, (%v:)", t, src, os, origin(2)) + defer func() { trc("-> %v", r) }() + } if os != ^types.Size_t(0) && n < os { Xabort(t) } @@ -390,11 +696,17 @@ func X__builtin___memcpy_chk(t *TLS, dest, src uintptr, n, os types.Size_t) (r u } func X__builtin_memset(t *TLS, s uintptr, c int32, n types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v n=%v, (%v:)", t, s, c, n, origin(2)) + } return Xmemset(t, s, c, n) } // void * __builtin___memset_chk (void *s, int c, size_t n, size_t os); func X__builtin___memset_chk(t *TLS, s uintptr, c int32, n, os types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v os=%v, (%v:)", t, s, c, os, origin(2)) + } if os < n { Xabort(t) } @@ -404,18 +716,14 @@ func X__builtin___memset_chk(t *TLS, s uintptr, c int32, n, os types.Size_t) uin // size_t __builtin_object_size (const void * ptr, int type) func X__builtin_object_size(t *TLS, p uintptr, typ int32) types.Size_t { + if __ccgo_strace { + trc("t=%v p=%v typ=%v, (%v:)", t, p, typ, origin(2)) + } return ^types.Size_t(0) //TODO frontend magic } var atomicLoadStore16 sync.Mutex -func AtomicLoadNUint16(ptr uintptr, memorder int32) uint16 { - atomicLoadStore16.Lock() - r := *(*uint16)(unsafe.Pointer(ptr)) - atomicLoadStore16.Unlock() - return r -} - func AtomicStoreNUint16(ptr uintptr, val uint16, memorder int32) { atomicLoadStore16.Lock() *(*uint16)(unsafe.Pointer(ptr)) = val @@ -424,6 +732,10 @@ func AtomicStoreNUint16(ptr uintptr, val uint16, memorder int32) { // int sprintf(char *str, const char *format, ...); func Xsprintf(t *TLS, str, format, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + defer func() { trc("-> %v", r) }() + } b := printf(format, args) r = int32(len(b)) copy((*RawMem)(unsafe.Pointer(str))[:r:r], b) @@ -433,11 +745,18 @@ func Xsprintf(t *TLS, str, format, args uintptr) (r int32) { // int __builtin___sprintf_chk (char *s, int flag, size_t os, const char *fmt, ...); func X__builtin___sprintf_chk(t *TLS, s uintptr, flag int32, os types.Size_t, format, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v s=%v flag=%v os=%v args=%v, (%v:)", t, s, flag, os, args, origin(2)) + defer func() { trc("-> %v", r) }() + } return Xsprintf(t, s, format, args) } // void qsort(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); func Xqsort(t *TLS, base uintptr, nmemb, size types.Size_t, compar uintptr) { + if __ccgo_strace { + trc("t=%v base=%v size=%v compar=%v, (%v:)", t, base, size, compar, origin(2)) + } sort.Sort(&sorter{ len: int(nmemb), base: base, @@ -451,6 +770,9 @@ func Xqsort(t *TLS, base uintptr, nmemb, size types.Size_t, compar uintptr) { // void __assert_fail(const char * assertion, const char * file, unsigned int line, const char * function); func X__assert_fail(t *TLS, assertion, file uintptr, line uint32, function uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v function=%v, (%v:)", t, file, line, function, origin(2)) + } fmt.Fprintf(os.Stderr, "assertion failure: %s:%d.%s: %s\n", GoString(file), line, GoString(function), GoString(assertion)) if memgrind { fmt.Fprintf(os.Stderr, "%s\n", debug.Stack()) @@ -460,46 +782,84 @@ func X__assert_fail(t *TLS, assertion, file uintptr, line uint32, function uintp } // int vprintf(const char *format, va_list ap); -func Xvprintf(t *TLS, s, ap uintptr) int32 { return Xprintf(t, s, ap) } + +func Xvprintf(t *TLS, s, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } + return Xprintf(t, s, ap) +} // int vsprintf(char *str, const char *format, va_list ap); func Xvsprintf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } return Xsprintf(t, str, format, va) } // int vsnprintf(char *str, size_t size, const char *format, va_list ap); func Xvsnprintf(t *TLS, str uintptr, size types.Size_t, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v size=%v va=%v, (%v:)", t, str, size, va, origin(2)) + } return Xsnprintf(t, str, size, format, va) } +func X__builtin_vsnprintf(t *TLS, str uintptr, size types.Size_t, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v size=%v va=%v, (%v:)", t, str, size, va, origin(2)) + } + return Xvsnprintf(t, str, size, format, va) +} + // int obstack_vprintf (struct obstack *obstack, const char *template, va_list ap) func Xobstack_vprintf(t *TLS, obstack, template, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } panic(todo("")) } // extern void _obstack_newchunk(struct obstack *, int); func X_obstack_newchunk(t *TLS, obstack uintptr, length int32) int32 { + if __ccgo_strace { + trc("t=%v obstack=%v length=%v, (%v:)", t, obstack, length, origin(2)) + } panic(todo("")) } // int _obstack_begin (struct obstack *h, _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment, void *(*chunkfun) (size_t), void (*freefun) (void *)) func X_obstack_begin(t *TLS, obstack uintptr, size, alignment int32, chunkfun, freefun uintptr) int32 { + if __ccgo_strace { + trc("t=%v obstack=%v alignment=%v freefun=%v, (%v:)", t, obstack, alignment, freefun, origin(2)) + } panic(todo("")) } // void obstack_free (struct obstack *h, void *obj) func Xobstack_free(t *TLS, obstack, obj uintptr) { + if __ccgo_strace { + trc("t=%v obj=%v, (%v:)", t, obj, origin(2)) + } panic(todo("")) } // unsigned int sleep(unsigned int seconds); func Xsleep(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } gotime.Sleep(gotime.Second * gotime.Duration(seconds)) return 0 } // size_t strcspn(const char *s, const char *reject); func Xstrcspn(t *TLS, s, reject uintptr) (r types.Size_t) { + if __ccgo_strace { + trc("t=%v reject=%v, (%v:)", t, reject, origin(2)) + defer func() { trc("-> %v", r) }() + } bits := newBits(256) for { c := *(*byte)(unsafe.Pointer(reject)) @@ -523,12 +883,19 @@ func Xstrcspn(t *TLS, s, reject uintptr) (r types.Size_t) { // int printf(const char *format, ...); func Xprintf(t *TLS, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } n, _ := write(printf(format, args)) return int32(n) } // int snprintf(char *str, size_t size, const char *format, ...); func Xsnprintf(t *TLS, str uintptr, size types.Size_t, format, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v str=%v size=%v args=%v, (%v:)", t, str, size, args, origin(2)) + defer func() { trc("-> %v", r) }() + } if format == 0 { return 0 } @@ -550,6 +917,10 @@ func Xsnprintf(t *TLS, str uintptr, size types.Size_t, format, args uintptr) (r // int __builtin___snprintf_chk(char * str, size_t maxlen, int flag, size_t os, const char * format, ...); func X__builtin___snprintf_chk(t *TLS, str uintptr, maxlen types.Size_t, flag int32, os types.Size_t, format, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v str=%v maxlen=%v flag=%v os=%v args=%v, (%v:)", t, str, maxlen, flag, os, args, origin(2)) + defer func() { trc("-> %v", r) }() + } if os != ^types.Size_t(0) && maxlen > os { Xabort(t) } @@ -559,6 +930,10 @@ func X__builtin___snprintf_chk(t *TLS, str uintptr, maxlen types.Size_t, flag in // int __builtin___vsnprintf_chk (char *s, size_t maxlen, int flag, size_t os, const char *fmt, va_list ap); func X__builtin___vsnprintf_chk(t *TLS, str uintptr, maxlen types.Size_t, flag int32, os types.Size_t, format, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v str=%v maxlen=%v flag=%v os=%v args=%v, (%v:)", t, str, maxlen, flag, os, args, origin(2)) + defer func() { trc("-> %v", r) }() + } if os != ^types.Size_t(0) && maxlen > os { Xabort(t) } @@ -568,6 +943,9 @@ func X__builtin___vsnprintf_chk(t *TLS, str uintptr, maxlen types.Size_t, flag i // int abs(int j); func Xabs(t *TLS, j int32) int32 { + if __ccgo_strace { + trc("t=%v j=%v, (%v:)", t, j, origin(2)) + } if j >= 0 { return j } @@ -576,6 +954,9 @@ func Xabs(t *TLS, j int32) int32 { } func Xllabs(tls *TLS, a int64) int64 { + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } if a >= int64(0) { return a } @@ -583,53 +964,287 @@ func Xllabs(tls *TLS, a int64) int64 { return -a } -func X__builtin_isnan(t *TLS, x float64) int32 { return Bool32(math.IsNaN(x)) } -func X__builtin_llabs(tls *TLS, a int64) int64 { return Xllabs(tls, a) } -func Xacos(t *TLS, x float64) float64 { return math.Acos(x) } -func Xacosh(t *TLS, x float64) float64 { return math.Acosh(x) } -func Xasin(t *TLS, x float64) float64 { return math.Asin(x) } -func Xasinh(t *TLS, x float64) float64 { return math.Asinh(x) } -func Xatan(t *TLS, x float64) float64 { return math.Atan(x) } -func Xatan2(t *TLS, x, y float64) float64 { return math.Atan2(x, y) } -func Xatanh(t *TLS, x float64) float64 { return math.Atanh(x) } -func Xceil(t *TLS, x float64) float64 { return math.Ceil(x) } -func Xceilf(t *TLS, x float32) float32 { return float32(math.Ceil(float64(x))) } -func Xcopysign(t *TLS, x, y float64) float64 { return math.Copysign(x, y) } -func Xcopysignf(t *TLS, x, y float32) float32 { return float32(math.Copysign(float64(x), float64(y))) } -func Xcos(t *TLS, x float64) float64 { return math.Cos(x) } -func Xcosf(t *TLS, x float32) float32 { return float32(math.Cos(float64(x))) } -func Xcosh(t *TLS, x float64) float64 { return math.Cosh(x) } -func Xexp(t *TLS, x float64) float64 { return math.Exp(x) } -func Xfabs(t *TLS, x float64) float64 { return math.Abs(x) } -func Xfabsf(t *TLS, x float32) float32 { return float32(math.Abs(float64(x))) } -func Xfloor(t *TLS, x float64) float64 { return math.Floor(x) } -func Xfmod(t *TLS, x, y float64) float64 { return math.Mod(x, y) } -func Xhypot(t *TLS, x, y float64) float64 { return math.Hypot(x, y) } -func Xisnan(t *TLS, x float64) int32 { return X__builtin_isnan(t, x) } -func Xisnanf(t *TLS, x float32) int32 { return Bool32(math.IsNaN(float64(x))) } -func Xisnanl(t *TLS, x float64) int32 { return Bool32(math.IsNaN(x)) } // ccgo has to handle long double as double as Go does not support long double. -func Xldexp(t *TLS, x float64, exp int32) float64 { return math.Ldexp(x, int(exp)) } -func Xlog(t *TLS, x float64) float64 { return math.Log(x) } -func Xlog10(t *TLS, x float64) float64 { return math.Log10(x) } -func Xlog2(t *TLS, x float64) float64 { return math.Log2(x) } -func Xround(t *TLS, x float64) float64 { return math.Round(x) } -func Xsin(t *TLS, x float64) float64 { return math.Sin(x) } -func Xsinf(t *TLS, x float32) float32 { return float32(math.Sin(float64(x))) } -func Xsinh(t *TLS, x float64) float64 { return math.Sinh(x) } -func Xsqrt(t *TLS, x float64) float64 { return math.Sqrt(x) } -func Xtan(t *TLS, x float64) float64 { return math.Tan(x) } -func Xtanh(t *TLS, x float64) float64 { return math.Tanh(x) } -func Xtrunc(t *TLS, x float64) float64 { return math.Trunc(x) } +func X__builtin_isnan(t *TLS, x float64) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Bool32(math.IsNaN(x)) +} + +func X__builtin_llabs(tls *TLS, a int64) int64 { + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } + return Xllabs(tls, a) +} + +func Xacos(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Acos(x) +} + +func Xacosh(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Acosh(x) +} + +func Xasin(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Asin(x) +} + +func Xasinh(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Asinh(x) +} + +func Xatan(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Atan(x) +} + +func Xatan2(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return math.Atan2(x, y) +} + +func Xatanh(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Atanh(x) +} + +func Xceil(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Ceil(x) +} + +func Xceilf(t *TLS, x float32) float32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return float32(math.Ceil(float64(x))) +} + +func Xcopysign(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return math.Copysign(x, y) +} + +func Xcopysignf(t *TLS, x, y float32) float32 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return float32(math.Copysign(float64(x), float64(y))) +} + +func Xcos(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Cos(x) +} + +func Xcosf(t *TLS, x float32) float32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return float32(math.Cos(float64(x))) +} + +func Xcosh(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Cosh(x) +} + +func Xexp(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Exp(x) +} + +func Xfabs(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Abs(x) +} + +func Xfabsf(t *TLS, x float32) float32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return float32(math.Abs(float64(x))) +} + +func Xfloor(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Floor(x) +} + +func Xfmod(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return math.Mod(x, y) +} + +func Xhypot(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return math.Hypot(x, y) +} + +func Xisnan(t *TLS, x float64) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return X__builtin_isnan(t, x) +} + +func Xisnanf(t *TLS, x float32) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Bool32(math.IsNaN(float64(x))) +} + +func Xisnanl(t *TLS, x float64) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Bool32(math.IsNaN(x)) +} // ccgo has to handle long double as double as Go does not support long double. + +func Xldexp(t *TLS, x float64, exp int32) float64 { + if __ccgo_strace { + trc("t=%v x=%v exp=%v, (%v:)", t, x, exp, origin(2)) + } + return math.Ldexp(x, int(exp)) +} + +func Xlog(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Log(x) +} + +func Xlog10(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Log10(x) +} + +func Xlog2(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Log2(x) +} + +func Xround(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Round(x) +} + +func X__builtin_round(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Round(x) +} + +func Xsin(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Sin(x) +} + +func Xsinf(t *TLS, x float32) float32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return float32(math.Sin(float64(x))) +} + +func Xsinh(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Sinh(x) +} + +func Xsqrt(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Sqrt(x) +} + +func Xtan(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Tan(x) +} + +func Xtanh(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Tanh(x) +} + +func Xtrunc(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Trunc(x) +} var nextRand = uint64(1) // int rand(void); func Xrand(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } nextRand = nextRand*1103515245 + 12345 return int32(uint32(nextRand / (math.MaxUint32 + 1) % math.MaxInt32)) } func Xpow(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } r := math.Pow(x, y) if x > 0 && r == 1 && y >= -1.0000000000000000715e-18 && y < -1e-30 { r = 0.9999999999999999 @@ -638,12 +1253,18 @@ func Xpow(t *TLS, x, y float64) float64 { } func Xfrexp(t *TLS, x float64, exp uintptr) float64 { + if __ccgo_strace { + trc("t=%v x=%v exp=%v, (%v:)", t, x, exp, origin(2)) + } f, e := math.Frexp(x) *(*int32)(unsafe.Pointer(exp)) = int32(e) return f } func Xmodf(t *TLS, x float64, iptr uintptr) float64 { + if __ccgo_strace { + trc("t=%v x=%v iptr=%v, (%v:)", t, x, iptr, origin(2)) + } i, f := math.Modf(x) *(*float64)(unsafe.Pointer(iptr)) = i return f @@ -651,6 +1272,10 @@ func Xmodf(t *TLS, x float64, iptr uintptr) float64 { // char *strncpy(char *dest, const char *src, size_t n) func Xstrncpy(t *TLS, dest, src uintptr, n types.Size_t) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v n=%v, (%v:)", t, src, n, origin(2)) + defer func() { trc("-> %v", r) }() + } r = dest for c := *(*int8)(unsafe.Pointer(src)); c != 0 && n > 0; n-- { *(*int8)(unsafe.Pointer(dest)) = c @@ -667,6 +1292,10 @@ func Xstrncpy(t *TLS, dest, src uintptr, n types.Size_t) (r uintptr) { // char * __builtin___strncpy_chk (char *dest, const char *src, size_t n, size_t os); func X__builtin___strncpy_chk(t *TLS, dest, src uintptr, n, os types.Size_t) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v os=%v, (%v:)", t, src, os, origin(2)) + defer func() { trc("-> %v", r) }() + } if n != ^types.Size_t(0) && os < n { Xabort(t) } @@ -676,6 +1305,9 @@ func X__builtin___strncpy_chk(t *TLS, dest, src uintptr, n, os types.Size_t) (r // int strcmp(const char *s1, const char *s2) func Xstrcmp(t *TLS, s1, s2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v s2=%v, (%v:)", t, s2, origin(2)) + } for { ch1 := *(*byte)(unsafe.Pointer(s1)) s1++ @@ -689,6 +1321,10 @@ func Xstrcmp(t *TLS, s1, s2 uintptr) int32 { // size_t strlen(const char *s) func Xstrlen(t *TLS, s uintptr) (r types.Size_t) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + defer func() { trc("-> %v", r) }() + } if s == 0 { return 0 } @@ -701,6 +1337,10 @@ func Xstrlen(t *TLS, s uintptr) (r types.Size_t) { // char *strcat(char *dest, const char *src) func Xstrcat(t *TLS, dest, src uintptr) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v, (%v:)", t, src, origin(2)) + defer func() { trc("-> %v", r) }() + } r = dest for *(*int8)(unsafe.Pointer(dest)) != 0 { dest++ @@ -718,11 +1358,18 @@ func Xstrcat(t *TLS, dest, src uintptr) (r uintptr) { // char * __builtin___strcat_chk (char *dest, const char *src, size_t os); func X__builtin___strcat_chk(t *TLS, dest, src uintptr, os types.Size_t) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v os=%v, (%v:)", t, src, os, origin(2)) + defer func() { trc("-> %v", r) }() + } return Xstrcat(t, dest, src) } // int strncmp(const char *s1, const char *s2, size_t n) func Xstrncmp(t *TLS, s1, s2 uintptr, n types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v s2=%v n=%v, (%v:)", t, s2, n, origin(2)) + } var ch1, ch2 byte for ; n != 0; n-- { ch1 = *(*byte)(unsafe.Pointer(s1)) @@ -742,6 +1389,10 @@ func Xstrncmp(t *TLS, s1, s2 uintptr, n types.Size_t) int32 { // char *strcpy(char *dest, const char *src) func Xstrcpy(t *TLS, dest, src uintptr) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v, (%v:)", t, src, origin(2)) + defer func() { trc("-> %v", r) }() + } r = dest // src0 := src for ; ; dest++ { @@ -756,6 +1407,9 @@ func Xstrcpy(t *TLS, dest, src uintptr) (r uintptr) { // char *strchr(const char *s, int c) func Xstrchr(t *TLS, s uintptr, c int32) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v, (%v:)", t, s, c, origin(2)) + } for { ch2 := *(*byte)(unsafe.Pointer(s)) if ch2 == byte(c) { @@ -772,6 +1426,10 @@ func Xstrchr(t *TLS, s uintptr, c int32) uintptr { // char *strrchr(const char *s, int c) func Xstrrchr(t *TLS, s uintptr, c int32) (r uintptr) { + if __ccgo_strace { + trc("t=%v s=%v c=%v, (%v:)", t, s, c, origin(2)) + defer func() { trc("-> %v", r) }() + } for { ch2 := *(*byte)(unsafe.Pointer(s)) if ch2 == 0 { @@ -787,6 +1445,9 @@ func Xstrrchr(t *TLS, s uintptr, c int32) (r uintptr) { // void *memset(void *s, int c, size_t n) func Xmemset(t *TLS, s uintptr, c int32, n types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v n=%v, (%v:)", t, s, c, n, origin(2)) + } if n != 0 { c := byte(c & 0xff) @@ -820,6 +1481,10 @@ func Xmemset(t *TLS, s uintptr, c int32, n types.Size_t) uintptr { // void *memcpy(void *dest, const void *src, size_t n); func Xmemcpy(t *TLS, dest, src uintptr, n types.Size_t) (r uintptr) { + if __ccgo_strace { + trc("t=%v src=%v n=%v, (%v:)", t, src, n, origin(2)) + defer func() { trc("-> %v", r) }() + } if n != 0 { copy((*RawMem)(unsafe.Pointer(dest))[:n:n], (*RawMem)(unsafe.Pointer(src))[:n:n]) } @@ -828,6 +1493,9 @@ func Xmemcpy(t *TLS, dest, src uintptr, n types.Size_t) (r uintptr) { // int memcmp(const void *s1, const void *s2, size_t n); func Xmemcmp(t *TLS, s1, s2 uintptr, n types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v s2=%v n=%v, (%v:)", t, s2, n, origin(2)) + } for ; n != 0; n-- { c1 := *(*byte)(unsafe.Pointer(s1)) s1++ @@ -846,6 +1514,9 @@ func Xmemcmp(t *TLS, s1, s2 uintptr, n types.Size_t) int32 { // void *memchr(const void *s, int c, size_t n); func Xmemchr(t *TLS, s uintptr, c int32, n types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v n=%v, (%v:)", t, s, c, n, origin(2)) + } for ; n != 0; n-- { if *(*byte)(unsafe.Pointer(s)) == byte(c) { return s @@ -858,6 +1529,9 @@ func Xmemchr(t *TLS, s uintptr, c int32, n types.Size_t) uintptr { // void *memmove(void *dest, const void *src, size_t n); func Xmemmove(t *TLS, dest, src uintptr, n types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v src=%v n=%v, (%v:)", t, src, n, origin(2)) + } if n == 0 { return dest } @@ -868,6 +1542,9 @@ func Xmemmove(t *TLS, dest, src uintptr, n types.Size_t) uintptr { // void * __builtin___memmove_chk (void *dest, const void *src, size_t n, size_t os); func X__builtin___memmove_chk(t *TLS, dest, src uintptr, n, os types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v src=%v os=%v, (%v:)", t, src, os, origin(2)) + } if os != ^types.Size_t(0) && os < n { Xabort(t) } @@ -877,6 +1554,9 @@ func X__builtin___memmove_chk(t *TLS, dest, src uintptr, n, os types.Size_t) uin // char *getenv(const char *name); func Xgetenv(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } return getenv(Environ(), GoString(name)) } @@ -901,6 +1581,9 @@ func getenv(p uintptr, nm string) uintptr { // char *strstr(const char *haystack, const char *needle); func Xstrstr(t *TLS, haystack, needle uintptr) uintptr { + if __ccgo_strace { + trc("t=%v needle=%v, (%v:)", t, needle, origin(2)) + } hs := GoString(haystack) nd := GoString(needle) if i := strings.Index(hs, nd); i >= 0 { @@ -913,11 +1596,18 @@ func Xstrstr(t *TLS, haystack, needle uintptr) uintptr { // int putc(int c, FILE *stream); func Xputc(t *TLS, c int32, fp uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v fp=%v, (%v:)", t, c, fp, origin(2)) + } return Xfputc(t, c, fp) } // int atoi(const char *nptr); func Xatoi(t *TLS, nptr uintptr) int32 { + if __ccgo_strace { + trc("t=%v nptr=%v, (%v:)", t, nptr, origin(2)) + } + _, neg, _, n, _ := strToUint64(t, nptr, 10) switch { case neg: @@ -929,6 +1619,9 @@ func Xatoi(t *TLS, nptr uintptr) int32 { // double atof(const char *nptr); func Xatof(t *TLS, nptr uintptr) float64 { + if __ccgo_strace { + trc("t=%v nptr=%v, (%v:)", t, nptr, origin(2)) + } n, _ := strToFloatt64(t, nptr, 64) // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(nptr), n) @@ -938,6 +1631,9 @@ func Xatof(t *TLS, nptr uintptr) float64 { // int tolower(int c); func Xtolower(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } if c >= 'A' && c <= 'Z' { return c + ('a' - 'A') } @@ -947,6 +1643,9 @@ func Xtolower(t *TLS, c int32) int32 { // int toupper(int c); func Xtoupper(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } if c >= 'a' && c <= 'z' { return c - ('a' - 'A') } @@ -956,11 +1655,17 @@ func Xtoupper(t *TLS, c int32) int32 { // int isatty(int fd); func Xisatty(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } return Bool32(isatty.IsTerminal(uintptr(fd))) } // long atol(const char *nptr); func Xatol(t *TLS, nptr uintptr) long { + if __ccgo_strace { + trc("t=%v nptr=%v, (%v:)", t, nptr, origin(2)) + } _, neg, _, n, _ := strToUint64(t, nptr, 10) switch { case neg: @@ -987,6 +1692,9 @@ func getLocalLocation() (loc *gotime.Location) { // time_t mktime(struct tm *tm); func Xmktime(t *TLS, ptm uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v ptm=%v, (%v:)", t, ptm, origin(2)) + } loc := getLocalLocation() tt := gotime.Date( int((*time.Tm)(unsafe.Pointer(ptm)).Ftm_year+1900), @@ -1005,6 +1713,9 @@ func Xmktime(t *TLS, ptm uintptr) time.Time_t { // char *strpbrk(const char *s, const char *accept); func Xstrpbrk(t *TLS, s, accept uintptr) uintptr { + if __ccgo_strace { + trc("t=%v accept=%v, (%v:)", t, accept, origin(2)) + } bits := newBits(256) for { b := *(*byte)(unsafe.Pointer(accept)) @@ -1031,6 +1742,9 @@ func Xstrpbrk(t *TLS, s, accept uintptr) uintptr { // int strcasecmp(const char *s1, const char *s2); func Xstrcasecmp(t *TLS, s1, s2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v s2=%v, (%v:)", t, s2, origin(2)) + } for { ch1 := *(*byte)(unsafe.Pointer(s1)) if ch1 >= 'a' && ch1 <= 'z' { @@ -1050,11 +1764,17 @@ func Xstrcasecmp(t *TLS, s1, s2 uintptr) int32 { } func Xntohs(t *TLS, netshort uint16) uint16 { + if __ccgo_strace { + trc("t=%v netshort=%v, (%v:)", t, netshort, origin(2)) + } return uint16((*[2]byte)(unsafe.Pointer(&netshort))[0])<<8 | uint16((*[2]byte)(unsafe.Pointer(&netshort))[1]) } // uint16_t htons(uint16_t hostshort); func Xhtons(t *TLS, hostshort uint16) uint16 { + if __ccgo_strace { + trc("t=%v hostshort=%v, (%v:)", t, hostshort, origin(2)) + } var a [2]byte a[0] = byte(hostshort >> 8) a[1] = byte(hostshort) @@ -1063,6 +1783,9 @@ func Xhtons(t *TLS, hostshort uint16) uint16 { // uint32_t htonl(uint32_t hostlong); func Xhtonl(t *TLS, hostlong uint32) uint32 { + if __ccgo_strace { + trc("t=%v hostlong=%v, (%v:)", t, hostlong, origin(2)) + } var a [4]byte a[0] = byte(hostlong >> 24) a[1] = byte(hostlong >> 16) @@ -1073,6 +1796,9 @@ func Xhtonl(t *TLS, hostlong uint32) uint32 { // FILE *fopen(const char *pathname, const char *mode); func Xfopen(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } return Xfopen64(t, pathname, mode) //TODO 32 bit } @@ -1084,6 +1810,9 @@ func Dmesg(s string, args ...interface{}) { // void sqlite3_log(int iErrCode, const char *zFormat, ...); func X__ccgo_sqlite3_log(t *TLS, iErrCode int32, zFormat uintptr, args uintptr) { + if __ccgo_strace { + trc("t=%v iErrCode=%v zFormat=%v args=%v, (%v:)", t, iErrCode, zFormat, args, origin(2)) + } // if dmesgs { // dmesg("%v: iErrCode: %v, msg: %s\n%s", origin(1), iErrCode, printf(zFormat, args), debug.Stack()) // } @@ -1091,11 +1820,17 @@ func X__ccgo_sqlite3_log(t *TLS, iErrCode int32, zFormat uintptr, args uintptr) // int _IO_putc(int __c, _IO_FILE *__fp); func X_IO_putc(t *TLS, c int32, fp uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v fp=%v, (%v:)", t, c, fp, origin(2)) + } return Xputc(t, c, fp) } // int atexit(void (*function)(void)); func Xatexit(t *TLS, function uintptr) int32 { + if __ccgo_strace { + trc("t=%v function=%v, (%v:)", t, function, origin(2)) + } AtExit(func() { (*struct{ f func(*TLS) })(unsafe.Pointer(&struct{ uintptr }{function})).f(t) }) @@ -1104,6 +1839,9 @@ func Xatexit(t *TLS, function uintptr) int32 { // int vasprintf(char **strp, const char *fmt, va_list ap); func Xvasprintf(t *TLS, strp, fmt, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } @@ -1215,31 +1953,49 @@ func AtomicAddFloat64(addr *float64, delta float64) (new float64) { // size_t mbstowcs(wchar_t *dest, const char *src, size_t n); func Xmbstowcs(t *TLS, dest, src uintptr, n types.Size_t) types.Size_t { + if __ccgo_strace { + trc("t=%v src=%v n=%v, (%v:)", t, src, n, origin(2)) + } panic(todo("")) } // int mbtowc(wchar_t *pwc, const char *s, size_t n); func Xmbtowc(t *TLS, pwc, s uintptr, n types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v s=%v n=%v, (%v:)", t, s, n, origin(2)) + } panic(todo("")) } // size_t __ctype_get_mb_cur_max(void); func X__ctype_get_mb_cur_max(t *TLS) types.Size_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int wctomb(char *s, wchar_t wc); func Xwctomb(t *TLS, s uintptr, wc wchar_t) int32 { + if __ccgo_strace { + trc("t=%v s=%v wc=%v, (%v:)", t, s, wc, origin(2)) + } panic(todo("")) } // int mblen(const char *s, size_t n); func Xmblen(t *TLS, s uintptr, n types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v s=%v n=%v, (%v:)", t, s, n, origin(2)) + } panic(todo("")) } // ssize_t readv(int fd, const struct iovec *iov, int iovcnt); func Xreadv(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v iov=%v iovcnt=%v, (%v:)", t, fd, iov, iovcnt, origin(2)) + } panic(todo("")) } @@ -1248,11 +2004,17 @@ func Xreadv(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { // const struct termios *termp, // const struct winsize *winp); func Xopenpty(t *TLS, amaster, aslave, name, termp, winp uintptr) int32 { + if __ccgo_strace { + trc("t=%v winp=%v, (%v:)", t, winp, origin(2)) + } panic(todo("")) } // pid_t setsid(void); func Xsetsid(t *TLS) types.Pid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } @@ -1261,26 +2023,41 @@ func Xsetsid(t *TLS) types.Pid_t { // fd_set *exceptfds, const struct timespec *timeout, // const sigset_t *sigmask); func Xpselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout, sigmask uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v sigmask=%v, (%v:)", t, nfds, sigmask, origin(2)) + } panic(todo("")) } // int kill(pid_t pid, int sig); func Xkill(t *TLS, pid types.Pid_t, sig int32) int32 { + if __ccgo_strace { + trc("t=%v pid=%v sig=%v, (%v:)", t, pid, sig, origin(2)) + } panic(todo("")) } // int tcsendbreak(int fd, int duration); func Xtcsendbreak(t *TLS, fd, duration int32) int32 { + if __ccgo_strace { + trc("t=%v duration=%v, (%v:)", t, duration, origin(2)) + } panic(todo("")) } // int wcwidth(wchar_t c); func Xwcwidth(t *TLS, c wchar_t) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } panic(todo("")) } // int clock_gettime(clockid_t clk_id, struct timespec *tp); func Xclock_gettime(t *TLS, clk_id int32, tp uintptr) int32 { + if __ccgo_strace { + trc("t=%v clk_id=%v tp=%v, (%v:)", t, clk_id, tp, origin(2)) + } panic(todo("")) } @@ -1294,6 +2071,9 @@ func AtExit(f func()) { } func X__ccgo_dmesg(t *TLS, fmt uintptr, va uintptr) { + if __ccgo_strace { + trc("t=%v fmt=%v va=%v, (%v:)", t, fmt, va, origin(2)) + } if dmesgs { dmesg("%s", printf(fmt, va)) } @@ -1305,6 +2085,9 @@ func X__ccgo_dmesg(t *TLS, fmt uintptr, va uintptr) { // to the buffer starting at the location pointed to by buffer. The maximum // permitted value for the length argument is 256. func Xgetentropy(t *TLS, buffer uintptr, length size_t) int32 { + if __ccgo_strace { + trc("t=%v buffer=%v length=%v, (%v:)", t, buffer, length, origin(2)) + } const max = 256 switch { case length == 0: @@ -1327,6 +2110,9 @@ func Xgetentropy(t *TLS, buffer uintptr, length size_t) int32 { // void * reallocarray(void *ptr, size_t nmemb, size_t size); func Xreallocarray(t *TLS, ptr uintptr, nmemb, size size_t) uintptr { + if __ccgo_strace { + trc("t=%v ptr=%v size=%v, (%v:)", t, ptr, size, origin(2)) + } hi, lo := mathutil.MulUint128_64(uint64(nmemb), uint64(size)) if hi != 0 || lo > uint64(unsafe.Sizeof(RawMem{})) { t.setErrno(errno.ENOMEM) @@ -1338,11 +2124,17 @@ func Xreallocarray(t *TLS, ptr uintptr, nmemb, size size_t) uintptr { // int setjmp(jmp_buf env); func Xsetjmp(t *TLS, env uintptr) int32 { + if __ccgo_strace { + trc("t=%v env=%v, (%v:)", t, env, origin(2)) + } return 0 //TODO } // void longjmp(jmp_buf env, int val); func Xlongjmp(t *TLS, env uintptr, val int32) { + if __ccgo_strace { + trc("t=%v env=%v val=%v, (%v:)", t, env, val, origin(2)) + } panic(todo("")) } @@ -1354,36 +2146,57 @@ func Xlongjmp(t *TLS, env uintptr, val int32) { // int _setjmp(jmp_buf env); func X_setjmp(t *TLS, env uintptr) int32 { + if __ccgo_strace { + trc("t=%v env=%v, (%v:)", t, env, origin(2)) + } return 0 //TODO } // void _longjmp(jmp_buf env, int val); func X_longjmp(t *TLS, env uintptr, val int32) { + if __ccgo_strace { + trc("t=%v env=%v val=%v, (%v:)", t, env, val, origin(2)) + } panic(todo("")) } // unsigned __sync_add_and_fetch_uint32(*unsigned, unsigned) func X__sync_add_and_fetch_uint32(t *TLS, p uintptr, v uint32) uint32 { + if __ccgo_strace { + trc("t=%v p=%v v=%v, (%v:)", t, p, v, origin(2)) + } return atomic.AddUint32((*uint32)(unsafe.Pointer(p)), v) } // unsigned __sync_sub_and_fetch_uint32(*unsigned, unsigned) func X__sync_sub_and_fetch_uint32(t *TLS, p uintptr, v uint32) uint32 { + if __ccgo_strace { + trc("t=%v p=%v v=%v, (%v:)", t, p, v, origin(2)) + } return atomic.AddUint32((*uint32)(unsafe.Pointer(p)), -v) } // int sched_yield(void); func Xsched_yield(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } runtime.Gosched() } // int getc(FILE *stream); func Xgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return Xfgetc(t, stream) } // char *fgets(char *s, int size, FILE *stream); func Xfgets(t *TLS, s uintptr, size int32, stream uintptr) uintptr { + if __ccgo_strace { + trc("t=%v s=%v size=%v stream=%v, (%v:)", t, s, size, stream, origin(2)) + } var b []byte out: for ; size > 0; size-- { @@ -1408,6 +2221,9 @@ out: // void bzero(void *s, size_t n); func Xbzero(t *TLS, s uintptr, n types.Size_t) { + if __ccgo_strace { + trc("t=%v s=%v n=%v, (%v:)", t, s, n, origin(2)) + } b := (*RawMem)(unsafe.Pointer(s))[:n] for i := range b { b[i] = 0 @@ -1416,6 +2232,9 @@ func Xbzero(t *TLS, s uintptr, n types.Size_t) { // char *rindex(const char *s, int c); func Xrindex(t *TLS, s uintptr, c int32) uintptr { + if __ccgo_strace { + trc("t=%v s=%v c=%v, (%v:)", t, s, c, origin(2)) + } if s == 0 { return 0 } @@ -1437,9 +2256,62 @@ func Xrindex(t *TLS, s uintptr, c int32) uintptr { // int isascii(int c); func Xisascii(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } return Bool32(c >= 0 && c <= 0x7f) } func X__builtin_isunordered(t *TLS, a, b float64) int32 { + if __ccgo_strace { + trc("t=%v b=%v, (%v:)", t, b, origin(2)) + } return Bool32(math.IsNaN(a) || math.IsNaN(b)) } + +func AtomicLoadNUint16(ptr uintptr, memorder int32) uint16 { + atomicLoadStore16.Lock() + r := *(*uint16)(unsafe.Pointer(ptr)) + atomicLoadStore16.Unlock() + return r +} + +func PreIncAtomicInt32P(p uintptr, d int32) int32 { + return atomic.AddInt32((*int32)(unsafe.Pointer(p)), d) +} + +func PreIncAtomicInt64P(p uintptr, d int64) int64 { + return atomic.AddInt64((*int64)(unsafe.Pointer(p)), d) +} + +func PreIncAtomicUint32P(p uintptr, d uint32) uint32 { + return atomic.AddUint32((*uint32)(unsafe.Pointer(p)), d) +} + +func PreIncAtomicUint64P(p uintptr, d uint64) uint64 { + return atomic.AddUint64((*uint64)(unsafe.Pointer(p)), d) +} + +func PreInrAtomicUintptrP(p uintptr, d uintptr) uintptr { + return atomic.AddUintptr((*uintptr)(unsafe.Pointer(p)), d) +} + +func X__builtin_ffs(tls *TLS, i int32) (r int32) { + if __ccgo_strace { + trc("tls=%v i=%v, (%v:)", tls, i, origin(2)) + defer func() { trc("-> %v", r) }() + } + return Xffs(tls, i) +} + +func Xffs(tls *TLS, i int32) (r int32) { + if __ccgo_strace { + trc("tls=%v i=%v, (%v:)", tls, i, origin(2)) + defer func() { trc("-> %v", r) }() + } + if i == 0 { + return 0 + } + + return int32(mbits.TrailingZeros32(uint32(i))) + 1 +} diff --git a/vendor/modernc.org/libc/libc32.go b/vendor/modernc.org/libc/libc32.go index 06072848..b0943d25 100644 --- a/vendor/modernc.org/libc/libc32.go +++ b/vendor/modernc.org/libc/libc32.go @@ -7,6 +7,13 @@ package libc // import "modernc.org/libc" +import ( + "unsafe" + + "modernc.org/libc/limits" + "modernc.org/libc/sys/types" +) + const ( heapSize = 1 << 30 // Adjust for your debugging session requirements and system RAM size. ) @@ -28,3 +35,48 @@ type bits []int func newBits(n int) (r bits) { return make(bits, (n+31)>>5) } func (b bits) has(n int) bool { return b != nil && b[n>>5]&(1<>5] |= 1 << uint(n&31) } + +func Xstrchrnul(tls *TLS, s uintptr, c int32) (r uintptr) { + return x___strchrnul(tls, s, c) +} + +func x___strchrnul(tls *TLS, s uintptr, c int32) (r uintptr) { + var k types.Size_t + var w uintptr + _, _ = k, w + c = int32(uint8(c)) + if !(c != 0) { + return s + uintptr(Xstrlen(tls, s)) + } + for { + if !(uint32(s)%Uint32FromInt64(4) != 0) { + break + } + if !(*(*int8)(unsafe.Pointer(s)) != 0) || int32(*(*uint8)(unsafe.Pointer(s))) == c { + return s + } + goto _1 + _1: + s++ + } + k = uint32(-Int32FromInt32(1)) / Uint32FromInt32(limits.UCHAR_MAX) * uint32(c) + w = s + for { + if !(!((*(*uint32)(unsafe.Pointer(w))-uint32(-Int32FromInt32(1))/Uint32FromInt32(limits.UCHAR_MAX)) & ^*(*uint32)(unsafe.Pointer(w)) & (uint32(-Int32FromInt32(1))/Uint32FromInt32(limits.UCHAR_MAX)*uint32(Int32FromInt32(limits.UCHAR_MAX)/Int32FromInt32(2)+Int32FromInt32(1))) != 0) && !((*(*uint32)(unsafe.Pointer(w))^k-uint32(-Int32FromInt32(1))/Uint32FromInt32(limits.UCHAR_MAX)) & ^(*(*uint32)(unsafe.Pointer(w))^k) & (uint32(-Int32FromInt32(1))/Uint32FromInt32(limits.UCHAR_MAX)*uint32(Int32FromInt32(limits.UCHAR_MAX)/Int32FromInt32(2)+Int32FromInt32(1))) != 0)) { + break + } + goto _2 + _2: + w += 4 + } + s = w + for { + if !(*(*int8)(unsafe.Pointer(s)) != 0 && int32(*(*uint8)(unsafe.Pointer(s))) != c) { + break + } + goto _3 + _3: + s++ + } + return s +} diff --git a/vendor/modernc.org/libc/libc64.go b/vendor/modernc.org/libc/libc64.go index 01690fe8..8e77fb40 100644 --- a/vendor/modernc.org/libc/libc64.go +++ b/vendor/modernc.org/libc/libc64.go @@ -7,6 +7,13 @@ package libc // import "modernc.org/libc" +import ( + "unsafe" + + "modernc.org/libc/limits" + "modernc.org/libc/sys/types" +) + const ( heapSize = 2 << 30 // Adjust for your debugging session requirements and system RAM size. ) @@ -26,3 +33,48 @@ type bits []int func newBits(n int) (r bits) { return make(bits, (n+63)>>6) } func (b bits) has(n int) bool { return b != nil && b[n>>6]&(1<>6] |= 1 << uint(n&63) } + +func Xstrchrnul(tls *TLS, s uintptr, c int32) (r uintptr) { + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + defer func() { trc("-> %v", r) }() + } + var k types.Size_t + var w uintptr + _, _ = k, w + c = int32(uint8(uint8(c))) + if !(c != 0) { + return s + uintptr(Xstrlen(tls, s)) + } + for { + if !(uint64(uint64(s))%Uint64FromInt64(8) != 0) { + break + } + if !(*(*int8)(unsafe.Pointer(s)) != 0) || int32(*(*uint8)(unsafe.Pointer(s))) == c { + return s + } + goto _1 + _1: + s++ + } + k = uint64(-Int32FromInt32(1)) / Uint64FromInt32(limits.UCHAR_MAX) * uint64(uint64(c)) + w = s + for { + if !(!((*(*uint64)(unsafe.Pointer(w))-uint64(-Int32FromInt32(1))/Uint64FromInt32(limits.UCHAR_MAX)) & ^*(*uint64)(unsafe.Pointer(w)) & (uint64(-Int32FromInt32(1))/Uint64FromInt32(limits.UCHAR_MAX)*uint64(Int32FromInt32(limits.UCHAR_MAX)/Int32FromInt32(2)+Int32FromInt32(1))) != 0) && !((*(*uint64)(unsafe.Pointer(w))^k-uint64(-Int32FromInt32(1))/Uint64FromInt32(limits.UCHAR_MAX)) & ^(*(*uint64)(unsafe.Pointer(w))^k) & (uint64(-Int32FromInt32(1))/Uint64FromInt32(limits.UCHAR_MAX)*uint64(Int32FromInt32(limits.UCHAR_MAX)/Int32FromInt32(2)+Int32FromInt32(1))) != 0)) { + break + } + goto _2 + _2: + w += 8 + } + s = w + for { + if !(*(*int8)(unsafe.Pointer(s)) != 0 && int32(*(*uint8)(unsafe.Pointer(s))) != c) { + break + } + goto _3 + _3: + s++ + } + return s +} diff --git a/vendor/modernc.org/libc/libc_amd64.go b/vendor/modernc.org/libc/libc_amd64.go new file mode 100644 index 00000000..c17aee5c --- /dev/null +++ b/vendor/modernc.org/libc/libc_amd64.go @@ -0,0 +1,24 @@ +// Copyright 2023 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package libc // import "modernc.org/libc" + +import ( + "fmt" + "unsafe" +) + +// Byte loads are atomic on this CPU. +func a_load_8(addr uintptr) uint32 { + return uint32(*(*byte)(unsafe.Pointer(addr))) +} + +// int16 loads are atomic on this CPU when properly aligned. +func a_load_16(addr uintptr) uint32 { + if addr&1 != 0 { + panic(fmt.Errorf("unaligned atomic 16 bit access at %#0x", addr)) + } + + return uint32(*(*uint16)(unsafe.Pointer(addr))) +} diff --git a/vendor/modernc.org/libc/libc_darwin.go b/vendor/modernc.org/libc/libc_darwin.go index 334bf8fe..0dc83330 100644 --- a/vendor/modernc.org/libc/libc_darwin.go +++ b/vendor/modernc.org/libc/libc_darwin.go @@ -121,24 +121,50 @@ func fwrite(fd int32, b []byte) (int, error) { return unix.Write(int(fd), b) } -func X__inline_isnand(t *TLS, x float64) int32 { return Xisnan(t, x) } -func X__inline_isnanf(t *TLS, x float32) int32 { return Xisnanf(t, x) } -func X__inline_isnanl(t *TLS, x float64) int32 { return Xisnan(t, x) } +func X__inline_isnand(t *TLS, x float64) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Xisnan(t, x) +} + +func X__inline_isnanf(t *TLS, x float32) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Xisnanf(t, x) +} + +func X__inline_isnanl(t *TLS, x float64) int32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return Xisnan(t, x) +} // int fprintf(FILE *stream, const char *format, ...); func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } n, _ := fwrite(int32((*stdio.FILE)(unsafe.Pointer(stream)).F_file), printf(format, args)) return int32(n) } // int usleep(useconds_t usec); func Xusleep(t *TLS, usec types.Useconds_t) int32 { + if __ccgo_strace { + trc("t=%v usec=%v, (%v:)", t, usec, origin(2)) + } gotime.Sleep(gotime.Microsecond * gotime.Duration(usec)) return 0 } // int futimes(int fd, const struct timeval tv[2]); func Xfutimes(t *TLS, fd int32, tv uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v tv=%v, (%v:)", t, fd, tv, origin(2)) + } var a []unix.Timeval if tv != 0 { a = make([]unix.Timeval, 2) @@ -161,11 +187,17 @@ func Xfutimes(t *TLS, fd int32, tv uintptr) int32 { // void srandomdev(void); func Xsrandomdev(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int gethostuuid(uuid_t id, const struct timespec *wait); func Xgethostuuid(t *TLS, id uintptr, wait uintptr) int32 { + if __ccgo_strace { + trc("t=%v id=%v wait=%v, (%v:)", t, id, wait, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETHOSTUUID, id, wait, 0); err != 0 { // Cannot avoid the syscall here. if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -182,6 +214,9 @@ func Xgethostuuid(t *TLS, id uintptr, wait uintptr) int32 { // int flock(int fd, int operation); func Xflock(t *TLS, fd, operation int32) int32 { + if __ccgo_strace { + trc("t=%v operation=%v, (%v:)", t, operation, origin(2)) + } if err := unix.Flock(int(fd), int(operation)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -198,6 +233,9 @@ func Xflock(t *TLS, fd, operation int32) int32 { // int fsctl(const char *,unsigned long,void*,unsigned int); func Xfsctl(t *TLS, path uintptr, request ulong, data uintptr, options uint32) int32 { + if __ccgo_strace { + trc("t=%v path=%v request=%v data=%v options=%v, (%v:)", t, path, request, data, options, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall6(unix.SYS_FSCTL, path, uintptr(request), data, uintptr(options), 0, 0); err != 0 { // t.setErrno(err) @@ -209,16 +247,25 @@ func Xfsctl(t *TLS, path uintptr, request ulong, data uintptr, options uint32) i // int * __error(void); func X__error(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return t.errnop } // int isspace(int c); func Xisspace(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } return __isspace(t, c) } // void __assert_rtn(const char *, const char *, int, const char *) func X__assert_rtn(t *TLS, function, file uintptr, line int32, assertion uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v assertion=%v, (%v:)", t, file, line, assertion, origin(2)) + } panic(todo("")) // fmt.Fprintf(os.Stderr, "assertion failure: %s:%d.%s: %s\n", GoString(file), line, GoString(function), GoString(assertion)) // os.Stderr.Sync() @@ -227,6 +274,9 @@ func X__assert_rtn(t *TLS, function, file uintptr, line int32, assertion uintptr // int getrusage(int who, struct rusage *usage); func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if __ccgo_strace { + trc("t=%v who=%v usage=%v, (%v:)", t, who, usage, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { // t.setErrno(err) @@ -238,6 +288,9 @@ func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { // int fgetc(FILE *stream); func Xfgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } fd := int((*stdio.FILE)(unsafe.Pointer(stream)).F_file) var buf [1]byte if n, _ := unix.Read(fd, buf[:]); n != 0 { @@ -249,16 +302,25 @@ func Xfgetc(t *TLS, stream uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xlstat64(t, pathname, statbuf) } // int stat(const char *pathname, struct stat *statbuf); func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xstat64(t, pathname, statbuf) } // int chdir(const char *path); func Xchdir(t *TLS, path uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v, (%v:)", t, path, origin(2)) + } if err := unix.Chdir(GoString(path)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -311,6 +373,9 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { // int open(const char *pathname, int flags, ...); func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } var mode types.Mode_t if args != 0 { mode = (types.Mode_t)(VaUint32(&args)) @@ -332,6 +397,9 @@ func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { // off_t lseek(int fd, off_t offset, int whence); func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } return types.Off_t(Xlseek64(t, fd, offset, whence)) } @@ -352,6 +420,9 @@ var fsyncStatbuf stat.Stat // int fsync(int fd); func Xfsync(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if noFsync { // Simulate -DSQLITE_NO_SYNC for sqlite3 testfixture, see function full_sync in sqlite3.c return Xfstat(t, fd, uintptr(unsafe.Pointer(&fsyncStatbuf))) @@ -373,6 +444,9 @@ func Xfsync(t *TLS, fd int32) int32 { // long sysconf(int name); func Xsysconf(t *TLS, name int32) long { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } switch name { case unistd.X_SC_PAGESIZE: return long(unix.Getpagesize()) @@ -385,6 +459,9 @@ func Xsysconf(t *TLS, name int32) long { // int close(int fd); func Xclose(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if err := unix.Close(int(fd)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -401,6 +478,9 @@ func Xclose(t *TLS, fd int32) int32 { // char *getcwd(char *buf, size_t size); func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } if _, err := unix.Getcwd((*RawMem)(unsafe.Pointer(buf))[:size:size]); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -417,11 +497,17 @@ func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { // int fstat(int fd, struct stat *statbuf); func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } return Xfstat64(t, fd, statbuf) } // int ftruncate(int fd, off_t length); func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if err := unix.Ftruncate(int(fd), int64(length)); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -438,11 +524,17 @@ func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } return Xfcntl64(t, fd, cmd, args) } // ssize_t read(int fd, void *buf, size_t count); func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } var n int var err error switch { @@ -470,6 +562,9 @@ func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // ssize_t write(int fd, const void *buf, size_t count); func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } var n int var err error switch { @@ -497,6 +592,9 @@ func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // int fchmod(int fd, mode_t mode); func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } if err := unix.Fchmod(int(fd), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %d %#o: %v FAIL", origin(1), fd, mode, err) @@ -513,6 +611,9 @@ func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { // int fchown(int fd, uid_t owner, gid_t group); func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v owner=%v group=%v, (%v:)", t, fd, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHOWN, uintptr(fd), uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -523,6 +624,9 @@ func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { // uid_t geteuid(void); func Xgeteuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r := types.Uid_t(unix.Geteuid()) if dmesgs { dmesg("%v: %v", origin(1), r) @@ -532,6 +636,9 @@ func Xgeteuid(t *TLS) types.Uid_t { // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } // Cannot avoid the syscall here, addr sometimes matter. data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { @@ -550,6 +657,9 @@ func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, off // int munmap(void *addr, size_t length); func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v addr=%v length=%v, (%v:)", t, addr, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { // Cannot avoid the syscall here, must pair with mmap. if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -563,6 +673,9 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if __ccgo_strace { + trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) + } if tz != 0 { panic(todo("")) } @@ -583,6 +696,9 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { // int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optlen=%v, (%v:)", t, optname, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 { t.setErrno(err) return -1 @@ -593,6 +709,9 @@ func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) i // int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optval=%v optlen=%v, (%v:)", t, optname, optval, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 { t.setErrno(err) return -1 @@ -603,6 +722,9 @@ func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen so // int ioctl(int fd, unsigned long request, ...); func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v request=%v va=%v, (%v:)", t, fd, request, va, origin(2)) + } var argp uintptr if va != 0 { argp = VaUintptr(&va) @@ -618,6 +740,9 @@ func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { // int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETSOCKNAME, uintptr(sockfd), addr, addrlen); err != 0 { // Cannot avoid the syscall here. if dmesgs { dmesg("%v: fd %v: %v FAIL", origin(1), sockfd, err) @@ -634,6 +759,9 @@ func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { // int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v timeout=%v, (%v:)", t, nfds, timeout, origin(2)) + } n, err := unix.Select( int(nfds), (*unix.FdSet)(unsafe.Pointer(readfds)), @@ -657,6 +785,9 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) // int mkfifo(const char *pathname, mode_t mode); func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Mkfifo(GoString(pathname), uint32(mode)); err != nil { t.setErrno(err) return -1 @@ -667,6 +798,9 @@ func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // mode_t umask(mode_t mask); func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + if __ccgo_strace { + trc("t=%v mask=%v, (%v:)", t, mask, origin(2)) + } return types.Mode_t(unix.Umask(int(mask))) } @@ -682,6 +816,9 @@ func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { // pid_t (pid_t pid, int *wstatus, int options); func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + if __ccgo_strace { + trc("t=%v pid=%v wstatus=%v optname=%v, (%v:)", t, pid, wstatus, optname, origin(2)) + } n, err := unix.Wait4(int(pid), (*unix.WaitStatus)(unsafe.Pointer(wstatus)), int(optname), nil) if err != nil { if dmesgs { @@ -699,6 +836,9 @@ func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid // int uname(struct utsname *buf); func Xuname(t *TLS, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } if err := unix.Uname((*unix.Utsname)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -715,6 +855,9 @@ func Xuname(t *TLS, buf uintptr) int32 { // ssize_t recv(int sockfd, void *buf, size_t len, int flags); func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -726,6 +869,9 @@ func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // ssize_t send(int sockfd, const void *buf, size_t len, int flags); func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -737,6 +883,9 @@ func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // int shutdown(int sockfd, int how); func Xshutdown(t *TLS, sockfd, how int32) int32 { + if __ccgo_strace { + trc("t=%v how=%v, (%v:)", t, how, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { t.setErrno(err) return -1 @@ -747,6 +896,9 @@ func Xshutdown(t *TLS, sockfd, how int32) int32 { // int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -757,6 +909,9 @@ func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int socket(int domain, int type, int protocol); func Xsocket(t *TLS, domain, type1, protocol int32) int32 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol)) if err != 0 { t.setErrno(err) @@ -768,6 +923,9 @@ func Xsocket(t *TLS, domain, type1, protocol int32) int32 { // int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen)) if err != 0 { t.setErrno(err) @@ -779,6 +937,9 @@ func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -789,6 +950,9 @@ func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int listen(int sockfd, int backlog); func Xlisten(t *TLS, sockfd, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v backlog=%v, (%v:)", t, backlog, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 { t.setErrno(err) return -1 @@ -799,6 +963,9 @@ func Xlisten(t *TLS, sockfd, backlog int32) int32 { // int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall6(unix.SYS_ACCEPT4, uintptr(sockfd), addr, uintptr(addrlen), 0, 0, 0) // if err != 0 { @@ -831,6 +998,9 @@ func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // uid_t getuid(void); func Xgetuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r := types.Uid_t(os.Getuid()) if dmesgs { dmesg("%v: %v", origin(1), r) @@ -840,6 +1010,9 @@ func Xgetuid(t *TLS) types.Uid_t { // pid_t getpid(void); func Xgetpid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r := int32(os.Getpid()) if dmesgs { dmesg("%v: %v", origin(1), r) @@ -849,6 +1022,9 @@ func Xgetpid(t *TLS) int32 { // int system(const char *command); func Xsystem(t *TLS, command uintptr) int32 { + if __ccgo_strace { + trc("t=%v command=%v, (%v:)", t, command, origin(2)) + } s := GoString(command) if command == 0 { panic(todo("")) @@ -868,11 +1044,17 @@ func Xsystem(t *TLS, command uintptr) int32 { // int setvbuf(FILE *stream, char *buf, int mode, size_t size); func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v mode=%v size=%v, (%v:)", t, buf, mode, size, origin(2)) + } return 0 //TODO } // int raise(int sig); func Xraise(t *TLS, sig int32) int32 { + if __ccgo_strace { + trc("t=%v sig=%v, (%v:)", t, sig, origin(2)) + } panic(todo("")) } @@ -888,6 +1070,9 @@ func Xraise(t *TLS, sig int32) int32 { // int fileno(FILE *stream); func Xfileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if stream == 0 { if dmesgs { dmesg("%v: FAIL", origin(1)) @@ -961,6 +1146,9 @@ func (f *ftstream) close(t *TLS) { // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } f := &ftstream{} var walk func(string) @@ -1065,6 +1253,9 @@ func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr // FTSENT *fts_read(FTS *ftsp); func Xfts_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } f := getObject(ftsp).(*ftstream) if f.x == len(f.s) { if dmesgs { @@ -1087,6 +1278,9 @@ func Xfts_read(t *TLS, ftsp uintptr) uintptr { // int fts_close(FTS *ftsp); func Xfts_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } getObject(ftsp).(*ftstream).close(t) removeObject(ftsp) return 0 @@ -1094,41 +1288,65 @@ func Xfts_close(t *TLS, ftsp uintptr) int32 { // void tzset (void); func Xtzset(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } //TODO } // char *strerror(int errnum); func Xstrerror(t *TLS, errnum int32) uintptr { + if __ccgo_strace { + trc("t=%v errnum=%v, (%v:)", t, errnum, origin(2)) + } panic(todo("")) } // void *dlopen(const char *filename, int flags); func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + if __ccgo_strace { + trc("t=%v filename=%v flags=%v, (%v:)", t, filename, flags, origin(2)) + } panic(todo("")) } // char *dlerror(void); func Xdlerror(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int dlclose(void *handle); func Xdlclose(t *TLS, handle uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } panic(todo("")) } // void *dlsym(void *handle, const char *symbol); func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + if __ccgo_strace { + trc("t=%v symbol=%v, (%v:)", t, symbol, origin(2)) + } panic(todo("")) } // void perror(const char *s); func Xperror(t *TLS, s uintptr) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func Xpclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -1136,6 +1354,9 @@ func Xpclose(t *TLS, stream uintptr) int32 { // const char *gai_strerror(int errcode); func Xgai_strerror(t *TLS, errcode int32) uintptr { + if __ccgo_strace { + trc("t=%v errcode=%v, (%v:)", t, errcode, origin(2)) + } panic(todo("")) // copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) // return uintptr(unsafe.Pointer(&gai_strerrorBuf)) @@ -1143,16 +1364,25 @@ func Xgai_strerror(t *TLS, errcode int32) uintptr { // int tcgetattr(int fd, struct termios *termios_p); func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v termios_p=%v, (%v:)", t, fd, termios_p, origin(2)) + } panic(todo("")) } // int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v optional_actions=%v termios_p=%v, (%v:)", t, optional_actions, termios_p, origin(2)) + } panic(todo("")) } // speed_t cfgetospeed(const struct termios *termios_p); func Xcfgetospeed(t *TLS, termios_p uintptr) termios.Speed_t { + if __ccgo_strace { + trc("t=%v termios_p=%v, (%v:)", t, termios_p, origin(2)) + } panic(todo("")) } @@ -1170,6 +1400,9 @@ func Xcfsetispeed(...interface{}) int32 { // pid_t fork(void); func Xfork(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } if dmesgs { dmesg("%v: FAIL", origin(1)) } @@ -1181,21 +1414,33 @@ var emptyStr = [1]byte{} // char *setlocale(int category, const char *locale); func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + if __ccgo_strace { + trc("t=%v category=%v locale=%v, (%v:)", t, category, locale, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // char *nl_langinfo(nl_item item); func Xnl_langinfo(t *TLS, item langinfo.Nl_item) uintptr { + if __ccgo_strace { + trc("t=%v item=%v, (%v:)", t, item, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // FILE *popen(const char *command, const char *type); func Xpopen(t *TLS, command, type1 uintptr) uintptr { + if __ccgo_strace { + trc("t=%v type1=%v, (%v:)", t, type1, origin(2)) + } panic(todo("")) } // char *realpath(const char *path, char *resolved_path); func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + if __ccgo_strace { + trc("t=%v resolved_path=%v, (%v:)", t, resolved_path, origin(2)) + } s, err := filepath.EvalSymlinks(GoString(path)) if err != nil { if os.IsNotExist(err) { @@ -1227,20 +1472,32 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { // struct tm *gmtime_r(const time_t *timep, struct tm *result); func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } panic(todo("")) } // char *inet_ntoa(struct in_addr in); func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func X__ccgo_in6addr_anyp(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) // return uintptr(unsafe.Pointer(&in6_addr_any)) } func Xabort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } if dmesgs { dmesg("%v:", origin(1)) } @@ -1258,11 +1515,17 @@ func Xabort(t *TLS) { // int fflush(FILE *stream); func Xfflush(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return 0 //TODO } // size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } fd := uintptr(file(stream).fd()) count := size * nmemb var n int @@ -1292,6 +1555,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types // size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } fd := uintptr(file(stream).fd()) count := size * nmemb var n int @@ -1321,6 +1587,9 @@ func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) type // int fclose(FILE *stream); func Xfclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } r := file(stream).close(t) if r != 0 { if dmesgs { @@ -1338,6 +1607,9 @@ func Xfclose(t *TLS, stream uintptr) int32 { // int fputc(int c, FILE *stream); func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } if _, err := fwrite(file(stream).fd(), []byte{byte(c)}); err != nil { return stdio.EOF } @@ -1347,6 +1619,9 @@ func Xfputc(t *TLS, c int32, stream uintptr) int32 { // int fseek(FILE *stream, long offset, int whence); func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if __ccgo_strace { + trc("t=%v stream=%v offset=%v whence=%v, (%v:)", t, stream, offset, whence, origin(2)) + } if n := Xlseek(t, int32(file(stream).fd()), types.Off_t(offset), whence); n < 0 { if dmesgs { dmesg("%v: fd %v, off %#x, whence %v: %v", origin(1), file(stream).fd(), offset, whenceStr(whence), n) @@ -1363,6 +1638,9 @@ func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { // long ftell(FILE *stream); func Xftell(t *TLS, stream uintptr) long { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } n := Xlseek(t, file(stream).fd(), 0, stdio.SEEK_CUR) if n < 0 { file(stream).setErr() @@ -1377,11 +1655,17 @@ func Xftell(t *TLS, stream uintptr) long { // int ferror(FILE *stream); func Xferror(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return Bool32(file(stream).err()) } // int fputs(const char *s, FILE *stream); func Xfputs(t *TLS, s, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { // return -1 @@ -1394,6 +1678,9 @@ var getservbynameStaticResult netdb.Servent // struct servent *getservbyname(const char *name, const char *proto); func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { + if __ccgo_strace { + trc("t=%v proto=%v, (%v:)", t, proto, origin(2)) + } var protoent *gonetdb.Protoent if proto != 0 { protoent = gonetdb.GetProtoByName(GoString(proto)) @@ -1528,6 +1815,9 @@ func fcntlCmdStr(cmd int32) string { // ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); func Xpwrite(t *TLS, fd int32, buf uintptr, count types.Size_t, offset types.Off_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v offset=%v, (%v:)", t, fd, buf, count, offset, origin(2)) + } var n int var err error switch { @@ -1555,11 +1845,17 @@ func Xpwrite(t *TLS, fd int32, buf uintptr, count types.Size_t, offset types.Off // char***_NSGetEnviron() func X_NSGetEnviron(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return EnvironP() } // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint32) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1576,6 +1872,9 @@ func Xchflags(t *TLS, path uintptr, flags uint32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Rmdir(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1592,6 +1891,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // uint64_t mach_absolute_time(void); func Xmach_absolute_time(t *TLS) uint64 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return uint64(gotime.Now().UnixNano()) } @@ -1603,12 +1905,18 @@ type machTimebaseInfo = struct { // kern_return_t mach_timebase_info(mach_timebase_info_t info); func Xmach_timebase_info(t *TLS, info uintptr) int32 { + if __ccgo_strace { + trc("t=%v info=%v, (%v:)", t, info, origin(2)) + } *(*machTimebaseInfo)(unsafe.Pointer(info)) = machTimebaseInfo{Fnumer: 1, Fdenom: 1} return 0 } // int getattrlist(const char* path, struct attrlist * attrList, void * attrBuf, size_t attrBufSize, unsigned long options); func Xgetattrlist(t *TLS, path, attrList, attrBuf uintptr, attrBufSize types.Size_t, options uint32) int32 { + if __ccgo_strace { + trc("t=%v attrBuf=%v attrBufSize=%v options=%v, (%v:)", t, attrBuf, attrBufSize, options, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_GETATTRLIST, path, attrList, attrBuf, uintptr(attrBufSize), uintptr(options), 0); err != 0 { // Cannot avoid the syscall here. if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1625,6 +1933,9 @@ func Xgetattrlist(t *TLS, path, attrList, attrBuf uintptr, attrBufSize types.Siz // int setattrlist(const char* path, struct attrlist * attrList, void * attrBuf, size_t attrBufSize, unsigned long options); func Xsetattrlist(t *TLS, path, attrList, attrBuf uintptr, attrBufSize types.Size_t, options uint32) int32 { + if __ccgo_strace { + trc("t=%v attrBuf=%v attrBufSize=%v options=%v, (%v:)", t, attrBuf, attrBufSize, options, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_SETATTRLIST, path, attrList, attrBuf, uintptr(attrBufSize), uintptr(options), 0); err != 0 { // Cannot avoid the syscall here. if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1660,6 +1971,9 @@ type darwinDir struct { // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") @@ -1688,6 +2002,9 @@ func Xopendir(t *TLS, name uintptr) uintptr { // struct dirent *readdir(DIR *dirp); func Xreaddir(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } if (*darwinDir)(unsafe.Pointer(dir)).eof { return 0 } @@ -1719,6 +2036,9 @@ func Xreaddir(t *TLS, dir uintptr) uintptr { } func Xclosedir(t *TLS, dir uintptr) int32 { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } // trc("---- closedir: %#x", dir) r := Xclose(t, int32((*darwinDir)(unsafe.Pointer(dir)).fd)) Xfree(t, dir) @@ -1727,6 +2047,9 @@ func Xclosedir(t *TLS, dir uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } var a [2]int if err := syscall.Pipe(a[:]); err != nil { if dmesgs { @@ -1745,6 +2068,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int __isoc99_sscanf(const char *str, const char *format, ...); func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1754,6 +2080,9 @@ func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { // int sscanf(const char *str, const char *format, ...); func Xsscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1763,26 +2092,41 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 { // int posix_fadvise(int fd, off_t offset, off_t len, int advice); func Xposix_fadvise(t *TLS, fd int32, offset, len types.Off_t, advice int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v len=%v advice=%v, (%v:)", t, fd, len, advice, origin(2)) + } panic(todo("")) } // clock_t clock(void); func Xclock(t *TLS) time.Clock_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return time.Clock_t(gotime.Since(startTime) * gotime.Duration(time.CLOCKS_PER_SEC) / gotime.Second) } // int iswspace(wint_t wc); func Xiswspace(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsSpace(rune(wc))) } // int iswalnum(wint_t wc); func Xiswalnum(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsLetter(rune(wc)) || unicode.IsNumber(rune(wc))) } // void arc4random_buf(void *buf, size_t nbytes); func Xarc4random_buf(t *TLS, buf uintptr, buflen size_t) { + if __ccgo_strace { + trc("t=%v buf=%v buflen=%v, (%v:)", t, buf, buflen, origin(2)) + } if _, err := crand.Read((*RawMem)(unsafe.Pointer(buf))[:buflen]); err != nil { panic(todo("")) } @@ -1799,35 +2143,59 @@ type darwin_mutex_t struct { } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return (int32((*darwin_mutexattr_t)(unsafe.Pointer(a)).x[4] >> 2 & 3)) } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return (int32((*darwin_mutex_t)(unsafe.Pointer(m)).x[4] >> 2 & 3)) } func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } panic(todo("")) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } panic(todo("")) } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } panic(todo("")) } func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*darwin_mutexattr_t)(unsafe.Pointer(a)) = darwin_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return errno.EINVAL } @@ -1837,6 +2205,9 @@ func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { // ssize_t writev(int fd, const struct iovec *iov, int iovcnt); func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v iov=%v iovcnt=%v, (%v:)", t, fd, iov, iovcnt, origin(2)) + } // if dmesgs { // dmesg("%v: fd %v iov %#x iovcnt %v", origin(1), fd, iov, iovcnt) // } @@ -1854,6 +2225,9 @@ func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { // int pause(void); func Xpause(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } c := make(chan os.Signal) gosignal.Notify(c, syscall.SIGABRT, @@ -1911,6 +2285,9 @@ func Xpause(t *TLS) int32 { // (_p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] |= ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)))); // } func X__darwin_fd_set(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:12:1: */ + if __ccgo_strace { + trc("tls=%v _fd=%v _p=%v, (%v:)", tls, _fd, _p, origin(2)) + } *(*int32)(unsafe.Pointer(_p + uintptr(uint64(_fd)/(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))*4)) |= int32(uint64(uint64(1)) << (uint64(_fd) % (uint64(unsafe.Sizeof(int32(0))) * uint64(8)))) return int32(0) } @@ -1921,6 +2298,9 @@ func X__darwin_fd_set(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:12:1: * // return _p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] & ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS))); // } func X__darwin_fd_isset(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:17:1: */ + if __ccgo_strace { + trc("tls=%v _fd=%v _p=%v, (%v:)", tls, _fd, _p, origin(2)) + } return *(*int32)(unsafe.Pointer(_p + uintptr(uint64(_fd)/(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))*4)) & int32(uint64(uint64(1))<<(uint64(_fd)%(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))) } @@ -1930,17 +2310,26 @@ func X__darwin_fd_isset(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:17:1: // (_p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] &= ~((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)))); // } func X__darwin_fd_clr(tls *TLS, _fd int32, _p uintptr) int32 { /* main.c:22:1: */ + if __ccgo_strace { + trc("tls=%v _fd=%v _p=%v, (%v:)", tls, _fd, _p, origin(2)) + } *(*int32)(unsafe.Pointer(_p + uintptr(uint64(_fd)/(uint64(unsafe.Sizeof(int32(0)))*uint64(8)))*4)) &= ^int32(uint64(uint64(1)) << (uint64(_fd) % (uint64(unsafe.Sizeof(int32(0))) * uint64(8)))) return int32(0) } // int ungetc(int c, FILE *stream); func Xungetc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } panic(todo("")) } // int issetugid(void); func Xissetugid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } @@ -1948,6 +2337,9 @@ var progname uintptr // const char *getprogname(void); func Xgetprogname(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } if progname != 0 { return progname } @@ -1964,11 +2356,17 @@ func Xgetprogname(t *TLS) uintptr { // void uuid_copy(uuid_t dst, uuid_t src); func Xuuid_copy(t *TLS, dst, src uintptr) { + if __ccgo_strace { + trc("t=%v src=%v, (%v:)", t, src, origin(2)) + } *(*uuid.Uuid_t)(unsafe.Pointer(dst)) = *(*uuid.Uuid_t)(unsafe.Pointer(src)) } // int uuid_parse( char *in, uuid_t uu); func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { + if __ccgo_strace { + trc("t=%v in=%v uu=%v, (%v:)", t, in, uu, origin(2)) + } r, err := guuid.Parse(GoString(in)) if err != nil { return -1 @@ -2004,15 +2402,24 @@ func X__sincospi_stret(t *TLS, f float64) struct{ F__sinval, F__cosval float64 } // int __srget(FILE *); func X__srget(t *TLS, f uintptr) int32 { + if __ccgo_strace { + trc("t=%v f=%v, (%v:)", t, f, origin(2)) + } panic(todo("")) } // int __svfscanf(FILE *, const char *, va_list) __scanflike(2, 0); func X__svfscanf(t *TLS, f uintptr, p, q uintptr) int32 { + if __ccgo_strace { + trc("t=%v f=%v q=%v, (%v:)", t, f, q, origin(2)) + } panic(todo("")) } // int __swbuf(int, FILE *); func X__swbuf(t *TLS, i int32, f uintptr) int32 { + if __ccgo_strace { + trc("t=%v i=%v f=%v, (%v:)", t, i, f, origin(2)) + } panic(todo("")) } diff --git a/vendor/modernc.org/libc/libc_darwin_amd64.go b/vendor/modernc.org/libc/libc_darwin_amd64.go index e8f46c49..5f3929e6 100644 --- a/vendor/modernc.org/libc/libc_darwin_amd64.go +++ b/vendor/modernc.org/libc/libc_darwin_amd64.go @@ -17,6 +17,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } var kact, koldact uintptr if act != 0 { sz := int(unsafe.Sizeof(signal.X__sigaction{})) @@ -44,6 +47,10 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + defer func() { trc("-> %v", r) }() + } var err error var p uintptr var i int @@ -76,6 +83,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) (r int32) { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -92,6 +102,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -108,6 +121,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstatfs(int fd, struct statfs *buf); func Xfstatfs(t *TLS, fd int32, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v, (%v:)", t, fd, buf, origin(2)) + } if err := unix.Fstatfs(int(fd), (*unix.Statfs_t)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %v: %v FAIL", origin(1), fd, err) @@ -124,6 +140,9 @@ func Xfstatfs(t *TLS, fd int32, buf uintptr) int32 { // int statfs(const char *path, struct statfs *buf); func Xstatfs(t *TLS, path uintptr, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v buf=%v, (%v:)", t, path, buf, origin(2)) + } if err := unix.Statfs(GoString(path), (*unix.Statfs_t)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -140,6 +159,9 @@ func Xstatfs(t *TLS, path uintptr, buf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -156,6 +178,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -173,6 +198,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -195,6 +223,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -206,6 +237,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -226,6 +260,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -242,6 +279,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -258,6 +298,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -274,6 +317,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -296,6 +342,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -312,6 +361,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -328,6 +380,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -344,6 +399,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -355,6 +413,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { // t.setErrno(err) @@ -366,6 +427,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -377,6 +441,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if err != 0 { t.setErrno(err) @@ -388,6 +455,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -412,6 +482,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { diff --git a/vendor/modernc.org/libc/libc_darwin_arm64.go b/vendor/modernc.org/libc/libc_darwin_arm64.go index 3864d311..b156eae1 100644 --- a/vendor/modernc.org/libc/libc_darwin_arm64.go +++ b/vendor/modernc.org/libc/libc_darwin_arm64.go @@ -18,6 +18,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } var kact, koldact uintptr if act != 0 { sz := int(unsafe.Sizeof(signal.X__sigaction{})) @@ -45,6 +48,10 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + defer func() { trc("-> %v", r) }() + } var err error var p uintptr var i int @@ -77,6 +84,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) (r int32) { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -93,6 +103,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -109,6 +122,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstatfs(int fd, struct statfs *buf); func Xfstatfs(t *TLS, fd int32, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v, (%v:)", t, fd, buf, origin(2)) + } if err := unix.Fstatfs(int(fd), (*unix.Statfs_t)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %v: %v FAIL", origin(1), fd, err) @@ -125,6 +141,9 @@ func Xfstatfs(t *TLS, fd int32, buf uintptr) int32 { // int statfs(const char *path, struct statfs *buf); func Xstatfs(t *TLS, path uintptr, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v buf=%v, (%v:)", t, path, buf, origin(2)) + } if err := unix.Statfs(GoString(path), (*unix.Statfs_t)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -141,6 +160,9 @@ func Xstatfs(t *TLS, path uintptr, buf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -157,6 +179,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -174,6 +199,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -196,6 +224,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -207,6 +238,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n := time.Now().UTC().Unix() if tloc != 0 { *(*types.Time_t)(unsafe.Pointer(tloc)) = types.Time_t(n) @@ -226,6 +260,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -242,6 +279,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -258,6 +298,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -274,6 +317,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -296,6 +342,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -312,6 +361,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -328,6 +380,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -344,6 +399,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -355,6 +413,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { // t.setErrno(err) @@ -366,6 +427,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -376,6 +440,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -388,6 +455,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -412,6 +482,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { diff --git a/vendor/modernc.org/libc/libc_freebsd.go b/vendor/modernc.org/libc/libc_freebsd.go index 96282190..825195e5 100644 --- a/vendor/modernc.org/libc/libc_freebsd.go +++ b/vendor/modernc.org/libc/libc_freebsd.go @@ -60,6 +60,9 @@ var X_ThreadRuneLocale uintptr //TODO initialize and implement _Thread_local sem // include/xlocale/_ctype.h:54:_RuneLocale *__runes_for_locale(locale_t, int*); func X__runes_for_locale(t *TLS, l locale_t, p uintptr) uintptr { + if __ccgo_strace { + trc("t=%v l=%v p=%v, (%v:)", t, l, p, origin(2)) + } panic(todo("")) } @@ -108,23 +111,35 @@ func fwrite(fd int32, b []byte) (int, error) { // unsigned long ___runetype(__ct_rune_t) __pure; func X___runetype(t *TLS, x types.X__ct_rune_t) ulong { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } panic(todo("")) } // int fprintf(FILE *stream, const char *format, ...); func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } n, _ := fwrite(int32((*stdio.FILE)(unsafe.Pointer(stream)).F_file), printf(format, args)) return int32(n) } // int usleep(useconds_t usec); func Xusleep(t *TLS, usec types.X__useconds_t) int32 { + if __ccgo_strace { + trc("t=%v usec=%v, (%v:)", t, usec, origin(2)) + } gotime.Sleep(gotime.Microsecond * gotime.Duration(usec)) return 0 } // int getrusage(int who, struct rusage *usage); func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if __ccgo_strace { + trc("t=%v who=%v usage=%v, (%v:)", t, who, usage, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { t.setErrno(err) return -1 @@ -135,6 +150,9 @@ func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { // int fgetc(FILE *stream); func Xfgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } fd := int((*stdio.FILE)(unsafe.Pointer(stream)).F_file) var buf [1]byte if n, _ := unix.Read(fd, buf[:]); n != 0 { @@ -146,16 +164,25 @@ func Xfgetc(t *TLS, stream uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xlstat64(t, pathname, statbuf) } // int stat(const char *pathname, struct stat *statbuf); func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xstat64(t, pathname, statbuf) } // int chdir(const char *path); func Xchdir(t *TLS, path uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v, (%v:)", t, path, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHDIR, path, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -205,11 +232,17 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { // int open(const char *pathname, int flags, ...); func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } return Xopen64(t, pathname, flags, args) } // int open(const char *pathname, int flags, ...); func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } var mode types.Mode_t if args != 0 { mode = (types.Mode_t)(VaUint32(&args)) @@ -232,6 +265,9 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { // off_t lseek(int fd, off_t offset, int whence); func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } return types.Off_t(Xlseek64(t, fd, offset, whence)) } @@ -243,6 +279,9 @@ var fsyncStatbuf stat.Stat // int fsync(int fd); func Xfsync(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if noFsync { // Simulate -DSQLITE_NO_SYNC for sqlite3 testfixture, see function full_sync in sqlite3.c return Xfstat(t, fd, uintptr(unsafe.Pointer(&fsyncStatbuf))) @@ -261,6 +300,9 @@ func Xfsync(t *TLS, fd int32) int32 { // long sysconf(int name); func Xsysconf(t *TLS, name int32) long { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } switch name { case unistd.X_SC_PAGESIZE: return long(unix.Getpagesize()) @@ -277,6 +319,9 @@ func Xsysconf(t *TLS, name int32) long { // int close(int fd); func Xclose(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CLOSE, uintptr(fd), 0, 0); err != 0 { t.setErrno(err) return -1 @@ -290,6 +335,9 @@ func Xclose(t *TLS, fd int32) int32 { // char *getcwd(char *buf, size_t size); func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } if _, err := unix.Getcwd((*RawMem)(unsafe.Pointer(buf))[:size:size]); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -306,11 +354,17 @@ func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { // int fstat(int fd, struct stat *statbuf); func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } return Xfstat64(t, fd, statbuf) } // int ftruncate(int fd, off_t length); func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if err := unix.Ftruncate(int(fd), int64(length)); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -327,11 +381,17 @@ func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } return Xfcntl64(t, fd, cmd, args) } // ssize_t read(int fd, void *buf, size_t count); func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READ, uintptr(fd), buf, uintptr(count)) if err != 0 { t.setErrno(err) @@ -347,6 +407,9 @@ func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // ssize_t write(int fd, const void *buf, size_t count); func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } const retry = 5 var err syscall.Errno for i := 0; i < retry; i++ { @@ -372,6 +435,9 @@ func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // int fchmod(int fd, mode_t mode); func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -385,6 +451,9 @@ func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { // int fchown(int fd, uid_t owner, gid_t group); func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v owner=%v group=%v, (%v:)", t, fd, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHOWN, uintptr(fd), uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -395,12 +464,18 @@ func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { // uid_t geteuid(void); func Xgeteuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_GETEUID, 0, 0, 0) return types.Uid_t(n) } // int munmap(void *addr, size_t length); func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v addr=%v length=%v, (%v:)", t, addr, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { t.setErrno(err) return -1 @@ -411,6 +486,9 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if __ccgo_strace { + trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) + } if tz != 0 { panic(todo("")) } @@ -428,6 +506,9 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { // int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optlen=%v, (%v:)", t, optname, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 { t.setErrno(err) return -1 @@ -438,6 +519,9 @@ func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) i // int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optval=%v optlen=%v, (%v:)", t, optname, optval, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 { t.setErrno(err) return -1 @@ -448,6 +532,9 @@ func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen so // int ioctl(int fd, unsigned long request, ...); func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v request=%v va=%v, (%v:)", t, fd, request, va, origin(2)) + } var argp uintptr if va != 0 { argp = VaUintptr(&va) @@ -463,6 +550,9 @@ func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { // int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETSOCKNAME, uintptr(sockfd), addr, addrlen); err != 0 { // if dmesgs { // dmesg("%v: fd %v: %v", origin(1), sockfd, err) @@ -476,6 +566,9 @@ func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { // int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v timeout=%v, (%v:)", t, nfds, timeout, origin(2)) + } n, err := unix.Select( int(nfds), (*unix.FdSet)(unsafe.Pointer(readfds)), @@ -493,17 +586,26 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) // int mkfifo(const char *pathname, mode_t mode); func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) } // mode_t umask(mode_t mask); func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + if __ccgo_strace { + trc("t=%v mask=%v, (%v:)", t, mask, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_UMASK, uintptr(mask), 0, 0) return types.Mode_t(n) } // int execvp(const char *file, char *const argv[]); func Xexecvp(t *TLS, file, argv uintptr) int32 { + if __ccgo_strace { + trc("t=%v argv=%v, (%v:)", t, argv, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_EXECVE, file, argv, Environ()); err != 0 { t.setErrno(err) return -1 @@ -514,6 +616,9 @@ func Xexecvp(t *TLS, file, argv uintptr) int32 { // pid_t waitpid(pid_t pid, int *wstatus, int options); func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + if __ccgo_strace { + trc("t=%v pid=%v wstatus=%v optname=%v, (%v:)", t, pid, wstatus, optname, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_WAIT4, uintptr(pid), wstatus, uintptr(optname), 0, 0, 0) if err != 0 { t.setErrno(err) @@ -525,6 +630,9 @@ func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid // int uname(struct utsname *buf); func Xuname(t *TLS, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } if err := unix.Uname((*unix.Utsname)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -541,6 +649,9 @@ func Xuname(t *TLS, buf uintptr) int32 { // ssize_t recv(int sockfd, void *buf, size_t len, int flags); func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -552,6 +663,9 @@ func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // ssize_t send(int sockfd, const void *buf, size_t len, int flags); func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -563,6 +677,9 @@ func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // int shutdown(int sockfd, int how); func Xshutdown(t *TLS, sockfd, how int32) int32 { + if __ccgo_strace { + trc("t=%v how=%v, (%v:)", t, how, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { t.setErrno(err) return -1 @@ -573,6 +690,9 @@ func Xshutdown(t *TLS, sockfd, how int32) int32 { // int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -583,6 +703,9 @@ func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int socket(int domain, int type, int protocol); func Xsocket(t *TLS, domain, type1, protocol int32) int32 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol)) if err != 0 { t.setErrno(err) @@ -594,6 +717,9 @@ func Xsocket(t *TLS, domain, type1, protocol int32) int32 { // int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen)) if err != 0 { t.setErrno(err) @@ -605,6 +731,9 @@ func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -615,6 +744,9 @@ func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int listen(int sockfd, int backlog); func Xlisten(t *TLS, sockfd, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v backlog=%v, (%v:)", t, backlog, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 { t.setErrno(err) return -1 @@ -625,6 +757,9 @@ func Xlisten(t *TLS, sockfd, backlog int32) int32 { // int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_ACCEPT4, uintptr(sockfd), addr, uintptr(addrlen), 0, 0, 0) if err != 0 { t.setErrno(err) @@ -636,16 +771,25 @@ func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xgetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xsetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -656,16 +800,25 @@ func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // uid_t getuid(void); func Xgetuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return types.Uid_t(os.Getuid()) } // pid_t getpid(void); func Xgetpid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return int32(os.Getpid()) } // int system(const char *command); func Xsystem(t *TLS, command uintptr) int32 { + if __ccgo_strace { + trc("t=%v command=%v, (%v:)", t, command, origin(2)) + } s := GoString(command) if command == 0 { panic(todo("")) @@ -685,26 +838,41 @@ func Xsystem(t *TLS, command uintptr) int32 { // int setvbuf(FILE *stream, char *buf, int mode, size_t size); func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v mode=%v size=%v, (%v:)", t, buf, mode, size, origin(2)) + } return 0 //TODO } // int raise(int sig); func Xraise(t *TLS, sig int32) int32 { + if __ccgo_strace { + trc("t=%v sig=%v, (%v:)", t, sig, origin(2)) + } panic(todo("")) } // int backtrace(void **buffer, int size); func Xbacktrace(t *TLS, buf uintptr, size int32) int32 { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } panic(todo("")) } // void backtrace_symbols_fd(void *const *buffer, int size, int fd); func Xbacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) { + if __ccgo_strace { + trc("t=%v buffer=%v fd=%v, (%v:)", t, buffer, fd, origin(2)) + } panic(todo("")) } // int fileno(FILE *stream); func Xfileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -738,11 +906,17 @@ func (f *ftstream) close(t *TLS) { // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } return Xfts64_open(t, path_argv, options, compar) } // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } f := &ftstream{} var walk func(string) @@ -847,11 +1021,17 @@ func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintp // FTSENT *fts_read(FTS *ftsp); func Xfts_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_read(t, ftsp) } // FTSENT *fts_read(FTS *ftsp); func Xfts64_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } f := getObject(ftsp).(*ftstream) if f.x == len(f.s) { t.setErrno(0) @@ -868,11 +1048,17 @@ func Xfts64_read(t *TLS, ftsp uintptr) uintptr { // int fts_close(FTS *ftsp); func Xfts_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_close(t, ftsp) } // int fts_close(FTS *ftsp); func Xfts64_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } getObject(ftsp).(*ftstream).close(t) removeObject(ftsp) return 0 @@ -880,6 +1066,9 @@ func Xfts64_close(t *TLS, ftsp uintptr) int32 { // void tzset (void); func Xtzset(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } //TODO } @@ -887,6 +1076,9 @@ var strerrorBuf [100]byte // char *strerror(int errnum); func Xstrerror(t *TLS, errnum int32) uintptr { + if __ccgo_strace { + trc("t=%v errnum=%v, (%v:)", t, errnum, origin(2)) + } if dmesgs { dmesg("%v: %v\n%s", origin(1), errnum, debug.Stack()) } @@ -896,31 +1088,49 @@ func Xstrerror(t *TLS, errnum int32) uintptr { // void *dlopen(const char *filename, int flags); func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + if __ccgo_strace { + trc("t=%v filename=%v flags=%v, (%v:)", t, filename, flags, origin(2)) + } panic(todo("")) } // char *dlerror(void); func Xdlerror(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int dlclose(void *handle); func Xdlclose(t *TLS, handle uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } panic(todo("")) } // void *dlsym(void *handle, const char *symbol); func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + if __ccgo_strace { + trc("t=%v symbol=%v, (%v:)", t, symbol, origin(2)) + } panic(todo("")) } // void perror(const char *s); func Xperror(t *TLS, s uintptr) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func Xpclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -928,37 +1138,58 @@ var gai_strerrorBuf [100]byte // const char *gai_strerror(int errcode); func Xgai_strerror(t *TLS, errcode int32) uintptr { + if __ccgo_strace { + trc("t=%v errcode=%v, (%v:)", t, errcode, origin(2)) + } copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) return uintptr(unsafe.Pointer(&gai_strerrorBuf)) } // int tcgetattr(int fd, struct termios *termios_p); func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v termios_p=%v, (%v:)", t, fd, termios_p, origin(2)) + } panic(todo("")) } // int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v optional_actions=%v termios_p=%v, (%v:)", t, optional_actions, termios_p, origin(2)) + } panic(todo("")) } // speed_t cfgetospeed(const struct termios *termios_p); func Xcfgetospeed(t *TLS, termios_p uintptr) termios.Speed_t { + if __ccgo_strace { + trc("t=%v termios_p=%v, (%v:)", t, termios_p, origin(2)) + } panic(todo("")) } // int cfsetospeed(struct termios *termios_p, speed_t speed); func Xcfsetospeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // int cfsetispeed(struct termios *termios_p, speed_t speed); func Xcfsetispeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // pid_t fork(void); func Xfork(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } t.setErrno(errno.ENOSYS) return -1 } @@ -967,21 +1198,33 @@ var emptyStr = [1]byte{} // char *setlocale(int category, const char *locale); func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + if __ccgo_strace { + trc("t=%v category=%v locale=%v, (%v:)", t, category, locale, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // char *nl_langinfo(nl_item item); func Xnl_langinfo(t *TLS, item langinfo.Nl_item) uintptr { + if __ccgo_strace { + trc("t=%v item=%v, (%v:)", t, item, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // FILE *popen(const char *command, const char *type); func Xpopen(t *TLS, command, type1 uintptr) uintptr { + if __ccgo_strace { + trc("t=%v type1=%v, (%v:)", t, type1, origin(2)) + } panic(todo("")) } // char *realpath(const char *path, char *resolved_path); func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + if __ccgo_strace { + trc("t=%v resolved_path=%v, (%v:)", t, resolved_path, origin(2)) + } s, err := filepath.EvalSymlinks(GoString(path)) if err != nil { if os.IsNotExist(err) { @@ -1010,19 +1253,31 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { // struct tm *gmtime_r(const time_t *timep, struct tm *result); func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } panic(todo("")) } // char *inet_ntoa(struct in_addr in); func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func X__ccgo_in6addr_anyp(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return uintptr(unsafe.Pointer(&in6_addr_any)) } func Xabort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } if dmesgs { dmesg("%v:", origin(1)) } @@ -1040,11 +1295,17 @@ func Xabort(t *TLS) { // int fflush(FILE *stream); func Xfflush(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return 0 //TODO } // size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_READ, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1060,6 +1321,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types // size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1075,11 +1339,17 @@ func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) type // int fclose(FILE *stream); func Xfclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return file(stream).close(t) } // int fputc(int c, FILE *stream); func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } if _, err := fwrite(file(stream).fd(), []byte{byte(c)}); err != nil { return stdio.EOF } @@ -1089,6 +1359,9 @@ func Xfputc(t *TLS, c int32, stream uintptr) int32 { // int fseek(FILE *stream, long offset, int whence); func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if __ccgo_strace { + trc("t=%v stream=%v offset=%v whence=%v, (%v:)", t, stream, offset, whence, origin(2)) + } if n := Xlseek(t, int32(file(stream).fd()), types.Off_t(offset), whence); n < 0 { // if dmesgs { // dmesg("%v: fd %v, off %#x, whence %v: %v", origin(1), file(stream).fd(), offset, whenceStr(whence), n) @@ -1105,6 +1378,9 @@ func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { // long ftell(FILE *stream); func Xftell(t *TLS, stream uintptr) long { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } n := Xlseek(t, file(stream).fd(), 0, stdio.SEEK_CUR) if n < 0 { file(stream).setErr() @@ -1119,21 +1395,33 @@ func Xftell(t *TLS, stream uintptr) long { // int ferror(FILE *stream); func Xferror(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return Bool32(file(stream).err()) } // int ungetc(int c, FILE *stream); func Xungetc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } panic(todo("")) } // int fscanf(FILE *stream, const char *format, ...); func Xfscanf(t *TLS, stream, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } panic(todo("")) } // int fputs(const char *s, FILE *stream); func Xfputs(t *TLS, s, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { return -1 } @@ -1145,6 +1433,9 @@ var getservbynameStaticResult netdb.Servent // struct servent *getservbyname(const char *name, const char *proto); func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { + if __ccgo_strace { + trc("t=%v proto=%v, (%v:)", t, proto, origin(2)) + } var protoent *gonetdb.Protoent if proto != 0 { protoent = gonetdb.GetProtoByName(GoString(proto)) @@ -1222,6 +1513,9 @@ func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { } func Xreaddir64(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } return Xreaddir(t, dir) } @@ -1234,14 +1528,23 @@ func __syscall(r, _ uintptr, errno syscall.Errno) long { } func X__syscall1(t *TLS, trap, p1 long) long { + if __ccgo_strace { + trc("t=%v p1=%v, (%v:)", t, p1, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), 0, 0)) } func X__syscall3(t *TLS, trap, p1, p2, p3 long) long { + if __ccgo_strace { + trc("t=%v p3=%v, (%v:)", t, p3, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3))) } func X__syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { + if __ccgo_strace { + trc("t=%v p4=%v, (%v:)", t, p4, origin(2)) + } return __syscall(unix.Syscall6(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3), uintptr(p4), 0, 0)) } @@ -1264,26 +1567,41 @@ func fcntlCmdStr(cmd int32) string { // int setenv(const char *name, const char *value, int overwrite); func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { + if __ccgo_strace { + trc("t=%v value=%v overwrite=%v, (%v:)", t, value, overwrite, origin(2)) + } panic(todo("")) } // int unsetenv(const char *name); func Xunsetenv(t *TLS, name uintptr) int32 { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } panic(todo("")) } // int pause(void); func Xpause(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // ssize_t writev(int fd, const struct iovec *iov, int iovcnt); func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v iov=%v iovcnt=%v, (%v:)", t, fd, iov, iovcnt, origin(2)) + } panic(todo("")) } // int __isoc99_sscanf(const char *str, const char *format, ...); func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := Xsscanf(t, str, format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1293,16 +1611,25 @@ func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { // void __assert(const char * func, const char * file, int line, const char *expr) __dead2; func X__assert(t *TLS, fn, file uintptr, line int32, expr uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v expr=%v, (%v:)", t, file, line, expr, origin(2)) + } X__assert_fail(t, expr, file, uint32(line), fn) } // include/stdio.h:456:int __swbuf(int, FILE *); func X__swbuf(t *TLS, n int32, file uintptr) int32 { + if __ccgo_strace { + trc("t=%v n=%v file=%v, (%v:)", t, n, file, origin(2)) + } return Xfputc(t, n, file) //TODO improve performance, use a real buffer. } // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Rmdir(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1319,6 +1646,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // struct dirent *readdir(DIR *dirp); func Xreaddir(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } if (*darwinDir)(unsafe.Pointer(dir)).eof { return 0 } @@ -1357,6 +1687,9 @@ type darwinDir struct { // int sscanf(const char *str, const char *format, ...); func Xsscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1366,10 +1699,16 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 { // int * __error(void); func X__error(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return t.errnop } func Xclosedir(t *TLS, dir uintptr) int32 { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } r := Xclose(t, int32((*darwinDir)(unsafe.Pointer(dir)).fd)) Xfree(t, dir) return r @@ -1377,11 +1716,17 @@ func Xclosedir(t *TLS, dir uintptr) int32 { // int __xuname(int namesize, void *namebuf) func X__xuname(t *TLS, namesize int32, namebuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v namesize=%v namebuf=%v, (%v:)", t, namesize, namebuf, origin(2)) + } return Xuname(t, namebuf) } // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } var a [2]int if err := syscall.Pipe(a[:]); err != nil { if dmesgs { @@ -1400,10 +1745,16 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // char *inet_ntoa(struct in_addr in); func X__inet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } // Cannot avoid the syscall here, addr sometimes matter. data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { @@ -1423,18 +1774,30 @@ func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, off const PTHREAD_MUTEX_DEFAULT = 0 func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return (int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).F__attr & uint32(3))) } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return (*(*int32)(unsafe.Pointer((m /* &.__u */ /* &.__i */))) & 15) } func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) } func Xpthread_attr_init(t *TLS, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } *(*pthread.Pthread_attr_t)(unsafe.Pointer(pAttr)) = pthread.Pthread_attr_t(0) return 0 } @@ -1451,6 +1814,9 @@ func Xpthread_attr_init(t *TLS, pAttr uintptr) int32 { // // int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } typ := PTHREAD_MUTEX_DEFAULT if pAttr != 0 { typ = int(X__ccgo_pthreadMutexattrGettype(t, pAttr)) @@ -1464,11 +1830,17 @@ func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 { } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) return 0 } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -1477,15 +1849,24 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } @@ -1495,6 +1876,9 @@ func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pth // int uuid_parse( char *in, uuid_t uu); func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { + if __ccgo_strace { + trc("t=%v in=%v uu=%v, (%v:)", t, in, uu, origin(2)) + } r, err := guuid.Parse(GoString(in)) if err != nil { return -1 @@ -1504,27 +1888,47 @@ func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { return 0 } -func X__srget(t *TLS, stream uintptr) int32 { return Xgetc(t, stream) } +func X__srget(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } + return Xgetc(t, stream) +} func X___tolower(t *TLS, r rune) rune { + if __ccgo_strace { + trc("t=%v r=%v, (%v:)", t, r, origin(2)) + } return unicode.ToLower(r) } func X___toupper(t *TLS, r rune) rune { + if __ccgo_strace { + trc("t=%v r=%v, (%v:)", t, r, origin(2)) + } return unicode.ToLower(r) } // uint16_t __builtin_bswap16 (uint32_t x) func Xbswap16(t *TLS, x uint16) uint16 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap16(t, x) } // uint32_t __builtin_bswap32 (uint32_t x) func Xbswap32(t *TLS, x uint32) uint32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap32(t, x) } // uint64_t __builtin_bswap64 (uint64_t x) func Xbswap64(t *TLS, x uint64) uint64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap64(t, x) } diff --git a/vendor/modernc.org/libc/libc_freebsd_386.go b/vendor/modernc.org/libc/libc_freebsd_386.go index 29444877..1fee674c 100644 --- a/vendor/modernc.org/libc/libc_freebsd_386.go +++ b/vendor/modernc.org/libc/libc_freebsd_386.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { t.setErrno(err) return -1 @@ -34,6 +37,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -73,6 +79,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -89,6 +98,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -105,6 +117,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -121,6 +136,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -137,6 +155,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -153,6 +174,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -177,6 +201,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -193,6 +220,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -209,6 +239,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -219,6 +252,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -241,6 +277,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -257,6 +296,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -273,6 +315,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -294,6 +339,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -310,6 +358,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -321,6 +372,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -343,6 +397,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -353,6 +410,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -364,6 +424,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -376,6 +439,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -386,6 +452,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -485,6 +554,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -572,6 +644,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -606,6 +681,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint32(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") @@ -632,6 +710,9 @@ func Xopendir(t *TLS, name uintptr) uintptr { // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint32) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) diff --git a/vendor/modernc.org/libc/libc_freebsd_amd64.go b/vendor/modernc.org/libc/libc_freebsd_amd64.go index 48f7fd78..e2e31e0b 100644 --- a/vendor/modernc.org/libc/libc_freebsd_amd64.go +++ b/vendor/modernc.org/libc/libc_freebsd_amd64.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { t.setErrno(err) return -1 @@ -34,6 +37,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -73,6 +79,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -89,6 +98,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -105,6 +117,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -121,6 +136,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -137,6 +155,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -153,6 +174,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -177,6 +201,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -193,6 +220,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -209,6 +239,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -219,6 +252,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -241,6 +277,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -257,6 +296,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -273,6 +315,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -294,6 +339,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -310,6 +358,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -321,6 +372,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -343,6 +397,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -353,6 +410,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -364,6 +424,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -376,6 +439,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -386,6 +452,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -485,6 +554,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -572,6 +644,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -606,6 +681,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") @@ -632,6 +710,9 @@ func Xopendir(t *TLS, name uintptr) uintptr { // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint64) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) diff --git a/vendor/modernc.org/libc/libc_freebsd_arm.go b/vendor/modernc.org/libc/libc_freebsd_arm.go index 29444877..1fee674c 100644 --- a/vendor/modernc.org/libc/libc_freebsd_arm.go +++ b/vendor/modernc.org/libc/libc_freebsd_arm.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { t.setErrno(err) return -1 @@ -34,6 +37,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -73,6 +79,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -89,6 +98,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -105,6 +117,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -121,6 +136,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -137,6 +155,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -153,6 +174,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -177,6 +201,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -193,6 +220,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -209,6 +239,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -219,6 +252,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -241,6 +277,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -257,6 +296,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -273,6 +315,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -294,6 +339,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -310,6 +358,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -321,6 +372,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -343,6 +397,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -353,6 +410,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -364,6 +424,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -376,6 +439,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -386,6 +452,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -485,6 +554,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -572,6 +644,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -606,6 +681,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint32(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") @@ -632,6 +710,9 @@ func Xopendir(t *TLS, name uintptr) uintptr { // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint32) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) diff --git a/vendor/modernc.org/libc/libc_freebsd_arm64.go b/vendor/modernc.org/libc/libc_freebsd_arm64.go index 48f7fd78..e2e31e0b 100644 --- a/vendor/modernc.org/libc/libc_freebsd_arm64.go +++ b/vendor/modernc.org/libc/libc_freebsd_arm64.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { t.setErrno(err) return -1 @@ -34,6 +37,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -73,6 +79,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -89,6 +98,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -105,6 +117,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -121,6 +136,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -137,6 +155,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -153,6 +174,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -177,6 +201,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -193,6 +220,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -209,6 +239,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -219,6 +252,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -241,6 +277,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -257,6 +296,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -273,6 +315,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -294,6 +339,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -310,6 +358,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -321,6 +372,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -343,6 +397,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -353,6 +410,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -364,6 +424,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -376,6 +439,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -386,6 +452,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -485,6 +554,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -572,6 +644,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -606,6 +681,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") @@ -632,6 +710,9 @@ func Xopendir(t *TLS, name uintptr) uintptr { // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint64) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) diff --git a/vendor/modernc.org/libc/libc_linux.go b/vendor/modernc.org/libc/libc_linux.go index 08f67be8..428c1cc7 100644 --- a/vendor/modernc.org/libc/libc_linux.go +++ b/vendor/modernc.org/libc/libc_linux.go @@ -37,6 +37,11 @@ import ( "modernc.org/libc/uuid/uuid" ) +const ( + // musl/src/internal/stdio_impl.h:16:#define F_EOF 16 + m_F_EOF = 16 +) + var ( in6_addr_any in.In6_addr _ = X__ctype_b_loc @@ -49,10 +54,13 @@ type ( type file uintptr -func (f file) fd() int32 { return (*stdio.FILE)(unsafe.Pointer(f)).F_fileno } -func (f file) setFd(fd int32) { (*stdio.FILE)(unsafe.Pointer(f)).F_fileno = fd } -func (f file) err() bool { return (*stdio.FILE)(unsafe.Pointer(f)).F_flags2&stdio.X_IO_ERR_SEEN != 0 } -func (f file) setErr() { (*stdio.FILE)(unsafe.Pointer(f)).F_flags2 |= stdio.X_IO_ERR_SEEN } +func (f file) fd() int32 { return (*stdio.FILE)(unsafe.Pointer(f)).F_fileno } +func (f file) setFd(fd int32) { (*stdio.FILE)(unsafe.Pointer(f)).F_fileno = fd } +func (f file) err() bool { return (*stdio.FILE)(unsafe.Pointer(f)).F_flags2&stdio.X_IO_ERR_SEEN != 0 } +func (f file) setErr() { (*stdio.FILE)(unsafe.Pointer(f)).F_flags2 |= stdio.X_IO_ERR_SEEN } +func (f file) flags() int32 { return (*stdio.FILE)(unsafe.Pointer(f)).F_flags } +func (f file) orFlags(n int32) { (*stdio.FILE)(unsafe.Pointer(f)).F_flags |= n } +func (f file) xorFlags(n int32) { (*stdio.FILE)(unsafe.Pointer(f)).F_flags ^= n } func (f file) close(t *TLS) int32 { r := Xclose(t, f.fd()) @@ -86,18 +94,27 @@ func fwrite(fd int32, b []byte) (int, error) { // int fprintf(FILE *stream, const char *format, ...); func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } n, _ := fwrite((*stdio.FILE)(unsafe.Pointer(stream)).F_fileno, printf(format, args)) return int32(n) } // int usleep(useconds_t usec); func Xusleep(t *TLS, usec types.X__useconds_t) int32 { + if __ccgo_strace { + trc("t=%v usec=%v, (%v:)", t, usec, origin(2)) + } time.Sleep(time.Microsecond * time.Duration(usec)) return 0 } // int getrusage(int who, struct rusage *usage); func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if __ccgo_strace { + trc("t=%v who=%v usage=%v, (%v:)", t, who, usage, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { t.setErrno(err) return -1 @@ -108,16 +125,25 @@ func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xlstat64(t, pathname, statbuf) } // int stat(const char *pathname, struct stat *statbuf); func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xstat64(t, pathname, statbuf) } // int chdir(const char *path); func Xchdir(t *TLS, path uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v, (%v:)", t, path, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHDIR, path, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -167,11 +193,17 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { // int open(const char *pathname, int flags, ...); func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } return Xopen64(t, pathname, flags, args) } // int open(const char *pathname, int flags, ...); func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } //TODO- flags |= fcntl.O_LARGEFILE var mode types.Mode_t if args != 0 { @@ -195,6 +227,9 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { // int openat(int dirfd, const char *pathname, int flags, mode_t mode); func Xopenat(t *TLS, dirfd int32, pathname uintptr, flags int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v flags=%v mode=%v, (%v:)", t, dirfd, pathname, flags, mode, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go fd, _, err := unix.Syscall6(unix.SYS_OPENAT, uintptr(dirfd), pathname, uintptr(flags), uintptr(mode), 0, 0) if err != 0 { @@ -207,6 +242,9 @@ func Xopenat(t *TLS, dirfd int32, pathname uintptr, flags int32, mode types.Mode // off_t lseek(int fd, off_t offset, int whence); func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } return types.Off_t(Xlseek64(t, fd, offset, whence)) } @@ -227,6 +265,9 @@ var fsyncStatbuf stat.Stat // int fsync(int fd); func Xfsync(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if noFsync { // Simulate -DSQLITE_NO_SYNC for sqlite3 testfixture, see function full_sync in sqlite3.c return Xfstat(t, fd, uintptr(unsafe.Pointer(&fsyncStatbuf))) @@ -245,6 +286,9 @@ func Xfsync(t *TLS, fd int32) int32 { // long sysconf(int name); func Xsysconf(t *TLS, name int32) long { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } switch name { case unistd.X_SC_PAGESIZE: return long(unix.Getpagesize()) @@ -261,6 +305,9 @@ func Xsysconf(t *TLS, name int32) long { // int close(int fd); func Xclose(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CLOSE, uintptr(fd), 0, 0); err != 0 { t.setErrno(err) return -1 @@ -274,6 +321,9 @@ func Xclose(t *TLS, fd int32) int32 { // char *getcwd(char *buf, size_t size); func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_GETCWD, buf, uintptr(size), 0) if err != 0 { t.setErrno(err) @@ -288,21 +338,33 @@ func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { // int fstat(int fd, struct stat *statbuf); func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } return Xfstat64(t, fd, statbuf) } // int ftruncate(int fd, off_t length); func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } return Xftruncate64(t, fd, length) } // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } return Xfcntl64(t, fd, cmd, args) } // ssize_t read(int fd, void *buf, size_t count); func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READ, uintptr(fd), buf, uintptr(count)) if err != 0 { t.setErrno(err) @@ -318,6 +380,9 @@ func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // ssize_t write(int fd, const void *buf, size_t count); func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } const retry = 5 var err syscall.Errno for i := 0; i < retry; i++ { @@ -343,6 +408,9 @@ func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // int fchmod(int fd, mode_t mode); func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -356,6 +424,9 @@ func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { // int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags); func Xfchmodat(t *TLS, dirfd int32, pathname uintptr, mode types.Mode_t, flags int32) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v mode=%v flags=%v, (%v:)", t, dirfd, pathname, mode, flags, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go // Linux fchmodat doesn't support the flags parameter. Mimick glibc's behavior // and check the flags. Otherwise the mode would be applied to the symlink @@ -379,6 +450,9 @@ func Xfchmodat(t *TLS, dirfd int32, pathname uintptr, mode types.Mode_t, flags i // int fchown(int fd, uid_t owner, gid_t group); func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v owner=%v group=%v, (%v:)", t, fd, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHOWN, uintptr(fd), uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -389,12 +463,18 @@ func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { // uid_t geteuid(void); func Xgeteuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_GETEUID, 0, 0, 0) return types.Uid_t(n) } // int munmap(void *addr, size_t length); func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v addr=%v length=%v, (%v:)", t, addr, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { t.setErrno(err) return -1 @@ -405,6 +485,9 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if __ccgo_strace { + trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) + } if tz != 0 { panic(todo("")) } @@ -422,6 +505,9 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { // int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optlen=%v, (%v:)", t, optname, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 { t.setErrno(err) return -1 @@ -432,6 +518,9 @@ func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) i // int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optval=%v optlen=%v, (%v:)", t, optname, optval, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 { t.setErrno(err) return -1 @@ -442,6 +531,9 @@ func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen so // int ioctl(int fd, unsigned long request, ...); func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v request=%v va=%v, (%v:)", t, fd, request, va, origin(2)) + } var argp uintptr if va != 0 { argp = VaUintptr(&va) @@ -457,6 +549,9 @@ func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { // int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETSOCKNAME, uintptr(sockfd), addr, addrlen); err != 0 { // if dmesgs { // dmesg("%v: fd %v: %v", origin(1), sockfd, err) @@ -470,6 +565,9 @@ func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { // int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v timeout=%v, (%v:)", t, nfds, timeout, origin(2)) + } n, err := unix.Select( int(nfds), (*unix.FdSet)(unsafe.Pointer(readfds)), @@ -487,6 +585,9 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) // int mkfifo(const char *pathname, mode_t mode); func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Mkfifo(GoString(pathname), mode); err != nil { t.setErrno(err) return -1 @@ -497,12 +598,18 @@ func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // mode_t umask(mode_t mask); func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + if __ccgo_strace { + trc("t=%v mask=%v, (%v:)", t, mask, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_UMASK, uintptr(mask), 0, 0) return types.Mode_t(n) } // int execvp(const char *file, char *const argv[]); func Xexecvp(t *TLS, file, argv uintptr) int32 { + if __ccgo_strace { + trc("t=%v argv=%v, (%v:)", t, argv, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_EXECVE, file, argv, Environ()); err != 0 { t.setErrno(err) return -1 @@ -513,6 +620,9 @@ func Xexecvp(t *TLS, file, argv uintptr) int32 { // pid_t waitpid(pid_t pid, int *wstatus, int options); func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + if __ccgo_strace { + trc("t=%v pid=%v wstatus=%v optname=%v, (%v:)", t, pid, wstatus, optname, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_WAIT4, uintptr(pid), wstatus, uintptr(optname), 0, 0, 0) if err != 0 { t.setErrno(err) @@ -524,6 +634,9 @@ func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid // int uname(struct utsname *buf); func Xuname(t *TLS, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UNAME, buf, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -534,6 +647,9 @@ func Xuname(t *TLS, buf uintptr) int32 { // ssize_t recv(int sockfd, void *buf, size_t len, int flags); func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -545,6 +661,9 @@ func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // ssize_t send(int sockfd, const void *buf, size_t len, int flags); func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -556,6 +675,9 @@ func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // int shutdown(int sockfd, int how); func Xshutdown(t *TLS, sockfd, how int32) int32 { + if __ccgo_strace { + trc("t=%v how=%v, (%v:)", t, how, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { t.setErrno(err) return -1 @@ -566,6 +688,9 @@ func Xshutdown(t *TLS, sockfd, how int32) int32 { // int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -576,6 +701,9 @@ func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int socket(int domain, int type, int protocol); func Xsocket(t *TLS, domain, type1, protocol int32) int32 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol)) if err != 0 { t.setErrno(err) @@ -587,6 +715,9 @@ func Xsocket(t *TLS, domain, type1, protocol int32) int32 { // int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen)) if err != 0 { t.setErrno(err) @@ -598,6 +729,9 @@ func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -608,6 +742,9 @@ func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int listen(int sockfd, int backlog); func Xlisten(t *TLS, sockfd, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v backlog=%v, (%v:)", t, backlog, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 { t.setErrno(err) return -1 @@ -618,6 +755,9 @@ func Xlisten(t *TLS, sockfd, backlog int32) int32 { // int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_ACCEPT4, uintptr(sockfd), addr, uintptr(addrlen), 0, 0, 0) if err != 0 { t.setErrno(err) @@ -629,26 +769,41 @@ func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xgetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xsetrlimit64(t, resource, rlim) } // uid_t getuid(void); func Xgetuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return types.Uid_t(os.Getuid()) } // pid_t getpid(void); func Xgetpid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return int32(os.Getpid()) } // int system(const char *command); func Xsystem(t *TLS, command uintptr) int32 { + if __ccgo_strace { + trc("t=%v command=%v, (%v:)", t, command, origin(2)) + } s := GoString(command) if command == 0 { panic(todo("")) @@ -668,26 +823,41 @@ func Xsystem(t *TLS, command uintptr) int32 { // int setvbuf(FILE *stream, char *buf, int mode, size_t size); func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v mode=%v size=%v, (%v:)", t, buf, mode, size, origin(2)) + } return 0 //TODO } // int raise(int sig); func Xraise(t *TLS, sig int32) int32 { + if __ccgo_strace { + trc("t=%v sig=%v, (%v:)", t, sig, origin(2)) + } panic(todo("")) } // int backtrace(void **buffer, int size); func Xbacktrace(t *TLS, buf uintptr, size int32) int32 { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } panic(todo("")) } // void backtrace_symbols_fd(void *const *buffer, int size, int fd); func Xbacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) { + if __ccgo_strace { + trc("t=%v buffer=%v fd=%v, (%v:)", t, buffer, fd, origin(2)) + } panic(todo("")) } // int fileno(FILE *stream); func Xfileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if stream == 0 { t.setErrno(errno.EBADF) return -1 @@ -755,11 +925,17 @@ func (f *ftstream) close(t *TLS) { // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } return Xfts64_open(t, path_argv, options, compar) } // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } f := &ftstream{} var walk func(string) @@ -864,11 +1040,17 @@ func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintp // FTSENT *fts_read(FTS *ftsp); func Xfts_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_read(t, ftsp) } // FTSENT *fts_read(FTS *ftsp); func Xfts64_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } f := getObject(ftsp).(*ftstream) if f.x == len(f.s) { t.setErrno(0) @@ -885,11 +1067,17 @@ func Xfts64_read(t *TLS, ftsp uintptr) uintptr { // int fts_close(FTS *ftsp); func Xfts_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_close(t, ftsp) } // int fts_close(FTS *ftsp); func Xfts64_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } getObject(ftsp).(*ftstream).close(t) removeObject(ftsp) return 0 @@ -897,6 +1085,9 @@ func Xfts64_close(t *TLS, ftsp uintptr) int32 { // void tzset (void); func Xtzset(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } //TODO } @@ -904,6 +1095,9 @@ var strerrorBuf [100]byte // char *strerror(int errnum); func Xstrerror(t *TLS, errnum int32) uintptr { + if __ccgo_strace { + trc("t=%v errnum=%v, (%v:)", t, errnum, origin(2)) + } if dmesgs { dmesg("%v: %v\n%s", origin(1), errnum, debug.Stack()) } @@ -913,31 +1107,49 @@ func Xstrerror(t *TLS, errnum int32) uintptr { // void *dlopen(const char *filename, int flags); func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + if __ccgo_strace { + trc("t=%v filename=%v flags=%v, (%v:)", t, filename, flags, origin(2)) + } panic(todo("%q", GoString(filename))) } // char *dlerror(void); func Xdlerror(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int dlclose(void *handle); func Xdlclose(t *TLS, handle uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } panic(todo("")) } // void *dlsym(void *handle, const char *symbol); func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + if __ccgo_strace { + trc("t=%v symbol=%v, (%v:)", t, symbol, origin(2)) + } panic(todo("")) } // void perror(const char *s); func Xperror(t *TLS, s uintptr) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func Xpclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -945,37 +1157,58 @@ var gai_strerrorBuf [100]byte // const char *gai_strerror(int errcode); func Xgai_strerror(t *TLS, errcode int32) uintptr { + if __ccgo_strace { + trc("t=%v errcode=%v, (%v:)", t, errcode, origin(2)) + } copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) return uintptr(unsafe.Pointer(&gai_strerrorBuf)) } // int tcgetattr(int fd, struct termios *termios_p); func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v termios_p=%v, (%v:)", t, fd, termios_p, origin(2)) + } panic(todo("")) } // int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v optional_actions=%v termios_p=%v, (%v:)", t, optional_actions, termios_p, origin(2)) + } panic(todo("")) } // speed_t cfgetospeed(const struct termios *termios_p); func Xcfgetospeed(t *TLS, termios_p uintptr) termios.Speed_t { + if __ccgo_strace { + trc("t=%v termios_p=%v, (%v:)", t, termios_p, origin(2)) + } panic(todo("")) } // int cfsetospeed(struct termios *termios_p, speed_t speed); func Xcfsetospeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // int cfsetispeed(struct termios *termios_p, speed_t speed); func Xcfsetispeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // pid_t fork(void); func Xfork(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } t.setErrno(errno.ENOSYS) return -1 } @@ -984,21 +1217,33 @@ var emptyStr = [1]byte{} // char *setlocale(int category, const char *locale); func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + if __ccgo_strace { + trc("t=%v category=%v locale=%v, (%v:)", t, category, locale, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // char *nl_langinfo(nl_item item); func Xnl_langinfo(t *TLS, item langinfo.Nl_item) uintptr { + if __ccgo_strace { + trc("t=%v item=%v, (%v:)", t, item, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // FILE *popen(const char *command, const char *type); func Xpopen(t *TLS, command, type1 uintptr) uintptr { + if __ccgo_strace { + trc("t=%v type1=%v, (%v:)", t, type1, origin(2)) + } panic(todo("")) } // char *realpath(const char *path, char *resolved_path); func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + if __ccgo_strace { + trc("t=%v resolved_path=%v, (%v:)", t, resolved_path, origin(2)) + } s, err := filepath.EvalSymlinks(GoString(path)) if err != nil { if os.IsNotExist(err) { @@ -1027,19 +1272,31 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { // struct tm *gmtime_r(const time_t *timep, struct tm *result); func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } panic(todo("")) } // char *inet_ntoa(struct in_addr in); func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func X__ccgo_in6addr_anyp(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return uintptr(unsafe.Pointer(&in6_addr_any)) } func Xabort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } // if dmesgs { // dmesg("%v:\n%s", origin(1), debug.Stack()) // } @@ -1059,12 +1316,21 @@ func Xabort(t *TLS) { // int fflush(FILE *stream); func Xfflush(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return 0 //TODO } // size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_READ, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) + if m == 0 { + file(stream).orFlags(m_F_EOF) + } if err != 0 { file(stream).setErr() return 0 @@ -1079,6 +1345,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types // size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1094,11 +1363,17 @@ func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) type // int fclose(FILE *stream); func Xfclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return file(stream).close(t) } // int fputc(int c, FILE *stream); func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } if _, err := fwrite(file(stream).fd(), []byte{byte(c)}); err != nil { return stdio.EOF } @@ -1108,6 +1383,9 @@ func Xfputc(t *TLS, c int32, stream uintptr) int32 { // int fseek(FILE *stream, long offset, int whence); func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if __ccgo_strace { + trc("t=%v stream=%v offset=%v whence=%v, (%v:)", t, stream, offset, whence, origin(2)) + } if n := Xlseek(t, int32(file(stream).fd()), types.Off_t(offset), whence); n < 0 { // if dmesgs { // dmesg("%v: fd %v, off %#x, whence %v: %v", origin(1), file(stream).fd(), offset, whenceStr(whence), n) @@ -1119,11 +1397,15 @@ func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { // if dmesgs { // dmesg("%v: fd %v, off %#x, whence %v: ok", origin(1), file(stream).fd(), offset, whenceStr(whence)) // } + file(stream).xorFlags(m_F_EOF) return 0 } // long ftell(FILE *stream); func Xftell(t *TLS, stream uintptr) long { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } n := Xlseek(t, file(stream).fd(), 0, stdio.SEEK_CUR) if n < 0 { file(stream).setErr() @@ -1138,21 +1420,33 @@ func Xftell(t *TLS, stream uintptr) long { // int ferror(FILE *stream); func Xferror(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return Bool32(file(stream).err()) } // int ungetc(int c, FILE *stream); func Xungetc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } panic(todo("")) } // int fscanf(FILE *stream, const char *format, ...); func Xfscanf(t *TLS, stream, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } panic(todo("")) } // int fputs(const char *s, FILE *stream); func Xfputs(t *TLS, s, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { return -1 } @@ -1164,6 +1458,9 @@ var getservbynameStaticResult netdb.Servent // struct servent *getservbyname(const char *name, const char *proto); func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { + if __ccgo_strace { + trc("t=%v proto=%v, (%v:)", t, proto, origin(2)) + } var protoent *gonetdb.Protoent if proto != 0 { protoent = gonetdb.GetProtoByName(GoString(proto)) @@ -1241,6 +1538,9 @@ func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { } func Xreaddir64(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } return Xreaddir(t, dir) } @@ -1253,14 +1553,23 @@ func __syscall(r, _ uintptr, errno syscall.Errno) long { } func X__syscall1(t *TLS, trap, p1 long) long { + if __ccgo_strace { + trc("t=%v p1=%v, (%v:)", t, p1, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), 0, 0)) } func X__syscall3(t *TLS, trap, p1, p2, p3 long) long { + if __ccgo_strace { + trc("t=%v p3=%v, (%v:)", t, p3, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3))) } func X__syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { + if __ccgo_strace { + trc("t=%v p4=%v, (%v:)", t, p4, origin(2)) + } return __syscall(unix.Syscall6(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3), uintptr(p4), 0, 0)) } @@ -1283,16 +1592,25 @@ func fcntlCmdStr(cmd int32) string { // int setenv(const char *name, const char *value, int overwrite); func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { + if __ccgo_strace { + trc("t=%v value=%v overwrite=%v, (%v:)", t, value, overwrite, origin(2)) + } panic(todo("")) } // int unsetenv(const char *name); func Xunsetenv(t *TLS, name uintptr) int32 { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } panic(todo("")) } // int pause(void); func Xpause(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } err := unix.Pause() if err != nil { t.setErrno(err) @@ -1303,6 +1621,9 @@ func Xpause(t *TLS) int32 { // ssize_t writev(int fd, const struct iovec *iov, int iovcnt); func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v iov=%v iovcnt=%v, (%v:)", t, fd, iov, iovcnt, origin(2)) + } // if dmesgs { // dmesg("%v: fd %v iov %#x iovcnt %v", origin(1), fd, iov, iovcnt) // } @@ -1335,6 +1656,9 @@ func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { // int __isoc99_sscanf(const char *str, const char *format, ...); func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := Xsscanf(t, str, format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1360,6 +1684,9 @@ func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { // ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset); func Xpwrite(t *TLS, fd int32, buf uintptr, count types.Size_t, offset types.Off_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v offset=%v, (%v:)", t, fd, buf, count, offset, origin(2)) + } var n int var err error switch { @@ -1387,6 +1714,9 @@ func Xpwrite(t *TLS, fd int32, buf uintptr, count types.Size_t, offset types.Off // int fstatfs(int fd, struct statfs *buf); func Xfstatfs(t *TLS, fd int32, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v, (%v:)", t, fd, buf, origin(2)) + } if err := unix.Fstatfs(int(fd), (*unix.Statfs_t)(unsafe.Pointer(buf))); err != nil { t.setErrno(err) return -1 @@ -1397,6 +1727,9 @@ func Xfstatfs(t *TLS, fd int32, buf uintptr) int32 { // ssize_t getrandom(void *buf, size_t buflen, unsigned int flags); func Xgetrandom(t *TLS, buf uintptr, buflen size_t, flags uint32) ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v buflen=%v flags=%v, (%v:)", t, buf, buflen, flags, origin(2)) + } n, err := unix.Getrandom((*RawMem)(unsafe.Pointer(buf))[:buflen], int(flags)) if err != nil { t.setErrno(err) @@ -1408,6 +1741,9 @@ func Xgetrandom(t *TLS, buf uintptr, buflen size_t, flags uint32) ssize_t { // int posix_fadvise(int fd, off_t offset, off_t len, int advice); func Xposix_fadvise(t *TLS, fd int32, offset, len types.Off_t, advice int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v len=%v advice=%v, (%v:)", t, fd, len, advice, origin(2)) + } if err := unix.Fadvise(int(fd), int64(offset), int64(len), int(advice)); err != nil { return int32(err.(unix.Errno)) } @@ -1417,22 +1753,32 @@ func Xposix_fadvise(t *TLS, fd int32, offset, len types.Off_t, advice int32) int // int fgetc(FILE *stream); func Xfgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } fd := int((*stdio.FILE)(unsafe.Pointer(stream)).F_fileno) var buf [1]byte if n, _ := unix.Read(fd, buf[:]); n != 0 { return int32(buf[0]) } + file(stream).orFlags(m_F_EOF) return stdio.EOF } // void uuid_copy(uuid_t dst, uuid_t src); func Xuuid_copy(t *TLS, dst, src uintptr) { + if __ccgo_strace { + trc("t=%v src=%v, (%v:)", t, src, origin(2)) + } *(*uuid.Uuid_t)(unsafe.Pointer(dst)) = *(*uuid.Uuid_t)(unsafe.Pointer(src)) } // int uuid_parse( char *in, uuid_t uu); func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { + if __ccgo_strace { + trc("t=%v in=%v uu=%v, (%v:)", t, in, uu, origin(2)) + } r, err := guuid.Parse(GoString(in)) if err != nil { return -1 @@ -1444,6 +1790,9 @@ func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { // int mkdirat(int dirfd, const char *pathname, mode_t mode); func Xmkdirat(t *TLS, dirfd int32, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v mode=%v, (%v:)", t, dirfd, pathname, mode, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall(unix.SYS_MKDIRAT, uintptr(dirfd), pathname, uintptr(mode)); err != 0 { t.setErrno(err) @@ -1455,6 +1804,9 @@ func Xmkdirat(t *TLS, dirfd int32, pathname uintptr, mode types.Mode_t) int32 { // int symlinkat(const char *target, int newdirfd, const char *linkpath); func Xsymlinkat(t *TLS, target uintptr, newdirfd int32, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v target=%v newdirfd=%v linkpath=%v, (%v:)", t, target, newdirfd, linkpath, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall(unix.SYS_SYMLINKAT, target, uintptr(newdirfd), linkpath); err != 0 { t.setErrno(err) @@ -1466,6 +1818,9 @@ func Xsymlinkat(t *TLS, target uintptr, newdirfd int32, linkpath uintptr) int32 // int utimensat(int dirfd, const char *pathname, const struct timespec times[2], int flags); func Xutimensat(t *TLS, dirfd int32, pathname, times uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v times=%v flags=%v, (%v:)", t, dirfd, times, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall6(unix.SYS_UTIMENSAT, uintptr(dirfd), pathname, times, uintptr(flags), 0, 0); err != 0 { t.setErrno(err) @@ -1477,6 +1832,9 @@ func Xutimensat(t *TLS, dirfd int32, pathname, times uintptr, flags int32) int32 // int unlinkat(int dirfd, const char *pathname, int flags); func Xunlinkat(t *TLS, dirfd int32, pathname uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v flags=%v, (%v:)", t, dirfd, pathname, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall(unix.SYS_UNLINKAT, uintptr(dirfd), pathname, uintptr(flags)); err != 0 { t.setErrno(err) @@ -1488,6 +1846,9 @@ func Xunlinkat(t *TLS, dirfd int32, pathname uintptr, flags int32) int32 { // int faccessat(int dirfd, const char *pathname, int mode, int flags); func Xfaccessat(t *TLS, dirfd int32, pathname uintptr, mode, flags int32) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v flags=%v, (%v:)", t, dirfd, pathname, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall(unix.SYS_FACCESSAT, uintptr(dirfd), pathname, uintptr(mode)); err != 0 { t.setErrno(err) @@ -1499,6 +1860,9 @@ func Xfaccessat(t *TLS, dirfd int32, pathname uintptr, mode, flags int32) int32 // int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags); func Xrenameat2(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v olddirfd=%v oldpath=%v newdirfd=%v newpath=%v flags=%v, (%v:)", t, olddirfd, oldpath, newdirfd, newpath, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall6(unix.SYS_RENAMEAT2, uintptr(olddirfd), oldpath, uintptr(newdirfd), newpath, uintptr(flags), 0); err != 0 { t.setErrno(err) @@ -1510,6 +1874,9 @@ func Xrenameat2(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath // int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev); func Xmknodat(t *TLS, dirfd int32, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v mode=%v dev=%v, (%v:)", t, dirfd, pathname, mode, dev, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall6(unix.SYS_MKNODAT, uintptr(dirfd), pathname, uintptr(mode), uintptr(dev), 0, 0); err != 0 { t.setErrno(err) @@ -1521,6 +1888,9 @@ func Xmknodat(t *TLS, dirfd int32, pathname uintptr, mode types.Mode_t, dev type // int fchownat(int dirfd, const char *pathname, uid_t owner, gid_t group, int flags); func Xfchownat(t *TLS, dirfd int32, pathname uintptr, uid types.Uid_t, gid types.Gid_t, flags int32) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v pathname=%v uid=%v gid=%v flags=%v, (%v:)", t, dirfd, pathname, uid, gid, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall6(unix.SYS_FCHOWNAT, uintptr(dirfd), pathname, uintptr(uid), uintptr(gid), uintptr(flags), 0); err != 0 { t.setErrno(err) @@ -1532,6 +1902,9 @@ func Xfchownat(t *TLS, dirfd int32, pathname uintptr, uid types.Uid_t, gid types // int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags); func Xlinkat(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v olddirfd=%v oldpath=%v newdirfd=%v newpath=%v flags=%v, (%v:)", t, olddirfd, oldpath, newdirfd, newpath, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall6(unix.SYS_LINKAT, uintptr(olddirfd), oldpath, uintptr(newdirfd), newpath, uintptr(flags), 0); err != 0 { t.setErrno(err) @@ -1543,6 +1916,9 @@ func Xlinkat(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath ui // int pipe2(int pipefd[2], int flags); func Xpipe2(t *TLS, pipefd uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v flags=%v, (%v:)", t, pipefd, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall(unix.SYS_PIPE2, pipefd, uintptr(flags), 0); err != 0 { t.setErrno(t) @@ -1554,6 +1930,9 @@ func Xpipe2(t *TLS, pipefd uintptr, flags int32) int32 { // int dup3(int oldfd, int newfd, int flags); func Xdup3(t *TLS, oldfd int32, newfd int32, flags int32) int32 { + if __ccgo_strace { + trc("t=%v oldfd=%v newfd=%v flags=%v, (%v:)", t, oldfd, newfd, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go if _, _, err := unix.Syscall(unix.SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags)); err != 0 { t.setErrno(err) @@ -1565,6 +1944,9 @@ func Xdup3(t *TLS, oldfd int32, newfd int32, flags int32) int32 { // ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsiz); func Xreadlinkat(t *TLS, dirfd int32, pathname, buf uintptr, bufsiz types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v dirfd=%v buf=%v bufsiz=%v, (%v:)", t, dirfd, buf, bufsiz, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux.go n, _, err := unix.Syscall6(unix.SYS_READLINKAT, uintptr(dirfd), pathname, buf, uintptr(bufsiz), 0, 0) if err != 0 { @@ -1577,7 +1959,21 @@ func Xreadlinkat(t *TLS, dirfd int32, pathname, buf uintptr, bufsiz types.Size_t // int nanosleep(const struct timespec *req, struct timespec *rem); func Xnanosleep(t *TLS, req, rem uintptr) int32 { + if __ccgo_strace { + trc("t=%v rem=%v, (%v:)", t, rem, origin(2)) + } v := *(*ctime.Timespec)(unsafe.Pointer(req)) time.Sleep(time.Second*time.Duration(v.Ftv_sec) + time.Duration(v.Ftv_nsec)) return 0 } + +func Xfeof(t *TLS, f uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v f=%v, (%v:)", t, f, origin(2)) + defer func() { trc("-> %v", r) }() + } + X__lockfile(t, f) + r = BoolInt32(!!((*stdio.FILE)(unsafe.Pointer(f)).F_flags&Int32FromInt32(m_F_EOF) != 0)) + X__unlockfile(t, f) + return r +} diff --git a/vendor/modernc.org/libc/libc_linux_386.go b/vendor/modernc.org/libc/libc_linux_386.go index c1369dd5..25b0daa9 100644 --- a/vendor/modernc.org/libc/libc_linux_386.go +++ b/vendor/modernc.org/libc/libc_linux_386.go @@ -13,12 +13,16 @@ import ( "modernc.org/libc/errno" "modernc.org/libc/fcntl" "modernc.org/libc/signal" + "modernc.org/libc/stdio" "modernc.org/libc/sys/stat" "modernc.org/libc/sys/types" ) // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/arch/x32/ksigaction.h // // struct k_sigaction { @@ -64,6 +68,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -88,6 +95,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LSTAT64, pathname, statbuf, 0); err != 0 { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -104,6 +114,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_STAT64, pathname, statbuf, 0); err != 0 { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -120,6 +133,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT64, uintptr(fd), statbuf, 0); err != 0 { if dmesgs { dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -136,6 +152,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -156,11 +175,17 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP2, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset>>12)) if err != 0 { if dmesgs { @@ -178,6 +203,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32)); err != 0 { if dmesgs { dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -194,6 +222,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } bp := t.Alloc(int(unsafe.Sizeof(types.X__loff_t(0)))) defer t.Free(int(unsafe.Sizeof(types.X__loff_t(0)))) if _, _, err := unix.Syscall6(unix.SYS__LLSEEK, uintptr(fd), uintptr(offset>>32), uintptr(offset), bp, uintptr(whence), 0); err != 0 { @@ -212,6 +243,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -222,6 +256,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) if err != 0 { panic(todo("")) @@ -232,6 +269,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -242,6 +282,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) if err != 0 { t.setErrno(err) @@ -256,6 +299,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -269,6 +315,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { t.setErrno(err) return -1 @@ -282,6 +331,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHMOD, pathname, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -295,6 +347,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -308,6 +363,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UNLINK, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -321,6 +379,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -337,6 +398,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -350,6 +414,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RENAME, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -360,6 +427,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { t.setErrno(err) return -1 @@ -370,6 +440,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -380,6 +453,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -390,6 +466,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -400,6 +479,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if err != 0 { t.setErrno(err) @@ -411,6 +493,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) if err != 0 { t.setErrno(err) @@ -422,6 +507,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -458,6 +546,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -465,3 +556,160 @@ func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { return 0 } + +var _table1 = [384]int32{ + 129: int32(1), + 130: int32(2), + 131: int32(3), + 132: int32(4), + 133: int32(5), + 134: int32(6), + 135: int32(7), + 136: int32(8), + 137: int32(9), + 138: int32(10), + 139: int32(11), + 140: int32(12), + 141: int32(13), + 142: int32(14), + 143: int32(15), + 144: int32(16), + 145: int32(17), + 146: int32(18), + 147: int32(19), + 148: int32(20), + 149: int32(21), + 150: int32(22), + 151: int32(23), + 152: int32(24), + 153: int32(25), + 154: int32(26), + 155: int32(27), + 156: int32(28), + 157: int32(29), + 158: int32(30), + 159: int32(31), + 160: int32(32), + 161: int32(33), + 162: int32(34), + 163: int32(35), + 164: int32(36), + 165: int32(37), + 166: int32(38), + 167: int32(39), + 168: int32(40), + 169: int32(41), + 170: int32(42), + 171: int32(43), + 172: int32(44), + 173: int32(45), + 174: int32(46), + 175: int32(47), + 176: int32(48), + 177: int32(49), + 178: int32(50), + 179: int32(51), + 180: int32(52), + 181: int32(53), + 182: int32(54), + 183: int32(55), + 184: int32(56), + 185: int32(57), + 186: int32(58), + 187: int32(59), + 188: int32(60), + 189: int32(61), + 190: int32(62), + 191: int32(63), + 192: int32(64), + 193: int32('a'), + 194: int32('b'), + 195: int32('c'), + 196: int32('d'), + 197: int32('e'), + 198: int32('f'), + 199: int32('g'), + 200: int32('h'), + 201: int32('i'), + 202: int32('j'), + 203: int32('k'), + 204: int32('l'), + 205: int32('m'), + 206: int32('n'), + 207: int32('o'), + 208: int32('p'), + 209: int32('q'), + 210: int32('r'), + 211: int32('s'), + 212: int32('t'), + 213: int32('u'), + 214: int32('v'), + 215: int32('w'), + 216: int32('x'), + 217: int32('y'), + 218: int32('z'), + 219: int32(91), + 220: int32(92), + 221: int32(93), + 222: int32(94), + 223: int32(95), + 224: int32(96), + 225: int32('a'), + 226: int32('b'), + 227: int32('c'), + 228: int32('d'), + 229: int32('e'), + 230: int32('f'), + 231: int32('g'), + 232: int32('h'), + 233: int32('i'), + 234: int32('j'), + 235: int32('k'), + 236: int32('l'), + 237: int32('m'), + 238: int32('n'), + 239: int32('o'), + 240: int32('p'), + 241: int32('q'), + 242: int32('r'), + 243: int32('s'), + 244: int32('t'), + 245: int32('u'), + 246: int32('v'), + 247: int32('w'), + 248: int32('x'), + 249: int32('y'), + 250: int32('z'), + 251: int32(123), + 252: int32(124), + 253: int32(125), + 254: int32(126), + 255: int32(127), +} + +var _ptable1 = uintptr(unsafe.Pointer(&_table1)) + uintptr(128)*4 + +func X__ctype_tolower_loc(tls *TLS) (r uintptr) { + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + defer func() { trc("-> %v", r) }() + } + return uintptr(unsafe.Pointer(&_ptable1)) +} + +var Xin6addr_any = Tin6_addr{} + +type Tin6_addr = struct { + F__in6_union struct { + F__s6_addr16 [0][8]uint16 + F__s6_addr32 [0][4]uint32 + F__s6_addr [16]uint8 + } +} + +func Xrewinddir(tls *TLS, f uintptr) { + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } + Xfseek(tls, f, 0, stdio.SEEK_SET) +} diff --git a/vendor/modernc.org/libc/libc_linux_amd64.go b/vendor/modernc.org/libc/libc_linux_amd64.go index 4d3bf1a5..4aa05557 100644 --- a/vendor/modernc.org/libc/libc_linux_amd64.go +++ b/vendor/modernc.org/libc/libc_linux_amd64.go @@ -7,6 +7,7 @@ package libc // import "modernc.org/libc" import ( "os" "strings" + gotime "time" "unicode" "unsafe" @@ -14,12 +15,21 @@ import ( "modernc.org/libc/errno" "modernc.org/libc/fcntl" "modernc.org/libc/signal" + "modernc.org/libc/stdio" "modernc.org/libc/sys/types" + "modernc.org/libc/time" "modernc.org/libc/wctype" ) +var ( + startTime = gotime.Now() // For clock(3) +) + // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/arch/x86_64/ksigaction.h // // struct k_sigaction { @@ -65,6 +75,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -89,6 +102,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LSTAT, pathname, statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -105,6 +121,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_STAT, pathname, statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -121,6 +140,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -136,11 +158,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { // if dmesgs { @@ -158,6 +186,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -179,6 +210,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -195,6 +229,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) if err != 0 { // if dmesgs { @@ -212,6 +249,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -222,6 +262,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) if err != 0 { panic(todo("")) @@ -232,6 +275,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) if err != 0 { t.setErrno(err) @@ -246,6 +292,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -256,6 +305,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -269,6 +321,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { t.setErrno(err) return -1 @@ -282,6 +337,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHMOD, pathname, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -295,6 +353,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -308,6 +369,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UNLINK, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -321,6 +385,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -337,6 +404,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -350,6 +420,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RENAME, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -360,6 +433,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { t.setErrno(err) return -1 @@ -370,6 +446,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -380,6 +459,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -390,6 +472,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -400,6 +485,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if err != 0 { t.setErrno(err) @@ -411,6 +499,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) if err != 0 { t.setErrno(err) @@ -422,6 +513,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -458,16 +552,25 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int iswspace(wint_t wc); func Xiswspace(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsSpace(rune(wc))) } // int iswalnum(wint_t wc); func Xiswalnum(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsLetter(rune(wc)) || unicode.IsNumber(rune(wc))) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -475,3 +578,188 @@ func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { return 0 } + +func AtomicLoadPInt8(addr uintptr) (val int8) { + return int8(a_load_8(addr)) +} + +func AtomicLoadPInt16(addr uintptr) (val int16) { + return int16(a_load_16(addr)) +} + +func AtomicLoadPUint8(addr uintptr) byte { + return byte(a_load_8(addr)) +} + +func AtomicLoadPUint16(addr uintptr) uint16 { + return uint16(a_load_16(addr)) +} + +func AtomicLoadNUint8(ptr uintptr, memorder int32) uint8 { + return byte(a_load_8(ptr)) +} + +var _table1 = [384]int32{ + 129: int32(1), + 130: int32(2), + 131: int32(3), + 132: int32(4), + 133: int32(5), + 134: int32(6), + 135: int32(7), + 136: int32(8), + 137: int32(9), + 138: int32(10), + 139: int32(11), + 140: int32(12), + 141: int32(13), + 142: int32(14), + 143: int32(15), + 144: int32(16), + 145: int32(17), + 146: int32(18), + 147: int32(19), + 148: int32(20), + 149: int32(21), + 150: int32(22), + 151: int32(23), + 152: int32(24), + 153: int32(25), + 154: int32(26), + 155: int32(27), + 156: int32(28), + 157: int32(29), + 158: int32(30), + 159: int32(31), + 160: int32(32), + 161: int32(33), + 162: int32(34), + 163: int32(35), + 164: int32(36), + 165: int32(37), + 166: int32(38), + 167: int32(39), + 168: int32(40), + 169: int32(41), + 170: int32(42), + 171: int32(43), + 172: int32(44), + 173: int32(45), + 174: int32(46), + 175: int32(47), + 176: int32(48), + 177: int32(49), + 178: int32(50), + 179: int32(51), + 180: int32(52), + 181: int32(53), + 182: int32(54), + 183: int32(55), + 184: int32(56), + 185: int32(57), + 186: int32(58), + 187: int32(59), + 188: int32(60), + 189: int32(61), + 190: int32(62), + 191: int32(63), + 192: int32(64), + 193: int32('a'), + 194: int32('b'), + 195: int32('c'), + 196: int32('d'), + 197: int32('e'), + 198: int32('f'), + 199: int32('g'), + 200: int32('h'), + 201: int32('i'), + 202: int32('j'), + 203: int32('k'), + 204: int32('l'), + 205: int32('m'), + 206: int32('n'), + 207: int32('o'), + 208: int32('p'), + 209: int32('q'), + 210: int32('r'), + 211: int32('s'), + 212: int32('t'), + 213: int32('u'), + 214: int32('v'), + 215: int32('w'), + 216: int32('x'), + 217: int32('y'), + 218: int32('z'), + 219: int32(91), + 220: int32(92), + 221: int32(93), + 222: int32(94), + 223: int32(95), + 224: int32(96), + 225: int32('a'), + 226: int32('b'), + 227: int32('c'), + 228: int32('d'), + 229: int32('e'), + 230: int32('f'), + 231: int32('g'), + 232: int32('h'), + 233: int32('i'), + 234: int32('j'), + 235: int32('k'), + 236: int32('l'), + 237: int32('m'), + 238: int32('n'), + 239: int32('o'), + 240: int32('p'), + 241: int32('q'), + 242: int32('r'), + 243: int32('s'), + 244: int32('t'), + 245: int32('u'), + 246: int32('v'), + 247: int32('w'), + 248: int32('x'), + 249: int32('y'), + 250: int32('z'), + 251: int32(123), + 252: int32(124), + 253: int32(125), + 254: int32(126), + 255: int32(127), +} + +var _ptable1 = uintptr(unsafe.Pointer(&_table1)) + uintptr(128)*4 + +func X__ctype_tolower_loc(tls *TLS) (r uintptr) { + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + defer func() { trc("-> %v", r) }() + } + return uintptr(unsafe.Pointer(&_ptable1)) +} + +type Tin6_addr = struct { + F__in6_union struct { + F__s6_addr16 [0][8]uint16 + F__s6_addr32 [0][4]uint32 + F__s6_addr [16]uint8 + } +} + +var Xin6addr_any = Tin6_addr{} + +func Xrewinddir(tls *TLS, f uintptr) { + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } + Xfseek(tls, f, 0, stdio.SEEK_SET) +} + +// clock_t clock(void); +func Xclock(t *TLS) time.Clock_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } + return time.Clock_t(gotime.Since(startTime) * gotime.Duration(time.CLOCKS_PER_SEC) / gotime.Second) +} diff --git a/vendor/modernc.org/libc/libc_linux_arm.go b/vendor/modernc.org/libc/libc_linux_arm.go index ce45b1ae..c8e04947 100644 --- a/vendor/modernc.org/libc/libc_linux_arm.go +++ b/vendor/modernc.org/libc/libc_linux_arm.go @@ -20,6 +20,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/arch/x32/ksigaction.h // // struct k_sigaction { @@ -65,6 +68,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -89,6 +95,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -105,6 +114,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_STAT64, pathname, statbuf, 0); err != 0 { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -121,6 +133,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT64, uintptr(fd), statbuf, 0); err != 0 { if dmesgs { dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -137,6 +152,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -158,11 +176,17 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP2, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset>>12)) if err != 0 { if dmesgs { @@ -180,6 +204,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { t.setErrno(err) return -1 @@ -193,6 +220,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { t.setErrno(err) return -1 @@ -206,6 +236,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_FTRUNCATE64, uintptr(fd), 0, uintptr(length), uintptr(length>>32), 0, 0); err != 0 { if dmesgs { dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -222,6 +255,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -239,6 +275,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if err := unix.Utime(GoString(filename), (*unix.Utimbuf)(unsafe.Pointer(times))); err != nil { t.setErrno(err) return -1 @@ -249,11 +288,17 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) } // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if err := unix.Getrlimit(int(resource), (*unix.Rlimit)(unsafe.Pointer(rlim))); err != nil { t.setErrno(err) return -1 @@ -264,6 +309,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n := time.Now().UTC().Unix() if tloc != 0 { *(*types.Time_t)(unsafe.Pointer(tloc)) = types.Time_t(n) @@ -273,6 +321,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var tv []unix.Timeval if times != 0 { tv = make([]unix.Timeval, 2) @@ -294,6 +345,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlinkat(unix.AT_FDCWD, GoString(pathname), 0); err != nil { t.setErrno(err) return -1 @@ -307,6 +361,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Faccessat(unix.AT_FDCWD, GoString(pathname), uint32(mode), 0); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -323,6 +380,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Rmdir(GoString(pathname)); err != nil { t.setErrno(err) return -1 @@ -336,6 +396,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { t.setErrno(err) return -1 @@ -346,11 +409,17 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) } // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if err := unix.Chown(GoString(pathname), int(owner), int(group)); err != nil { t.setErrno(err) return -1 @@ -361,11 +430,17 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) } // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_PIPE2, pipefd, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -376,11 +451,17 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) } // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } n, err := unix.Readlink(GoString(path), GoBytes(buf, int(bufsize))) if err != nil { t.setErrno(err) @@ -392,6 +473,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -428,6 +512,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { t.setErrno(err) return -1 @@ -450,6 +537,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 diff --git a/vendor/modernc.org/libc/libc_linux_arm64.go b/vendor/modernc.org/libc/libc_linux_arm64.go index 1b83364e..5a33ff8a 100644 --- a/vendor/modernc.org/libc/libc_linux_arm64.go +++ b/vendor/modernc.org/libc/libc_linux_arm64.go @@ -20,6 +20,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/src/internal/ksigaction.h // // struct k_sigaction { @@ -65,6 +68,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -81,6 +87,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Fstatat(unix.AT_FDCWD, GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf)), 0); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -97,6 +106,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlinkat(unix.AT_FDCWD, GoString(pathname), 0); err != nil { t.setErrno(err) return -1 @@ -110,6 +122,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Faccessat(unix.AT_FDCWD, GoString(pathname), uint32(mode), 0); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -126,6 +141,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) if err != 0 { if dmesgs { @@ -143,6 +161,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { if dmesgs { dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -159,6 +180,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { if dmesgs { dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -175,6 +199,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -199,6 +226,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Rmdir(GoString(pathname)); err != nil { t.setErrno(err) return -1 @@ -212,6 +242,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { t.setErrno(err) return -1 @@ -222,11 +255,17 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) } // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if err := unix.Chown(GoString(pathname), int(owner), int(group)); err != nil { t.setErrno(err) return -1 @@ -237,11 +276,17 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) } // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_PIPE2, pipefd, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -252,11 +297,17 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) } // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -267,6 +318,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } n, err := unix.Readlink(GoString(path), GoBytes(buf, int(bufsize))) if err != nil { t.setErrno(err) @@ -278,6 +332,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -314,6 +371,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { t.setErrno(err) return -1 @@ -327,6 +387,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -347,11 +410,17 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { if dmesgs { @@ -369,6 +438,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { t.setErrno(err) return -1 @@ -382,6 +454,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { t.setErrno(err) return -1 @@ -395,6 +470,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n := time.Now().UTC().Unix() if tloc != 0 { *(*types.Time_t)(unsafe.Pointer(tloc)) = types.Time_t(n) @@ -404,6 +482,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var tv []unix.Timeval if times != 0 { tv = make([]unix.Timeval, 2) @@ -425,6 +506,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if err := unix.Utime(GoString(filename), (*unix.Utimbuf)(unsafe.Pointer(times))); err != nil { t.setErrno(err) return -1 @@ -435,11 +519,17 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 diff --git a/vendor/modernc.org/libc/libc_linux_loong64.go b/vendor/modernc.org/libc/libc_linux_loong64.go index 5dc8d5e0..b8b4f94f 100644 --- a/vendor/modernc.org/libc/libc_linux_loong64.go +++ b/vendor/modernc.org/libc/libc_linux_loong64.go @@ -5,10 +5,10 @@ package libc // import "modernc.org/libc" import ( - "unicode" - "unsafe" "os" "strings" + "unicode" + "unsafe" "golang.org/x/sys/unix" "modernc.org/libc/errno" @@ -20,6 +20,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/arch/x86_64/ksigaction.h // // struct k_sigaction { @@ -65,6 +68,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -89,6 +95,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LSTAT, pathname, statbuf, 0); err != 0 { // // if dmesgs { @@ -106,6 +115,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_STAT, pathname, statbuf, 0); err != 0 { // // if dmesgs { @@ -123,6 +135,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // // if dmesgs { @@ -139,11 +154,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { // if dmesgs { @@ -161,6 +182,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -182,6 +206,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -198,6 +225,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) if err != 0 { // if dmesgs { @@ -215,6 +245,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { // t.setErrno(err) @@ -226,6 +259,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -237,6 +273,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) // if err != 0 { @@ -252,6 +291,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { // t.setErrno(err) @@ -263,6 +305,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { // t.setErrno(err) @@ -277,6 +322,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { // t.setErrno(err) @@ -291,6 +339,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_CHMOD, pathname, uintptr(mode), 0); err != 0 { // t.setErrno(err) @@ -305,6 +356,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { // t.setErrno(err) @@ -319,6 +373,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UNLINK, pathname, 0, 0); err != 0 { // t.setErrno(err) @@ -333,6 +390,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // // if dmesgs { @@ -350,6 +410,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { // t.setErrno(err) @@ -364,6 +427,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_RENAME, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -375,6 +441,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -386,6 +455,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } panic(todo("")) // // if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { // // t.setErrno(err) @@ -397,6 +469,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -408,6 +483,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { // t.setErrno(err) @@ -419,6 +497,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -431,6 +512,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) // if err != 0 { @@ -443,6 +527,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -478,16 +565,25 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int iswspace(wint_t wc); func Xiswspace(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsSpace(rune(wc))) } // int iswalnum(wint_t wc); func Xiswalnum(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsLetter(rune(wc)) || unicode.IsNumber(rune(wc))) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { // t.setErrno(err) diff --git a/vendor/modernc.org/libc/libc_linux_ppc64le.go b/vendor/modernc.org/libc/libc_linux_ppc64le.go index d23be04f..c05fd055 100644 --- a/vendor/modernc.org/libc/libc_linux_ppc64le.go +++ b/vendor/modernc.org/libc/libc_linux_ppc64le.go @@ -20,6 +20,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/arch/x86_64/ksigaction.h // // struct k_sigaction { @@ -65,6 +68,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -97,6 +103,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LSTAT, pathname, statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -113,6 +122,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_STAT, pathname, statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -129,6 +141,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -144,11 +159,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { // if dmesgs { @@ -166,6 +187,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -187,6 +211,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -203,6 +230,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) if err != 0 { // if dmesgs { @@ -220,6 +250,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -230,6 +263,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) if err != 0 { panic(todo("")) @@ -240,6 +276,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) if err != 0 { t.setErrno(err) @@ -254,6 +293,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -264,6 +306,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -277,6 +322,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { t.setErrno(err) return -1 @@ -290,6 +338,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHMOD, pathname, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -303,6 +354,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -316,6 +370,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UNLINK, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -329,6 +386,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -345,6 +405,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -358,6 +421,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RENAME, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -368,6 +434,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { t.setErrno(err) return -1 @@ -378,6 +447,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -388,6 +460,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -398,6 +473,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -408,6 +486,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if err != 0 { t.setErrno(err) @@ -419,6 +500,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) if err != 0 { t.setErrno(err) @@ -430,6 +514,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -466,11 +553,17 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int iswspace(wint_t wc); func Xiswspace(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsSpace(rune(wc))) } // int iswalnum(wint_t wc); func Xiswalnum(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsLetter(rune(wc)) || unicode.IsNumber(rune(wc))) } @@ -488,6 +581,9 @@ func __syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 diff --git a/vendor/modernc.org/libc/libc_linux_riscv64.go b/vendor/modernc.org/libc/libc_linux_riscv64.go index e49c0f44..a0413638 100644 --- a/vendor/modernc.org/libc/libc_linux_riscv64.go +++ b/vendor/modernc.org/libc/libc_linux_riscv64.go @@ -21,6 +21,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/arch/x86_64/ksigaction.h // // struct k_sigaction { @@ -66,6 +69,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -90,6 +96,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int fstatat(int dirfd, const char *pathname, struct stat *statbuf, int flags); func Xfstatat(t *TLS, dirfd int32, pathname, statbuf uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v dirfd=%v statbuf=%v flags=%v, (%v:)", t, dirfd, statbuf, flags, origin(2)) + } // From golang.org/x/sys/unix/zsyscall_linux_riscv64.go if _, _, err := unix.Syscall6(unix.SYS_FSTATAT, uintptr(dirfd), pathname, statbuf, uintptr(flags), 0, 0); err != 0 { t.setErrno(err) @@ -101,18 +110,27 @@ func Xfstatat(t *TLS, dirfd int32, pathname, statbuf uintptr, flags int32) int32 // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux_riscv64.go return Xfstatat(t, unix.AT_FDCWD, pathname, statbuf, unix.AT_SYMLINK_NOFOLLOW) } // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux_riscv64.go return Xfstatat(t, unix.AT_FDCWD, pathname, statbuf, 0) } // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -128,11 +146,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { // if dmesgs { @@ -150,6 +174,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -171,6 +198,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -187,6 +217,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) if err != 0 { // if dmesgs { @@ -218,6 +251,9 @@ type utimbuf struct { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if times == 0 { return Xutimes(t, filename, 0) } @@ -234,6 +270,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // No alarm syscall on linux/riscv64. And cannot implement with setitimer as in musl, // because of missing defination to constant ITIMER_REAL in types_linux_riscv64.go. @@ -241,6 +280,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux_riscv64.go var tv types.Timeval if err := Xgettimeofday(t, uintptr(unsafe.Pointer(&tv)), 0); err != 0 { @@ -256,6 +298,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -266,95 +311,143 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xmkdirat(t, unix.AT_FDCWD, path, mode) } // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xsymlinkat(t, target, unix.AT_FDCWD, linkpath) } // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xfchmodat(t, unix.AT_FDCWD, pathname, mode, 0) } // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } return Xutimensat(t, unix.AT_FDCWD, filename, times, 0) } // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xunlinkat(t, unix.AT_FDCWD, pathname, 0) } // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xfaccessat(t, unix.AT_FDCWD, pathname, mode, 0) } // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xunlinkat(t, unix.AT_FDCWD, pathname, unix.AT_REMOVEDIR) } // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xrenameat(t, unix.AT_FDCWD, oldpath, unix.AT_FDCWD, newpath) } // int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); func Xrenameat(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v olddirfd=%v oldpath=%v newdirfd=%v newpath=%v, (%v:)", t, olddirfd, oldpath, newdirfd, newpath, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux_riscv64.go return Xrenameat2(t, olddirfd, oldpath, newdirfd, newpath, 0) } // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xmknodat(t, unix.AT_FDCWD, pathname, mode, dev) } // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xfchownat(t, unix.AT_FDCWD, pathname, owner, group, 0) } // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xlinkat(t, unix.AT_FDCWD, oldpath, unix.AT_FDCWD, newpath, 0) } // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xpipe2(t, pipefd, 0) } // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xdup3(t, oldfd, newfd, 0) } // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } // From golang.org/x/sys/unix/syscall_linux.go return Xreadlinkat(t, unix.AT_FDCWD, path, buf, bufsize) } // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -392,11 +485,17 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int iswspace(wint_t wc); func Xiswspace(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsSpace(rune(wc))) } // int iswalnum(wint_t wc); func Xiswalnum(t *TLS, wc wctype.Wint_t) int32 { + if __ccgo_strace { + trc("t=%v wc=%v, (%v:)", t, wc, origin(2)) + } return Bool32(unicode.IsLetter(rune(wc)) || unicode.IsNumber(rune(wc))) } @@ -414,6 +513,9 @@ func __syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 diff --git a/vendor/modernc.org/libc/libc_linux_s390x.go b/vendor/modernc.org/libc/libc_linux_s390x.go index d5a0aa6e..a6d2961a 100644 --- a/vendor/modernc.org/libc/libc_linux_s390x.go +++ b/vendor/modernc.org/libc/libc_linux_s390x.go @@ -18,6 +18,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } // musl/src/internal/ksigaction.h // struct k_sigaction { // void (*handler)(int); @@ -62,6 +65,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -86,6 +92,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LSTAT, pathname, statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -102,6 +111,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_STAT, pathname, statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -118,6 +130,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -133,11 +148,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } // https://github.com/golang/go/blob/7d822af4500831d131562f17dcf53374469d823e/src/syscall/syscall_linux_s390x.go#L77 args := [6]uintptr{addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)} data, _, err := unix.Syscall(unix.SYS_MMAP, uintptr(unsafe.Pointer(&args[0])), 0, 0) @@ -157,6 +178,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -178,6 +202,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { // dmesg("%v: fd %d: %v", origin(1), fd, err) @@ -194,6 +221,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) if err != 0 { // if dmesgs { @@ -211,6 +241,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -221,6 +254,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) if err != 0 { panic(todo("")) @@ -231,6 +267,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } n, err := unix.Time((*unix.Time_t)(unsafe.Pointer(tloc))) if err != nil { t.setErrno(err) @@ -242,6 +281,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -252,6 +294,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -265,6 +310,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { t.setErrno(err) return -1 @@ -278,6 +326,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHMOD, pathname, uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -291,6 +342,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { t.setErrno(err) return -1 @@ -304,6 +358,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_UNLINK, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -317,6 +374,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // if dmesgs { // dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -333,6 +393,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -346,6 +409,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_RENAME, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -356,6 +422,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { t.setErrno(err) return -1 @@ -366,6 +435,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -376,6 +448,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { t.setErrno(err) return -1 @@ -386,6 +461,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -396,6 +474,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) if err != 0 { t.setErrno(err) @@ -407,6 +488,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) if err != 0 { t.setErrno(err) @@ -418,6 +502,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -467,6 +554,9 @@ func __syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 diff --git a/vendor/modernc.org/libc/libc_netbsd.go b/vendor/modernc.org/libc/libc_netbsd.go index f4ed268f..2a440124 100644 --- a/vendor/modernc.org/libc/libc_netbsd.go +++ b/vendor/modernc.org/libc/libc_netbsd.go @@ -79,6 +79,9 @@ var X_ThreadRuneLocale uintptr //TODO initialize and implement _Thread_local sem // include/xlocale/_ctype.h:54:_RuneLocale *__runes_for_locale(locale_t, int*); func X__runes_for_locale(t *TLS, l locale_t, p uintptr) uintptr { + if __ccgo_strace { + trc("t=%v l=%v p=%v, (%v:)", t, l, p, origin(2)) + } panic(todo("")) } @@ -142,23 +145,35 @@ func fwrite(fd int32, b []byte) (int, error) { // unsigned long ___runetype(__ct_rune_t) __pure; func X___runetype(t *TLS, x int32) ulong { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } panic(todo("")) } // int fprintf(FILE *stream, const char *format, ...); func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } n, _ := fwrite(int32((*stdio.FILE)(unsafe.Pointer(stream)).F_file), printf(format, args)) return int32(n) } // int usleep(useconds_t usec); func Xusleep(t *TLS, usec uint32) int32 { + if __ccgo_strace { + trc("t=%v usec=%v, (%v:)", t, usec, origin(2)) + } gotime.Sleep(gotime.Microsecond * gotime.Duration(usec)) return 0 } // int getrusage(int who, struct rusage *usage); func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if __ccgo_strace { + trc("t=%v who=%v usage=%v, (%v:)", t, who, usage, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { t.setErrno(err) return -1 @@ -169,6 +184,9 @@ func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { // int fgetc(FILE *stream); func Xfgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } fd := int((*stdio.FILE)(unsafe.Pointer(stream)).F_file) var buf [1]byte if n, _ := unix.Read(fd, buf[:]); n != 0 { @@ -180,16 +198,25 @@ func Xfgetc(t *TLS, stream uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xlstat64(t, pathname, statbuf) } // int stat(const char *pathname, struct stat *statbuf); func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xstat64(t, pathname, statbuf) } // int chdir(const char *path); func Xchdir(t *TLS, path uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v, (%v:)", t, path, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHDIR, path, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -239,11 +266,17 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { // int open(const char *pathname, int flags, ...); func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } return Xopen64(t, pathname, flags, args) } // int open(const char *pathname, int flags, ...); func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } var mode types.Mode_t if args != 0 { mode = (types.Mode_t)(VaUint32(&args)) @@ -266,6 +299,9 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { // off_t lseek(int fd, off_t offset, int whence); func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } return types.Off_t(Xlseek64(t, fd, offset, whence)) } @@ -277,6 +313,9 @@ var fsyncStatbuf stat.Stat // int fsync(int fd); func Xfsync(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if noFsync { // Simulate -DSQLITE_NO_SYNC for sqlite3 testfixture, see function full_sync in sqlite3.c return Xfstat(t, fd, uintptr(unsafe.Pointer(&fsyncStatbuf))) @@ -295,6 +334,9 @@ func Xfsync(t *TLS, fd int32) int32 { // long sysconf(int name); func Xsysconf(t *TLS, name int32) long { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } switch name { case unistd.X_SC_PAGESIZE: return long(unix.Getpagesize()) @@ -311,6 +353,9 @@ func Xsysconf(t *TLS, name int32) long { // int close(int fd); func Xclose(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CLOSE, uintptr(fd), 0, 0); err != 0 { t.setErrno(err) return -1 @@ -324,6 +369,9 @@ func Xclose(t *TLS, fd int32) int32 { // char *getcwd(char *buf, size_t size); func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } if _, err := unix.Getcwd((*RawMem)(unsafe.Pointer(buf))[:size:size]); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -340,11 +388,17 @@ func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { // int fstat(int fd, struct stat *statbuf); func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } return Xfstat64(t, fd, statbuf) } // int ftruncate(int fd, off_t length); func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if err := unix.Ftruncate(int(fd), int64(length)); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -361,11 +415,17 @@ func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } return Xfcntl64(t, fd, cmd, args) } // ssize_t read(int fd, void *buf, size_t count); func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READ, uintptr(fd), buf, uintptr(count)) if err != 0 { t.setErrno(err) @@ -381,6 +441,9 @@ func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // ssize_t write(int fd, const void *buf, size_t count); func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } const retry = 5 var err syscall.Errno for i := 0; i < retry; i++ { @@ -406,6 +469,9 @@ func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // int fchmod(int fd, mode_t mode); func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -419,6 +485,9 @@ func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { // int fchown(int fd, uid_t owner, gid_t group); func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v owner=%v group=%v, (%v:)", t, fd, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHOWN, uintptr(fd), uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -429,12 +498,18 @@ func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { // uid_t geteuid(void); func Xgeteuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_GETEUID, 0, 0, 0) return types.Uid_t(n) } // int munmap(void *addr, size_t length); func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v addr=%v length=%v, (%v:)", t, addr, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { t.setErrno(err) return -1 @@ -445,6 +520,9 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if __ccgo_strace { + trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) + } if tz != 0 { panic(todo("")) } @@ -462,6 +540,9 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { // int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optlen=%v, (%v:)", t, optname, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 { t.setErrno(err) return -1 @@ -472,6 +553,9 @@ func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) i // int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optval=%v optlen=%v, (%v:)", t, optname, optval, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 { t.setErrno(err) return -1 @@ -482,6 +566,9 @@ func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen so // int ioctl(int fd, unsigned long request, ...); func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v request=%v va=%v, (%v:)", t, fd, request, va, origin(2)) + } var argp uintptr if va != 0 { argp = VaUintptr(&va) @@ -497,6 +584,9 @@ func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { // int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETSOCKNAME, uintptr(sockfd), addr, addrlen); err != 0 { // if dmesgs { // dmesg("%v: fd %v: %v", origin(1), sockfd, err) @@ -510,6 +600,9 @@ func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { // int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v timeout=%v, (%v:)", t, nfds, timeout, origin(2)) + } n, err := unix.Select( int(nfds), (*unix.FdSet)(unsafe.Pointer(readfds)), @@ -527,17 +620,26 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) // int mkfifo(const char *pathname, mode_t mode); func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) } // mode_t umask(mode_t mask); func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + if __ccgo_strace { + trc("t=%v mask=%v, (%v:)", t, mask, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_UMASK, uintptr(mask), 0, 0) return types.Mode_t(n) } // int execvp(const char *file, char *const argv[]); func Xexecvp(t *TLS, file, argv uintptr) int32 { + if __ccgo_strace { + trc("t=%v argv=%v, (%v:)", t, argv, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_EXECVE, file, argv, Environ()); err != 0 { t.setErrno(err) return -1 @@ -548,6 +650,9 @@ func Xexecvp(t *TLS, file, argv uintptr) int32 { // pid_t waitpid(pid_t pid, int *wstatus, int options); func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + if __ccgo_strace { + trc("t=%v pid=%v wstatus=%v optname=%v, (%v:)", t, pid, wstatus, optname, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_WAIT4, uintptr(pid), wstatus, uintptr(optname), 0, 0, 0) if err != 0 { t.setErrno(err) @@ -559,6 +664,9 @@ func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid // int uname(struct utsname *buf); func Xuname(t *TLS, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } if err := unix.Uname((*unix.Utsname)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -575,6 +683,9 @@ func Xuname(t *TLS, buf uintptr) int32 { // ssize_t recv(int sockfd, void *buf, size_t len, int flags); func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -586,6 +697,9 @@ func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // ssize_t send(int sockfd, const void *buf, size_t len, int flags); func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -597,6 +711,9 @@ func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // int shutdown(int sockfd, int how); func Xshutdown(t *TLS, sockfd, how int32) int32 { + if __ccgo_strace { + trc("t=%v how=%v, (%v:)", t, how, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { t.setErrno(err) return -1 @@ -607,6 +724,9 @@ func Xshutdown(t *TLS, sockfd, how int32) int32 { // int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -617,6 +737,9 @@ func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int socket(int domain, int type, int protocol); func Xsocket(t *TLS, domain, type1, protocol int32) int32 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol)) if err != 0 { t.setErrno(err) @@ -628,6 +751,9 @@ func Xsocket(t *TLS, domain, type1, protocol int32) int32 { // int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen)) if err != 0 { t.setErrno(err) @@ -639,6 +765,9 @@ func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -649,6 +778,9 @@ func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int listen(int sockfd, int backlog); func Xlisten(t *TLS, sockfd, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v backlog=%v, (%v:)", t, backlog, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 { t.setErrno(err) return -1 @@ -659,6 +791,9 @@ func Xlisten(t *TLS, sockfd, backlog int32) int32 { // int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall6(unix.SYS_ACCEPT4, uintptr(sockfd), addr, uintptr(addrlen), 0, 0, 0) // if err != 0 { @@ -671,16 +806,25 @@ func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xgetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xsetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -691,16 +835,25 @@ func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // uid_t getuid(void); func Xgetuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return types.Uid_t(os.Getuid()) } // pid_t getpid(void); func Xgetpid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return int32(os.Getpid()) } // int system(const char *command); func Xsystem(t *TLS, command uintptr) int32 { + if __ccgo_strace { + trc("t=%v command=%v, (%v:)", t, command, origin(2)) + } s := GoString(command) if command == 0 { panic(todo("")) @@ -720,26 +873,41 @@ func Xsystem(t *TLS, command uintptr) int32 { // int setvbuf(FILE *stream, char *buf, int mode, size_t size); func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v mode=%v size=%v, (%v:)", t, buf, mode, size, origin(2)) + } return 0 //TODO } // int raise(int sig); func Xraise(t *TLS, sig int32) int32 { + if __ccgo_strace { + trc("t=%v sig=%v, (%v:)", t, sig, origin(2)) + } panic(todo("")) } // int backtrace(void **buffer, int size); func Xbacktrace(t *TLS, buf uintptr, size int32) int32 { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } panic(todo("")) } // void backtrace_symbols_fd(void *const *buffer, int size, int fd); func Xbacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) { + if __ccgo_strace { + trc("t=%v buffer=%v fd=%v, (%v:)", t, buffer, fd, origin(2)) + } panic(todo("")) } // int fileno(FILE *stream); func Xfileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -773,11 +941,17 @@ func (f *ftstream) close(t *TLS) { // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } return Xfts64_open(t, path_argv, options, compar) } // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } f := &ftstream{} var walk func(string) @@ -882,11 +1056,17 @@ func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintp // FTSENT *fts_read(FTS *ftsp); func Xfts_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_read(t, ftsp) } // FTSENT *fts_read(FTS *ftsp); func Xfts64_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } f := getObject(ftsp).(*ftstream) if f.x == len(f.s) { t.setErrno(0) @@ -903,11 +1083,17 @@ func Xfts64_read(t *TLS, ftsp uintptr) uintptr { // int fts_close(FTS *ftsp); func Xfts_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_close(t, ftsp) } // int fts_close(FTS *ftsp); func Xfts64_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } getObject(ftsp).(*ftstream).close(t) removeObject(ftsp) return 0 @@ -915,6 +1101,9 @@ func Xfts64_close(t *TLS, ftsp uintptr) int32 { // void tzset (void); func Xtzset(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } //TODO } @@ -922,6 +1111,9 @@ var strerrorBuf [100]byte // char *strerror(int errnum); func Xstrerror(t *TLS, errnum int32) uintptr { + if __ccgo_strace { + trc("t=%v errnum=%v, (%v:)", t, errnum, origin(2)) + } if dmesgs { dmesg("%v: %v\n%s", origin(1), errnum, debug.Stack()) } @@ -931,31 +1123,49 @@ func Xstrerror(t *TLS, errnum int32) uintptr { // void *dlopen(const char *filename, int flags); func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + if __ccgo_strace { + trc("t=%v filename=%v flags=%v, (%v:)", t, filename, flags, origin(2)) + } panic(todo("")) } // char *dlerror(void); func Xdlerror(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int dlclose(void *handle); func Xdlclose(t *TLS, handle uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } panic(todo("")) } // void *dlsym(void *handle, const char *symbol); func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + if __ccgo_strace { + trc("t=%v symbol=%v, (%v:)", t, symbol, origin(2)) + } panic(todo("")) } // void perror(const char *s); func Xperror(t *TLS, s uintptr) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func Xpclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -963,37 +1173,58 @@ var gai_strerrorBuf [100]byte // const char *gai_strerror(int errcode); func Xgai_strerror(t *TLS, errcode int32) uintptr { + if __ccgo_strace { + trc("t=%v errcode=%v, (%v:)", t, errcode, origin(2)) + } copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) return uintptr(unsafe.Pointer(&gai_strerrorBuf)) } // int tcgetattr(int fd, struct termios *termios_p); func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v termios_p=%v, (%v:)", t, fd, termios_p, origin(2)) + } panic(todo("")) } // int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v optional_actions=%v termios_p=%v, (%v:)", t, optional_actions, termios_p, origin(2)) + } panic(todo("")) } // speed_t cfgetospeed(const struct termios *termios_p); func Xcfgetospeed(t *TLS, termios_p uintptr) termios.Speed_t { + if __ccgo_strace { + trc("t=%v termios_p=%v, (%v:)", t, termios_p, origin(2)) + } panic(todo("")) } // int cfsetospeed(struct termios *termios_p, speed_t speed); func Xcfsetospeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // int cfsetispeed(struct termios *termios_p, speed_t speed); func Xcfsetispeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // pid_t fork(void); func Xfork(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } t.setErrno(errno.ENOSYS) return -1 } @@ -1002,21 +1233,33 @@ var emptyStr = [1]byte{} // char *setlocale(int category, const char *locale); func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + if __ccgo_strace { + trc("t=%v category=%v locale=%v, (%v:)", t, category, locale, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // char *nl_langinfo(nl_item item); func Xnl_langinfo(t *TLS, item langinfo.Nl_item) uintptr { + if __ccgo_strace { + trc("t=%v item=%v, (%v:)", t, item, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // FILE *popen(const char *command, const char *type); func Xpopen(t *TLS, command, type1 uintptr) uintptr { + if __ccgo_strace { + trc("t=%v type1=%v, (%v:)", t, type1, origin(2)) + } panic(todo("")) } // char *realpath(const char *path, char *resolved_path); func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + if __ccgo_strace { + trc("t=%v resolved_path=%v, (%v:)", t, resolved_path, origin(2)) + } s, err := filepath.EvalSymlinks(GoString(path)) if err != nil { if os.IsNotExist(err) { @@ -1045,19 +1288,31 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { // struct tm *gmtime_r(const time_t *timep, struct tm *result); func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } panic(todo("")) } // char *inet_ntoa(struct in_addr in); func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func X__ccgo_in6addr_anyp(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return uintptr(unsafe.Pointer(&in6_addr_any)) } func Xabort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) //TODO // if dmesgs { // dmesg("%v:", origin(1)) @@ -1076,11 +1331,17 @@ func Xabort(t *TLS) { // int fflush(FILE *stream); func Xfflush(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return 0 //TODO } // size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_READ, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1096,6 +1357,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types // size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1111,11 +1375,17 @@ func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) type // int fclose(FILE *stream); func Xfclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return file(stream).close(t) } // int fputc(int c, FILE *stream); func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } if _, err := fwrite(file(stream).fd(), []byte{byte(c)}); err != nil { return stdio.EOF } @@ -1125,6 +1395,9 @@ func Xfputc(t *TLS, c int32, stream uintptr) int32 { // int fseek(FILE *stream, long offset, int whence); func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if __ccgo_strace { + trc("t=%v stream=%v offset=%v whence=%v, (%v:)", t, stream, offset, whence, origin(2)) + } if n := Xlseek(t, int32(file(stream).fd()), types.Off_t(offset), whence); n < 0 { // if dmesgs { // dmesg("%v: fd %v, off %#x, whence %v: %v", origin(1), file(stream).fd(), offset, whenceStr(whence), n) @@ -1141,6 +1414,9 @@ func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { // long ftell(FILE *stream); func Xftell(t *TLS, stream uintptr) long { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } n := Xlseek(t, file(stream).fd(), 0, stdio.SEEK_CUR) if n < 0 { file(stream).setErr() @@ -1155,21 +1431,33 @@ func Xftell(t *TLS, stream uintptr) long { // int ferror(FILE *stream); func Xferror(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return Bool32(file(stream).err()) } // int ungetc(int c, FILE *stream); func Xungetc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } panic(todo("")) } // int fscanf(FILE *stream, const char *format, ...); func Xfscanf(t *TLS, stream, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } panic(todo("")) } // int fputs(const char *s, FILE *stream); func Xfputs(t *TLS, s, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { return -1 } @@ -1181,6 +1469,9 @@ var getservbynameStaticResult netdb.Servent // struct servent *getservbyname(const char *name, const char *proto); func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { + if __ccgo_strace { + trc("t=%v proto=%v, (%v:)", t, proto, origin(2)) + } var protoent *gonetdb.Protoent if proto != 0 { protoent = gonetdb.GetProtoByName(GoString(proto)) @@ -1258,6 +1549,9 @@ func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { } func Xreaddir64(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } return Xreaddir(t, dir) } @@ -1270,14 +1564,23 @@ func __syscall(r, _ uintptr, errno syscall.Errno) long { } func X__syscall1(t *TLS, trap, p1 long) long { + if __ccgo_strace { + trc("t=%v p1=%v, (%v:)", t, p1, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), 0, 0)) } func X__syscall3(t *TLS, trap, p1, p2, p3 long) long { + if __ccgo_strace { + trc("t=%v p3=%v, (%v:)", t, p3, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3))) } func X__syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { + if __ccgo_strace { + trc("t=%v p4=%v, (%v:)", t, p4, origin(2)) + } return __syscall(unix.Syscall6(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3), uintptr(p4), 0, 0)) } @@ -1300,26 +1603,41 @@ func fcntlCmdStr(cmd int32) string { // int setenv(const char *name, const char *value, int overwrite); func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { + if __ccgo_strace { + trc("t=%v value=%v overwrite=%v, (%v:)", t, value, overwrite, origin(2)) + } panic(todo("")) } // int unsetenv(const char *name); func Xunsetenv(t *TLS, name uintptr) int32 { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } panic(todo("")) } // int pause(void); func Xpause(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // ssize_t writev(int fd, const struct iovec *iov, int iovcnt); func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v iov=%v iovcnt=%v, (%v:)", t, fd, iov, iovcnt, origin(2)) + } panic(todo("")) } // int __isoc99_sscanf(const char *str, const char *format, ...); func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := Xsscanf(t, str, format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1329,20 +1647,32 @@ func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { // void __assert(const char * func, const char * file, int line, const char *expr) __dead2; func X__assert(t *TLS, fn, file uintptr, line int32, expr uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v expr=%v, (%v:)", t, file, line, expr, origin(2)) + } X__assert_fail(t, expr, file, uint32(line), fn) } func X__assert13(t *TLS, file uintptr, line int32, fn, msg uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v msg=%v, (%v:)", t, file, line, msg, origin(2)) + } X__assert_fail(t, msg, file, uint32(line), fn) } // include/stdio.h:456:int __swbuf(int, FILE *); func X__swbuf(t *TLS, n int32, file uintptr) int32 { + if __ccgo_strace { + trc("t=%v n=%v file=%v, (%v:)", t, n, file, origin(2)) + } return Xfputc(t, n, file) //TODO improve performance, use a real buffer. } // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Rmdir(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1359,6 +1689,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // struct dirent *readdir(DIR *dirp); func Xreaddir(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } if (*darwinDir)(unsafe.Pointer(dir)).eof { return 0 } @@ -1397,6 +1730,9 @@ type darwinDir struct { // int sscanf(const char *str, const char *format, ...); func Xsscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1406,10 +1742,16 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 { // int * __error(void); func X__error(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return t.errnop } func Xclosedir(t *TLS, dir uintptr) int32 { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } r := Xclose(t, int32((*darwinDir)(unsafe.Pointer(dir)).fd)) Xfree(t, dir) return r @@ -1417,11 +1759,17 @@ func Xclosedir(t *TLS, dir uintptr) int32 { // int __xuname(int namesize, void *namebuf) func X__xuname(t *TLS, namesize int32, namebuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v namesize=%v namebuf=%v, (%v:)", t, namesize, namebuf, origin(2)) + } return Xuname(t, namebuf) } // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint64) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1438,6 +1786,9 @@ func Xchflags(t *TLS, path uintptr, flags uint64) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } var a [2]int if err := syscall.Pipe(a[:]); err != nil { if dmesgs { @@ -1456,10 +1807,16 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // char *inet_ntoa(struct in_addr in); func X__inet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } // Cannot avoid the syscall here, addr sometimes matter. data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) if err != 0 { @@ -1477,27 +1834,45 @@ func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, off } func X__errno(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return X__errno_location(t) } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return (int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).F__attr & uint32(3))) } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return (*(*int32)(unsafe.Pointer((m /* &.__u */ /* &.__i */))) & 15) } func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) return 0 } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -1506,15 +1881,24 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } @@ -1524,6 +1908,9 @@ func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pth // int uuid_parse( char *in, uuid_t uu); func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { + if __ccgo_strace { + trc("t=%v in=%v uu=%v, (%v:)", t, in, uu, origin(2)) + } r, err := guuid.Parse(GoString(in)) if err != nil { return -1 @@ -1533,19 +1920,33 @@ func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { return 0 } -func X__srget(t *TLS, stream uintptr) int32 { return Xgetc(t, stream) } +func X__srget(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } + return Xgetc(t, stream) +} // uint16_t __builtin_bswap16 (uint32_t x) func Xbswap16(t *TLS, x uint16) uint16 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap16(t, x) } // uint32_t __builtin_bswap32 (uint32_t x) func Xbswap32(t *TLS, x uint32) uint32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap32(t, x) } // uint64_t __builtin_bswap64 (uint64_t x) func Xbswap64(t *TLS, x uint64) uint64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap64(t, x) } diff --git a/vendor/modernc.org/libc/libc_netbsd_amd64.go b/vendor/modernc.org/libc/libc_netbsd_amd64.go index c418ad4f..7c4026fa 100644 --- a/vendor/modernc.org/libc/libc_netbsd_amd64.go +++ b/vendor/modernc.org/libc/libc_netbsd_amd64.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { // t.setErrno(err) @@ -35,6 +38,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -74,6 +80,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -90,6 +99,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -106,6 +118,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -122,6 +137,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -138,6 +156,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -154,6 +175,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -178,6 +202,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -194,6 +221,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -210,6 +240,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -220,6 +253,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -242,6 +278,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -258,6 +297,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -274,6 +316,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -295,6 +340,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -311,6 +359,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -322,6 +373,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -344,6 +398,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -354,6 +411,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -365,6 +425,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -377,6 +440,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -388,6 +454,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // int getnameinfo(const struct sockaddr * restrict sa, socklen_t salen, char * restrict host, socklen_t hostlen, char * restrict serv, socklen_t servlen, int flags); func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -487,6 +556,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -574,6 +646,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -608,6 +683,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") diff --git a/vendor/modernc.org/libc/libc_netbsd_arm.go b/vendor/modernc.org/libc/libc_netbsd_arm.go index 7f10ac9c..1a4ebd2f 100644 --- a/vendor/modernc.org/libc/libc_netbsd_arm.go +++ b/vendor/modernc.org/libc/libc_netbsd_arm.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { // t.setErrno(err) @@ -35,6 +38,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -74,6 +80,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -90,6 +99,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -106,6 +118,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -122,6 +137,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -138,6 +156,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -154,6 +175,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -178,6 +202,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -194,6 +221,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -210,6 +240,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -220,6 +253,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -242,6 +278,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -258,6 +297,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -274,6 +316,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -295,6 +340,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -311,6 +359,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -322,6 +373,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -344,6 +398,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -354,6 +411,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -365,6 +425,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -377,6 +440,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -387,6 +453,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -486,6 +555,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -573,6 +645,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -607,6 +682,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint32(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") diff --git a/vendor/modernc.org/libc/libc_openbsd.go b/vendor/modernc.org/libc/libc_openbsd.go index 767fddfe..b9c27c99 100644 --- a/vendor/modernc.org/libc/libc_openbsd.go +++ b/vendor/modernc.org/libc/libc_openbsd.go @@ -79,6 +79,9 @@ var X_ThreadRuneLocale uintptr //TODO initialize and implement _Thread_local sem // include/xlocale/_ctype.h:54:_RuneLocale *__runes_for_locale(locale_t, int*); func X__runes_for_locale(t *TLS, l locale_t, p uintptr) uintptr { + if __ccgo_strace { + trc("t=%v l=%v p=%v, (%v:)", t, l, p, origin(2)) + } panic(todo("")) } @@ -142,23 +145,35 @@ func fwrite(fd int32, b []byte) (int, error) { // unsigned long ___runetype(__ct_rune_t) __pure; func X___runetype(t *TLS, x int32) ulong { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } panic(todo("")) } // int fprintf(FILE *stream, const char *format, ...); func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } n, _ := fwrite(int32((*stdio.FILE)(unsafe.Pointer(stream)).F_file), printf(format, args)) return int32(n) } // int usleep(useconds_t usec); func Xusleep(t *TLS, usec uint32) int32 { + if __ccgo_strace { + trc("t=%v usec=%v, (%v:)", t, usec, origin(2)) + } gotime.Sleep(gotime.Microsecond * gotime.Duration(usec)) return 0 } // int getrusage(int who, struct rusage *usage); func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if __ccgo_strace { + trc("t=%v who=%v usage=%v, (%v:)", t, who, usage, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { t.setErrno(err) return -1 @@ -169,6 +184,9 @@ func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { // int fgetc(FILE *stream); func Xfgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } fd := int((*stdio.FILE)(unsafe.Pointer(stream)).F_file) var buf [1]byte if n, _ := unix.Read(fd, buf[:]); n != 0 { @@ -180,16 +198,25 @@ func Xfgetc(t *TLS, stream uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xlstat64(t, pathname, statbuf) } // int stat(const char *pathname, struct stat *statbuf); func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xstat64(t, pathname, statbuf) } // int chdir(const char *path); func Xchdir(t *TLS, path uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v, (%v:)", t, path, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHDIR, path, 0, 0); err != 0 { t.setErrno(err) return -1 @@ -239,11 +266,17 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { // int open(const char *pathname, int flags, ...); func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } return Xopen64(t, pathname, flags, args) } // int open(const char *pathname, int flags, ...); func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } var mode types.Mode_t if args != 0 { mode = (types.Mode_t)(VaUint32(&args)) @@ -266,6 +299,9 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { // off_t lseek(int fd, off_t offset, int whence); func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } return types.Off_t(Xlseek64(t, fd, offset, whence)) } @@ -277,6 +313,9 @@ var fsyncStatbuf stat.Stat // int fsync(int fd); func Xfsync(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if noFsync { // Simulate -DSQLITE_NO_SYNC for sqlite3 testfixture, see function full_sync in sqlite3.c return Xfstat(t, fd, uintptr(unsafe.Pointer(&fsyncStatbuf))) @@ -295,6 +334,9 @@ func Xfsync(t *TLS, fd int32) int32 { // long sysconf(int name); func Xsysconf(t *TLS, name int32) long { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } switch name { case unistd.X_SC_PAGESIZE: return long(unix.Getpagesize()) @@ -311,6 +353,9 @@ func Xsysconf(t *TLS, name int32) long { // int close(int fd); func Xclose(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CLOSE, uintptr(fd), 0, 0); err != 0 { t.setErrno(err) return -1 @@ -324,6 +369,9 @@ func Xclose(t *TLS, fd int32) int32 { // char *getcwd(char *buf, size_t size); func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } if _, err := unix.Getcwd((*RawMem)(unsafe.Pointer(buf))[:size:size]); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -340,11 +388,17 @@ func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { // int fstat(int fd, struct stat *statbuf); func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } return Xfstat64(t, fd, statbuf) } // int ftruncate(int fd, off_t length); func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } if err := unix.Ftruncate(int(fd), int64(length)); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -361,11 +415,17 @@ func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } return Xfcntl64(t, fd, cmd, args) } // ssize_t read(int fd, void *buf, size_t count); func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_READ, uintptr(fd), buf, uintptr(count)) if err != 0 { t.setErrno(err) @@ -381,6 +441,9 @@ func Xread(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // ssize_t write(int fd, const void *buf, size_t count); func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } const retry = 5 var err syscall.Errno for i := 0; i < retry; i++ { @@ -406,6 +469,9 @@ func Xwrite(t *TLS, fd int32, buf uintptr, count types.Size_t) types.Ssize_t { // int fchmod(int fd, mode_t mode); func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); err != 0 { t.setErrno(err) return -1 @@ -419,6 +485,9 @@ func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { // int fchown(int fd, uid_t owner, gid_t group); func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v owner=%v group=%v, (%v:)", t, fd, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_FCHOWN, uintptr(fd), uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -429,12 +498,18 @@ func Xfchown(t *TLS, fd int32, owner types.Uid_t, group types.Gid_t) int32 { // uid_t geteuid(void); func Xgeteuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_GETEUID, 0, 0, 0) return types.Uid_t(n) } // int munmap(void *addr, size_t length); func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v addr=%v length=%v, (%v:)", t, addr, length, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { t.setErrno(err) return -1 @@ -445,6 +520,9 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if __ccgo_strace { + trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) + } if tz != 0 { panic(todo("")) } @@ -462,6 +540,9 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { // int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optlen=%v, (%v:)", t, optname, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_GETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, optlen, 0); err != 0 { t.setErrno(err) return -1 @@ -472,6 +553,9 @@ func Xgetsockopt(t *TLS, sockfd, level, optname int32, optval, optlen uintptr) i // int setsockopt(int sockfd, int level, int optname, const void *optval, socklen_t optlen); func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen socket.Socklen_t) int32 { + if __ccgo_strace { + trc("t=%v optname=%v optval=%v optlen=%v, (%v:)", t, optname, optval, optlen, origin(2)) + } if _, _, err := unix.Syscall6(unix.SYS_SETSOCKOPT, uintptr(sockfd), uintptr(level), uintptr(optname), optval, uintptr(optlen), 0); err != 0 { t.setErrno(err) return -1 @@ -482,6 +566,9 @@ func Xsetsockopt(t *TLS, sockfd, level, optname int32, optval uintptr, optlen so // int ioctl(int fd, unsigned long request, ...); func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v request=%v va=%v, (%v:)", t, fd, request, va, origin(2)) + } var argp uintptr if va != 0 { argp = VaUintptr(&va) @@ -497,6 +584,9 @@ func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { // int getsockname(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETSOCKNAME, uintptr(sockfd), addr, addrlen); err != 0 { // if dmesgs { // dmesg("%v: fd %v: %v", origin(1), sockfd, err) @@ -510,6 +600,9 @@ func Xgetsockname(t *TLS, sockfd int32, addr, addrlen uintptr) int32 { // int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v timeout=%v, (%v:)", t, nfds, timeout, origin(2)) + } n, err := unix.Select( int(nfds), (*unix.FdSet)(unsafe.Pointer(readfds)), @@ -527,17 +620,26 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) // int mkfifo(const char *pathname, mode_t mode); func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) } // mode_t umask(mode_t mask); func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + if __ccgo_strace { + trc("t=%v mask=%v, (%v:)", t, mask, origin(2)) + } n, _, _ := unix.Syscall(unix.SYS_UMASK, uintptr(mask), 0, 0) return types.Mode_t(n) } // int execvp(const char *file, char *const argv[]); func Xexecvp(t *TLS, file, argv uintptr) int32 { + if __ccgo_strace { + trc("t=%v argv=%v, (%v:)", t, argv, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_EXECVE, file, argv, Environ()); err != 0 { t.setErrno(err) return -1 @@ -548,6 +650,9 @@ func Xexecvp(t *TLS, file, argv uintptr) int32 { // pid_t waitpid(pid_t pid, int *wstatus, int options); func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + if __ccgo_strace { + trc("t=%v pid=%v wstatus=%v optname=%v, (%v:)", t, pid, wstatus, optname, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_WAIT4, uintptr(pid), wstatus, uintptr(optname), 0, 0, 0) if err != 0 { t.setErrno(err) @@ -559,6 +664,9 @@ func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid // int uname(struct utsname *buf); func Xuname(t *TLS, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } if err := unix.Uname((*unix.Utsname)(unsafe.Pointer(buf))); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -575,6 +683,9 @@ func Xuname(t *TLS, buf uintptr) int32 { // ssize_t recv(int sockfd, void *buf, size_t len, int flags); func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_RECVFROM, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -586,6 +697,9 @@ func Xrecv(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // ssize_t send(int sockfd, const void *buf, size_t len, int flags); func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v, (%v:)", t, sockfd, buf, len, flags, origin(2)) + } n, _, err := unix.Syscall6(unix.SYS_SENDTO, uintptr(sockfd), buf, uintptr(len), uintptr(flags), 0, 0) if err != 0 { t.setErrno(err) @@ -597,6 +711,9 @@ func Xsend(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32) typ // int shutdown(int sockfd, int how); func Xshutdown(t *TLS, sockfd, how int32) int32 { + if __ccgo_strace { + trc("t=%v how=%v, (%v:)", t, how, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { t.setErrno(err) return -1 @@ -607,6 +724,9 @@ func Xshutdown(t *TLS, sockfd, how int32) int32 { // int getpeername(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETPEERNAME, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -617,6 +737,9 @@ func Xgetpeername(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int socket(int domain, int type, int protocol); func Xsocket(t *TLS, domain, type1, protocol int32) int32 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_SOCKET, uintptr(domain), uintptr(type1), uintptr(protocol)) if err != 0 { t.setErrno(err) @@ -628,6 +751,9 @@ func Xsocket(t *TLS, domain, type1, protocol int32) int32 { // int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_BIND, uintptr(sockfd), addr, uintptr(addrlen)) if err != 0 { t.setErrno(err) @@ -639,6 +765,9 @@ func Xbind(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CONNECT, uintptr(sockfd), addr, uintptr(addrlen)); err != 0 { t.setErrno(err) return -1 @@ -649,6 +778,9 @@ func Xconnect(t *TLS, sockfd int32, addr uintptr, addrlen uint32) int32 { // int listen(int sockfd, int backlog); func Xlisten(t *TLS, sockfd, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v backlog=%v, (%v:)", t, backlog, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_LISTEN, uintptr(sockfd), uintptr(backlog), 0); err != 0 { t.setErrno(err) return -1 @@ -659,6 +791,9 @@ func Xlisten(t *TLS, sockfd, backlog int32) int32 { // int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen); func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall6(unix.SYS_ACCEPT4, uintptr(sockfd), addr, uintptr(addrlen), 0, 0, 0) // if err != 0 { @@ -671,16 +806,25 @@ func Xaccept(t *TLS, sockfd int32, addr uintptr, addrlen uintptr) int32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xgetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xsetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -691,16 +835,25 @@ func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // uid_t getuid(void); func Xgetuid(t *TLS) types.Uid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return types.Uid_t(os.Getuid()) } // pid_t getpid(void); func Xgetpid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return int32(os.Getpid()) } // int system(const char *command); func Xsystem(t *TLS, command uintptr) int32 { + if __ccgo_strace { + trc("t=%v command=%v, (%v:)", t, command, origin(2)) + } s := GoString(command) if command == 0 { panic(todo("")) @@ -720,26 +873,41 @@ func Xsystem(t *TLS, command uintptr) int32 { // int setvbuf(FILE *stream, char *buf, int mode, size_t size); func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v mode=%v size=%v, (%v:)", t, buf, mode, size, origin(2)) + } return 0 //TODO } // int raise(int sig); func Xraise(t *TLS, sig int32) int32 { + if __ccgo_strace { + trc("t=%v sig=%v, (%v:)", t, sig, origin(2)) + } panic(todo("")) } // int backtrace(void **buffer, int size); func Xbacktrace(t *TLS, buf uintptr, size int32) int32 { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } panic(todo("")) } // void backtrace_symbols_fd(void *const *buffer, int size, int fd); func Xbacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) { + if __ccgo_strace { + trc("t=%v buffer=%v fd=%v, (%v:)", t, buffer, fd, origin(2)) + } panic(todo("")) } // int fileno(FILE *stream); func Xfileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -773,11 +941,17 @@ func (f *ftstream) close(t *TLS) { // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } return Xfts64_open(t, path_argv, options, compar) } // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } f := &ftstream{} var walk func(string) @@ -882,11 +1056,17 @@ func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintp // FTSENT *fts_read(FTS *ftsp); func Xfts_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_read(t, ftsp) } // FTSENT *fts_read(FTS *ftsp); func Xfts64_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } f := getObject(ftsp).(*ftstream) if f.x == len(f.s) { t.setErrno(0) @@ -903,11 +1083,17 @@ func Xfts64_read(t *TLS, ftsp uintptr) uintptr { // int fts_close(FTS *ftsp); func Xfts_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_close(t, ftsp) } // int fts_close(FTS *ftsp); func Xfts64_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } getObject(ftsp).(*ftstream).close(t) removeObject(ftsp) return 0 @@ -915,6 +1101,9 @@ func Xfts64_close(t *TLS, ftsp uintptr) int32 { // void tzset (void); func Xtzset(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } //TODO } @@ -922,6 +1111,9 @@ var strerrorBuf [100]byte // char *strerror(int errnum); func Xstrerror(t *TLS, errnum int32) uintptr { + if __ccgo_strace { + trc("t=%v errnum=%v, (%v:)", t, errnum, origin(2)) + } if dmesgs { dmesg("%v: %v\n%s", origin(1), errnum, debug.Stack()) } @@ -931,31 +1123,49 @@ func Xstrerror(t *TLS, errnum int32) uintptr { // void *dlopen(const char *filename, int flags); func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + if __ccgo_strace { + trc("t=%v filename=%v flags=%v, (%v:)", t, filename, flags, origin(2)) + } panic(todo("")) } // char *dlerror(void); func Xdlerror(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int dlclose(void *handle); func Xdlclose(t *TLS, handle uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } panic(todo("")) } // void *dlsym(void *handle, const char *symbol); func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + if __ccgo_strace { + trc("t=%v symbol=%v, (%v:)", t, symbol, origin(2)) + } panic(todo("")) } // void perror(const char *s); func Xperror(t *TLS, s uintptr) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func Xpclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -963,37 +1173,58 @@ var gai_strerrorBuf [100]byte // const char *gai_strerror(int errcode); func Xgai_strerror(t *TLS, errcode int32) uintptr { + if __ccgo_strace { + trc("t=%v errcode=%v, (%v:)", t, errcode, origin(2)) + } copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) return uintptr(unsafe.Pointer(&gai_strerrorBuf)) } // int tcgetattr(int fd, struct termios *termios_p); func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v termios_p=%v, (%v:)", t, fd, termios_p, origin(2)) + } panic(todo("")) } // int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v optional_actions=%v termios_p=%v, (%v:)", t, optional_actions, termios_p, origin(2)) + } panic(todo("")) } // speed_t cfgetospeed(const struct termios *termios_p); func Xcfgetospeed(t *TLS, termios_p uintptr) termios.Speed_t { + if __ccgo_strace { + trc("t=%v termios_p=%v, (%v:)", t, termios_p, origin(2)) + } panic(todo("")) } // int cfsetospeed(struct termios *termios_p, speed_t speed); func Xcfsetospeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // int cfsetispeed(struct termios *termios_p, speed_t speed); func Xcfsetispeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // pid_t fork(void); func Xfork(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } t.setErrno(errno.ENOSYS) return -1 } @@ -1002,21 +1233,33 @@ var emptyStr = [1]byte{} // char *setlocale(int category, const char *locale); func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + if __ccgo_strace { + trc("t=%v category=%v locale=%v, (%v:)", t, category, locale, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // char *nl_langinfo(nl_item item); func Xnl_langinfo(t *TLS, item langinfo.Nl_item) uintptr { + if __ccgo_strace { + trc("t=%v item=%v, (%v:)", t, item, origin(2)) + } return uintptr(unsafe.Pointer(&emptyStr)) //TODO } // FILE *popen(const char *command, const char *type); func Xpopen(t *TLS, command, type1 uintptr) uintptr { + if __ccgo_strace { + trc("t=%v type1=%v, (%v:)", t, type1, origin(2)) + } panic(todo("")) } // char *realpath(const char *path, char *resolved_path); func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + if __ccgo_strace { + trc("t=%v resolved_path=%v, (%v:)", t, resolved_path, origin(2)) + } s, err := filepath.EvalSymlinks(GoString(path)) if err != nil { if os.IsNotExist(err) { @@ -1045,19 +1288,31 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { // struct tm *gmtime_r(const time_t *timep, struct tm *result); func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } panic(todo("")) } // char *inet_ntoa(struct in_addr in); func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func X__ccgo_in6addr_anyp(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return uintptr(unsafe.Pointer(&in6_addr_any)) } func Xabort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) //TODO // if dmesgs { // dmesg("%v:", origin(1)) @@ -1076,11 +1331,17 @@ func Xabort(t *TLS) { // int fflush(FILE *stream); func Xfflush(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return 0 //TODO } // size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_READ, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1096,6 +1357,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types // size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } m, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), ptr, uintptr(size*nmemb)) if err != 0 { file(stream).setErr() @@ -1111,11 +1375,17 @@ func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) type // int fclose(FILE *stream); func Xfclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return file(stream).close(t) } // int fputc(int c, FILE *stream); func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } if _, err := fwrite(file(stream).fd(), []byte{byte(c)}); err != nil { return stdio.EOF } @@ -1125,6 +1395,9 @@ func Xfputc(t *TLS, c int32, stream uintptr) int32 { // int fseek(FILE *stream, long offset, int whence); func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if __ccgo_strace { + trc("t=%v stream=%v offset=%v whence=%v, (%v:)", t, stream, offset, whence, origin(2)) + } if n := Xlseek(t, int32(file(stream).fd()), types.Off_t(offset), whence); n < 0 { // if dmesgs { // dmesg("%v: fd %v, off %#x, whence %v: %v", origin(1), file(stream).fd(), offset, whenceStr(whence), n) @@ -1141,6 +1414,9 @@ func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { // long ftell(FILE *stream); func Xftell(t *TLS, stream uintptr) long { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } n := Xlseek(t, file(stream).fd(), 0, stdio.SEEK_CUR) if n < 0 { file(stream).setErr() @@ -1155,21 +1431,33 @@ func Xftell(t *TLS, stream uintptr) long { // int ferror(FILE *stream); func Xferror(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } return Bool32(file(stream).err()) } // int ungetc(int c, FILE *stream); func Xungetc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } panic(todo("")) } // int fscanf(FILE *stream, const char *format, ...); func Xfscanf(t *TLS, stream, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } panic(todo("")) } // int fputs(const char *s, FILE *stream); func Xfputs(t *TLS, s, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { return -1 } @@ -1181,6 +1469,9 @@ var getservbynameStaticResult netdb.Servent // struct servent *getservbyname(const char *name, const char *proto); func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { + if __ccgo_strace { + trc("t=%v proto=%v, (%v:)", t, proto, origin(2)) + } var protoent *gonetdb.Protoent if proto != 0 { protoent = gonetdb.GetProtoByName(GoString(proto)) @@ -1258,6 +1549,9 @@ func Xgetservbyname(t *TLS, name, proto uintptr) uintptr { } func Xreaddir64(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } return Xreaddir(t, dir) } @@ -1270,14 +1564,23 @@ func __syscall(r, _ uintptr, errno syscall.Errno) long { } func X__syscall1(t *TLS, trap, p1 long) long { + if __ccgo_strace { + trc("t=%v p1=%v, (%v:)", t, p1, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), 0, 0)) } func X__syscall3(t *TLS, trap, p1, p2, p3 long) long { + if __ccgo_strace { + trc("t=%v p3=%v, (%v:)", t, p3, origin(2)) + } return __syscall(unix.Syscall(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3))) } func X__syscall4(t *TLS, trap, p1, p2, p3, p4 long) long { + if __ccgo_strace { + trc("t=%v p4=%v, (%v:)", t, p4, origin(2)) + } return __syscall(unix.Syscall6(uintptr(trap), uintptr(p1), uintptr(p2), uintptr(p3), uintptr(p4), 0, 0)) } @@ -1300,26 +1603,41 @@ func fcntlCmdStr(cmd int32) string { // int setenv(const char *name, const char *value, int overwrite); func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { + if __ccgo_strace { + trc("t=%v value=%v overwrite=%v, (%v:)", t, value, overwrite, origin(2)) + } panic(todo("")) } // int unsetenv(const char *name); func Xunsetenv(t *TLS, name uintptr) int32 { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } panic(todo("")) } // int pause(void); func Xpause(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // ssize_t writev(int fd, const struct iovec *iov, int iovcnt); func Xwritev(t *TLS, fd int32, iov uintptr, iovcnt int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v iov=%v iovcnt=%v, (%v:)", t, fd, iov, iovcnt, origin(2)) + } panic(todo("")) } // int __isoc99_sscanf(const char *str, const char *format, ...); func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := Xsscanf(t, str, format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1329,20 +1647,32 @@ func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { // void __assert(const char * func, const char * file, int line, const char *expr) __dead2; func X__assert(t *TLS, fn, file uintptr, line int32, expr uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v expr=%v, (%v:)", t, file, line, expr, origin(2)) + } X__assert_fail(t, expr, file, uint32(line), fn) } func X__assert13(t *TLS, file uintptr, line int32, fn, msg uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v msg=%v, (%v:)", t, file, line, msg, origin(2)) + } X__assert_fail(t, msg, file, uint32(line), fn) } // include/stdio.h:456:int __swbuf(int, FILE *); func X__swbuf(t *TLS, n int32, file uintptr) int32 { + if __ccgo_strace { + trc("t=%v n=%v file=%v, (%v:)", t, n, file, origin(2)) + } return Xfputc(t, n, file) //TODO improve performance, use a real buffer. } // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Rmdir(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1359,6 +1689,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // struct dirent *readdir(DIR *dirp); func Xreaddir(t *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } if (*darwinDir)(unsafe.Pointer(dir)).eof { return 0 } @@ -1397,6 +1730,9 @@ type darwinDir struct { // int sscanf(const char *str, const char *format, ...); func Xsscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -1406,10 +1742,16 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 { // int * __error(void); func X__error(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return t.errnop } func Xclosedir(t *TLS, dir uintptr) int32 { + if __ccgo_strace { + trc("t=%v dir=%v, (%v:)", t, dir, origin(2)) + } r := Xclose(t, int32((*darwinDir)(unsafe.Pointer(dir)).fd)) Xfree(t, dir) return r @@ -1417,11 +1759,17 @@ func Xclosedir(t *TLS, dir uintptr) int32 { // int __xuname(int namesize, void *namebuf) func X__xuname(t *TLS, namesize int32, namebuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v namesize=%v namebuf=%v, (%v:)", t, namesize, namebuf, origin(2)) + } return Xuname(t, namebuf) } // int chflags(const char *path, u_int flags); func Xchflags(t *TLS, path uintptr, flags uint32) int32 { + if __ccgo_strace { + trc("t=%v path=%v flags=%v, (%v:)", t, path, flags, origin(2)) + } if err := unix.Chflags(GoString(path), int(flags)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -1438,6 +1786,9 @@ func Xchflags(t *TLS, path uintptr, flags uint32) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } var a [2]int if err := syscall.Pipe(a[:]); err != nil { if dmesgs { @@ -1456,10 +1807,16 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // char *inet_ntoa(struct in_addr in); func X__inet_ntoa(t *TLS, in1 in.In_addr) uintptr { + if __ccgo_strace { + trc("t=%v in1=%v, (%v:)", t, in1, origin(2)) + } panic(todo("")) } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } // On 2021-12-23, a new syscall for mmap was introduced: // // 49 STD NOLOCK { void *sys_mmap(void *addr, size_t len, int prot, \ @@ -1485,27 +1842,45 @@ func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, off } func X__errno(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return X__errno_location(t) } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return (int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).F__attr & uint32(3))) } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return (*(*int32)(unsafe.Pointer((m /* &.__u */ /* &.__i */))) & 15) } func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer((a /* &.__u */ /* &.__i */) + 6*4)) return 0 } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -1514,15 +1889,24 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } @@ -1532,6 +1916,9 @@ func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pth // int uuid_parse( char *in, uuid_t uu); func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { + if __ccgo_strace { + trc("t=%v in=%v uu=%v, (%v:)", t, in, uu, origin(2)) + } r, err := guuid.Parse(GoString(in)) if err != nil { return -1 @@ -1541,16 +1928,27 @@ func Xuuid_parse(t *TLS, in uintptr, uu uintptr) int32 { return 0 } -func X__srget(t *TLS, stream uintptr) int32 { return Xgetc(t, stream) } +func X__srget(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } + return Xgetc(t, stream) +} // void __assert2(const char *, int, const char *, const char *); // __assert2(__FILE__, __LINE__, __func__, #e)) func X__assert2(t *TLS, file uintptr, line int32, fn, expr uintptr) { + if __ccgo_strace { + trc("t=%v file=%v line=%v expr=%v, (%v:)", t, file, line, expr, origin(2)) + } X__assert_fail(t, expr, file, uint32(line), fn) } // int getpagesize(void); func Xgetpagesize(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return int32(unix.Getpagesize()) } @@ -1568,6 +1966,9 @@ const PTHREAD_MUTEX_DEFAULT = 0 // // int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } typ := PTHREAD_MUTEX_DEFAULT if pAttr != 0 { typ = int(X__ccgo_pthreadMutexattrGettype(t, pAttr)) @@ -1582,17 +1983,31 @@ func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 { // uint16_t __builtin_bswap16 (uint32_t x) func Xbswap16(t *TLS, x uint16) uint16 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap16(t, x) } // uint32_t __builtin_bswap32 (uint32_t x) func Xbswap32(t *TLS, x uint32) uint32 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap32(t, x) } // uint64_t __builtin_bswap64 (uint64_t x) func Xbswap64(t *TLS, x uint64) uint64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } return X__builtin_bswap64(t, x) } -func X__builtin_isblank(t *TLS, _c int32) int32 { return Xisblank(t, _c) } +func X__builtin_isblank(t *TLS, _c int32) int32 { + if __ccgo_strace { + trc("t=%v _c=%v, (%v:)", t, _c, origin(2)) + } + return Xisblank(t, _c) +} diff --git a/vendor/modernc.org/libc/libc_openbsd_386.go b/vendor/modernc.org/libc/libc_openbsd_386.go index 8c30e7b5..5b414c18 100644 --- a/vendor/modernc.org/libc/libc_openbsd_386.go +++ b/vendor/modernc.org/libc/libc_openbsd_386.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { t.setErrno(err) return -1 @@ -34,6 +37,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -73,6 +79,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -89,6 +98,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -105,6 +117,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -121,6 +136,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -137,6 +155,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -153,6 +174,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -177,6 +201,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -193,6 +220,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -209,6 +239,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -219,6 +252,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -241,6 +277,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -257,6 +296,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -273,6 +315,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -294,6 +339,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -310,6 +358,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -321,6 +372,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -343,6 +397,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -353,6 +410,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -364,6 +424,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -376,6 +439,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -386,6 +452,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -485,6 +554,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -572,6 +644,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -606,6 +681,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint32(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") diff --git a/vendor/modernc.org/libc/libc_openbsd_amd64.go b/vendor/modernc.org/libc/libc_openbsd_amd64.go index 434f06bb..20017d9a 100644 --- a/vendor/modernc.org/libc/libc_openbsd_amd64.go +++ b/vendor/modernc.org/libc/libc_openbsd_amd64.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { // t.setErrno(err) @@ -35,6 +38,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -74,6 +80,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -90,6 +99,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -106,6 +118,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -122,6 +137,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -138,6 +156,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -154,6 +175,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -178,6 +202,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -194,6 +221,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -210,6 +240,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -220,6 +253,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -242,6 +278,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -258,6 +297,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -274,6 +316,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -295,6 +340,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -311,6 +359,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -322,6 +373,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -344,6 +398,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -354,6 +411,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -365,6 +425,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -377,6 +440,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -388,6 +454,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // int getnameinfo(const struct sockaddr * restrict sa, socklen_t salen, char * restrict host, socklen_t hostlen, char * restrict serv, socklen_t servlen, int flags); func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -487,6 +556,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -574,6 +646,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -608,6 +683,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") diff --git a/vendor/modernc.org/libc/libc_openbsd_arm64.go b/vendor/modernc.org/libc/libc_openbsd_arm64.go index 8843f989..b0dbcfa7 100644 --- a/vendor/modernc.org/libc/libc_openbsd_arm64.go +++ b/vendor/modernc.org/libc/libc_openbsd_arm64.go @@ -24,6 +24,9 @@ type ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SIGACTION, uintptr(signum), act, oldact); err != 0 { // t.setErrno(err) @@ -35,6 +38,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int switch m { @@ -74,6 +80,9 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Lstat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -90,6 +99,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } if err := unix.Stat(GoString(pathname), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(pathname), err) @@ -106,6 +118,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } if err := unix.Mkdir(GoString(path), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q: %v FAIL", origin(1), GoString(path), err) @@ -122,6 +137,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Access(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -138,6 +156,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } if err := unix.Unlink(GoString(pathname)); err != nil { if dmesgs { dmesg("%v: %q: %v", origin(1), GoString(pathname), err) @@ -154,6 +175,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } var n int var err error switch { @@ -178,6 +202,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } if err := unix.Symlink(GoString(target), GoString(linkpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -194,6 +221,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int chmod(const char *pathname, mode_t mode) func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } if err := unix.Chmod(GoString(pathname), uint32(mode)); err != nil { if dmesgs { dmesg("%v: %q %#o: %v FAIL", origin(1), GoString(pathname), mode, err) @@ -210,6 +240,9 @@ func Xchmod(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) time.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n := time.Now().UTC().Unix() // if tloc != 0 { @@ -220,6 +253,9 @@ func Xtime(t *TLS, tloc uintptr) time.Time_t { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -242,6 +278,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } if err := unix.Fstat(int(fd), (*unix.Stat_t)(unsafe.Pointer(statbuf))); err != nil { if dmesgs { dmesg("%v: fd %d: %v FAIL", origin(1), fd, err) @@ -258,6 +297,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } n, err := unix.Seek(int(fd), int64(offset), int(whence)) if err != nil { if dmesgs { @@ -274,6 +316,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { } func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } var arg uintptr if args != 0 { arg = *(*uintptr)(unsafe.Pointer(args)) @@ -295,6 +340,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } if err := unix.Rename(GoString(oldpath), GoString(newpath)); err != nil { if dmesgs { dmesg("%v: %v FAIL", origin(1), err) @@ -311,6 +359,9 @@ func Xrename(t *TLS, oldpath, newpath uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -322,6 +373,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } var a []unix.Timeval if times != 0 { a = make([]unix.Timeval, 2) @@ -344,6 +398,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // int chown(const char *pathname, uid_t owner, gid_t group); func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v owner=%v group=%v, (%v:)", t, pathname, owner, group, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_CHOWN, pathname, uintptr(owner), uintptr(group)); err != 0 { t.setErrno(err) return -1 @@ -354,6 +411,9 @@ func Xchown(t *TLS, pathname uintptr, owner types.Uid_t, group types.Gid_t) int3 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -365,6 +425,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -377,6 +440,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -388,6 +454,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // int getnameinfo(const struct sockaddr * restrict sa, socklen_t salen, char * restrict host, socklen_t hostlen, char * restrict serv, socklen_t servlen, int flags); func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen size_t, serv uintptr, servlen size_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(347) //TODO defer tls.Free(347) @@ -487,6 +556,9 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen siz } func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } panic(todo("")) //TODO bp := tls.Alloc(28) //TODO defer tls.Free(28) @@ -574,6 +646,9 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { t.setErrno(err) return -1 @@ -608,6 +683,9 @@ func newFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscall.Err // DIR *opendir(const char *name); func Xopendir(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } p := Xmalloc(t, uint64(unsafe.Sizeof(darwinDir{}))) if p == 0 { panic("OOM") diff --git a/vendor/modernc.org/libc/libc_unix.go b/vendor/modernc.org/libc/libc_unix.go index 085c86b3..f2002007 100644 --- a/vendor/modernc.org/libc/libc_unix.go +++ b/vendor/modernc.org/libc/libc_unix.go @@ -44,6 +44,9 @@ func init() { // sighandler_t signal(int signum, sighandler_t handler); func Xsignal(t *TLS, signum int32, handler uintptr) uintptr { //TODO use sigaction? + if __ccgo_strace { + trc("t=%v signum=%v handler=%v, (%v:)", t, signum, handler, origin(2)) + } signalsMu.Lock() defer signalsMu.Unlock() @@ -88,11 +91,17 @@ func Xsignal(t *TLS, signum int32, handler uintptr) uintptr { //TODO use sigacti // void rewind(FILE *stream); func Xrewind(t *TLS, stream uintptr) { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } Xfseek(t, stream, 0, stdio.SEEK_SET) } // int putchar(int c); func Xputchar(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } if _, err := write([]byte{byte(c)}); err != nil { return stdio.EOF } @@ -102,6 +111,9 @@ func Xputchar(t *TLS, c int32) int32 { // int gethostname(char *name, size_t len); func Xgethostname(t *TLS, name uintptr, slen types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v name=%v slen=%v, (%v:)", t, name, slen, origin(2)) + } if slen < 0 { t.setErrno(errno.EINVAL) return -1 @@ -128,41 +140,65 @@ func Xgethostname(t *TLS, name uintptr, slen types.Size_t) int32 { // int remove(const char *pathname); func Xremove(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } panic(todo("")) } // long pathconf(const char *path, int name); func Xpathconf(t *TLS, path uintptr, name int32) long { + if __ccgo_strace { + trc("t=%v path=%v name=%v, (%v:)", t, path, name, origin(2)) + } panic(todo("")) } // ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags, struct sockaddr *src_addr, socklen_t *addrlen); func Xrecvfrom(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32, src_addr, addrlen uintptr) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v addrlen=%v, (%v:)", t, sockfd, buf, len, flags, addrlen, origin(2)) + } panic(todo("")) } // ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); func Xsendto(t *TLS, sockfd int32, buf uintptr, len types.Size_t, flags int32, src_addr uintptr, addrlen socklen_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v len=%v flags=%v src_addr=%v addrlen=%v, (%v:)", t, sockfd, buf, len, flags, src_addr, addrlen, origin(2)) + } panic(todo("")) } // void srand48(long int seedval); func Xsrand48(t *TLS, seedval long) { + if __ccgo_strace { + trc("t=%v seedval=%v, (%v:)", t, seedval, origin(2)) + } panic(todo("")) } // long int lrand48(void); func Xlrand48(t *TLS) long { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); func Xsendmsg(t *TLS, sockfd int32, msg uintptr, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v msg=%v flags=%v, (%v:)", t, sockfd, msg, flags, origin(2)) + } panic(todo("")) } // int poll(struct pollfd *fds, nfds_t nfds, int timeout); func Xpoll(t *TLS, fds uintptr, nfds poll.Nfds_t, timeout int32) int32 { + if __ccgo_strace { + trc("t=%v fds=%v nfds=%v timeout=%v, (%v:)", t, fds, nfds, timeout, origin(2)) + } if nfds == 0 { panic(todo("")) } @@ -184,6 +220,9 @@ func Xpoll(t *TLS, fds uintptr, nfds poll.Nfds_t, timeout int32) int32 { // ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); func Xrecvmsg(t *TLS, sockfd int32, msg uintptr, flags int32) types.Ssize_t { + if __ccgo_strace { + trc("t=%v sockfd=%v msg=%v flags=%v, (%v:)", t, sockfd, msg, flags, origin(2)) + } n, _, err := unix.Syscall(unix.SYS_RECVMSG, uintptr(sockfd), msg, uintptr(flags)) if err != 0 { t.setErrno(err) @@ -195,51 +234,81 @@ func Xrecvmsg(t *TLS, sockfd int32, msg uintptr, flags int32) types.Ssize_t { // struct cmsghdr *CMSG_NXTHDR(struct msghdr *msgh, struct cmsghdr *cmsg); func X__cmsg_nxthdr(t *TLS, msgh, cmsg uintptr) uintptr { + if __ccgo_strace { + trc("t=%v cmsg=%v, (%v:)", t, cmsg, origin(2)) + } panic(todo("")) } // wchar_t *wcschr(const wchar_t *wcs, wchar_t wc); func Xwcschr(t *TLS, wcs uintptr, wc wchar_t) wchar_t { + if __ccgo_strace { + trc("t=%v wcs=%v wc=%v, (%v:)", t, wcs, wc, origin(2)) + } panic(todo("")) } // gid_t getegid(void); func Xgetegid(t *TLS) types.Gid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // gid_t getgid(void); func Xgetgid(t *TLS) types.Gid_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // void *shmat(int shmid, const void *shmaddr, int shmflg); func Xshmat(t *TLS, shmid int32, shmaddr uintptr, shmflg int32) uintptr { + if __ccgo_strace { + trc("t=%v shmid=%v shmaddr=%v shmflg=%v, (%v:)", t, shmid, shmaddr, shmflg, origin(2)) + } panic(todo("")) } // int shmctl(int shmid, int cmd, struct shmid_ds *buf); func Xshmctl(t *TLS, shmid, cmd int32, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v buf=%v, (%v:)", t, cmd, buf, origin(2)) + } panic(todo("")) } // int shmdt(const void *shmaddr); func Xshmdt(t *TLS, shmaddr uintptr) int32 { + if __ccgo_strace { + trc("t=%v shmaddr=%v, (%v:)", t, shmaddr, origin(2)) + } panic(todo("")) } // int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); func Xgetresuid(t *TLS, ruid, euid, suid uintptr) int32 { + if __ccgo_strace { + trc("t=%v suid=%v, (%v:)", t, suid, origin(2)) + } panic(todo("")) } // int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); func Xgetresgid(t *TLS, rgid, egid, sgid uintptr) int32 { + if __ccgo_strace { + trc("t=%v sgid=%v, (%v:)", t, sgid, origin(2)) + } panic(todo("")) } // FILE *tmpfile(void); func Xtmpfile(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } f, err := ioutil.TempFile("", "tmpfile-") if err != nil { t.setErrno(err) @@ -258,6 +327,9 @@ func Xtmpfile(t *TLS) uintptr { // FILE *fdopen(int fd, const char *mode); func Xfdopen(t *TLS, fd int32, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") switch m { case @@ -282,6 +354,9 @@ func Xfdopen(t *TLS, fd int32, mode uintptr) uintptr { // struct passwd *getpwnam(const char *name); func Xgetpwnam(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } f, err := os.Open("/etc/passwd") if err != nil { panic(todo("", err)) @@ -334,6 +409,9 @@ func Xgetpwnam(t *TLS, name uintptr) uintptr { // int getpwnam_r(char *name, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result); func Xgetpwnam_r(t *TLS, name, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v buflen=%v result=%v, (%v:)", t, buf, buflen, result, origin(2)) + } f, err := os.Open("/etc/passwd") if err != nil { panic(todo("", err)) @@ -399,6 +477,9 @@ var staticGetgrgid grp.Group // struct group *getgrgid(gid_t gid); func Xgetgrgid(t *TLS, gid uint32) uintptr { + if __ccgo_strace { + trc("t=%v gid=%v, (%v:)", t, gid, origin(2)) + } f, err := os.Open("/etc/group") if err != nil { panic(todo("")) @@ -440,6 +521,9 @@ func Xgetgrgid(t *TLS, gid uint32) uintptr { // int getgrgid_r(gid_t gid, struct group *grp, char *buf, size_t buflen, struct group **result); func Xgetgrgid_r(t *TLS, gid uint32, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 { + if __ccgo_strace { + trc("t=%v gid=%v buf=%v buflen=%v result=%v, (%v:)", t, gid, buf, buflen, result, origin(2)) + } f, err := os.Open("/etc/group") if err != nil { panic(todo("")) @@ -626,6 +710,9 @@ func init() { // struct passwd *getpwuid(uid_t uid); func Xgetpwuid(t *TLS, uid uint32) uintptr { + if __ccgo_strace { + trc("t=%v uid=%v, (%v:)", t, uid, origin(2)) + } f, err := os.Open("/etc/passwd") if err != nil { panic(todo("", err)) @@ -688,6 +775,9 @@ func initPasswd(t *TLS, p *pwd.Passwd, name, pwd string, uid, gid uint32, gecos, // struct group *getgrnam(const char *name); func Xgetgrnam(t *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } f, err := os.Open("/etc/group") if err != nil { panic(todo("")) @@ -734,6 +824,9 @@ func Xgetgrnam(t *TLS, name uintptr) uintptr { // int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result); func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v buflen=%v result=%v, (%v:)", t, buf, buflen, result, origin(2)) + } f, err := os.Open("/etc/group") if err != nil { panic(todo("")) @@ -787,6 +880,9 @@ func Xgetgrnam_r(t *TLS, name, pGrp, buf uintptr, buflen types.Size_t, result ui // int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result); func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t, result uintptr) int32 { + if __ccgo_strace { + trc("t=%v uid=%v buf=%v buflen=%v result=%v, (%v:)", t, uid, buf, buflen, result, origin(2)) + } f, err := os.Open("/etc/passwd") if err != nil { panic(todo("", err)) @@ -846,6 +942,9 @@ func Xgetpwuid_r(t *TLS, uid types.Uid_t, cpwd, buf uintptr, buflen types.Size_t // int mkostemp(char *template, int flags); func Xmkostemp(t *TLS, template uintptr, flags int32) int32 { + if __ccgo_strace { + trc("t=%v template=%v flags=%v, (%v:)", t, template, flags, origin(2)) + } len := uintptr(Xstrlen(t, template)) x := template + uintptr(len-6) for i := uintptr(0); i < 6; i++ { @@ -866,12 +965,18 @@ func Xmkostemp(t *TLS, template uintptr, flags int32) int32 { // void uuid_generate_random(uuid_t out); func Xuuid_generate_random(t *TLS, out uintptr) { + if __ccgo_strace { + trc("t=%v out=%v, (%v:)", t, out, origin(2)) + } x := guuid.New() copy((*RawMem)(unsafe.Pointer(out))[:], x[:]) } // void uuid_unparse(uuid_t uu, char *out); func Xuuid_unparse(t *TLS, uu, out uintptr) { + if __ccgo_strace { + trc("t=%v out=%v, (%v:)", t, out, origin(2)) + } s := (*guuid.UUID)(unsafe.Pointer(uu)).String() copy((*RawMem)(unsafe.Pointer(out))[:], s) *(*byte)(unsafe.Pointer(out + uintptr(len(s)))) = 0 @@ -881,12 +986,18 @@ var staticRandomData = &rand.Rand{} // char *initstate(unsigned seed, char *state, size_t size); func Xinitstate(t *TLS, seed uint32, statebuf uintptr, statelen types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v seed=%v statebuf=%v statelen=%v, (%v:)", t, seed, statebuf, statelen, origin(2)) + } staticRandomData = rand.New(rand.NewSource(int64(seed))) return 0 } // char *setstate(const char *state); func Xsetstate(t *TLS, state uintptr) uintptr { + if __ccgo_strace { + trc("t=%v state=%v, (%v:)", t, state, origin(2)) + } t.setErrno(errno.EINVAL) //TODO return 0 } @@ -902,6 +1013,9 @@ func Xsetstate(t *TLS, state uintptr) uintptr { // // char *initstate_r(unsigned int seed, char *statebuf, size_t statelen, struct random_data *buf); func Xinitstate_r(t *TLS, seed uint32, statebuf uintptr, statelen types.Size_t, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v seed=%v statebuf=%v statelen=%v buf=%v, (%v:)", t, seed, statebuf, statelen, buf, origin(2)) + } if buf == 0 { panic(todo("")) } @@ -921,11 +1035,17 @@ var ( // int mkstemps(char *template, int suffixlen); func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 { + if __ccgo_strace { + trc("t=%v template=%v suffixlen=%v, (%v:)", t, template, suffixlen, origin(2)) + } return Xmkstemps64(t, template, suffixlen) } // int mkstemps(char *template, int suffixlen); func Xmkstemps64(t *TLS, template uintptr, suffixlen int32) int32 { + if __ccgo_strace { + trc("t=%v template=%v suffixlen=%v, (%v:)", t, template, suffixlen, origin(2)) + } len := uintptr(Xstrlen(t, template)) x := template + uintptr(len-6) - uintptr(suffixlen) for i := uintptr(0); i < 6; i++ { @@ -946,16 +1066,25 @@ func Xmkstemps64(t *TLS, template uintptr, suffixlen int32) int32 { // int mkstemp(char *template); func Xmkstemp(t *TLS, template uintptr) int32 { + if __ccgo_strace { + trc("t=%v template=%v, (%v:)", t, template, origin(2)) + } return Xmkstemp64(t, template) } // int mkstemp(char *template); func Xmkstemp64(t *TLS, template uintptr) int32 { + if __ccgo_strace { + trc("t=%v template=%v, (%v:)", t, template, origin(2)) + } return Xmkstemps64(t, template, 0) } // int random_r(struct random_data *buf, int32_t *result); func Xrandom_r(t *TLS, buf, result uintptr) int32 { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } randomDataMu.Lock() defer randomDataMu.Unlock() @@ -970,11 +1099,17 @@ func Xrandom_r(t *TLS, buf, result uintptr) int32 { // int strerror_r(int errnum, char *buf, size_t buflen); func Xstrerror_r(t *TLS, errnum int32, buf uintptr, buflen size_t) int32 { + if __ccgo_strace { + trc("t=%v errnum=%v buf=%v buflen=%v, (%v:)", t, errnum, buf, buflen, origin(2)) + } panic(todo("")) } // void endpwent(void); func Xendpwent(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } // nop } @@ -982,11 +1117,17 @@ var ctimeStaticBuf [32]byte // char *ctime(const time_t *timep); func Xctime(t *TLS, timep uintptr) uintptr { + if __ccgo_strace { + trc("t=%v timep=%v, (%v:)", t, timep, origin(2)) + } return Xctime_r(t, timep, uintptr(unsafe.Pointer(&ctimeStaticBuf[0]))) } // char *ctime_r(const time_t *timep, char *buf); func Xctime_r(t *TLS, timep, buf uintptr) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } ut := *(*ctime.Time_t)(unsafe.Pointer(timep)) tm := time.Unix(int64(ut), 0).Local() s := tm.Format(time.ANSIC) + "\n\x00" @@ -996,6 +1137,9 @@ func Xctime_r(t *TLS, timep, buf uintptr) uintptr { // ssize_t pread(int fd, void *buf, size_t count, off_t offset); func Xpread(t *TLS, fd int32, buf uintptr, count types.Size_t, offset types.Off_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v offset=%v, (%v:)", t, fd, buf, count, offset, origin(2)) + } var n int var err error switch { diff --git a/vendor/modernc.org/libc/libc_windows.go b/vendor/modernc.org/libc/libc_windows.go index fc36dc5a..81f4078b 100644 --- a/vendor/modernc.org/libc/libc_windows.go +++ b/vendor/modernc.org/libc/libc_windows.go @@ -344,6 +344,9 @@ func fwrite(fd int32, b []byte) (int, error) { // int fprintf(FILE *stream, const char *format, ...); func Xfprintf(t *TLS, stream, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -356,12 +359,18 @@ func Xfprintf(t *TLS, stream, format, args uintptr) int32 { // int usleep(useconds_t usec); func Xusleep(t *TLS, usec types.Useconds_t) int32 { + if __ccgo_strace { + trc("t=%v usec=%v, (%v:)", t, usec, origin(2)) + } gotime.Sleep(gotime.Microsecond * gotime.Duration(usec)) return 0 } // int getrusage(int who, struct rusage *usage); func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { + if __ccgo_strace { + trc("t=%v who=%v usage=%v, (%v:)", t, who, usage, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_GETRUSAGE, uintptr(who), usage, 0); err != 0 { // t.setErrno(err) @@ -373,16 +382,25 @@ func Xgetrusage(t *TLS, who int32, usage uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xlstat64(t, pathname, statbuf) } // int stat(const char *pathname, struct stat *statbuf); func Xstat(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } return Xstat64(t, pathname, statbuf) } // int chdir(const char *path); func Xchdir(t *TLS, path uintptr) int32 { + if __ccgo_strace { + trc("t=%v path=%v, (%v:)", t, path, origin(2)) + } err := syscall.Chdir(GoString(path)) if err != nil { t.setErrno(err) @@ -445,6 +463,9 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { // // ); func X_wopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } var mode types.Mode_t if args != 0 { mode = *(*types.Mode_t)(unsafe.Pointer(args)) @@ -469,11 +490,17 @@ func X_wopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { // int open(const char *pathname, int flags, ...); func Xopen(t *TLS, pathname uintptr, flags int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v args=%v, (%v:)", t, pathname, flags, args, origin(2)) + } return Xopen64(t, pathname, flags, args) } // int open(const char *pathname, int flags, ...); func Xopen64(t *TLS, pathname uintptr, flags int32, cmode uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v flags=%v cmode=%v, (%v:)", t, pathname, flags, cmode, origin(2)) + } var mode types.Mode_t if cmode != 0 { @@ -500,6 +527,9 @@ func Xopen64(t *TLS, pathname uintptr, flags int32, cmode uintptr) int32 { // off_t lseek(int fd, off_t offset, int whence); func Xlseek(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } return types.Off_t(Xlseek64(t, fd, offset, whence)) } @@ -520,6 +550,9 @@ var fsyncStatbuf stat.Stat // int fsync(int fd); func Xfsync(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -540,6 +573,9 @@ func Xfsync(t *TLS, fd int32) int32 { // long sysconf(int name); func Xsysconf(t *TLS, name int32) long { + if __ccgo_strace { + trc("t=%v name=%v, (%v:)", t, name, origin(2)) + } panic(todo("")) // switch name { // case unistd.X_SC_PAGESIZE: @@ -551,6 +587,9 @@ func Xsysconf(t *TLS, name int32) long { // int close(int fd); func Xclose(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -572,6 +611,9 @@ func Xclose(t *TLS, fd int32) int32 { // char *getcwd(char *buf, size_t size); func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } b := make([]uint16, size) n, err := syscall.GetCurrentDirectory(uint32(len(b)), &b[0]) @@ -597,16 +639,25 @@ func Xgetcwd(t *TLS, buf uintptr, size types.Size_t) uintptr { // int fstat(int fd, struct stat *statbuf); func Xfstat(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } return Xfstat64(t, fd, statbuf) } // int ftruncate(int fd, off_t length); func Xftruncate(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } return Xftruncate64(t, fd, length) } // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } return Xfcntl64(t, fd, cmd, args) } @@ -618,6 +669,9 @@ func Xfcntl(t *TLS, fd, cmd int32, args uintptr) int32 { // // ); func Xread(t *TLS, fd int32, buf uintptr, count uint32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } f, ok := fdToFile(fd) if !ok { t.setErrno(errno.EBADF) @@ -646,6 +700,9 @@ func Xread(t *TLS, fd int32, buf uintptr, count uint32) int32 { // // ); func Xwrite(t *TLS, fd int32, buf uintptr, count uint32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buf=%v count=%v, (%v:)", t, fd, buf, count, origin(2)) + } f, ok := fdToFile(fd) if !ok { t.setErrno(errno.EBADF) @@ -671,6 +728,9 @@ func Xwrite(t *TLS, fd int32, buf uintptr, count uint32) int32 { // int fchmod(int fd, mode_t mode); func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FCHMOD, uintptr(fd), uintptr(mode), 0); err != 0 { // t.setErrno(err) @@ -701,6 +761,9 @@ func Xfchmod(t *TLS, fd int32, mode types.Mode_t) int32 { // int munmap(void *addr, size_t length); func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v addr=%v length=%v, (%v:)", t, addr, length, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MUNMAP, addr, uintptr(length), 0); err != 0 { // t.setErrno(err) @@ -712,6 +775,9 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { + if __ccgo_strace { + trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) + } panic(todo("")) // if tz != 0 { // panic(todo("")) @@ -746,6 +812,9 @@ func Xsetsockopt(t *TLS, _ ...interface{}) int32 { // int ioctl(int fd, unsigned long request, ...); func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v request=%v va=%v, (%v:)", t, fd, request, va, origin(2)) + } panic(todo("")) // var argp uintptr // if va != 0 { @@ -762,6 +831,9 @@ func Xioctl(t *TLS, fd int32, request ulong, va uintptr) int32 { // int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) int32 { + if __ccgo_strace { + trc("t=%v nfds=%v timeout=%v, (%v:)", t, nfds, timeout, origin(2)) + } panic(todo("")) // n, err := unix.Select( // int(nfds), @@ -780,6 +852,9 @@ func Xselect(t *TLS, nfds int32, readfds, writefds, exceptfds, timeout uintptr) // int mkfifo(const char *pathname, mode_t mode); func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) // if err := unix.Mkfifo(GoString(pathname), mode); err != nil { // t.setErrno(err) @@ -791,6 +866,9 @@ func Xmkfifo(t *TLS, pathname uintptr, mode types.Mode_t) int32 { // mode_t umask(mode_t mask); func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { + if __ccgo_strace { + trc("t=%v mask=%v, (%v:)", t, mask, origin(2)) + } panic(todo("")) // n, _, _ := unix.Syscall(unix.SYS_UMASK, uintptr(mask), 0, 0) // return types.Mode_t(n) @@ -798,6 +876,9 @@ func Xumask(t *TLS, mask types.Mode_t) types.Mode_t { // int execvp(const char *file, char *const argv[]); func Xexecvp(t *TLS, file, argv uintptr) int32 { + if __ccgo_strace { + trc("t=%v argv=%v, (%v:)", t, argv, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_EXECVE, file, argv, Environ()); err != 0 { // t.setErrno(err) @@ -809,6 +890,9 @@ func Xexecvp(t *TLS, file, argv uintptr) int32 { // pid_t waitpid(pid_t pid, int *wstatus, int options); func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid_t { + if __ccgo_strace { + trc("t=%v pid=%v wstatus=%v optname=%v, (%v:)", t, pid, wstatus, optname, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall6(unix.SYS_WAIT4, uintptr(pid), wstatus, uintptr(optname), 0, 0, 0) // if err != 0 { @@ -821,6 +905,9 @@ func Xwaitpid(t *TLS, pid types.Pid_t, wstatus uintptr, optname int32) types.Pid // int uname(struct utsname *buf); func Xuname(t *TLS, buf uintptr) int32 { + if __ccgo_strace { + trc("t=%v buf=%v, (%v:)", t, buf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UNAME, buf, 0, 0); err != 0 { // t.setErrno(err) @@ -832,16 +919,25 @@ func Xuname(t *TLS, buf uintptr) int32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xgetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } return Xsetrlimit64(t, resource, rlim) } // int setrlimit(int resource, const struct rlimit *rlim); func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { // t.setErrno(err) @@ -858,11 +954,17 @@ func Xsetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // pid_t getpid(void); func Xgetpid(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return int32(os.Getpid()) } // int system(const char *command); func Xsystem(t *TLS, command uintptr) int32 { + if __ccgo_strace { + trc("t=%v command=%v, (%v:)", t, command, origin(2)) + } s := GoString(command) if command == 0 { panic(todo("")) @@ -897,6 +999,9 @@ func Xsystem(t *TLS, command uintptr) int32 { // struct passwd *getpwuid(uid_t uid); func Xgetpwuid(t *TLS, uid uint32) uintptr { + if __ccgo_strace { + trc("t=%v uid=%v, (%v:)", t, uid, origin(2)) + } panic(todo("")) // f, err := os.Open("/etc/passwd") // if err != nil { @@ -955,26 +1060,41 @@ func Xgetpwuid(t *TLS, uid uint32) uintptr { // int setvbuf(FILE *stream, char *buf, int mode, size_t size); func Xsetvbuf(t *TLS, stream, buf uintptr, mode int32, size types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v buf=%v mode=%v size=%v, (%v:)", t, buf, mode, size, origin(2)) + } return 0 //TODO } // int raise(int sig); func Xraise(t *TLS, sig int32) int32 { + if __ccgo_strace { + trc("t=%v sig=%v, (%v:)", t, sig, origin(2)) + } panic(todo("")) } // int backtrace(void **buffer, int size); func Xbacktrace(t *TLS, buf uintptr, size int32) int32 { + if __ccgo_strace { + trc("t=%v buf=%v size=%v, (%v:)", t, buf, size, origin(2)) + } panic(todo("")) } // void backtrace_symbols_fd(void *const *buffer, int size, int fd); func Xbacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) { + if __ccgo_strace { + trc("t=%v buffer=%v fd=%v, (%v:)", t, buffer, fd, origin(2)) + } panic(todo("")) } // int fileno(FILE *stream); func Xfileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } if stream == 0 { t.setErrno(errno.EBADF) return -1 @@ -1152,11 +1272,17 @@ func Xfileno(t *TLS, stream uintptr) int32 { // int mkstemps(char *template, int suffixlen); func Xmkstemps(t *TLS, template uintptr, suffixlen int32) int32 { + if __ccgo_strace { + trc("t=%v template=%v suffixlen=%v, (%v:)", t, template, suffixlen, origin(2)) + } return Xmkstemps64(t, template, suffixlen) } // int mkstemps(char *template, int suffixlen); func Xmkstemps64(t *TLS, template uintptr, suffixlen int32) int32 { + if __ccgo_strace { + trc("t=%v template=%v suffixlen=%v, (%v:)", t, template, suffixlen, origin(2)) + } panic(todo("")) // len := uintptr(Xstrlen(t, template)) // x := template + uintptr(len-6) - uintptr(suffixlen) @@ -1178,6 +1304,9 @@ func Xmkstemps64(t *TLS, template uintptr, suffixlen int32) int32 { // int mkstemp(char *template); func Xmkstemp64(t *TLS, template uintptr) int32 { + if __ccgo_strace { + trc("t=%v template=%v, (%v:)", t, template, origin(2)) + } return Xmkstemps64(t, template, 0) } @@ -1240,6 +1369,9 @@ type ftstream struct { // FTS *fts_open(char * const *path_argv, int options, int (*compar)(const FTSENT **, const FTSENT **)); func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintptr { + if __ccgo_strace { + trc("t=%v path_argv=%v options=%v compar=%v, (%v:)", t, path_argv, options, compar, origin(2)) + } panic(todo("")) // f := &ftstream{} // @@ -1345,11 +1477,17 @@ func Xfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) uintp // FTSENT *fts_read(FTS *ftsp); func Xfts_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_read(t, ftsp) } // FTSENT *fts_read(FTS *ftsp); func Xfts64_read(t *TLS, ftsp uintptr) uintptr { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } panic(todo("")) // f := winGetObject(ftsp).(*ftstream) // if f.x == len(f.s) { @@ -1367,11 +1505,17 @@ func Xfts64_read(t *TLS, ftsp uintptr) uintptr { // int fts_close(FTS *ftsp); func Xfts_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } return Xfts64_close(t, ftsp) } // int fts_close(FTS *ftsp); func Xfts64_close(t *TLS, ftsp uintptr) int32 { + if __ccgo_strace { + trc("t=%v ftsp=%v, (%v:)", t, ftsp, origin(2)) + } panic(todo("")) // winGetObject(ftsp).(*ftstream).close(t) // removeObject(ftsp) @@ -1380,6 +1524,9 @@ func Xfts64_close(t *TLS, ftsp uintptr) int32 { // void tzset (void); func Xtzset(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } //TODO } @@ -1387,37 +1534,58 @@ var strerrorBuf [256]byte // char *strerror(int errnum); func Xstrerror(t *TLS, errnum int32) uintptr { + if __ccgo_strace { + trc("t=%v errnum=%v, (%v:)", t, errnum, origin(2)) + } copy((*RawMem)(unsafe.Pointer(&strerrorBuf[0]))[:len(strerrorBuf):len(strerrorBuf)], fmt.Sprintf("errno %d\x00", errnum)) return uintptr(unsafe.Pointer(&strerrorBuf[0])) } // void *dlopen(const char *filename, int flags); func Xdlopen(t *TLS, filename uintptr, flags int32) uintptr { + if __ccgo_strace { + trc("t=%v filename=%v flags=%v, (%v:)", t, filename, flags, origin(2)) + } panic(todo("")) } // char *dlerror(void); func Xdlerror(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int dlclose(void *handle); func Xdlclose(t *TLS, handle uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } panic(todo("")) } // void *dlsym(void *handle, const char *symbol); func Xdlsym(t *TLS, handle, symbol uintptr) uintptr { + if __ccgo_strace { + trc("t=%v symbol=%v, (%v:)", t, symbol, origin(2)) + } panic(todo("")) } // void perror(const char *s); func Xperror(t *TLS, s uintptr) { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func Xpclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } @@ -1425,17 +1593,26 @@ var gai_strerrorBuf [100]byte // const char *gai_strerror(int errcode); func Xgai_strerror(t *TLS, errcode int32) uintptr { + if __ccgo_strace { + trc("t=%v errcode=%v, (%v:)", t, errcode, origin(2)) + } copy(gai_strerrorBuf[:], fmt.Sprintf("gai error %d\x00", errcode)) return uintptr(unsafe.Pointer(&gai_strerrorBuf)) } // int tcgetattr(int fd, struct termios *termios_p); func Xtcgetattr(t *TLS, fd int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v termios_p=%v, (%v:)", t, fd, termios_p, origin(2)) + } panic(todo("")) } // int tcsetattr(int fd, int optional_actions, const struct termios *termios_p); func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { + if __ccgo_strace { + trc("t=%v optional_actions=%v termios_p=%v, (%v:)", t, optional_actions, termios_p, origin(2)) + } panic(todo("")) } @@ -1446,22 +1623,34 @@ func Xtcsetattr(t *TLS, fd, optional_actions int32, termios_p uintptr) int32 { // int cfsetospeed(struct termios *termios_p, speed_t speed); func Xcfsetospeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // int cfsetispeed(struct termios *termios_p, speed_t speed); func Xcfsetispeed(t *TLS, termios_p uintptr, speed uint32) int32 { + if __ccgo_strace { + trc("t=%v termios_p=%v speed=%v, (%v:)", t, termios_p, speed, origin(2)) + } panic(todo("")) } // pid_t fork(void); func Xfork(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } t.setErrno(errno.ENOSYS) return -1 } // char *setlocale(int category, const char *locale); func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { + if __ccgo_strace { + trc("t=%v category=%v locale=%v, (%v:)", t, category, locale, origin(2)) + } return 0 //TODO } @@ -1472,11 +1661,17 @@ func Xsetlocale(t *TLS, category int32, locale uintptr) uintptr { // FILE *popen(const char *command, const char *type); func Xpopen(t *TLS, command, type1 uintptr) uintptr { + if __ccgo_strace { + trc("t=%v type1=%v, (%v:)", t, type1, origin(2)) + } panic(todo("")) } // char *realpath(const char *path, char *resolved_path); func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { + if __ccgo_strace { + trc("t=%v resolved_path=%v, (%v:)", t, resolved_path, origin(2)) + } s, err := filepath.EvalSymlinks(GoString(path)) if err != nil { if os.IsNotExist(err) { @@ -1505,6 +1700,9 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { // struct tm *gmtime_r(const time_t *timep, struct tm *result); func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { + if __ccgo_strace { + trc("t=%v result=%v, (%v:)", t, result, origin(2)) + } panic(todo("")) } @@ -1518,6 +1716,9 @@ func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { // } func Xabort(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) // if dmesgs { // dmesg("%v:\n%s", origin(1), debug.Stack()) @@ -1538,6 +1739,9 @@ func Xabort(t *TLS) { // int fflush(FILE *stream); func Xfflush(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1553,6 +1757,9 @@ func Xfflush(t *TLS, stream uintptr) int32 { // size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1578,6 +1785,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types // size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v ptr=%v nmemb=%v stream=%v, (%v:)", t, ptr, nmemb, stream, origin(2)) + } if ptr == 0 || size == 0 { return 0 } @@ -1605,6 +1815,9 @@ func Xfwrite(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) type // int fclose(FILE *stream); func Xfclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1615,6 +1828,9 @@ func Xfclose(t *TLS, stream uintptr) int32 { // int fputc(int c, FILE *stream); func Xfputc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1628,6 +1844,9 @@ func Xfputc(t *TLS, c int32, stream uintptr) int32 { // int fseek(FILE *stream, long offset, int whence); func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { + if __ccgo_strace { + trc("t=%v stream=%v offset=%v whence=%v, (%v:)", t, stream, offset, whence, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1649,6 +1868,9 @@ func Xfseek(t *TLS, stream uintptr, offset long, whence int32) int32 { // long ftell(FILE *stream); func Xftell(t *TLS, stream uintptr) long { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1669,6 +1891,9 @@ func Xftell(t *TLS, stream uintptr) long { // int ferror(FILE *stream); func Xferror(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1680,6 +1905,9 @@ func Xferror(t *TLS, stream uintptr) int32 { // int getc(FILE *stream); func Xfgetc(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1696,16 +1924,25 @@ func Xfgetc(t *TLS, stream uintptr) int32 { // int ungetc(int c, FILE *stream); func Xungetc(t *TLS, c int32, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v c=%v stream=%v, (%v:)", t, c, stream, origin(2)) + } panic(todo("")) } // int fscanf(FILE *stream, const char *format, ...); func Xfscanf(t *TLS, stream, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } panic(todo("")) } // int fputs(const char *s, FILE *stream); func Xfputs(t *TLS, s, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -1821,51 +2058,81 @@ func Xfputs(t *TLS, s, stream uintptr) int32 { // _CRTIMP extern int *__cdecl _errno(void); // /usr/share/mingw-w64/include/errno.h:17: func X_errno(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return t.errnop } // int vfscanf(FILE * restrict stream, const char * restrict format, va_list arg); func X__ms_vfscanf(t *TLS, stream, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } // int vsscanf(const char *str, const char *format, va_list ap); func X__ms_vsscanf(t *TLS, str, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } // int vscanf(const char *format, va_list ap); func X__ms_vscanf(t *TLS, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } // int vsnprintf(char *str, size_t size, const char *format, va_list ap); func X__ms_vsnprintf(t *TLS, str uintptr, size types.Size_t, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v size=%v ap=%v, (%v:)", t, str, size, ap, origin(2)) + } return Xvsnprintf(t, str, size, format, ap) } // int vfwscanf(FILE *stream, const wchar_t *format, va_list argptr;); func X__ms_vfwscanf(t *TLS, stream uintptr, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v ap=%v, (%v:)", t, stream, ap, origin(2)) + } panic(todo("")) } // int vwscanf(const wchar_t * restrict format, va_list arg); func X__ms_vwscanf(t *TLS, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } // int _vsnwprintf(wchar_t *buffer, size_t count, const wchar_t *format, va_list argptr); func X_vsnwprintf(t *TLS, buffer uintptr, count types.Size_t, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v buffer=%v count=%v ap=%v, (%v:)", t, buffer, count, ap, origin(2)) + } panic(todo("")) } // int vswscanf(const wchar_t *buffer, const wchar_t *format, va_list arglist); func X__ms_vswscanf(t *TLS, stream uintptr, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v ap=%v, (%v:)", t, stream, ap, origin(2)) + } panic(todo("")) } // __acrt_iob_func func X__acrt_iob_func(t *TLS, fd uint32) uintptr { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } f, ok := fdToFile(int32(fd)) if !ok { @@ -1881,6 +2148,9 @@ func X__acrt_iob_func(t *TLS, fd uint32) uintptr { // // ); func XSetEvent(t *TLS, hEvent uintptr) int32 { + if __ccgo_strace { + trc("t=%v hEvent=%v, (%v:)", t, hEvent, origin(2)) + } r0, _, err := syscall.Syscall(procSetEvent.Addr(), 1, hEvent, 0, 0) if r0 == 0 { t.setErrno(err) @@ -1895,6 +2165,9 @@ func XSetEvent(t *TLS, hEvent uintptr) int32 { // // ); func X_stricmp(t *TLS, string1, string2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v string2=%v, (%v:)", t, string2, origin(2)) + } var s1 = strings.ToLower(GoString(string1)) var s2 = strings.ToLower(GoString(string2)) return int32(strings.Compare(s1, s2)) @@ -1908,6 +2181,9 @@ func X_stricmp(t *TLS, string1, string2 uintptr) int32 { // // ); func XHeapFree(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) int32 { + if __ccgo_strace { + trc("t=%v hHeap=%v dwFlags=%v lpMem=%v, (%v:)", t, hHeap, dwFlags, lpMem, origin(2)) + } r0, _, err := syscall.Syscall(procHeapFree.Addr(), 3, hHeap, uintptr(dwFlags), lpMem) if err != 0 { t.setErrno(err) @@ -1917,6 +2193,9 @@ func XHeapFree(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) int32 { // HANDLE GetProcessHeap(); func XGetProcessHeap(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, err := syscall.Syscall(procGetProcessHeap.Addr(), 0, 0, 0, 0) if r0 == 0 { t.setErrno(err) @@ -1932,6 +2211,9 @@ func XGetProcessHeap(t *TLS) uintptr { // // ); func XHeapAlloc(t *TLS, hHeap uintptr, dwFlags uint32, dwBytes types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v hHeap=%v dwFlags=%v dwBytes=%v, (%v:)", t, hHeap, dwFlags, dwBytes, origin(2)) + } r0, _, err := syscall.Syscall(procHeapAlloc.Addr(), 3, hHeap, uintptr(dwFlags), uintptr(dwBytes)) if r0 == 0 { t.setErrno(err) @@ -1977,6 +2259,9 @@ func XWspiapiGetAddrInfo(t *TLS, _ ...interface{}) int32 { // // ); func Xwcscmp(t *TLS, string1, string2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v string2=%v, (%v:)", t, string2, origin(2)) + } var s1 = goWideString(string1) var s2 = goWideString(string2) return int32(strings.Compare(s1, s2)) @@ -1984,6 +2269,9 @@ func Xwcscmp(t *TLS, string1, string2 uintptr) int32 { // BOOL IsDebuggerPresent(); func XIsDebuggerPresent(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } @@ -1997,6 +2285,9 @@ func XExitProcess(t *TLS, _ ...interface{}) int32 { // // ); func XGetVersionExW(t *TLS, lpVersionInformation uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpVersionInformation=%v, (%v:)", t, lpVersionInformation, origin(2)) + } r0, _, err := syscall.Syscall(procGetVersionExW.Addr(), 1, lpVersionInformation, 0, 0) if r0 == 0 { t.setErrno(err) @@ -2021,6 +2312,9 @@ func XGetVolumeNameForVolumeMountPointW(t *TLS, _ ...interface{}) int32 { // // ); func Xwcslen(t *TLS, str uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v str=%v, (%v:)", t, str, origin(2)) + } r0, _, _ := syscall.Syscall(procLstrlenW.Addr(), 1, str, 0, 0) return types.Size_t(r0) } @@ -2031,6 +2325,9 @@ func Xwcslen(t *TLS, str uintptr) types.Size_t { // // ); func XGetStdHandle(t *TLS, nStdHandle uint32) uintptr { + if __ccgo_strace { + trc("t=%v nStdHandle=%v, (%v:)", t, nStdHandle, origin(2)) + } h, err := syscall.GetStdHandle(int(nStdHandle)) if err != nil { panic("no console") @@ -2044,6 +2341,9 @@ func XGetStdHandle(t *TLS, nStdHandle uint32) uintptr { // // ); func XCloseHandle(t *TLS, hObject uintptr) int32 { + if __ccgo_strace { + trc("t=%v hObject=%v, (%v:)", t, hObject, origin(2)) + } r := syscall.CloseHandle(syscall.Handle(hObject)) if r != nil { return errno.EINVAL @@ -2053,6 +2353,9 @@ func XCloseHandle(t *TLS, hObject uintptr) int32 { // DWORD GetLastError(); func XGetLastError(t *TLS) uint32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } var rv = *(*int32)(unsafe.Pointer(t.errnop)) return uint32(rv) @@ -2069,6 +2372,9 @@ func XGetLastError(t *TLS) uint32 { // // ); func XSetFilePointer(t *TLS, hFile uintptr, lDistanceToMove long, lpDistanceToMoveHigh uintptr, dwMoveMethod uint32) uint32 { + if __ccgo_strace { + trc("t=%v hFile=%v lDistanceToMove=%v lpDistanceToMoveHigh=%v dwMoveMethod=%v, (%v:)", t, hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod, origin(2)) + } r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, hFile, uintptr(lDistanceToMove), lpDistanceToMoveHigh, uintptr(dwMoveMethod), 0, 0) var uOff = uint32(r0) if uOff == 0xffffffff { @@ -2087,6 +2393,9 @@ func XSetFilePointer(t *TLS, hFile uintptr, lDistanceToMove long, lpDistanceToMo // // ); func XSetEndOfFile(t *TLS, hFile uintptr) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v, (%v:)", t, hFile, origin(2)) + } err := syscall.SetEndOfFile(syscall.Handle(hFile)) if err != nil { t.setErrno(err) @@ -2105,6 +2414,9 @@ func XSetEndOfFile(t *TLS, hFile uintptr) int32 { // // ); func XReadFile(t *TLS, hFile, lpBuffer uintptr, nNumberOfBytesToRead uint32, lpNumberOfBytesRead, lpOverlapped uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nNumberOfBytesToRead=%v lpOverlapped=%v, (%v:)", t, lpBuffer, nNumberOfBytesToRead, lpOverlapped, origin(2)) + } r1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, hFile, lpBuffer, uintptr(nNumberOfBytesToRead), uintptr(lpNumberOfBytesRead), uintptr(lpOverlapped), 0) if r1 == 0 { @@ -2128,6 +2440,9 @@ func XReadFile(t *TLS, hFile, lpBuffer uintptr, nNumberOfBytesToRead uint32, lpN // // ); func XWriteFile(t *TLS, hFile, lpBuffer uintptr, nNumberOfBytesToWrite uint32, lpNumberOfBytesWritten, lpOverlapped uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nNumberOfBytesToWrite=%v lpOverlapped=%v, (%v:)", t, lpBuffer, nNumberOfBytesToWrite, lpOverlapped, origin(2)) + } r1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, hFile, lpBuffer, uintptr(nNumberOfBytesToWrite), lpNumberOfBytesWritten, lpOverlapped, 0) if r1 == 0 { @@ -2147,6 +2462,9 @@ func XWriteFile(t *TLS, hFile, lpBuffer uintptr, nNumberOfBytesToWrite uint32, l // // ); func XGetFileAttributesW(t *TLS, lpFileName uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v, (%v:)", t, lpFileName, origin(2)) + } attrs, err := syscall.GetFileAttributes((*uint16)(unsafe.Pointer(lpFileName))) if attrs == syscall.INVALID_FILE_ATTRIBUTES { if err != nil { @@ -2170,6 +2488,9 @@ func XGetFileAttributesW(t *TLS, lpFileName uintptr) uint32 { // // ); func XCreateFileW(t *TLS, lpFileName uintptr, dwDesiredAccess, dwShareMode uint32, lpSecurityAttributes uintptr, dwCreationDisposition, dwFlagsAndAttributes uint32, hTemplateFile uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpFileName=%v dwShareMode=%v lpSecurityAttributes=%v dwFlagsAndAttributes=%v hTemplateFile=%v, (%v:)", t, lpFileName, dwShareMode, lpSecurityAttributes, dwFlagsAndAttributes, hTemplateFile, origin(2)) + } r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, lpFileName, uintptr(dwDesiredAccess), uintptr(dwShareMode), lpSecurityAttributes, uintptr(dwCreationDisposition), uintptr(dwFlagsAndAttributes), hTemplateFile, 0, 0) @@ -2197,6 +2518,9 @@ func XCreateFileW(t *TLS, lpFileName uintptr, dwDesiredAccess, dwShareMode uint3 // // ); func XDuplicateHandle(t *TLS, hSourceProcessHandle, hSourceHandle, hTargetProcessHandle, lpTargetHandle uintptr, dwDesiredAccess uint32, bInheritHandle int32, dwOptions uint32) int32 { + if __ccgo_strace { + trc("t=%v lpTargetHandle=%v dwDesiredAccess=%v bInheritHandle=%v dwOptions=%v, (%v:)", t, lpTargetHandle, dwDesiredAccess, bInheritHandle, dwOptions, origin(2)) + } r0, _, err := syscall.Syscall9(procDuplicateHandle.Addr(), 7, hSourceProcessHandle, hSourceHandle, hTargetProcessHandle, lpTargetHandle, uintptr(dwDesiredAccess), uintptr(bInheritHandle), uintptr(dwOptions), 0, 0) if r0 == 0 { @@ -2207,6 +2531,9 @@ func XDuplicateHandle(t *TLS, hSourceProcessHandle, hSourceHandle, hTargetProces // HANDLE GetCurrentProcess(); func XGetCurrentProcess(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, e1 := syscall.Syscall(procGetCurrentProcess.Addr(), 0, 0, 0, 0) if r0 == 0 { if e1 != 0 { @@ -2224,6 +2551,9 @@ func XGetCurrentProcess(t *TLS) uintptr { // // ); func XFlushFileBuffers(t *TLS, hFile uintptr) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v, (%v:)", t, hFile, origin(2)) + } err := syscall.FlushFileBuffers(syscall.Handle(hFile)) if err != nil { t.setErrno(err) @@ -2239,6 +2569,9 @@ func XFlushFileBuffers(t *TLS, hFile uintptr) int32 { // // ); func XGetFileType(t *TLS, hFile uintptr) uint32 { + if __ccgo_strace { + trc("t=%v hFile=%v, (%v:)", t, hFile, origin(2)) + } n, err := syscall.GetFileType(syscall.Handle(hFile)) if err != nil { t.setErrno(err) @@ -2253,6 +2586,9 @@ func XGetFileType(t *TLS, hFile uintptr) uint32 { // // ); func XGetConsoleMode(t *TLS, hConsoleHandle, lpMode uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpMode=%v, (%v:)", t, lpMode, origin(2)) + } err := syscall.GetConsoleMode(syscall.Handle(hConsoleHandle), (*uint32)(unsafe.Pointer(lpMode))) if err != nil { t.setErrno(err) @@ -2268,6 +2604,9 @@ func XGetConsoleMode(t *TLS, hConsoleHandle, lpMode uintptr) int32 { // // ); func XGetCommState(t *TLS, hFile, lpDCB uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpDCB=%v, (%v:)", t, lpDCB, origin(2)) + } r1, _, err := syscall.Syscall(procGetCommState.Addr(), 2, hFile, lpDCB, 0) if r1 == 0 { t.setErrno(err) @@ -2284,6 +2623,9 @@ func XGetCommState(t *TLS, hFile, lpDCB uintptr) int32 { // // ); func X_wcsnicmp(t *TLS, string1, string2 uintptr, count types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v string2=%v count=%v, (%v:)", t, string2, count, origin(2)) + } var s1 = strings.ToLower(goWideString(string1)) var l1 = len(s1) @@ -2316,6 +2658,9 @@ func X_wcsnicmp(t *TLS, string1, string2 uintptr, count types.Size_t) int32 { // // ); func XReadConsoleW(t *TLS, hConsoleInput, lpBuffer uintptr, nNumberOfCharsToRead uint32, lpNumberOfCharsRead, pInputControl uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nNumberOfCharsToRead=%v pInputControl=%v, (%v:)", t, lpBuffer, nNumberOfCharsToRead, pInputControl, origin(2)) + } rv, _, err := syscall.Syscall6(procReadConsoleW.Addr(), 5, hConsoleInput, lpBuffer, uintptr(nNumberOfCharsToRead), lpNumberOfCharsRead, pInputControl, 0) @@ -2336,6 +2681,9 @@ func XReadConsoleW(t *TLS, hConsoleInput, lpBuffer uintptr, nNumberOfCharsToRead // // ); func XWriteConsoleW(t *TLS, hConsoleOutput, lpBuffer uintptr, nNumberOfCharsToWrite uint32, lpNumberOfCharsWritten, lpReserved uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nNumberOfCharsToWrite=%v lpReserved=%v, (%v:)", t, lpBuffer, nNumberOfCharsToWrite, lpReserved, origin(2)) + } rv, _, err := syscall.Syscall6(procWriteConsoleW.Addr(), 5, hConsoleOutput, lpBuffer, uintptr(nNumberOfCharsToWrite), lpNumberOfCharsWritten, lpReserved, 0) if rv == 0 { @@ -2351,6 +2699,9 @@ func XWriteConsoleW(t *TLS, hConsoleOutput, lpBuffer uintptr, nNumberOfCharsToWr // // ); func XWaitForSingleObject(t *TLS, hHandle uintptr, dwMilliseconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v hHandle=%v dwMilliseconds=%v, (%v:)", t, hHandle, dwMilliseconds, origin(2)) + } rv, err := syscall.WaitForSingleObject(syscall.Handle(hHandle), dwMilliseconds) if err != nil { t.setErrno(err) @@ -2364,6 +2715,9 @@ func XWaitForSingleObject(t *TLS, hHandle uintptr, dwMilliseconds uint32) uint32 // // ); func XResetEvent(t *TLS, hEvent uintptr) int32 { + if __ccgo_strace { + trc("t=%v hEvent=%v, (%v:)", t, hEvent, origin(2)) + } rv, _, err := syscall.Syscall(procResetEvent.Addr(), 1, hEvent, 0, 0) if rv == 0 { t.setErrno(err) @@ -2380,6 +2734,9 @@ func XResetEvent(t *TLS, hEvent uintptr) int32 { // // ); func XPeekConsoleInputW(t *TLS, hConsoleInput, lpBuffer uintptr, nLength uint32, lpNumberOfEventsRead uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nLength=%v lpNumberOfEventsRead=%v, (%v:)", t, lpBuffer, nLength, lpNumberOfEventsRead, origin(2)) + } r0, _, err := syscall.Syscall6(procPeekConsoleInputW.Addr(), 4, hConsoleInput, lpBuffer, uintptr(nLength), lpNumberOfEventsRead, 0, 0) if r0 == 0 { t.setErrno(err) @@ -2395,11 +2752,17 @@ func XPeekConsoleInputW(t *TLS, hConsoleInput, lpBuffer uintptr, nLength uint32, // // ); func XwsprintfA(t *TLS, buf, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v args=%v, (%v:)", t, args, origin(2)) + } return Xsprintf(t, buf, format, args) } // UINT WINAPI GetConsoleCP(void); func XGetConsoleCP(t *TLS) uint32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, err := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0) if r0 == 0 { t.setErrno(err) @@ -2426,6 +2789,9 @@ func XGetConsoleCP(t *TLS) uint32 { // // ); func XCreateEventW(t *TLS, lpEventAttributes uintptr, bManualReset, bInitialState int32, lpName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpEventAttributes=%v bInitialState=%v lpName=%v, (%v:)", t, lpEventAttributes, bInitialState, lpName, origin(2)) + } r0, _, err := syscall.Syscall6(procCreateEventW.Addr(), 4, lpEventAttributes, uintptr(bManualReset), uintptr(bInitialState), lpName, 0, 0) if r0 == 0 { @@ -2467,6 +2833,9 @@ func ThreadProc(p uintptr) uintptr { // // ); func XCreateThread(t *TLS, lpThreadAttributes uintptr, dwStackSize types.Size_t, lpStartAddress, lpParameter uintptr, dwCreationFlags uint32, lpThreadId uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpThreadAttributes=%v dwStackSize=%v lpParameter=%v dwCreationFlags=%v lpThreadId=%v, (%v:)", t, lpThreadAttributes, dwStackSize, lpParameter, dwCreationFlags, lpThreadId, origin(2)) + } f := (*struct{ f func(*TLS, uintptr) uint32 })(unsafe.Pointer(&struct{ uintptr }{lpStartAddress})).f var tAdp = ThreadAdapter{threadFunc: f, tls: NewTLS(), param: lpParameter} tAdp.token = addObject(&tAdp) @@ -2486,6 +2855,9 @@ func XCreateThread(t *TLS, lpThreadAttributes uintptr, dwStackSize types.Size_t, // // ); func XSetThreadPriority(t *TLS, hThread uintptr, nPriority int32) int32 { + if __ccgo_strace { + trc("t=%v hThread=%v nPriority=%v, (%v:)", t, hThread, nPriority, origin(2)) + } //r0, _, err := syscall.Syscall(procSetThreadPriority.Addr(), 2, hThread, uintptr(nPriority), 0) //if r0 == 0 { @@ -2502,6 +2874,9 @@ func XSetThreadPriority(t *TLS, hThread uintptr, nPriority int32) int32 { // // ); func XSetConsoleMode(t *TLS, hConsoleHandle uintptr, dwMode uint32) int32 { + if __ccgo_strace { + trc("t=%v hConsoleHandle=%v dwMode=%v, (%v:)", t, hConsoleHandle, dwMode, origin(2)) + } rv, _, err := syscall.Syscall(procSetConsoleMode.Addr(), 2, hConsoleHandle, uintptr(dwMode), 0) if rv == 0 { t.setErrno(err) @@ -2523,6 +2898,9 @@ func XClearCommError(t *TLS, _ ...interface{}) int32 { // // ); func XDeleteCriticalSection(t *TLS, lpCriticalSection uintptr) { + if __ccgo_strace { + trc("t=%v lpCriticalSection=%v, (%v:)", t, lpCriticalSection, origin(2)) + } syscall.Syscall(procDeleteCriticalSection.Addr(), 1, lpCriticalSection, 0, 0) } @@ -2532,6 +2910,9 @@ func XDeleteCriticalSection(t *TLS, lpCriticalSection uintptr) { // // ); func XEnterCriticalSection(t *TLS, lpCriticalSection uintptr) { + if __ccgo_strace { + trc("t=%v lpCriticalSection=%v, (%v:)", t, lpCriticalSection, origin(2)) + } syscall.Syscall(procEnterCriticalSection.Addr(), 1, lpCriticalSection, 0, 0) } @@ -2541,6 +2922,9 @@ func XEnterCriticalSection(t *TLS, lpCriticalSection uintptr) { // // ); func XLeaveCriticalSection(t *TLS, lpCriticalSection uintptr) { + if __ccgo_strace { + trc("t=%v lpCriticalSection=%v, (%v:)", t, lpCriticalSection, origin(2)) + } syscall.Syscall(procLeaveCriticalSection.Addr(), 1, lpCriticalSection, 0, 0) } @@ -2562,6 +2946,9 @@ func XSetCommTimeouts(t *TLS, _ ...interface{}) int32 { // // ); func XInitializeCriticalSection(t *TLS, lpCriticalSection uintptr) { + if __ccgo_strace { + trc("t=%v lpCriticalSection=%v, (%v:)", t, lpCriticalSection, origin(2)) + } // InitializeCriticalSection always succeeds, even in low memory situations. syscall.Syscall(procInitializeCriticalSection.Addr(), 1, lpCriticalSection, 0, 0) } @@ -2593,6 +2980,9 @@ func XGetCommModemStatus(t *TLS, _ ...interface{}) int32 { // // ); func XMoveFileW(t *TLS, lpExistingFileName, lpNewFileName uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpNewFileName=%v, (%v:)", t, lpNewFileName, origin(2)) + } r0, _, err := syscall.Syscall(procMoveFileW.Addr(), 2, lpExistingFileName, lpNewFileName, 0) if err != 0 { t.setErrno(err) @@ -2609,6 +2999,9 @@ func XMoveFileW(t *TLS, lpExistingFileName, lpNewFileName uintptr) int32 { // // ); func XGetFullPathNameW(t *TLS, lpFileName uintptr, nBufferLength uint32, lpBuffer, lpFilePart uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v nBufferLength=%v lpFilePart=%v, (%v:)", t, lpFileName, nBufferLength, lpFilePart, origin(2)) + } r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, lpFileName, uintptr(nBufferLength), uintptr(lpBuffer), uintptr(lpFilePart), 0, 0) n := uint32(r0) if n == 0 { @@ -2627,6 +3020,9 @@ func XGetFullPathNameW(t *TLS, lpFileName uintptr, nBufferLength uint32, lpBuffe // // ); func XCharLowerW(t *TLS, lpsz uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpsz=%v, (%v:)", t, lpsz, origin(2)) + } panic(todo("")) } @@ -2637,6 +3033,9 @@ func XCharLowerW(t *TLS, lpsz uintptr) uintptr { // // ); func XCreateDirectoryW(t *TLS, lpPathName, lpSecurityAttributes uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpSecurityAttributes=%v, (%v:)", t, lpSecurityAttributes, origin(2)) + } err := syscall.CreateDirectory((*uint16)(unsafe.Pointer(lpPathName)), (*syscall.SecurityAttributes)(unsafe.Pointer(lpSecurityAttributes))) if err != nil { @@ -2653,6 +3052,9 @@ func XCreateDirectoryW(t *TLS, lpPathName, lpSecurityAttributes uintptr) int32 { // // ); func XSetFileAttributesW(t *TLS, lpFileName uintptr, dwFileAttributes uint32) int32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v dwFileAttributes=%v, (%v:)", t, lpFileName, dwFileAttributes, origin(2)) + } err := syscall.SetFileAttributes((*uint16)(unsafe.Pointer(lpFileName)), dwFileAttributes) if err != nil { t.setErrno(err) @@ -2670,6 +3072,9 @@ func XSetFileAttributesW(t *TLS, lpFileName uintptr, dwFileAttributes uint32) in // // ); func XGetTempFileNameW(t *TLS, lpPathName, lpPrefixString uintptr, uUnique uint32, lpTempFileName uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpPrefixString=%v uUnique=%v lpTempFileName=%v, (%v:)", t, lpPrefixString, uUnique, lpTempFileName, origin(2)) + } r0, _, e1 := syscall.Syscall6(procGetTempFileNameW.Addr(), 4, lpPathName, lpPrefixString, uintptr(uUnique), lpTempFileName, 0, 0) if r0 == 0 { t.setErrno(e1) @@ -2685,6 +3090,9 @@ func XGetTempFileNameW(t *TLS, lpPathName, lpPrefixString uintptr, uUnique uint3 // // ); func XCopyFileW(t *TLS, lpExistingFileName, lpNewFileName uintptr, bFailIfExists int32) int32 { + if __ccgo_strace { + trc("t=%v lpNewFileName=%v bFailIfExists=%v, (%v:)", t, lpNewFileName, bFailIfExists, origin(2)) + } r0, _, e1 := syscall.Syscall(procCopyFileW.Addr(), 3, lpExistingFileName, lpNewFileName, uintptr(bFailIfExists)) if r0 == 0 { t.setErrno(e1) @@ -2698,6 +3106,9 @@ func XCopyFileW(t *TLS, lpExistingFileName, lpNewFileName uintptr, bFailIfExists // // ); func XDeleteFileW(t *TLS, lpFileName uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v, (%v:)", t, lpFileName, origin(2)) + } err := syscall.DeleteFile((*uint16)(unsafe.Pointer(lpFileName))) if err != nil { t.setErrno(err) @@ -2712,6 +3123,9 @@ func XDeleteFileW(t *TLS, lpFileName uintptr) int32 { // // ); func XRemoveDirectoryW(t *TLS, lpPathName uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpPathName=%v, (%v:)", t, lpPathName, origin(2)) + } err := syscall.RemoveDirectory((*uint16)(unsafe.Pointer(lpPathName))) if err != nil { t.setErrno(err) @@ -2722,6 +3136,9 @@ func XRemoveDirectoryW(t *TLS, lpPathName uintptr) int32 { // HANDLE FindFirstFileW(LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData); func XFindFirstFileW(t *TLS, lpFileName, lpFindFileData uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpFindFileData=%v, (%v:)", t, lpFindFileData, origin(2)) + } r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, lpFileName, lpFindFileData, 0) handle := syscall.Handle(r0) if handle == syscall.InvalidHandle { @@ -2745,6 +3162,9 @@ func XFindFirstFileW(t *TLS, lpFileName, lpFindFileData uintptr) uintptr { // // ); func XFindFirstFileExW(t *TLS, lpFileName uintptr, fInfoLevelId int32, lpFindFileData uintptr, fSearchOp int32, lpSearchFilter uintptr, dwAdditionalFlags uint32) uintptr { + if __ccgo_strace { + trc("t=%v lpFileName=%v fInfoLevelId=%v lpFindFileData=%v fSearchOp=%v lpSearchFilter=%v dwAdditionalFlags=%v, (%v:)", t, lpFileName, fInfoLevelId, lpFindFileData, fSearchOp, lpSearchFilter, dwAdditionalFlags, origin(2)) + } r0, _, e1 := syscall.Syscall6(procFindFirstFileExW.Addr(), 6, lpFileName, uintptr(fInfoLevelId), lpFindFileData, uintptr(fSearchOp), lpSearchFilter, uintptr(dwAdditionalFlags)) handle := syscall.Handle(r0) if handle == syscall.InvalidHandle { @@ -2759,6 +3179,9 @@ func XFindFirstFileExW(t *TLS, lpFileName uintptr, fInfoLevelId int32, lpFindFil // BOOL FindClose(HANDLE hFindFile); func XFindClose(t *TLS, hFindFile uintptr) int32 { + if __ccgo_strace { + trc("t=%v hFindFile=%v, (%v:)", t, hFindFile, origin(2)) + } r0, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, hFindFile, 0, 0) if r0 == 0 { if e1 != 0 { @@ -2777,6 +3200,9 @@ func XFindClose(t *TLS, hFindFile uintptr) int32 { // // ); func XFindNextFileW(t *TLS, hFindFile, lpFindFileData uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFindFileData=%v, (%v:)", t, lpFindFileData, origin(2)) + } r0, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, hFindFile, lpFindFileData, 0) if r0 == 0 { if e1 != 0 { @@ -2795,6 +3221,9 @@ func XFindNextFileW(t *TLS, hFindFile, lpFindFileData uintptr) int32 { // // ); func XGetLogicalDriveStringsA(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 { + if __ccgo_strace { + trc("t=%v nBufferLength=%v lpBuffer=%v, (%v:)", t, nBufferLength, lpBuffer, origin(2)) + } r0, _, err := syscall.Syscall(procGetLogicalDriveStringsA.Addr(), 2, uintptr(nBufferLength), lpBuffer, 0) if err != 0 { t.setErrno(err) @@ -2815,6 +3244,9 @@ func XGetLogicalDriveStringsA(t *TLS, nBufferLength uint32, lpBuffer uintptr) ui // // ); func XGetVolumeInformationA(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr, nVolumeNameSize uint32, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer uintptr, nFileSystemNameSize uint32) int32 { + if __ccgo_strace { + trc("t=%v lpVolumeNameBuffer=%v nVolumeNameSize=%v lpFileSystemNameBuffer=%v nFileSystemNameSize=%v, (%v:)", t, lpVolumeNameBuffer, nVolumeNameSize, lpFileSystemNameBuffer, nFileSystemNameSize, origin(2)) + } r0, _, err := syscall.Syscall9(procGetVolumeInformationA.Addr(), 8, lpRootPathName, lpVolumeNameBuffer, @@ -2840,6 +3272,9 @@ func XGetVolumeInformationA(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr, // // ); func XCreateHardLinkW(t *TLS, lpFileName, lpExistingFileName, lpSecurityAttributes uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpSecurityAttributes=%v, (%v:)", t, lpSecurityAttributes, origin(2)) + } r0, _, err := syscall.Syscall(procCreateHardLinkW.Addr(), 1, lpFileName, lpExistingFileName, lpSecurityAttributes) if err != 0 { t.setErrno(err) @@ -2860,6 +3295,9 @@ func XCreateHardLinkW(t *TLS, lpFileName, lpExistingFileName, lpSecurityAttribut // // ); func XDeviceIoControl(t *TLS, hDevice uintptr, dwIoControlCode uint32, lpInBuffer uintptr, nInBufferSize uint32, lpOutBuffer uintptr, nOutBufferSize uint32, lpBytesReturned, lpOverlapped uintptr) int32 { + if __ccgo_strace { + trc("t=%v hDevice=%v dwIoControlCode=%v lpInBuffer=%v nInBufferSize=%v lpOutBuffer=%v nOutBufferSize=%v lpOverlapped=%v, (%v:)", t, hDevice, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpOverlapped, origin(2)) + } r0, _, err := syscall.Syscall9(procDeviceIoControl.Addr(), 8, hDevice, uintptr(dwIoControlCode), lpInBuffer, uintptr(nInBufferSize), lpOutBuffer, uintptr(nOutBufferSize), lpBytesReturned, lpOverlapped, 0) if r0 == 0 { @@ -2876,6 +3314,9 @@ func XDeviceIoControl(t *TLS, hDevice uintptr, dwIoControlCode uint32, lpInBuffe // // ); func Xwcsncmp(t *TLS, string1, string2 uintptr, count types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v string2=%v count=%v, (%v:)", t, string2, count, origin(2)) + } var s1 = goWideString(string1) var l1 = len(s1) var s2 = goWideString(string2) @@ -2908,6 +3349,9 @@ func Xwcsncmp(t *TLS, string1, string2 uintptr, count types.Size_t) int32 { // // ); func XMultiByteToWideChar(t *TLS, CodePage uint32, dwFlags uint32, lpMultiByteStr uintptr, cbMultiByte int32, lpWideCharStr uintptr, cchWideChar int32) int32 { + if __ccgo_strace { + trc("t=%v CodePage=%v dwFlags=%v lpMultiByteStr=%v cbMultiByte=%v lpWideCharStr=%v cchWideChar=%v, (%v:)", t, CodePage, dwFlags, lpMultiByteStr, cbMultiByte, lpWideCharStr, cchWideChar, origin(2)) + } r1, _, _ := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(CodePage), uintptr(dwFlags), uintptr(lpMultiByteStr), uintptr(cbMultiByte), uintptr(lpWideCharStr), uintptr(cchWideChar)) @@ -2920,6 +3364,9 @@ func XMultiByteToWideChar(t *TLS, CodePage uint32, dwFlags uint32, lpMultiByteSt // // ); func XOutputDebugStringW(t *TLS, lpOutputString uintptr) { + if __ccgo_strace { + trc("t=%v lpOutputString=%v, (%v:)", t, lpOutputString, origin(2)) + } panic(todo("")) } @@ -2937,6 +3384,9 @@ func XMessageBeep(t *TLS, _ ...interface{}) int32 { // // ); func X_InterlockedCompareExchange(t *TLS, Destination uintptr, Exchange, Comparand long) long { + if __ccgo_strace { + trc("t=%v Destination=%v Comparand=%v, (%v:)", t, Destination, Comparand, origin(2)) + } // The function returns the initial value of the Destination parameter. var v = *(*int32)(unsafe.Pointer(Destination)) @@ -2946,11 +3396,17 @@ func X_InterlockedCompareExchange(t *TLS, Destination uintptr, Exchange, Compara // int rename(const char *oldpath, const char *newpath); func Xrename(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) } // BOOL AreFileApisANSI(); func XAreFileApisANSI(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, _ := syscall.Syscall(procAreFileApisANSI.Addr(), 0, 0, 0, 0) return int32(r0) @@ -2996,6 +3452,9 @@ func XCreateFileA(t *TLS, lpFileName uintptr, dwDesiredAccess, dwShareMode uint3 // // ); func XCreateFileMappingA(t *TLS, hFile, lpFileMappingAttributes uintptr, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow uint32, lpName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpFileMappingAttributes=%v dwMaximumSizeLow=%v lpName=%v, (%v:)", t, lpFileMappingAttributes, dwMaximumSizeLow, lpName, origin(2)) + } panic(todo("")) } @@ -3010,6 +3469,9 @@ func XCreateFileMappingA(t *TLS, hFile, lpFileMappingAttributes uintptr, flProte // // ); func XCreateFileMappingW(t *TLS, hFile, lpFileMappingAttributes uintptr, flProtect, dwMaximumSizeHigh, dwMaximumSizeLow uint32, lpName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpFileMappingAttributes=%v dwMaximumSizeLow=%v lpName=%v, (%v:)", t, lpFileMappingAttributes, dwMaximumSizeLow, lpName, origin(2)) + } h, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, hFile, lpFileMappingAttributes, uintptr(flProtect), uintptr(dwMaximumSizeHigh), uintptr(dwMaximumSizeLow), lpName) if h == 0 { @@ -3030,6 +3492,9 @@ func XCreateFileMappingW(t *TLS, hFile, lpFileMappingAttributes uintptr, flProte // // ); func XCreateMutexW(t *TLS, lpMutexAttributes uintptr, bInitialOwner int32, lpName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpMutexAttributes=%v bInitialOwner=%v lpName=%v, (%v:)", t, lpMutexAttributes, bInitialOwner, lpName, origin(2)) + } panic(todo("")) } @@ -3039,6 +3504,9 @@ func XCreateMutexW(t *TLS, lpMutexAttributes uintptr, bInitialOwner int32, lpNam // // ); func XDeleteFileA(t *TLS, lpFileName uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v, (%v:)", t, lpFileName, origin(2)) + } panic(todo("")) } @@ -3054,6 +3522,9 @@ func XDeleteFileA(t *TLS, lpFileName uintptr) int32 { // // ); func XFormatMessageA(t *TLS, dwFlagsAndAttributes uint32, lpSource uintptr, dwMessageId, dwLanguageId uint32, lpBuffer uintptr, nSize uint32, Arguments uintptr) uint32 { + if __ccgo_strace { + trc("t=%v dwFlagsAndAttributes=%v lpSource=%v dwLanguageId=%v lpBuffer=%v nSize=%v Arguments=%v, (%v:)", t, dwFlagsAndAttributes, lpSource, dwLanguageId, lpBuffer, nSize, Arguments, origin(2)) + } panic(todo("")) } @@ -3069,6 +3540,9 @@ func XFormatMessageA(t *TLS, dwFlagsAndAttributes uint32, lpSource uintptr, dwMe // // ); func XFormatMessageW(t *TLS, dwFlags uint32, lpSource uintptr, dwMessageId, dwLanguageId uint32, lpBuffer uintptr, nSize uint32, Arguments uintptr) uint32 { + if __ccgo_strace { + trc("t=%v dwFlags=%v lpSource=%v dwLanguageId=%v lpBuffer=%v nSize=%v Arguments=%v, (%v:)", t, dwFlags, lpSource, dwLanguageId, lpBuffer, nSize, Arguments, origin(2)) + } r0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(dwFlags), lpSource, uintptr(dwMessageId), uintptr(dwLanguageId), lpBuffer, uintptr(nSize), Arguments, 0, 0) @@ -3085,11 +3559,17 @@ func XFormatMessageW(t *TLS, dwFlags uint32, lpSource uintptr, dwMessageId, dwLa // BOOL FreeLibrary(HMODULE hLibModule); func XFreeLibrary(t *TLS, hLibModule uintptr) int32 { + if __ccgo_strace { + trc("t=%v hLibModule=%v, (%v:)", t, hLibModule, origin(2)) + } panic(todo("")) } // DWORD GetCurrentProcessId(); func XGetCurrentProcessId(t *TLS) uint32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0) pid := uint32(r0) return pid @@ -3105,6 +3585,9 @@ func XGetCurrentProcessId(t *TLS) uint32 { // // ); func XGetDiskFreeSpaceA(t *TLS, lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpTotalNumberOfClusters=%v, (%v:)", t, lpTotalNumberOfClusters, origin(2)) + } panic(todo("")) } @@ -3118,6 +3601,9 @@ func XGetDiskFreeSpaceA(t *TLS, lpRootPathName, lpSectorsPerCluster, lpBytesPerS // // ); func XGetDiskFreeSpaceW(t *TLS, lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpTotalNumberOfClusters=%v, (%v:)", t, lpTotalNumberOfClusters, origin(2)) + } panic(todo("")) } @@ -3127,6 +3613,9 @@ func XGetDiskFreeSpaceW(t *TLS, lpRootPathName, lpSectorsPerCluster, lpBytesPerS // // ); func XGetFileAttributesA(t *TLS, lpFileName uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v, (%v:)", t, lpFileName, origin(2)) + } r0, _, err := syscall.Syscall(procGetFileAttributesA.Addr(), 1, lpFileName, 0, 0) if err != 0 { t.setErrno(err) @@ -3142,6 +3631,9 @@ func XGetFileAttributesA(t *TLS, lpFileName uintptr) uint32 { // // ); func XGetFileAttributesExW(t *TLS, lpFileName uintptr, fInfoLevelId uint32, lpFileInformation uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v fInfoLevelId=%v lpFileInformation=%v, (%v:)", t, lpFileName, fInfoLevelId, lpFileInformation, origin(2)) + } r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, lpFileName, uintptr(fInfoLevelId), lpFileInformation) if r1 == 0 { if e1 != 0 { @@ -3161,6 +3653,9 @@ func XGetFileAttributesExW(t *TLS, lpFileName uintptr, fInfoLevelId uint32, lpFi // // ); func XGetFileSize(t *TLS, hFile, lpFileSizeHigh uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpFileSizeHigh=%v, (%v:)", t, lpFileSizeHigh, origin(2)) + } r1, _, e1 := syscall.Syscall(procGetFileSize.Addr(), 2, hFile, lpFileSizeHigh, 0) if r1 == math.MaxUint32 { if lpFileSizeHigh == 0 { @@ -3188,11 +3683,17 @@ func XGetFileSize(t *TLS, hFile, lpFileSizeHigh uintptr) uint32 { // // ); func XGetFullPathNameA(t *TLS, lpFileName uintptr, nBufferLength uint32, lpBuffer, lpFilePart uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v nBufferLength=%v lpFilePart=%v, (%v:)", t, lpFileName, nBufferLength, lpFilePart, origin(2)) + } panic(todo("")) } // FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName); func XGetProcAddress(t *TLS, hModule, lpProcName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpProcName=%v, (%v:)", t, lpProcName, origin(2)) + } return 0 @@ -3211,6 +3712,9 @@ func XGetProcAddress(t *TLS, hModule, lpProcName uintptr) uintptr { // // ); func XRtlGetVersion(t *TLS, lpVersionInformation uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpVersionInformation=%v, (%v:)", t, lpVersionInformation, origin(2)) + } panic(todo("")) } @@ -3220,11 +3724,17 @@ func XRtlGetVersion(t *TLS, lpVersionInformation uintptr) uintptr { // // ); func XGetSystemInfo(t *TLS, lpSystemInfo uintptr) { + if __ccgo_strace { + trc("t=%v lpSystemInfo=%v, (%v:)", t, lpSystemInfo, origin(2)) + } syscall.Syscall(procGetSystemInfo.Addr(), 1, lpSystemInfo, 0, 0) } // void GetSystemTime(LPSYSTEMTIME lpSystemTime); func XGetSystemTime(t *TLS, lpSystemTime uintptr) { + if __ccgo_strace { + trc("t=%v lpSystemTime=%v, (%v:)", t, lpSystemTime, origin(2)) + } syscall.Syscall(procGetSystemTime.Addr(), 1, lpSystemTime, 0, 0) } @@ -3234,6 +3744,9 @@ func XGetSystemTime(t *TLS, lpSystemTime uintptr) { // // ); func XGetSystemTimeAsFileTime(t *TLS, lpSystemTimeAsFileTime uintptr) { + if __ccgo_strace { + trc("t=%v lpSystemTimeAsFileTime=%v, (%v:)", t, lpSystemTimeAsFileTime, origin(2)) + } syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, lpSystemTimeAsFileTime, 0, 0) } @@ -3244,6 +3757,9 @@ func XGetSystemTimeAsFileTime(t *TLS, lpSystemTimeAsFileTime uintptr) { // // ); func XGetTempPathA(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 { + if __ccgo_strace { + trc("t=%v nBufferLength=%v lpBuffer=%v, (%v:)", t, nBufferLength, lpBuffer, origin(2)) + } panic(todo("")) } @@ -3254,6 +3770,9 @@ func XGetTempPathA(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 { // // ); func XGetTempPathW(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 { + if __ccgo_strace { + trc("t=%v nBufferLength=%v lpBuffer=%v, (%v:)", t, nBufferLength, lpBuffer, origin(2)) + } rv, err := syscall.GetTempPath(nBufferLength, (*uint16)(unsafe.Pointer(lpBuffer))) if err != nil { t.setErrno(err) @@ -3263,6 +3782,9 @@ func XGetTempPathW(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 { // DWORD GetTickCount(); func XGetTickCount(t *TLS) uint32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, _ := syscall.Syscall(procGetTickCount.Addr(), 0, 0, 0, 0) return uint32(r0) } @@ -3273,6 +3795,9 @@ func XGetTickCount(t *TLS) uint32 { // // ); func XGetVersionExA(t *TLS, lpVersionInformation uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpVersionInformation=%v, (%v:)", t, lpVersionInformation, origin(2)) + } r0, _, err := syscall.Syscall(procGetVersionExA.Addr(), 1, lpVersionInformation, 0, 0) if r0 == 0 { t.setErrno(err) @@ -3288,6 +3813,9 @@ func XGetVersionExA(t *TLS, lpVersionInformation uintptr) int32 { // // ); func XHeapCreate(t *TLS, flOptions uint32, dwInitialSize, dwMaximumSize types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v flOptions=%v dwMaximumSize=%v, (%v:)", t, flOptions, dwMaximumSize, origin(2)) + } panic(todo("")) } @@ -3297,6 +3825,9 @@ func XHeapCreate(t *TLS, flOptions uint32, dwInitialSize, dwMaximumSize types.Si // // ); func XHeapDestroy(t *TLS, hHeap uintptr) int32 { + if __ccgo_strace { + trc("t=%v hHeap=%v, (%v:)", t, hHeap, origin(2)) + } panic(todo("")) } @@ -3309,6 +3840,9 @@ func XHeapDestroy(t *TLS, hHeap uintptr) int32 { // // ); func XHeapReAlloc(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr, dwBytes types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v hHeap=%v dwFlags=%v lpMem=%v dwBytes=%v, (%v:)", t, hHeap, dwFlags, lpMem, dwBytes, origin(2)) + } panic(todo("")) } @@ -3320,6 +3854,9 @@ func XHeapReAlloc(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr, dwBytes // // ); func XHeapSize(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v hHeap=%v dwFlags=%v lpMem=%v, (%v:)", t, hHeap, dwFlags, lpMem, origin(2)) + } panic(todo("")) } @@ -3331,6 +3868,9 @@ func XHeapSize(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) types.Size_ // // ); func XHeapValidate(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) int32 { + if __ccgo_strace { + trc("t=%v hHeap=%v dwFlags=%v lpMem=%v, (%v:)", t, hHeap, dwFlags, lpMem, origin(2)) + } panic(todo("")) } @@ -3341,11 +3881,17 @@ func XHeapValidate(t *TLS, hHeap uintptr, dwFlags uint32, lpMem uintptr) int32 { // // ); func XHeapCompact(t *TLS, hHeap uintptr, dwFlags uint32) types.Size_t { + if __ccgo_strace { + trc("t=%v hHeap=%v dwFlags=%v, (%v:)", t, hHeap, dwFlags, origin(2)) + } panic(todo("")) } // HMODULE LoadLibraryA(LPCSTR lpLibFileName); func XLoadLibraryA(t *TLS, lpLibFileName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpLibFileName=%v, (%v:)", t, lpLibFileName, origin(2)) + } panic(todo("")) } @@ -3355,6 +3901,9 @@ func XLoadLibraryA(t *TLS, lpLibFileName uintptr) uintptr { // // ); func XLoadLibraryW(t *TLS, lpLibFileName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpLibFileName=%v, (%v:)", t, lpLibFileName, origin(2)) + } panic(todo("")) } @@ -3364,6 +3913,9 @@ func XLoadLibraryW(t *TLS, lpLibFileName uintptr) uintptr { // // ); func XLocalFree(t *TLS, hMem uintptr) uintptr { + if __ccgo_strace { + trc("t=%v hMem=%v, (%v:)", t, hMem, origin(2)) + } h, err := syscall.LocalFree(syscall.Handle(hMem)) if h != 0 { if err != nil { @@ -3386,6 +3938,9 @@ func XLocalFree(t *TLS, hMem uintptr) uintptr { // // ); func XLockFile(t *TLS, hFile uintptr, dwFileOffsetLow, dwFileOffsetHigh, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh uint32) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v nNumberOfBytesToLockHigh=%v, (%v:)", t, hFile, nNumberOfBytesToLockHigh, origin(2)) + } r1, _, e1 := syscall.Syscall6(procLockFile.Addr(), 5, hFile, uintptr(dwFileOffsetLow), uintptr(dwFileOffsetHigh), uintptr(nNumberOfBytesToLockLow), uintptr(nNumberOfBytesToLockHigh), 0) @@ -3412,6 +3967,9 @@ func XLockFile(t *TLS, hFile uintptr, dwFileOffsetLow, dwFileOffsetHigh, nNumber // // ); func XLockFileEx(t *TLS, hFile uintptr, dwFlags, dwReserved, nNumberOfBytesToLockLow, nNumberOfBytesToLockHigh uint32, lpOverlapped uintptr) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v nNumberOfBytesToLockHigh=%v lpOverlapped=%v, (%v:)", t, hFile, nNumberOfBytesToLockHigh, lpOverlapped, origin(2)) + } r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, hFile, uintptr(dwFlags), uintptr(dwReserved), uintptr(nNumberOfBytesToLockLow), uintptr(nNumberOfBytesToLockHigh), lpOverlapped) if r1 == 0 { @@ -3435,6 +3993,9 @@ func XLockFileEx(t *TLS, hFile uintptr, dwFlags, dwReserved, nNumberOfBytesToLoc // // ); func XMapViewOfFile(t *TLS, hFileMappingObject uintptr, dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow uint32, dwNumberOfBytesToMap types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v hFileMappingObject=%v dwFileOffsetLow=%v dwNumberOfBytesToMap=%v, (%v:)", t, hFileMappingObject, dwFileOffsetLow, dwNumberOfBytesToMap, origin(2)) + } h, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, hFileMappingObject, uintptr(dwDesiredAccess), uintptr(dwFileOffsetHigh), uintptr(dwFileOffsetLow), uintptr(dwNumberOfBytesToMap), 0) if h == 0 { @@ -3453,6 +4014,9 @@ func XMapViewOfFile(t *TLS, hFileMappingObject uintptr, dwDesiredAccess, dwFileO // // ); func XQueryPerformanceCounter(t *TLS, lpPerformanceCount uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpPerformanceCount=%v, (%v:)", t, lpPerformanceCount, origin(2)) + } r0, _, _ := syscall.Syscall(procQueryPerformanceCounter.Addr(), 1, lpPerformanceCount, 0, 0) return int32(r0) } @@ -3463,11 +4027,17 @@ func XQueryPerformanceCounter(t *TLS, lpPerformanceCount uintptr) int32 { // // ); func XSleep(t *TLS, dwMilliseconds uint32) { + if __ccgo_strace { + trc("t=%v dwMilliseconds=%v, (%v:)", t, dwMilliseconds, origin(2)) + } gotime.Sleep(gotime.Duration(dwMilliseconds) * gotime.Millisecond) } // BOOL SystemTimeToFileTime(const SYSTEMTIME *lpSystemTime, LPFILETIME lpFileTime); func XSystemTimeToFileTime(t *TLS, lpSystemTime, lpFileTime uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileTime=%v, (%v:)", t, lpFileTime, origin(2)) + } r0, _, _ := syscall.Syscall(procSystemTimeToFileTime.Addr(), 2, lpSystemTime, lpFileTime, 0) return int32(r0) } @@ -3482,6 +4052,9 @@ func XSystemTimeToFileTime(t *TLS, lpSystemTime, lpFileTime uintptr) int32 { // // ); func XUnlockFile(t *TLS, hFile uintptr, dwFileOffsetLow, dwFileOffsetHigh, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh uint32) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v nNumberOfBytesToUnlockHigh=%v, (%v:)", t, hFile, nNumberOfBytesToUnlockHigh, origin(2)) + } r1, _, e1 := syscall.Syscall6(procUnlockFile.Addr(), 5, hFile, uintptr(dwFileOffsetLow), uintptr(dwFileOffsetHigh), uintptr(nNumberOfBytesToUnlockLow), uintptr(nNumberOfBytesToUnlockHigh), 0) if r1 == 0 { @@ -3505,6 +4078,9 @@ func XUnlockFile(t *TLS, hFile uintptr, dwFileOffsetLow, dwFileOffsetHigh, nNumb // // ); func XUnlockFileEx(t *TLS, hFile uintptr, dwReserved, nNumberOfBytesToUnlockLow, nNumberOfBytesToUnlockHigh uint32, lpOverlapped uintptr) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v nNumberOfBytesToUnlockHigh=%v lpOverlapped=%v, (%v:)", t, hFile, nNumberOfBytesToUnlockHigh, lpOverlapped, origin(2)) + } r1, _, e1 := syscall.Syscall6(procUnlockFileEx.Addr(), 5, hFile, uintptr(dwReserved), uintptr(nNumberOfBytesToUnlockLow), uintptr(nNumberOfBytesToUnlockHigh), lpOverlapped, 0) if r1 == 0 { @@ -3524,6 +4100,9 @@ func XUnlockFileEx(t *TLS, hFile uintptr, dwReserved, nNumberOfBytesToUnlockLow, // // ); func XUnmapViewOfFile(t *TLS, lpBaseAddress uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBaseAddress=%v, (%v:)", t, lpBaseAddress, origin(2)) + } err := syscall.UnmapViewOfFile(lpBaseAddress) if err != nil { t.setErrno(err) @@ -3545,6 +4124,9 @@ func XUnmapViewOfFile(t *TLS, lpBaseAddress uintptr) int32 { // // ); func XWideCharToMultiByte(t *TLS, CodePage uint32, dwFlags uint32, lpWideCharStr uintptr, cchWideChar int32, lpMultiByteStr uintptr, cbMultiByte int32, lpDefaultChar, lpUsedDefaultChar uintptr) int32 { + if __ccgo_strace { + trc("t=%v CodePage=%v dwFlags=%v lpWideCharStr=%v cchWideChar=%v lpMultiByteStr=%v cbMultiByte=%v lpUsedDefaultChar=%v, (%v:)", t, CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpUsedDefaultChar, origin(2)) + } r1, _, _ := syscall.Syscall9(procWideCharToMultiByte.Addr(), 8, uintptr(CodePage), uintptr(dwFlags), lpWideCharStr, uintptr(cchWideChar), lpMultiByteStr, uintptr(cbMultiByte), @@ -3558,6 +4140,9 @@ func XWideCharToMultiByte(t *TLS, CodePage uint32, dwFlags uint32, lpWideCharStr // // ) func XOutputDebugStringA(t *TLS, lpOutputString uintptr) { + if __ccgo_strace { + trc("t=%v lpOutputString=%v, (%v:)", t, lpOutputString, origin(2)) + } panic(todo("")) } @@ -3568,6 +4153,9 @@ func XOutputDebugStringA(t *TLS, lpOutputString uintptr) { // // ); func XFlushViewOfFile(t *TLS, lpBaseAddress uintptr, dwNumberOfBytesToFlush types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v lpBaseAddress=%v dwNumberOfBytesToFlush=%v, (%v:)", t, lpBaseAddress, dwNumberOfBytesToFlush, origin(2)) + } err := syscall.FlushViewOfFile(lpBaseAddress, uintptr(dwNumberOfBytesToFlush)) if err != nil { t.setErrno(err) @@ -3605,6 +4193,9 @@ func WindowsTickToUnixSeconds(windowsTicks int64) int64 { // int _stat64(const char *path, struct __stat64 *buffer); func X_stat64(t *TLS, path, buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v buffer=%v, (%v:)", t, buffer, origin(2)) + } var fa syscall.Win32FileAttributeData r1, _, e1 := syscall.Syscall(procGetFileAttributesExA.Addr(), 3, path, syscall.GetFileExInfoStandard, (uintptr)(unsafe.Pointer(&fa))) @@ -3658,6 +4249,9 @@ func WindowsAttrbiutesToStat(fa uint32) uint16 { // // ); func X_chsize(t *TLS, fd int32, size long) int32 { + if __ccgo_strace { + trc("t=%v fd=%v size=%v, (%v:)", t, fd, size, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -3676,6 +4270,9 @@ func X_chsize(t *TLS, fd int32, size long) int32 { // int _snprintf(char *str, size_t size, const char *format, ...); func X_snprintf(t *TLS, str uintptr, size types.Size_t, format, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v size=%v args=%v, (%v:)", t, str, size, args, origin(2)) + } return Xsnprintf(t, str, size, format, args) } @@ -3711,6 +4308,9 @@ func win32FindDataToFileInfo(t *TLS, fdata *stat.X_finddata64i32_t, wfd *syscall // // ); func X_findfirst64i32(t *TLS, filespec, fileinfo uintptr) types.Intptr_t { + if __ccgo_strace { + trc("t=%v fileinfo=%v, (%v:)", t, fileinfo, origin(2)) + } // Note: this is the 'narrow' character findfirst -- expects output // as mbcs -- conversion below -- via ToFileInfo @@ -3746,6 +4346,9 @@ func X_findfirst64i32(t *TLS, filespec, fileinfo uintptr) types.Intptr_t { // // ); func X_findnext64i32(t *TLS, handle types.Intptr_t, fileinfo uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v fileinfo=%v, (%v:)", t, handle, fileinfo, origin(2)) + } var fdata = (*stat.X_finddata64i32_t)(unsafe.Pointer(fileinfo)) var wfd syscall.Win32finddata @@ -3769,6 +4372,9 @@ func X_findnext64i32(t *TLS, handle types.Intptr_t, fileinfo uintptr) int32 { // // ); func X_findclose(t *TLS, handle types.Intptr_t) int32 { + if __ccgo_strace { + trc("t=%v handle=%v, (%v:)", t, handle, origin(2)) + } err := syscall.FindClose(syscall.Handle(handle)) if err != nil { @@ -3786,6 +4392,9 @@ func X_findclose(t *TLS, handle types.Intptr_t) int32 { // // ); func XGetEnvironmentVariableA(t *TLS, lpName, lpBuffer uintptr, nSize uint32) uint32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nSize=%v, (%v:)", t, lpBuffer, nSize, origin(2)) + } r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableA.Addr(), 3, lpName, lpBuffer, uintptr(nSize)) n := uint32(r0) if n == 0 { @@ -3805,6 +4414,9 @@ func XGetEnvironmentVariableA(t *TLS, lpName, lpBuffer uintptr, nSize uint32) ui // // ); func X_fstat64(t *TLS, fd int32, buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buffer=%v, (%v:)", t, fd, buffer, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -3842,6 +4454,9 @@ func X_fstat64(t *TLS, fd int32, buffer uintptr) int32 { // // ); func XCreateEventA(t *TLS, lpEventAttributes uintptr, bManualReset, bInitialState int32, lpName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpEventAttributes=%v bInitialState=%v lpName=%v, (%v:)", t, lpEventAttributes, bInitialState, lpName, origin(2)) + } r0, _, err := syscall.Syscall6(procCreateEventA.Addr(), 4, lpEventAttributes, uintptr(bManualReset), uintptr(bInitialState), lpName, 0, 0) if r0 == 0 { @@ -3856,6 +4471,9 @@ func XCreateEventA(t *TLS, lpEventAttributes uintptr, bManualReset, bInitialStat // // ); func XCancelSynchronousIo(t *TLS, hThread uintptr) int32 { + if __ccgo_strace { + trc("t=%v hThread=%v, (%v:)", t, hThread, origin(2)) + } panic(todo("")) } @@ -3868,6 +4486,9 @@ func X_endthreadex(t *TLS, _ ...interface{}) { // and gets that via the go callback. This is safe because the thread is calling into go // not a cdecl function which would expect the stack setup of cdecl. func X_beginthread(t *TLS, procAddr uintptr, stack_sz uint32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v procAddr=%v stack_sz=%v args=%v, (%v:)", t, procAddr, stack_sz, args, origin(2)) + } f := (*struct{ f func(*TLS, uintptr) uint32 })(unsafe.Pointer(&struct{ uintptr }{procAddr})).f var tAdp = ThreadAdapter{threadFunc: f, tls: NewTLS(), param: args} tAdp.token = addObject(&tAdp) @@ -3905,6 +4526,9 @@ func X_beginthreadex(t *TLS, _ uintptr, stack_sz uint32, procAddr uintptr, args // DWORD GetCurrentThreadId(); func XGetCurrentThreadId(t *TLS) uint32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0) return uint32(r0) //return uint32(t.ID) @@ -3917,6 +4541,9 @@ func XGetCurrentThreadId(t *TLS) uint32 { // // ); func XGetExitCodeThread(t *TLS, hThread, lpExitCode uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpExitCode=%v, (%v:)", t, lpExitCode, origin(2)) + } r0, _, _ := syscall.Syscall(procGetExitCodeThread.Addr(), 2, hThread, lpExitCode, 0) return int32(r0) } @@ -3929,6 +4556,9 @@ func XGetExitCodeThread(t *TLS, hThread, lpExitCode uintptr) int32 { // // ); func XWaitForSingleObjectEx(t *TLS, hHandle uintptr, dwMilliseconds uint32, bAlertable int32) uint32 { + if __ccgo_strace { + trc("t=%v hHandle=%v dwMilliseconds=%v bAlertable=%v, (%v:)", t, hHandle, dwMilliseconds, bAlertable, origin(2)) + } rv, _, _ := syscall.Syscall(procWaitForSingleObjectEx.Addr(), 3, hHandle, uintptr(dwMilliseconds), uintptr(bAlertable)) return uint32(rv) } @@ -3943,6 +4573,9 @@ func XWaitForSingleObjectEx(t *TLS, hHandle uintptr, dwMilliseconds uint32, bAle // // ); func XMsgWaitForMultipleObjectsEx(t *TLS, nCount uint32, pHandles uintptr, dwMilliseconds, dwWakeMask, dwFlags uint32) uint32 { + if __ccgo_strace { + trc("t=%v nCount=%v pHandles=%v dwFlags=%v, (%v:)", t, nCount, pHandles, dwFlags, origin(2)) + } r0, _, err := syscall.Syscall6(procMsgWaitForMultipleObjectsEx.Addr(), 5, uintptr(nCount), pHandles, @@ -3969,6 +4602,9 @@ func XMessageBoxW(t *TLS, _ ...interface{}) int32 { // // ); func XGetModuleFileNameW(t *TLS, hModule, lpFileName uintptr, nSize uint32) uint32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v nSize=%v, (%v:)", t, lpFileName, nSize, origin(2)) + } r0, _, err := syscall.Syscall(procGetModuleFileNameW.Addr(), 3, hModule, lpFileName, uintptr(nSize)) if r0 == 0 { t.setErrno(err) @@ -3984,6 +4620,9 @@ func XGetModuleFileNameW(t *TLS, hModule, lpFileName uintptr, nSize uint32) uint // // ); func XNetGetDCName(t *TLS, ServerName, DomainName, Buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v Buffer=%v, (%v:)", t, Buffer, origin(2)) + } r0, _, err := syscall.Syscall(procNetGetDCName.Addr(), 3, ServerName, DomainName, Buffer) if err != 0 { t.setErrno(err) @@ -4000,6 +4639,9 @@ func XNetGetDCName(t *TLS, ServerName, DomainName, Buffer uintptr) int32 { // // ); func XNetUserGetInfo(t *TLS, servername, username uintptr, level uint32, bufptr uintptr) uint32 { + if __ccgo_strace { + trc("t=%v username=%v level=%v bufptr=%v, (%v:)", t, username, level, bufptr, origin(2)) + } r0, _, err := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, servername, username, @@ -4025,6 +4667,9 @@ func XlstrlenW(t *TLS, _ ...interface{}) int32 { // // ); func XGetProfilesDirectoryW(t *TLS, lpProfileDir, lpcchSize uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpcchSize=%v, (%v:)", t, lpcchSize, origin(2)) + } r0, _, err := syscall.Syscall(procGetProfilesDirectoryW.Addr(), 2, lpProfileDir, lpcchSize, 0) if err != 0 { t.setErrno(err) @@ -4047,6 +4692,9 @@ func XNetApiBufferFree(t *TLS, _ ...interface{}) int32 { // // ); func XGetPrivateProfileStringA(t *TLS, lpAppName, lpKeyName, lpDefault, lpReturnedString uintptr, nSize uint32, lpFileName uintptr) uint32 { + if __ccgo_strace { + trc("t=%v lpReturnedString=%v nSize=%v lpFileName=%v, (%v:)", t, lpReturnedString, nSize, lpFileName, origin(2)) + } r0, _, err := syscall.Syscall6(procGetPrivateProfileStringA.Addr(), 4, lpAppName, lpKeyName, @@ -4075,6 +4723,9 @@ func XGetWindowsDirectoryA(t *TLS, _ ...interface{}) int32 { // // ); func XGetFileSecurityW(t *TLS, lpFileName uintptr, RequestedInformation uint32, pSecurityDescriptor uintptr, nLength uint32, lpnLengthNeeded uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v RequestedInformation=%v pSecurityDescriptor=%v nLength=%v lpnLengthNeeded=%v, (%v:)", t, lpFileName, RequestedInformation, pSecurityDescriptor, nLength, lpnLengthNeeded, origin(2)) + } r0, _, err := syscall.Syscall6(procGetFileSecurityW.Addr(), 5, lpFileName, uintptr(RequestedInformation), pSecurityDescriptor, uintptr(nLength), lpnLengthNeeded, 0) if err != 0 { t.setErrno(err) @@ -4090,6 +4741,9 @@ func XGetFileSecurityW(t *TLS, lpFileName uintptr, RequestedInformation uint32, // // ); func XGetSecurityDescriptorOwner(t *TLS, pSecurityDescriptor, pOwner, lpbOwnerDefaulted uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpbOwnerDefaulted=%v, (%v:)", t, lpbOwnerDefaulted, origin(2)) + } r0, _, err := syscall.Syscall(procGetSecurityDescriptorOwner.Addr(), 3, pSecurityDescriptor, pOwner, lpbOwnerDefaulted) if err != 0 { t.setErrno(err) @@ -4104,6 +4758,9 @@ func XGetSecurityDescriptorOwner(t *TLS, pSecurityDescriptor, pOwner, lpbOwnerDe // // ); func XGetSidIdentifierAuthority(t *TLS, pSid uintptr) uintptr { + if __ccgo_strace { + trc("t=%v pSid=%v, (%v:)", t, pSid, origin(2)) + } r0, _, err := syscall.Syscall(procGetSidIdentifierAuthority.Addr(), 1, pSid, 0, 0) if err != 0 { t.setErrno(err) @@ -4117,6 +4774,9 @@ func XGetSidIdentifierAuthority(t *TLS, pSid uintptr) uintptr { // // ); func XImpersonateSelf(t *TLS, ImpersonationLevel int32) int32 { + if __ccgo_strace { + trc("t=%v ImpersonationLevel=%v, (%v:)", t, ImpersonationLevel, origin(2)) + } r0, _, err := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(ImpersonationLevel), 0, 0) if err != 0 { t.setErrno(err) @@ -4133,6 +4793,9 @@ func XImpersonateSelf(t *TLS, ImpersonationLevel int32) int32 { // // ); func XOpenThreadToken(t *TLS, ThreadHandle uintptr, DesiredAccess uint32, OpenAsSelf int32, TokenHandle uintptr) int32 { + if __ccgo_strace { + trc("t=%v ThreadHandle=%v DesiredAccess=%v OpenAsSelf=%v TokenHandle=%v, (%v:)", t, ThreadHandle, DesiredAccess, OpenAsSelf, TokenHandle, origin(2)) + } r0, _, err := syscall.Syscall6(procOpenThreadToken.Addr(), 4, ThreadHandle, uintptr(DesiredAccess), uintptr(OpenAsSelf), TokenHandle, 0, 0) if err != 0 { t.setErrno(err) @@ -4142,6 +4805,9 @@ func XOpenThreadToken(t *TLS, ThreadHandle uintptr, DesiredAccess uint32, OpenAs // HANDLE GetCurrentThread(); func XGetCurrentThread(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, err := syscall.Syscall(procGetCurrentThread.Addr(), 0, 0, 0, 0) if err != 0 { t.setErrno(err) @@ -4151,6 +4817,9 @@ func XGetCurrentThread(t *TLS) uintptr { // BOOL RevertToSelf(); func XRevertToSelf(t *TLS) int32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, err := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) if err != 0 { t.setErrno(err) @@ -4171,6 +4840,9 @@ func XRevertToSelf(t *TLS) int32 { // // ); func XAccessCheck(t *TLS, pSecurityDescriptor, ClientToken uintptr, DesiredAccess uint32, GenericMapping, PrivilegeSet, PrivilegeSetLength, GrantedAccess, AccessStatus uintptr) int32 { + if __ccgo_strace { + trc("t=%v ClientToken=%v DesiredAccess=%v AccessStatus=%v, (%v:)", t, ClientToken, DesiredAccess, AccessStatus, origin(2)) + } r0, _, err := syscall.Syscall9(procAccessCheck.Addr(), 8, pSecurityDescriptor, ClientToken, @@ -4195,6 +4867,9 @@ func XAccessCheck(t *TLS, pSecurityDescriptor, ClientToken uintptr, DesiredAcces // // ); func Xwcsicmp(t *TLS, string1, string2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v string2=%v, (%v:)", t, string2, origin(2)) + } var s1 = strings.ToLower(goWideString(string1)) var s2 = strings.ToLower(goWideString(string2)) return int32(strings.Compare(s1, s2)) @@ -4206,6 +4881,9 @@ func Xwcsicmp(t *TLS, string1, string2 uintptr) int32 { // // ); func XSetCurrentDirectoryW(t *TLS, lpPathName uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpPathName=%v, (%v:)", t, lpPathName, origin(2)) + } err := syscall.SetCurrentDirectory((*uint16)(unsafe.Pointer(lpPathName))) if err != nil { t.setErrno(err) @@ -4221,6 +4899,9 @@ func XSetCurrentDirectoryW(t *TLS, lpPathName uintptr) int32 { // // ); func XGetCurrentDirectoryW(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint32 { + if __ccgo_strace { + trc("t=%v nBufferLength=%v lpBuffer=%v, (%v:)", t, nBufferLength, lpBuffer, origin(2)) + } n, err := syscall.GetCurrentDirectory(nBufferLength, (*uint16)(unsafe.Pointer(lpBuffer))) if err != nil { t.setErrno(err) @@ -4235,6 +4916,9 @@ func XGetCurrentDirectoryW(t *TLS, nBufferLength uint32, lpBuffer uintptr) uint3 // // ); func XGetFileInformationByHandle(t *TLS, hFile, lpFileInformation uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileInformation=%v, (%v:)", t, lpFileInformation, origin(2)) + } r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, hFile, lpFileInformation, 0) if r1 == 0 { if e1 != 0 { @@ -4259,6 +4943,9 @@ func XGetFileInformationByHandle(t *TLS, hFile, lpFileInformation uintptr) int32 // // ); func XGetVolumeInformationW(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr, nVolumeNameSize uint32, lpVolumeSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer uintptr, nFileSystemNameSize uint32) int32 { + if __ccgo_strace { + trc("t=%v lpVolumeNameBuffer=%v nVolumeNameSize=%v lpFileSystemNameBuffer=%v nFileSystemNameSize=%v, (%v:)", t, lpVolumeNameBuffer, nVolumeNameSize, lpFileSystemNameBuffer, nFileSystemNameSize, origin(2)) + } r0, _, err := syscall.Syscall9(procGetVolumeInformationW.Addr(), 8, lpRootPathName, lpVolumeNameBuffer, @@ -4283,6 +4970,9 @@ func XGetVolumeInformationW(t *TLS, lpRootPathName, lpVolumeNameBuffer uintptr, // // ); func Xwcschr(t *TLS, str uintptr, c wchar_t) uintptr { + if __ccgo_strace { + trc("t=%v str=%v c=%v, (%v:)", t, str, c, origin(2)) + } var source = str for { var buf = *(*uint16)(unsafe.Pointer(source)) @@ -4307,6 +4997,9 @@ func Xwcschr(t *TLS, str uintptr, c wchar_t) uintptr { // // ); func XSetFileTime(t *TLS, hFile uintptr, lpCreationTime, lpLastAccessTime, lpLastWriteTime uintptr) int32 { + if __ccgo_strace { + trc("t=%v hFile=%v lpLastWriteTime=%v, (%v:)", t, hFile, lpLastWriteTime, origin(2)) + } panic(todo("")) } @@ -4323,6 +5016,9 @@ func XSetFileTime(t *TLS, hFile uintptr, lpCreationTime, lpLastAccessTime, lpLas // // ); func XGetNamedSecurityInfoW(t *TLS, pObjectName uintptr, ObjectType, SecurityInfo uint32, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor uintptr) uint32 { + if __ccgo_strace { + trc("t=%v pObjectName=%v SecurityInfo=%v ppSecurityDescriptor=%v, (%v:)", t, pObjectName, SecurityInfo, ppSecurityDescriptor, origin(2)) + } panic(todo("")) } @@ -4334,6 +5030,9 @@ func XGetNamedSecurityInfoW(t *TLS, pObjectName uintptr, ObjectType, SecurityInf // // ); func XOpenProcessToken(t *TLS, ProcessHandle uintptr, DesiredAccess uint32, TokenHandle uintptr) int32 { + if __ccgo_strace { + trc("t=%v ProcessHandle=%v DesiredAccess=%v TokenHandle=%v, (%v:)", t, ProcessHandle, DesiredAccess, TokenHandle, origin(2)) + } panic(todo("")) } @@ -4347,6 +5046,9 @@ func XOpenProcessToken(t *TLS, ProcessHandle uintptr, DesiredAccess uint32, Toke // // ); func XGetTokenInformation(t *TLS, TokenHandle uintptr, TokenInformationClass uint32, TokenInformation uintptr, TokenInformationLength uint32, ReturnLength uintptr) int32 { + if __ccgo_strace { + trc("t=%v TokenHandle=%v TokenInformationClass=%v TokenInformation=%v TokenInformationLength=%v ReturnLength=%v, (%v:)", t, TokenHandle, TokenInformationClass, TokenInformation, TokenInformationLength, ReturnLength, origin(2)) + } panic(todo("")) } @@ -4357,6 +5059,9 @@ func XGetTokenInformation(t *TLS, TokenHandle uintptr, TokenInformationClass uin // // ); func XEqualSid(t *TLS, pSid1, pSid2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v pSid2=%v, (%v:)", t, pSid2, origin(2)) + } panic(todo("")) } @@ -4367,6 +5072,9 @@ func XEqualSid(t *TLS, pSid1, pSid2 uintptr) int32 { // // ); func XWSAStartup(t *TLS, wVersionRequired uint16, lpWSAData uintptr) int32 { + if __ccgo_strace { + trc("t=%v wVersionRequired=%v lpWSAData=%v, (%v:)", t, wVersionRequired, lpWSAData, origin(2)) + } r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(wVersionRequired), lpWSAData, 0) if r0 != 0 { t.setErrno(r0) @@ -4376,6 +5084,9 @@ func XWSAStartup(t *TLS, wVersionRequired uint16, lpWSAData uintptr) int32 { // HMODULE GetModuleHandleA(LPCSTR lpModuleName); func XGetModuleHandleA(t *TLS, lpModuleName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpModuleName=%v, (%v:)", t, lpModuleName, origin(2)) + } r0, _, err := syscall.Syscall(procGetModuleHandleA.Addr(), 1, lpModuleName, 0, 0) if r0 == 0 { t.setErrno(err) @@ -4389,6 +5100,9 @@ func XGetModuleHandleA(t *TLS, lpModuleName uintptr) uintptr { // // ); func XGetModuleHandleW(t *TLS, lpModuleName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v lpModuleName=%v, (%v:)", t, lpModuleName, origin(2)) + } r0, _, err := syscall.Syscall(procGetModuleHandleW.Addr(), 1, lpModuleName, 0, 0) if r0 == 0 { t.setErrno(err) @@ -4404,6 +5118,9 @@ func XGetModuleHandleW(t *TLS, lpModuleName uintptr) uintptr { // // ); func XGetEnvironmentVariableW(t *TLS, lpName, lpBuffer uintptr, nSize uint32) uint32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nSize=%v, (%v:)", t, lpBuffer, nSize, origin(2)) + } r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, lpName, lpBuffer, uintptr(nSize)) n := uint32(r0) if n == 0 { @@ -4423,6 +5140,9 @@ func XGetEnvironmentVariableW(t *TLS, lpName, lpBuffer uintptr, nSize uint32) ui // // ); func XlstrcmpiA(t *TLS, lpString1, lpString2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpString2=%v, (%v:)", t, lpString2, origin(2)) + } var s1 = strings.ToLower(GoString(lpString1)) var s2 = strings.ToLower(GoString(lpString2)) return int32(strings.Compare(s1, s2)) @@ -4434,6 +5154,9 @@ func XGetModuleFileNameA(t *TLS, _ ...interface{}) int32 { // UINT GetACP(); func XGetACP(t *TLS) uint32 { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0) return uint32(r0) } @@ -4445,6 +5168,9 @@ func XGetACP(t *TLS) uint32 { // // ); func XGetUserNameW(t *TLS, lpBuffer, pcbBuffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v pcbBuffer=%v, (%v:)", t, pcbBuffer, origin(2)) + } u, err := user.Current() if err != nil { panic(todo("")) @@ -4473,6 +5199,9 @@ func XGetUserNameW(t *TLS, lpBuffer, pcbBuffer uintptr) int32 { // // ); func XLoadLibraryExW(t *TLS, lpLibFileName, hFile uintptr, dwFlags uint32) uintptr { + if __ccgo_strace { + trc("t=%v hFile=%v dwFlags=%v, (%v:)", t, hFile, dwFlags, origin(2)) + } return 0 // If the function fails, the return value is NULL. } @@ -4483,6 +5212,9 @@ func XLoadLibraryExW(t *TLS, lpLibFileName, hFile uintptr, dwFlags uint32) uintp // // ); func Xwcscpy(t *TLS, strDestination, strSource uintptr) uintptr { + if __ccgo_strace { + trc("t=%v strSource=%v, (%v:)", t, strSource, origin(2)) + } if strSource == 0 { return 0 } @@ -4509,6 +5241,9 @@ func XwsprintfW(t *TLS, _ ...interface{}) int32 { // // ); func XRegisterClassW(t *TLS, lpWndClass uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpWndClass=%v, (%v:)", t, lpWndClass, origin(2)) + } r0, _, err := syscall.Syscall(procRegisterClassW.Addr(), 1, lpWndClass, 0, 0) if r0 == 0 { t.setErrno(err) @@ -4531,6 +5266,9 @@ func XDestroyWindow(t *TLS, _ ...interface{}) int32 { // // ); func XUnregisterClassW(t *TLS, lpClassName, hInstance uintptr) int32 { + if __ccgo_strace { + trc("t=%v hInstance=%v, (%v:)", t, hInstance, origin(2)) + } r0, _, err := syscall.Syscall(procUnregisterClassW.Addr(), 2, lpClassName, hInstance, 0) if r0 == 0 { t.setErrno(err) @@ -4563,6 +5301,9 @@ func XSetTimer(t *TLS, _ ...interface{}) int32 { // // ); func XCreateWindowExW(t *TLS, dwExStyle uint32, lpClassName, lpWindowName uintptr, dwStyle uint32, x, y, nWidth, nHeight int32, hWndParent, hMenu, hInstance, lpParam uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dwExStyle=%v lpWindowName=%v dwStyle=%v nHeight=%v lpParam=%v, (%v:)", t, dwExStyle, lpWindowName, dwStyle, nHeight, lpParam, origin(2)) + } r0, _, err := syscall.Syscall12(procCreateWindowExW.Addr(), 12, uintptr(dwExStyle), lpClassName, @@ -4593,6 +5334,9 @@ func XCreateWindowExW(t *TLS, dwExStyle uint32, lpClassName, lpWindowName uintpt // // ); func XPeekMessageW(t *TLS, lpMsg, hWnd uintptr, wMsgFilterMin, wMsgFilterMax, wRemoveMsg uint32) int32 { + if __ccgo_strace { + trc("t=%v hWnd=%v wRemoveMsg=%v, (%v:)", t, hWnd, wRemoveMsg, origin(2)) + } r0, _, err := syscall.Syscall6(procPeekMessageW.Addr(), 5, lpMsg, hWnd, @@ -4630,6 +5374,9 @@ func XDispatchMessageW(t *TLS, _ ...interface{}) int32 { // // ); func XSleepEx(t *TLS, dwMilliseconds uint32, bAlertable int32) uint32 { + if __ccgo_strace { + trc("t=%v dwMilliseconds=%v bAlertable=%v, (%v:)", t, dwMilliseconds, bAlertable, origin(2)) + } r0, _, _ := syscall.Syscall(procSleepEx.Addr(), 2, uintptr(dwMilliseconds), uintptr(bAlertable), 0) return uint32(r0) } @@ -4643,6 +5390,9 @@ func XSleepEx(t *TLS, dwMilliseconds uint32, bAlertable int32) uint32 { // // ); func XCreatePipe(t *TLS, hReadPipe, hWritePipe, lpPipeAttributes uintptr, nSize uint32) int32 { + if __ccgo_strace { + trc("t=%v lpPipeAttributes=%v nSize=%v, (%v:)", t, lpPipeAttributes, nSize, origin(2)) + } r0, _, err := syscall.Syscall6(procCreatePipe.Addr(), 4, hReadPipe, hWritePipe, lpPipeAttributes, uintptr(nSize), 0, 0) if r0 == 0 { t.setErrno(err) @@ -4687,6 +5437,9 @@ func XCreateProcessW(t *TLS, lpApplicationName, lpCommandLine, lpProcessAttribut // // ); func XWaitForInputIdle(t *TLS, hProcess uintptr, dwMilliseconds uint32) int32 { + if __ccgo_strace { + trc("t=%v hProcess=%v dwMilliseconds=%v, (%v:)", t, hProcess, dwMilliseconds, origin(2)) + } r0, _, _ := syscall.Syscall(procWaitForInputIdle.Addr(), 2, hProcess, uintptr(dwMilliseconds), 0) return int32(r0) } @@ -4702,6 +5455,9 @@ func XWaitForInputIdle(t *TLS, hProcess uintptr, dwMilliseconds uint32) int32 { // // ); func XSearchPathW(t *TLS, lpPath, lpFileName, lpExtension uintptr, nBufferLength uint32, lpBuffer, lpFilePart uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpExtension=%v nBufferLength=%v lpFilePart=%v, (%v:)", t, lpExtension, nBufferLength, lpFilePart, origin(2)) + } r0, _, err := syscall.Syscall6(procSearchPathW.Addr(), 6, lpPath, lpFileName, lpExtension, uintptr(nBufferLength), lpBuffer, lpFilePart) if r0 == 0 { t.setErrno(err) @@ -4720,6 +5476,9 @@ func XGetShortPathNameW(t *TLS, _ ...interface{}) int32 { // // ); func XGetExitCodeProcess(t *TLS, hProcess, lpExitCode uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpExitCode=%v, (%v:)", t, lpExitCode, origin(2)) + } r0, _, err := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, hProcess, lpExitCode, 0) if r0 == 0 { t.setErrno(err) @@ -4738,6 +5497,9 @@ func XGetExitCodeProcess(t *TLS, hProcess, lpExitCode uintptr) int32 { // // ); func XPeekNamedPipe(t *TLS, hNamedPipe, lpBuffer uintptr, nBufferSize uint32, lpBytesRead, lpTotalBytesAvail, lpBytesLeftThisMessage uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpBuffer=%v nBufferSize=%v lpBytesLeftThisMessage=%v, (%v:)", t, lpBuffer, nBufferSize, lpBytesLeftThisMessage, origin(2)) + } r0, _, err := syscall.Syscall6(procPeekNamedPipe.Addr(), 6, hNamedPipe, lpBuffer, uintptr(nBufferSize), lpBytesRead, lpTotalBytesAvail, lpBytesLeftThisMessage) if r0 == 0 { t.setErrno(err) @@ -4752,6 +5514,9 @@ func XPeekNamedPipe(t *TLS, hNamedPipe, lpBuffer uintptr, nBufferSize uint32, lp // // ); func X_InterlockedExchange(t *TLS, Target uintptr, Value long) long { + if __ccgo_strace { + trc("t=%v Target=%v Value=%v, (%v:)", t, Target, Value, origin(2)) + } old := atomic.SwapInt32((*int32)(unsafe.Pointer(Target)), Value) return old } @@ -4763,6 +5528,9 @@ func X_InterlockedExchange(t *TLS, Target uintptr, Value long) long { // // ); func XTerminateThread(t *TLS, hThread uintptr, dwExitCode uint32) int32 { + if __ccgo_strace { + trc("t=%v hThread=%v dwExitCode=%v, (%v:)", t, hThread, dwExitCode, origin(2)) + } r0, _, err := syscall.Syscall(procTerminateThread.Addr(), 2, hThread, uintptr(dwExitCode), 0) if err != 0 { t.setErrno(err) @@ -4777,6 +5545,9 @@ func XTerminateThread(t *TLS, hThread uintptr, dwExitCode uint32) int32 { // // ); func XGetComputerNameW(t *TLS, lpBuffer, nSize uintptr) int32 { + if __ccgo_strace { + trc("t=%v nSize=%v, (%v:)", t, nSize, origin(2)) + } panic(todo("")) } @@ -4850,6 +5621,9 @@ func X_controlfp(t *TLS, _ ...interface{}) uint32 { // // ); func XQueryPerformanceFrequency(t *TLS, lpFrequency uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFrequency=%v, (%v:)", t, lpFrequency, origin(2)) + } r1, _, err := syscall.Syscall(procQueryPerformanceFrequency.Addr(), 1, lpFrequency, 0, 0) if r1 == 0 { @@ -4871,6 +5645,9 @@ func inDST(t gotime.Time) bool { // void _ftime( struct _timeb *timeptr ); func X_ftime(t *TLS, timeptr uintptr) { + if __ccgo_strace { + trc("t=%v timeptr=%v, (%v:)", t, timeptr, origin(2)) + } var tm = gotime.Now() var tPtr = (*time.X__timeb64)(unsafe.Pointer(timeptr)) tPtr.Ftime = tm.Unix() @@ -4913,6 +5690,9 @@ func XDdeQueryStringW(t *TLS, _ ...interface{}) int32 { // // ); func X_wcsicmp(t *TLS, string1, string2 uintptr) int32 { + if __ccgo_strace { + trc("t=%v string2=%v, (%v:)", t, string2, origin(2)) + } return Xwcsicmp(t, string1, string2) } @@ -4981,6 +5761,9 @@ func XDdeGetLastError(t *TLS, _ ...interface{}) uint32 { // // ); func XDdeClientTransaction(t *TLS, pData uintptr, cbData uint32, hConv uintptr, hszItem uintptr, wFmt, wType, dwTimeout uint32, pdwResult uintptr) uintptr { + if __ccgo_strace { + trc("t=%v pData=%v cbData=%v hConv=%v hszItem=%v dwTimeout=%v pdwResult=%v, (%v:)", t, pData, cbData, hConv, hszItem, dwTimeout, pdwResult, origin(2)) + } panic(todo("")) } @@ -5049,39 +5832,66 @@ func XRegSetValueExW(t *TLS, _ ...interface{}) int32 { // // ); func X__mingw_vsnwprintf(t *TLS, buffer uintptr, count types.Size_t, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v buffer=%v count=%v va=%v, (%v:)", t, buffer, count, va, origin(2)) + } panic(todo("")) } // int vprintf(const char *format, va_list ap); -func X__mingw_vprintf(t *TLS, s, ap uintptr) int32 { return Xvprintf(t, s, ap) } + +func X__mingw_vprintf(t *TLS, s, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } + return Xvprintf(t, s, ap) +} // int vfscanf(FILE * restrict stream, const char * restrict format, va_list arg); func X__mingw_vfscanf(t *TLS, stream, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } // int vsscanf(const char *str, const char *format, va_list ap); func X__mingw_vsscanf(t *TLS, str, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } return Xsscanf(t, str, format, ap) } // int vfprintf(FILE * restrict stream, const char * restrict format, va_list arg); func X__mingw_vfprintf(t *TLS, f uintptr, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v f=%v va=%v, (%v:)", t, f, va, origin(2)) + } return Xvfprintf(t, f, format, va) } // int vsprintf(char * restrict s, const char * restrict format, va_list arg); func X__mingw_vsprintf(t *TLS, s, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } return Xvsprintf(t, s, format, ap) } // int vsnprintf(char *str, size_t size, const char *format, va_list ap); func X__mingw_vsnprintf(t *TLS, str uintptr, size types.Size_t, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v size=%v ap=%v, (%v:)", t, str, size, ap, origin(2)) + } panic(todo("")) } // int putchar(int char) func X_putchar(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } if _, err := fwrite(unistd.STDOUT_FILENO, []byte{byte(c)}); err != nil { return -1 } @@ -5090,21 +5900,33 @@ func X_putchar(t *TLS, c int32) int32 { // int vfwscanf(FILE *stream, const wchar_t *format, va_list argptr;); func X__mingw_vfwscanf(t *TLS, stream uintptr, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v ap=%v, (%v:)", t, stream, ap, origin(2)) + } panic(todo("")) } // int vswscanf(const wchar_t *buffer, const wchar_t *format, va_list arglist); func X__mingw_vswscanf(t *TLS, stream uintptr, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v ap=%v, (%v:)", t, stream, ap, origin(2)) + } panic(todo("")) } // int vfwprintf(FILE * restrict stream, const wchar_t * restrict format, va_list arg); func X__mingw_vfwprintf(t *TLS, stream, format, ap uintptr) int32 { + if __ccgo_strace { + trc("t=%v ap=%v, (%v:)", t, ap, origin(2)) + } panic(todo("")) } // int putchar(int c); func Xputchar(t *TLS, c int32) int32 { + if __ccgo_strace { + trc("t=%v c=%v, (%v:)", t, c, origin(2)) + } panic(todo("")) } @@ -5116,11 +5938,17 @@ func Xputchar(t *TLS, c int32) int32 { // // ); func X_assert(t *TLS, message, filename uintptr, line uint32) { + if __ccgo_strace { + trc("t=%v filename=%v line=%v, (%v:)", t, filename, line, origin(2)) + } panic(todo("")) } // char *strdup(const char *s); func X_strdup(t *TLS, s uintptr) uintptr { + if __ccgo_strace { + trc("t=%v s=%v, (%v:)", t, s, origin(2)) + } panic(todo("")) } @@ -5131,6 +5959,9 @@ func X_strdup(t *TLS, s uintptr) uintptr { // // ); func X_access(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } var path = GoString(pathname) @@ -5177,6 +6008,9 @@ func X_access(t *TLS, pathname uintptr, mode int32) int32 { // // ); func XSetConsoleCtrlHandler(t *TLS, HandlerRoutine uintptr, Add int32) int32 { + if __ccgo_strace { + trc("t=%v HandlerRoutine=%v Add=%v, (%v:)", t, HandlerRoutine, Add, origin(2)) + } //var fcc = &struct { // f func(*TLS, uint32) int32 @@ -5198,11 +6032,17 @@ func XSetConsoleCtrlHandler(t *TLS, HandlerRoutine uintptr, Add int32) int32 { // DebugBreak func XDebugBreak(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // int _isatty( int fd ); func X_isatty(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -5233,6 +6073,9 @@ func X_isatty(t *TLS, fd int32) int32 { // // ); func XSetConsoleTextAttribute(t *TLS, hConsoleOutput uintptr, wAttributes uint16) int32 { + if __ccgo_strace { + trc("t=%v hConsoleOutput=%v wAttributes=%v, (%v:)", t, hConsoleOutput, wAttributes, origin(2)) + } r1, _, _ := syscall.Syscall(procSetConsoleTextAttribute.Addr(), 2, hConsoleOutput, uintptr(wAttributes), 0) return int32(r1) } @@ -5244,6 +6087,9 @@ func XSetConsoleTextAttribute(t *TLS, hConsoleOutput uintptr, wAttributes uint16 // // ); func XGetConsoleScreenBufferInfo(t *TLS, hConsoleOutput, lpConsoleScreenBufferInfo uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpConsoleScreenBufferInfo=%v, (%v:)", t, lpConsoleScreenBufferInfo, origin(2)) + } r1, _, _ := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, hConsoleOutput, lpConsoleScreenBufferInfo, 0) return int32(r1) } @@ -5255,6 +6101,9 @@ func XGetConsoleScreenBufferInfo(t *TLS, hConsoleOutput, lpConsoleScreenBufferIn // // ); func X_popen(t *TLS, command, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } panic(todo("")) } @@ -5264,18 +6113,30 @@ func X_popen(t *TLS, command, mode uintptr) uintptr { // // ); func X_wunlink(t *TLS, filename uintptr) int32 { + if __ccgo_strace { + trc("t=%v filename=%v, (%v:)", t, filename, origin(2)) + } panic(todo("")) } func Xclosedir(tls *TLS, dir uintptr) int32 { + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } panic(todo("")) } func Xopendir(tls *TLS, name uintptr) uintptr { + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } panic(todo("")) } func Xreaddir(tls *TLS, dir uintptr) uintptr { + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } panic(todo("")) } @@ -5285,21 +6146,33 @@ func Xreaddir(tls *TLS, dir uintptr) uintptr { // // ); func X_unlink(t *TLS, filename uintptr) int32 { + if __ccgo_strace { + trc("t=%v filename=%v, (%v:)", t, filename, origin(2)) + } panic(todo("")) } // int pclose(FILE *stream); func X_pclose(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } panic(todo("")) } // int setmode (int fd, int mode); func Xsetmode(t *TLS, fd, mode int32) int32 { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } return X_setmode(t, fd, mode) } // int _setmode (int fd, int mode); func X_setmode(t *TLS, fd, mode int32) int32 { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } _, ok := fdToFile(fd) if !ok { @@ -5320,16 +6193,25 @@ func X_setmode(t *TLS, fd, mode int32) int32 { // int _mkdir(const char *dirname); func X_mkdir(t *TLS, dirname uintptr) int32 { + if __ccgo_strace { + trc("t=%v dirname=%v, (%v:)", t, dirname, origin(2)) + } panic(todo("")) } // int _chmod( const char *filename, int pmode ); func X_chmod(t *TLS, filename uintptr, pmode int32) int32 { + if __ccgo_strace { + trc("t=%v filename=%v pmode=%v, (%v:)", t, filename, pmode, origin(2)) + } panic(todo("")) } // int _fileno(FILE *stream); func X_fileno(t *TLS, stream uintptr) int32 { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } f, ok := winGetObject(stream).(*file) if !ok { t.setErrno(errno.EBADF) @@ -5340,11 +6222,17 @@ func X_fileno(t *TLS, stream uintptr) int32 { // void rewind(FILE *stream); func Xrewind(t *TLS, stream uintptr) { + if __ccgo_strace { + trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) + } Xfseek(t, stream, 0, unistd.SEEK_SET) } // __atomic_load_n func X__atomic_load_n(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } @@ -5355,16 +6243,25 @@ func X__atomic_store_n(t *TLS, _ ...interface{}) int32 { // __builtin_add_overflow func X__builtin_add_overflow(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // __builtin_mul_overflow func X__builtin_mul_overflow(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } // __builtin_sub_overflow func X__builtin_sub_overflow(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } panic(todo("")) } @@ -5426,6 +6323,9 @@ func goWideStringNZ(p uintptr) string { // LPWSTR GetCommandLineW(); func XGetCommandLineW(t *TLS) uintptr { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return uintptr(unsafe.Pointer(syscall.GetCommandLine())) } @@ -5438,6 +6338,9 @@ func XGetCommandLineW(t *TLS) uintptr { // // ); func XAddAccessDeniedAce(t *TLS, pAcl uintptr, dwAceRevision, AccessMask uint32, pSid uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAcl=%v AccessMask=%v pSid=%v, (%v:)", t, pAcl, AccessMask, pSid, origin(2)) + } panic(todo("")) } @@ -5451,6 +6354,9 @@ func XAddAccessDeniedAce(t *TLS, pAcl uintptr, dwAceRevision, AccessMask uint32, // // ); func XAddAce(t *TLS, pAcl uintptr, dwAceRevision, dwStartingAceIndex uint32, pAceList uintptr, nAceListLength uint32) int32 { + if __ccgo_strace { + trc("t=%v pAcl=%v dwStartingAceIndex=%v pAceList=%v nAceListLength=%v, (%v:)", t, pAcl, dwStartingAceIndex, pAceList, nAceListLength, origin(2)) + } panic(todo("")) } @@ -5462,6 +6368,9 @@ func XAddAce(t *TLS, pAcl uintptr, dwAceRevision, dwStartingAceIndex uint32, pAc // // ); func XGetAce(t *TLS, pAcl uintptr, dwAceIndex uint32, pAce uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAcl=%v dwAceIndex=%v pAce=%v, (%v:)", t, pAcl, dwAceIndex, pAce, origin(2)) + } panic(todo("")) } @@ -5474,6 +6383,9 @@ func XGetAce(t *TLS, pAcl uintptr, dwAceIndex uint32, pAce uintptr) int32 { // // ); func XGetAclInformation(t *TLS, pAcl, pAclInformation uintptr, nAclInformationLength, dwAclInformationClass uint32) int32 { + if __ccgo_strace { + trc("t=%v pAclInformation=%v dwAclInformationClass=%v, (%v:)", t, pAclInformation, dwAclInformationClass, origin(2)) + } r0, _, err := syscall.Syscall6(procGetAclInformation.Addr(), 4, pAclInformation, pAclInformation, @@ -5498,6 +6410,9 @@ func XGetAclInformation(t *TLS, pAcl, pAclInformation uintptr, nAclInformationLe // // ); func XGetFileSecurityA(t *TLS, lpFileName uintptr, RequestedInformation uint32, pSecurityDescriptor uintptr, nLength uint32, lpnLengthNeeded uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpFileName=%v RequestedInformation=%v pSecurityDescriptor=%v nLength=%v lpnLengthNeeded=%v, (%v:)", t, lpFileName, RequestedInformation, pSecurityDescriptor, nLength, lpnLengthNeeded, origin(2)) + } r0, _, err := syscall.Syscall6(procGetFileSecurityA.Addr(), 5, lpFileName, uintptr(RequestedInformation), @@ -5518,6 +6433,9 @@ func XGetFileSecurityA(t *TLS, lpFileName uintptr, RequestedInformation uint32, // // ); func XGetLengthSid(t *TLS, pSid uintptr) uint32 { + if __ccgo_strace { + trc("t=%v pSid=%v, (%v:)", t, pSid, origin(2)) + } panic(todo("")) } @@ -5530,6 +6448,9 @@ func XGetLengthSid(t *TLS, pSid uintptr) uint32 { // // ); func XGetSecurityDescriptorDacl(t *TLS, pSecurityDescriptor, lpbDaclPresent, pDacl, lpbDaclDefaulted uintptr) int32 { + if __ccgo_strace { + trc("t=%v lpbDaclDefaulted=%v, (%v:)", t, lpbDaclDefaulted, origin(2)) + } r0, _, err := syscall.Syscall6(procGetSecurityDescriptorDacl.Addr(), 4, pSecurityDescriptor, lpbDaclPresent, @@ -5550,6 +6471,9 @@ func XGetSecurityDescriptorDacl(t *TLS, pSecurityDescriptor, lpbDaclPresent, pDa // // ); func XGetSidLengthRequired(t *TLS, nSubAuthorityCount uint8) int32 { + if __ccgo_strace { + trc("t=%v nSubAuthorityCount=%v, (%v:)", t, nSubAuthorityCount, origin(2)) + } r0, _, err := syscall.Syscall(procGetSidLengthRequired.Addr(), 1, uintptr(nSubAuthorityCount), 0, 0) if err != 0 { t.setErrno(err) @@ -5564,6 +6488,9 @@ func XGetSidLengthRequired(t *TLS, nSubAuthorityCount uint8) int32 { // // ); func XGetSidSubAuthority(t *TLS, pSid uintptr, nSubAuthority uint32) uintptr { + if __ccgo_strace { + trc("t=%v pSid=%v nSubAuthority=%v, (%v:)", t, pSid, nSubAuthority, origin(2)) + } r0, _, err := syscall.Syscall(procGetSidSubAuthority.Addr(), 2, pSid, uintptr(nSubAuthority), 0) if err != 0 { t.setErrno(err) @@ -5579,6 +6506,9 @@ func XGetSidSubAuthority(t *TLS, pSid uintptr, nSubAuthority uint32) uintptr { // // ); func XInitializeAcl(t *TLS, pAcl uintptr, nAclLength, dwAclRevision uint32) int32 { + if __ccgo_strace { + trc("t=%v pAcl=%v dwAclRevision=%v, (%v:)", t, pAcl, dwAclRevision, origin(2)) + } panic(todo("")) } @@ -5590,6 +6520,9 @@ func XInitializeAcl(t *TLS, pAcl uintptr, nAclLength, dwAclRevision uint32) int3 // // ); func XInitializeSid(t *TLS, Sid, pIdentifierAuthority uintptr, nSubAuthorityCount uint8) int32 { + if __ccgo_strace { + trc("t=%v pIdentifierAuthority=%v nSubAuthorityCount=%v, (%v:)", t, pIdentifierAuthority, nSubAuthorityCount, origin(2)) + } r0, _, err := syscall.Syscall(procInitializeSid.Addr(), 3, Sid, pIdentifierAuthority, uintptr(nSubAuthorityCount)) if err != 0 { t.setErrno(err) @@ -5606,6 +6539,9 @@ func XInitializeSid(t *TLS, Sid, pIdentifierAuthority uintptr, nSubAuthorityCoun // // ); func XRaiseException(t *TLS, dwExceptionCode, dwExceptionFlags, nNumberOfArguments uint32, lpArguments uintptr) { + if __ccgo_strace { + trc("t=%v nNumberOfArguments=%v lpArguments=%v, (%v:)", t, nNumberOfArguments, lpArguments, origin(2)) + } panic(todo("")) } @@ -5615,6 +6551,9 @@ func XRaiseException(t *TLS, dwExceptionCode, dwExceptionFlags, nNumberOfArgumen // // ); func XSetErrorMode(t *TLS, uMode uint32) int32 { + if __ccgo_strace { + trc("t=%v uMode=%v, (%v:)", t, uMode, origin(2)) + } panic(todo("")) } @@ -5630,6 +6569,9 @@ func XSetErrorMode(t *TLS, uMode uint32) int32 { // // ); func XSetNamedSecurityInfoA(t *TLS, pObjectName uintptr, ObjectType, SecurityInfo uint32, psidOwner, psidGroup, pDacl, pSacl uintptr) uint32 { + if __ccgo_strace { + trc("t=%v pObjectName=%v SecurityInfo=%v pSacl=%v, (%v:)", t, pObjectName, SecurityInfo, pSacl, origin(2)) + } panic(todo("")) } @@ -5679,6 +6621,9 @@ func X_set_abort_behavior(t *TLS, _ ...interface{}) uint32 { // // ); func XOpenEventA(t *TLS, dwDesiredAccess uint32, bInheritHandle uint32, lpName uintptr) uintptr { + if __ccgo_strace { + trc("t=%v dwDesiredAccess=%v bInheritHandle=%v lpName=%v, (%v:)", t, dwDesiredAccess, bInheritHandle, lpName, origin(2)) + } r0, _, err := syscall.Syscall(procOpenEventA.Addr(), 3, uintptr(dwDesiredAccess), uintptr(bInheritHandle), lpName) if r0 == 0 { t.setErrno(err) @@ -5692,16 +6637,25 @@ func XOpenEventA(t *TLS, dwDesiredAccess uint32, bInheritHandle uint32, lpName u // // ); func X_msize(t *TLS, memblock uintptr) types.Size_t { + if __ccgo_strace { + trc("t=%v memblock=%v, (%v:)", t, memblock, origin(2)) + } return types.Size_t(UsableSize(memblock)) } // unsigned long _byteswap_ulong ( unsigned long val ); func X_byteswap_ulong(t *TLS, val ulong) ulong { + if __ccgo_strace { + trc("t=%v val=%v, (%v:)", t, val, origin(2)) + } return X__builtin_bswap32(t, val) } // unsigned __int64 _byteswap_uint64 ( unsigned __int64 val ); func X_byteswap_uint64(t *TLS, val uint64) uint64 { + if __ccgo_strace { + trc("t=%v val=%v, (%v:)", t, val, origin(2)) + } return X__builtin_bswap64(t, val) } @@ -5711,6 +6665,9 @@ func X_byteswap_uint64(t *TLS, val uint64) uint64 { // // ); func X_commit(t *TLS, fd int32) int32 { + if __ccgo_strace { + trc("t=%v fd=%v, (%v:)", t, fd, origin(2)) + } return Xfsync(t, fd) } @@ -5721,6 +6678,9 @@ func X_commit(t *TLS, fd int32) int32 { // // ); func X_stati64(t *TLS, path, buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v buffer=%v, (%v:)", t, buffer, origin(2)) + } panic(todo("")) } @@ -5731,6 +6691,9 @@ func X_stati64(t *TLS, path, buffer uintptr) int32 { // // ); func X_fstati64(t *TLS, fd int32, buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buffer=%v, (%v:)", t, fd, buffer, origin(2)) + } panic(todo("")) } @@ -5741,6 +6704,9 @@ func X_fstati64(t *TLS, fd int32, buffer uintptr) int32 { // // ); func X_findnext32(t *TLS, handle types.Intptr_t, buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v handle=%v buffer=%v, (%v:)", t, handle, buffer, origin(2)) + } panic(todo("")) } @@ -5751,6 +6717,9 @@ func X_findnext32(t *TLS, handle types.Intptr_t, buffer uintptr) int32 { // // ); func X_findfirst32(t *TLS, filespec, fileinfo uintptr) types.Intptr_t { + if __ccgo_strace { + trc("t=%v fileinfo=%v, (%v:)", t, fileinfo, origin(2)) + } panic(todo("")) } @@ -5785,6 +6754,9 @@ func X_findfirst32(t *TLS, filespec, fileinfo uintptr) types.Intptr_t { // long strtol(const char *nptr, char **endptr, int base); func Xstrtol(t *TLS, nptr, endptr uintptr, base int32) long { + if __ccgo_strace { + trc("t=%v endptr=%v base=%v, (%v:)", t, endptr, base, origin(2)) + } var s uintptr = nptr var acc ulong @@ -5919,6 +6891,9 @@ func Xstrtol(t *TLS, nptr, endptr uintptr, base int32) long { // unsigned long int strtoul(const char *nptr, char **endptr, int base); func Xstrtoul(t *TLS, nptr, endptr uintptr, base int32) ulong { + if __ccgo_strace { + trc("t=%v endptr=%v base=%v, (%v:)", t, endptr, base, origin(2)) + } var s uintptr = nptr var acc ulong var c byte @@ -6024,6 +6999,9 @@ func Xstrtoul(t *TLS, nptr, endptr uintptr, base int32) ulong { // int __isoc99_sscanf(const char *str, const char *format, ...); func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -6033,6 +7011,9 @@ func X__isoc99_sscanf(t *TLS, str, format, va uintptr) int32 { // int sscanf(const char *str, const char *format, ...); func Xsscanf(t *TLS, str, format, va uintptr) int32 { + if __ccgo_strace { + trc("t=%v va=%v, (%v:)", t, va, origin(2)) + } r := scanf(strings.NewReader(GoString(str)), format, va) // if dmesgs { // dmesg("%v: %q %q: %d", origin(1), GoString(str), GoString(format), r) @@ -6041,10 +7022,16 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 { } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } panic(todo("")) } func Xrint(tls *TLS, x float64) float64 { + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } switch { case x == 0: // also +0 and -0 return 0 @@ -6061,21 +7048,33 @@ func Xrint(tls *TLS, x float64) float64 { // FILE *fdopen(int fd, const char *mode); func Xfdopen(t *TLS, fd int32, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v fd=%v mode=%v, (%v:)", t, fd, mode, origin(2)) + } panic(todo("")) } // struct tm *_gmtime64( const __time64_t *sourceTime ); func X_gmtime64(t *TLS, sourceTime uintptr) uintptr { + if __ccgo_strace { + trc("t=%v sourceTime=%v, (%v:)", t, sourceTime, origin(2)) + } panic(todo("")) } // __time64_t _mktime64(struct tm *timeptr); func X_mktime64(t *TLS, timeptr uintptr) time.X__time64_t { + if __ccgo_strace { + trc("t=%v timeptr=%v, (%v:)", t, timeptr, origin(2)) + } return time.X__time64_t(Xmktime(t, timeptr)) } // char * gai_strerrorA(int ecode); func Xgai_strerrorA(t *TLS, ecode int32) uintptr { + if __ccgo_strace { + trc("t=%v ecode=%v, (%v:)", t, ecode, origin(2)) + } panic(todo("")) } @@ -6097,6 +7096,9 @@ type __timeb64 struct { // void _ftime64( struct __timeb64 *timeptr ); func X_ftime64(t *TLS, timeptr uintptr) { + if __ccgo_strace { + trc("t=%v timeptr=%v, (%v:)", t, timeptr, origin(2)) + } tm := gotime.Now() (*__timeb64)(unsafe.Pointer(timeptr)).time = types.X__time64_t(tm.Unix()) @@ -6107,18 +7109,30 @@ func X_ftime64(t *TLS, timeptr uintptr) { } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a)) } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a)) & int32(3) } func Xchmod(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("%q %#o", GoString(pathname), mode)) } @@ -6142,6 +7156,9 @@ func Xchmod(t *TLS, pathname uintptr, mode int32) int32 { // // ); func XGetComputerNameExW(t *TLS, nameType int32, lpBuffer, nSize uintptr) int32 { + if __ccgo_strace { + trc("t=%v nameType=%v nSize=%v, (%v:)", t, nameType, nSize, origin(2)) + } r0, _, err := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nameType), lpBuffer, nSize) if err != 0 { t.setErrno(err) @@ -6155,7 +7172,13 @@ func XGetComputerNameExW(t *TLS, nameType int32, lpBuffer, nSize uintptr) int32 // double y // // ); -func X_copysign(t *TLS, x, y float64) float64 { return Xcopysign(t, x, y) } + +func X_copysign(t *TLS, x, y float64) float64 { + if __ccgo_strace { + trc("t=%v y=%v, (%v:)", t, y, origin(2)) + } + return Xcopysign(t, x, y) +} // int _wtoi( // @@ -6163,6 +7186,9 @@ func X_copysign(t *TLS, x, y float64) float64 { return Xcopysign(t, x, y) } // // ); func X_wtoi(t *TLS, str uintptr) int32 { + if __ccgo_strace { + trc("t=%v str=%v, (%v:)", t, str, origin(2)) + } panic(todo("")) } @@ -6187,6 +7213,9 @@ func allocW(t *TLS, v string) (r uintptr) { // // ); func X_wgetenv(t *TLS, varname uintptr) uintptr { + if __ccgo_strace { + trc("t=%v varname=%v, (%v:)", t, varname, origin(2)) + } if !wenvValid { bootWinEnviron(t) } @@ -6210,6 +7239,9 @@ func X_wgetenv(t *TLS, varname uintptr) uintptr { // // ); func X_wputenv(t *TLS, envstring uintptr) int32 { + if __ccgo_strace { + trc("t=%v envstring=%v, (%v:)", t, envstring, origin(2)) + } if !wenvValid { bootWinEnviron(t) } @@ -6253,7 +7285,12 @@ func bootWinEnviron(t *TLS) { wenvValid = true } -func Xfabsl(t *TLS, x float64) float64 { return math.Abs(x) } +func Xfabsl(t *TLS, x float64) float64 { + if __ccgo_strace { + trc("t=%v x=%v, (%v:)", t, x, origin(2)) + } + return math.Abs(x) +} func X__stdio_common_vfprintf(t *TLS, args ...interface{}) int32 { panic("TODO") } func X__stdio_common_vfprintf_p(t *TLS, args ...interface{}) int32 { panic("TODO") } diff --git a/vendor/modernc.org/libc/libc_windows_386.go b/vendor/modernc.org/libc/libc_windows_386.go index d48e6f65..c956813c 100644 --- a/vendor/modernc.org/libc/libc_windows_386.go +++ b/vendor/modernc.org/libc/libc_windows_386.go @@ -17,6 +17,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // // musl/arch/x32/ksigaction.h // // @@ -62,6 +65,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } panic(todo("")) // var arg uintptr // if args != 0 { @@ -84,6 +90,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LSTAT64, pathname, statbuf, 0); err != 0 { // if dmesgs { @@ -101,6 +110,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_STAT64, pathname, statbuf, 0); err != 0 { // if dmesgs { @@ -118,6 +130,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FSTAT64, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { @@ -135,6 +150,9 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } panic(todo("")) // var arg uintptr // if args != 0 { @@ -156,11 +174,17 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } panic(todo("")) // data, _, err := unix.Syscall6(unix.SYS_MMAP2, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset>>12)) // if err != 0 { @@ -179,6 +203,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE64, uintptr(fd), uintptr(length), uintptr(length>>32)); err != 0 { // if dmesgs { @@ -196,6 +223,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } panic(todo("")) // bp := t.Alloc(int(unsafe.Sizeof(types.X__loff_t(0)))) // defer t.Free(int(unsafe.Sizeof(types.X__loff_t(0)))) @@ -215,6 +245,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { // t.setErrno(err) @@ -226,6 +259,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -237,6 +273,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { // t.setErrno(err) @@ -248,6 +287,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) // if err != 0 { @@ -263,6 +305,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { // t.setErrno(err) @@ -277,6 +322,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { // t.setErrno(err) @@ -291,6 +339,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { // t.setErrno(err) @@ -305,6 +356,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } err := syscall.DeleteFile((*uint16)(unsafe.Pointer(pathname))) if err != nil { t.setErrno(err) @@ -321,6 +375,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // if dmesgs { @@ -338,6 +395,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { // t.setErrno(err) @@ -352,6 +412,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -374,6 +437,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -385,6 +451,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { // t.setErrno(err) @@ -396,6 +465,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -408,6 +480,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) // if err != 0 { @@ -420,6 +495,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int @@ -456,14 +534,23 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { } func Xrecv(t *TLS, sockfd uint32, buf uintptr, len, flags int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v flags=%v, (%v:)", t, sockfd, buf, flags, origin(2)) + } panic(todo("")) } func Xsend(t *TLS, sockfd uint32, buf uintptr, len, flags int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v flags=%v, (%v:)", t, sockfd, buf, flags, origin(2)) + } panic(todo("")) } func Xshutdown(t *TLS, sockfd uint32, how int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v how=%v, (%v:)", t, sockfd, how, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SHUTDOWN, uintptr(sockfd), uintptr(how), 0); err != 0 { // t.setErrno(err) @@ -474,40 +561,67 @@ func Xshutdown(t *TLS, sockfd uint32, how int32) int32 { } func Xgetpeername(t *TLS, sockfd uint32, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xgetsockname(t *TLS, sockfd uint32, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } panic(todo("")) } func Xsocket(t *TLS, domain, type1, protocol int32) uint32 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } panic(todo("")) } func Xbind(t *TLS, sockfd uint32, addr uintptr, addrlen int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xconnect(t *TLS, sockfd uint32, addr uintptr, addrlen int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xlisten(t *TLS, sockfd uint32, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v backlog=%v, (%v:)", t, sockfd, backlog, origin(2)) + } panic(todo("")) } func Xaccept(t *TLS, sockfd uint32, addr uintptr, addrlen uintptr) uint32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } // struct tm *_localtime32( const __time32_t *sourceTime ); func X_localtime32(t *TLS, sourceTime uintptr) uintptr { + if __ccgo_strace { + trc("t=%v sourceTime=%v, (%v:)", t, sourceTime, origin(2)) + } panic(todo("")) } // struct tm *_gmtime32( const __time32_t *sourceTime ); func X_gmtime32(t *TLS, sourceTime uintptr) uintptr { + if __ccgo_strace { + trc("t=%v sourceTime=%v, (%v:)", t, sourceTime, origin(2)) + } panic(todo("")) } @@ -519,6 +633,9 @@ func X_gmtime32(t *TLS, sourceTime uintptr) uintptr { // // ); func XSetWindowLongW(t *TLS, hwnd uintptr, nIndex int32, dwNewLong long) long { + if __ccgo_strace { + trc("t=%v hwnd=%v nIndex=%v dwNewLong=%v, (%v:)", t, hwnd, nIndex, dwNewLong, origin(2)) + } panic(todo("")) } @@ -529,6 +646,9 @@ func XSetWindowLongW(t *TLS, hwnd uintptr, nIndex int32, dwNewLong long) long { // // ); func XGetWindowLongW(t *TLS, hwnd uintptr, nIndex int32) long { + if __ccgo_strace { + trc("t=%v hwnd=%v nIndex=%v, (%v:)", t, hwnd, nIndex, origin(2)) + } panic(todo("")) } @@ -555,6 +675,9 @@ func XSendMessageTimeoutW(t *TLS, _ ...interface{}) int32 { // // ); func X_fstat(t *TLS, fd int32, buffer uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v buffer=%v, (%v:)", t, fd, buffer, origin(2)) + } f, ok := fdToFile(fd) if !ok { t.setErrno(EBADF) diff --git a/vendor/modernc.org/libc/libc_windows_amd64.go b/vendor/modernc.org/libc/libc_windows_amd64.go index 2b73ab4c..9e65ed53 100644 --- a/vendor/modernc.org/libc/libc_windows_amd64.go +++ b/vendor/modernc.org/libc/libc_windows_amd64.go @@ -15,6 +15,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // musl/arch/x86_64/ksigaction.h // @@ -60,6 +63,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } panic(todo("")) // var arg uintptr // if args != 0 { @@ -82,6 +88,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LSTAT, pathname, statbuf, 0); err != 0 { // if dmesgs { @@ -99,6 +108,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_STAT, pathname, statbuf, 0); err != 0 { // if dmesgs { @@ -116,6 +128,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { @@ -132,11 +147,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } panic(todo("")) // data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) // if err != 0 { @@ -155,6 +176,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } panic(todo("")) // var arg uintptr // if args != 0 { @@ -177,6 +201,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { @@ -194,6 +221,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -218,6 +248,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { // t.setErrno(err) @@ -229,6 +262,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -240,6 +276,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) // if err != 0 { @@ -255,6 +294,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { // t.setErrno(err) @@ -266,6 +308,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { // t.setErrno(err) @@ -280,6 +325,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { // t.setErrno(err) @@ -294,6 +342,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { // t.setErrno(err) @@ -308,6 +359,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } err := syscall.DeleteFile((*uint16)(unsafe.Pointer(pathname))) if err != nil { @@ -324,6 +378,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // if dmesgs { @@ -341,6 +398,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { // t.setErrno(err) @@ -355,6 +415,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -377,6 +440,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -388,6 +454,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { // t.setErrno(err) @@ -399,6 +468,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -411,6 +483,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) // if err != 0 { @@ -423,6 +498,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int @@ -459,42 +537,72 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { } func Xrecv(t *TLS, sockfd uint64, buf uintptr, len, flags int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v flags=%v, (%v:)", t, sockfd, buf, flags, origin(2)) + } panic(todo("")) } func Xsend(t *TLS, sockfd uint64, buf uintptr, len, flags int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v flags=%v, (%v:)", t, sockfd, buf, flags, origin(2)) + } panic(todo("")) } func Xshutdown(t *TLS, sockfd uint64, how int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v how=%v, (%v:)", t, sockfd, how, origin(2)) + } panic(todo("")) } func Xgetpeername(t *TLS, sockfd uint64, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xgetsockname(t *TLS, sockfd uint64, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } panic(todo("")) } func Xsocket(t *TLS, domain, type1, protocol int32) uint64 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } panic(todo("")) } func Xbind(t *TLS, sockfd uint64, addr uintptr, addrlen int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xconnect(t *TLS, sockfd uint64, addr uintptr, addrlen int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xlisten(t *TLS, sockfd uint64, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v backlog=%v, (%v:)", t, sockfd, backlog, origin(2)) + } panic(todo("")) } func Xaccept(t *TLS, sockfd uint64, addr uintptr, addrlen uintptr) uint64 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } diff --git a/vendor/modernc.org/libc/libc_windows_arm64.go b/vendor/modernc.org/libc/libc_windows_arm64.go index 2b73ab4c..9e65ed53 100644 --- a/vendor/modernc.org/libc/libc_windows_arm64.go +++ b/vendor/modernc.org/libc/libc_windows_arm64.go @@ -15,6 +15,9 @@ import ( // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { + if __ccgo_strace { + trc("t=%v signum=%v oldact=%v, (%v:)", t, signum, oldact, origin(2)) + } panic(todo("")) // musl/arch/x86_64/ksigaction.h // @@ -60,6 +63,9 @@ func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { // int fcntl(int fd, int cmd, ... /* arg */ ); func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { + if __ccgo_strace { + trc("t=%v cmd=%v args=%v, (%v:)", t, cmd, args, origin(2)) + } panic(todo("")) // var arg uintptr // if args != 0 { @@ -82,6 +88,9 @@ func Xfcntl64(t *TLS, fd, cmd int32, args uintptr) int32 { // int lstat(const char *pathname, struct stat *statbuf); func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LSTAT, pathname, statbuf, 0); err != 0 { // if dmesgs { @@ -99,6 +108,9 @@ func Xlstat64(t *TLS, pathname, statbuf uintptr) int32 { // int stat(const char *pathname, struct stat *statbuf); func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v statbuf=%v, (%v:)", t, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_STAT, pathname, statbuf, 0); err != 0 { // if dmesgs { @@ -116,6 +128,9 @@ func Xstat64(t *TLS, pathname, statbuf uintptr) int32 { // int fstat(int fd, struct stat *statbuf); func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { + if __ccgo_strace { + trc("t=%v fd=%v statbuf=%v, (%v:)", t, fd, statbuf, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FSTAT, uintptr(fd), statbuf, 0); err != 0 { // if dmesgs { @@ -132,11 +147,17 @@ func Xfstat64(t *TLS, fd int32, statbuf uintptr) int32 { } func Xmmap(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } return Xmmap64(t, addr, length, prot, flags, fd, offset) } // void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, offset types.Off_t) uintptr { + if __ccgo_strace { + trc("t=%v addr=%v length=%v fd=%v offset=%v, (%v:)", t, addr, length, fd, offset, origin(2)) + } panic(todo("")) // data, _, err := unix.Syscall6(unix.SYS_MMAP, addr, uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) // if err != 0 { @@ -155,6 +176,9 @@ func Xmmap64(t *TLS, addr uintptr, length types.Size_t, prot, flags, fd int32, o // void *mremap(void *old_address, size_t old_size, size_t new_size, int flags, ... /* void *new_address */); func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags int32, args uintptr) uintptr { + if __ccgo_strace { + trc("t=%v old_address=%v new_size=%v flags=%v args=%v, (%v:)", t, old_address, new_size, flags, args, origin(2)) + } panic(todo("")) // var arg uintptr // if args != 0 { @@ -177,6 +201,9 @@ func Xmremap(t *TLS, old_address uintptr, old_size, new_size types.Size_t, flags // int ftruncate(int fd, off_t length); func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { + if __ccgo_strace { + trc("t=%v fd=%v length=%v, (%v:)", t, fd, length, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0); err != 0 { // if dmesgs { @@ -194,6 +221,9 @@ func Xftruncate64(t *TLS, fd int32, length types.Off_t) int32 { // off64_t lseek64(int fd, off64_t offset, int whence); func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { + if __ccgo_strace { + trc("t=%v fd=%v offset=%v whence=%v, (%v:)", t, fd, offset, whence, origin(2)) + } f, ok := fdToFile(fd) if !ok { @@ -218,6 +248,9 @@ func Xlseek64(t *TLS, fd int32, offset types.Off_t, whence int32) types.Off_t { // int utime(const char *filename, const struct utimbuf *times); func Xutime(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIME, filename, times, 0); err != 0 { // t.setErrno(err) @@ -229,6 +262,9 @@ func Xutime(t *TLS, filename, times uintptr) int32 { // unsigned int alarm(unsigned int seconds); func Xalarm(t *TLS, seconds uint32) uint32 { + if __ccgo_strace { + trc("t=%v seconds=%v, (%v:)", t, seconds, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_ALARM, uintptr(seconds), 0, 0) // if err != 0 { @@ -240,6 +276,9 @@ func Xalarm(t *TLS, seconds uint32) uint32 { // time_t time(time_t *tloc); func Xtime(t *TLS, tloc uintptr) types.Time_t { + if __ccgo_strace { + trc("t=%v tloc=%v, (%v:)", t, tloc, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_TIME, tloc, 0, 0) // if err != 0 { @@ -255,6 +294,9 @@ func Xtime(t *TLS, tloc uintptr) types.Time_t { // int getrlimit(int resource, struct rlimit *rlim); func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { + if __ccgo_strace { + trc("t=%v resource=%v rlim=%v, (%v:)", t, resource, rlim, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_GETRLIMIT, uintptr(resource), uintptr(rlim), 0); err != 0 { // t.setErrno(err) @@ -266,6 +308,9 @@ func Xgetrlimit64(t *TLS, resource int32, rlim uintptr) int32 { // int mkdir(const char *path, mode_t mode); func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { + if __ccgo_strace { + trc("t=%v path=%v mode=%v, (%v:)", t, path, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKDIR, path, uintptr(mode), 0); err != 0 { // t.setErrno(err) @@ -280,6 +325,9 @@ func Xmkdir(t *TLS, path uintptr, mode types.Mode_t) int32 { // int symlink(const char *target, const char *linkpath); func Xsymlink(t *TLS, target, linkpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v linkpath=%v, (%v:)", t, linkpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_SYMLINK, target, linkpath, 0); err != 0 { // t.setErrno(err) @@ -294,6 +342,9 @@ func Xsymlink(t *TLS, target, linkpath uintptr) int32 { // int utimes(const char *filename, const struct timeval times[2]); func Xutimes(t *TLS, filename, times uintptr) int32 { + if __ccgo_strace { + trc("t=%v times=%v, (%v:)", t, times, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_UTIMES, filename, times, 0); err != 0 { // t.setErrno(err) @@ -308,6 +359,9 @@ func Xutimes(t *TLS, filename, times uintptr) int32 { // int unlink(const char *pathname); func Xunlink(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } err := syscall.DeleteFile((*uint16)(unsafe.Pointer(pathname))) if err != nil { @@ -324,6 +378,9 @@ func Xunlink(t *TLS, pathname uintptr) int32 { // int access(const char *pathname, int mode); func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v, (%v:)", t, pathname, mode, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_ACCESS, pathname, uintptr(mode), 0); err != 0 { // if dmesgs { @@ -341,6 +398,9 @@ func Xaccess(t *TLS, pathname uintptr, mode int32) int32 { // int rmdir(const char *pathname); func Xrmdir(t *TLS, pathname uintptr) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v, (%v:)", t, pathname, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_RMDIR, pathname, 0, 0); err != 0 { // t.setErrno(err) @@ -355,6 +415,9 @@ func Xrmdir(t *TLS, pathname uintptr) int32 { // int mknod(const char *pathname, mode_t mode, dev_t dev); func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 { + if __ccgo_strace { + trc("t=%v pathname=%v mode=%v dev=%v, (%v:)", t, pathname, mode, dev, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_MKNOD, pathname, uintptr(mode), uintptr(dev)); err != 0 { // t.setErrno(err) @@ -377,6 +440,9 @@ func Xmknod(t *TLS, pathname uintptr, mode types.Mode_t, dev types.Dev_t) int32 // int link(const char *oldpath, const char *newpath); func Xlink(t *TLS, oldpath, newpath uintptr) int32 { + if __ccgo_strace { + trc("t=%v newpath=%v, (%v:)", t, newpath, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_LINK, oldpath, newpath, 0); err != 0 { // t.setErrno(err) @@ -388,6 +454,9 @@ func Xlink(t *TLS, oldpath, newpath uintptr) int32 { // int pipe(int pipefd[2]); func Xpipe(t *TLS, pipefd uintptr) int32 { + if __ccgo_strace { + trc("t=%v pipefd=%v, (%v:)", t, pipefd, origin(2)) + } panic(todo("")) // if _, _, err := unix.Syscall(unix.SYS_PIPE, pipefd, 0, 0); err != 0 { // t.setErrno(err) @@ -399,6 +468,9 @@ func Xpipe(t *TLS, pipefd uintptr) int32 { // int dup2(int oldfd, int newfd); func Xdup2(t *TLS, oldfd, newfd int32) int32 { + if __ccgo_strace { + trc("t=%v newfd=%v, (%v:)", t, newfd, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0) // if err != 0 { @@ -411,6 +483,9 @@ func Xdup2(t *TLS, oldfd, newfd int32) int32 { // ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsize); func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { + if __ccgo_strace { + trc("t=%v buf=%v bufsize=%v, (%v:)", t, buf, bufsize, origin(2)) + } panic(todo("")) // n, _, err := unix.Syscall(unix.SYS_READLINK, path, buf, uintptr(bufsize)) // if err != 0 { @@ -423,6 +498,9 @@ func Xreadlink(t *TLS, path, buf uintptr, bufsize types.Size_t) types.Ssize_t { // FILE *fopen64(const char *pathname, const char *mode); func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { + if __ccgo_strace { + trc("t=%v mode=%v, (%v:)", t, mode, origin(2)) + } m := strings.ReplaceAll(GoString(mode), "b", "") var flags int @@ -459,42 +537,72 @@ func Xfopen64(t *TLS, pathname, mode uintptr) uintptr { } func Xrecv(t *TLS, sockfd uint64, buf uintptr, len, flags int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v flags=%v, (%v:)", t, sockfd, buf, flags, origin(2)) + } panic(todo("")) } func Xsend(t *TLS, sockfd uint64, buf uintptr, len, flags int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v buf=%v flags=%v, (%v:)", t, sockfd, buf, flags, origin(2)) + } panic(todo("")) } func Xshutdown(t *TLS, sockfd uint64, how int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v how=%v, (%v:)", t, sockfd, how, origin(2)) + } panic(todo("")) } func Xgetpeername(t *TLS, sockfd uint64, addr uintptr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xgetsockname(t *TLS, sockfd uint64, addr, addrlen uintptr) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addrlen=%v, (%v:)", t, sockfd, addrlen, origin(2)) + } panic(todo("")) } func Xsocket(t *TLS, domain, type1, protocol int32) uint64 { + if __ccgo_strace { + trc("t=%v protocol=%v, (%v:)", t, protocol, origin(2)) + } panic(todo("")) } func Xbind(t *TLS, sockfd uint64, addr uintptr, addrlen int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xconnect(t *TLS, sockfd uint64, addr uintptr, addrlen int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } func Xlisten(t *TLS, sockfd uint64, backlog int32) int32 { + if __ccgo_strace { + trc("t=%v sockfd=%v backlog=%v, (%v:)", t, sockfd, backlog, origin(2)) + } panic(todo("")) } func Xaccept(t *TLS, sockfd uint64, addr uintptr, addrlen uintptr) uint64 { + if __ccgo_strace { + trc("t=%v sockfd=%v addr=%v addrlen=%v, (%v:)", t, sockfd, addr, addrlen, origin(2)) + } panic(todo("")) } diff --git a/vendor/modernc.org/libc/mem.go b/vendor/modernc.org/libc/mem.go index 50056c75..bdd14b19 100644 --- a/vendor/modernc.org/libc/mem.go +++ b/vendor/modernc.org/libc/mem.go @@ -21,6 +21,9 @@ var ( // void *malloc(size_t size); func Xmalloc(t *TLS, n types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v n=%v, (%v:)", t, n, origin(2)) + } if n == 0 { return 0 } @@ -40,6 +43,9 @@ func Xmalloc(t *TLS, n types.Size_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v size=%v, (%v:)", t, size, origin(2)) + } rq := int(n * size) if rq == 0 { return 0 @@ -60,6 +66,9 @@ func Xcalloc(t *TLS, n, size types.Size_t) uintptr { // void *realloc(void *ptr, size_t size); func Xrealloc(t *TLS, ptr uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v ptr=%v size=%v, (%v:)", t, ptr, size, origin(2)) + } allocMu.Lock() defer allocMu.Unlock() @@ -75,6 +84,9 @@ func Xrealloc(t *TLS, ptr uintptr, size types.Size_t) uintptr { // void free(void *ptr); func Xfree(t *TLS, p uintptr) { + if __ccgo_strace { + trc("t=%v p=%v, (%v:)", t, p, origin(2)) + } if p == 0 { return } @@ -86,6 +98,22 @@ func Xfree(t *TLS, p uintptr) { allocator.UintptrFree(p) } +func Xmalloc_usable_size(tls *TLS, p uintptr) (r types.Size_t) { + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + defer func() { trc("-> %v", r) }() + } + if p == 0 { + return 0 + } + + allocMu.Lock() + + defer allocMu.Unlock() + + return types.Size_t(memory.UintptrUsableSize(p)) +} + func UsableSize(p uintptr) types.Size_t { allocMu.Lock() diff --git a/vendor/modernc.org/libc/mem_brk.go b/vendor/modernc.org/libc/mem_brk.go index 00f35043..7b3c2ea5 100644 --- a/vendor/modernc.org/libc/mem_brk.go +++ b/vendor/modernc.org/libc/mem_brk.go @@ -32,6 +32,9 @@ var ( // void *malloc(size_t size); func Xmalloc(t *TLS, n types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v n=%v, (%v:)", t, n, origin(2)) + } if n == 0 { return 0 } @@ -54,11 +57,17 @@ func Xmalloc(t *TLS, n types.Size_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v size=%v, (%v:)", t, size, origin(2)) + } return Xmalloc(t, n*size) } // void *realloc(void *ptr, size_t size); func Xrealloc(t *TLS, ptr uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v ptr=%v size=%v, (%v:)", t, ptr, size, origin(2)) + } switch { case ptr != 0 && size != 0: p := Xmalloc(t, size) @@ -74,7 +83,12 @@ func Xrealloc(t *TLS, ptr uintptr, size types.Size_t) uintptr { } // void free(void *ptr); -func Xfree(t *TLS, p uintptr) {} + +func Xfree(t *TLS, p uintptr) { + if __ccgo_strace { + trc("t=%v p=%v, (%v:)", t, p, origin(2)) + } +} func UsableSize(p uintptr) types.Size_t { return types.Size_t(*(*uintptr)(unsafe.Pointer(p - uintptrSize))) diff --git a/vendor/modernc.org/libc/memgrind.go b/vendor/modernc.org/libc/memgrind.go index 70044c07..f09aed89 100644 --- a/vendor/modernc.org/libc/memgrind.go +++ b/vendor/modernc.org/libc/memgrind.go @@ -74,6 +74,9 @@ func pc2origin(pc uintptr) string { // void *malloc(size_t size); func Xmalloc(t *TLS, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v size=%v, (%v:)", t, size, origin(2)) + } if size == 0 { return 0 } @@ -110,6 +113,9 @@ func Xmalloc(t *TLS, size types.Size_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v size=%v, (%v:)", t, size, origin(2)) + } rq := int(n * size) if rq == 0 { return 0 @@ -147,6 +153,9 @@ func Xcalloc(t *TLS, n, size types.Size_t) uintptr { // void *realloc(void *ptr, size_t size); func Xrealloc(t *TLS, ptr uintptr, size types.Size_t) uintptr { + if __ccgo_strace { + trc("t=%v ptr=%v size=%v, (%v:)", t, ptr, size, origin(2)) + } allocMu.Lock() defer allocMu.Unlock() @@ -198,6 +207,9 @@ func Xrealloc(t *TLS, ptr uintptr, size types.Size_t) uintptr { // void free(void *ptr); func Xfree(t *TLS, p uintptr) { + if __ccgo_strace { + trc("t=%v p=%v, (%v:)", t, p, origin(2)) + } if p == 0 { return } diff --git a/vendor/modernc.org/libc/musl_darwin_amd64.go b/vendor/modernc.org/libc/musl_darwin_amd64.go index 350e8def..e0333fa3 100644 --- a/vendor/modernc.org/libc/musl_darwin_amd64.go +++ b/vendor/modernc.org/libc/musl_darwin_amd64.go @@ -459,6 +459,9 @@ type _RuneLocale = struct { } /* table.c:1616:3 */ func X__istype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1670:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v _f=%v, (%v:)", tls, _c, _f, origin(2)) + } return func() int32 { if Xisascii(tls, _c) != 0 { @@ -470,6 +473,9 @@ func X__istype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1670:1: */ } func X__isctype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1681:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v _f=%v, (%v:)", tls, _c, _f, origin(2)) + } if _c < 0 || _c >= int32(1)<<8 { return 0 @@ -479,6 +485,9 @@ func X__isctype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1681:1: */ } func X__wcwidth(tls *TLS, _c int32) int32 { /* table.c:1700:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } var _x uint32 if _c == 0 { @@ -497,90 +506,156 @@ func X__wcwidth(tls *TLS, _c int32) int32 { /* table.c:1700:1: */ } func Xisalnum(tls *TLS, _c int32) int32 { /* table.c:1718:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000100|0x00000400)) } func Xisalpha(tls *TLS, _c int32) int32 { /* table.c:1724:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000100)) } func Xisblank(tls *TLS, _c int32) int32 { /* table.c:1730:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00020000)) } func Xiscntrl(tls *TLS, _c int32) int32 { /* table.c:1736:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000200)) } func Xisdigit(tls *TLS, _c int32) int32 { /* table.c:1743:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__isctype(tls, _c, uint64(0x00000400)) } func Xisgraph(tls *TLS, _c int32) int32 { /* table.c:1749:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000800)) } func Xislower(tls *TLS, _c int32) int32 { /* table.c:1755:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00001000)) } func Xisprint(tls *TLS, _c int32) int32 { /* table.c:1761:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00040000)) } func Xispunct(tls *TLS, _c int32) int32 { /* table.c:1767:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00002000)) } func Xisupper(tls *TLS, _c int32) int32 { /* table.c:1779:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00008000)) } func Xisxdigit(tls *TLS, _c int32) int32 { /* table.c:1786:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__isctype(tls, _c, uint64(0x00010000)) } func Xtoascii(tls *TLS, _c int32) int32 { /* table.c:1792:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return _c & 0x7F } func Xdigittoint(tls *TLS, _c int32) int32 { /* table.c:1811:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__maskrune(tls, _c, uint64(0x0F)) } func Xishexnumber(tls *TLS, _c int32) int32 { /* table.c:1817:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00010000)) } func Xisideogram(tls *TLS, _c int32) int32 { /* table.c:1823:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00080000)) } func Xisnumber(tls *TLS, _c int32) int32 { /* table.c:1829:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000400)) } func Xisphonogram(tls *TLS, _c int32) int32 { /* table.c:1835:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00200000)) } func Xisrune(tls *TLS, _c int32) int32 { /* table.c:1841:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0xFFFFFFF0)) } func Xisspecial(tls *TLS, _c int32) int32 { /* table.c:1847:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00100000)) } func X__maskrune(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1871:2: */ + if __ccgo_strace { + trc("tls=%v _c=%v _f=%v, (%v:)", tls, _c, _f, origin(2)) + } return int32(uint32(int32(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&X_DefaultRuneLocale)) + 60 + uintptr(_c&0xff)*4)))) & uint32(_f)) } func X__toupper(tls *TLS, c int32) int32 { /* table.c:1876:20: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Xtoupper(tls, c) } func X__tolower(tls *TLS, c int32) int32 { /* table.c:1878:20: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Xtolower(tls, c) } @@ -670,6 +745,9 @@ type gid_t = uint32 /* alltypes.h:250:18 */ type useconds_t = uint32 /* alltypes.h:260:18 */ func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */ + if __ccgo_strace { + trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2)) + } var i size_t var newenv uintptr var tmp uintptr @@ -750,6 +828,9 @@ oom: var _soldenv uintptr /* putenv.c:22:14: */ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, s, '=')) - int64(s)) / 1) if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) { return Xunsetenv(tls, s) @@ -758,6 +839,9 @@ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ } func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */ + if __ccgo_strace { + trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2)) + } //TODO for (size_t i=0; i < env_alloced_n; i++) var i size_t = uint64(0) for ; i < _senv_alloced_n; i++ { @@ -784,6 +868,9 @@ var _senv_alloced uintptr /* setenv.c:7:14: */ var _senv_alloced_n size_t /* setenv.c:8:16: */ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ + if __ccgo_strace { + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) + } var s uintptr var l1 size_t var l2 size_t @@ -808,6 +895,9 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* } func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, name, '=')) - int64(name)) / 1) if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 { *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 @@ -1549,6 +1639,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1726,6 +1819,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -2031,6 +2127,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE)(unsafe.Pointer(f)).Fbuf) - int64((*FILE)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -2042,6 +2141,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE)(unsafe.Pointer(f)).Frpos)-int64((*FILE)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -2103,10 +2205,16 @@ type lconv = struct { var posix_lconv = lconv{Fdecimal_point: ts + 23, Fthousands_sep: ts + 13, Fgrouping: ts + 13, Fint_curr_symbol: ts + 13, Fcurrency_symbol: ts + 13, Fmon_decimal_point: ts + 13, Fmon_thousands_sep: ts + 13, Fmon_grouping: ts + 13, Fpositive_sign: ts + 13, Fnegative_sign: ts + 13, Fint_frac_digits: Int8FromInt32(255), Ffrac_digits: Int8FromInt32(255), Fp_cs_precedes: Int8FromInt32(255), Fp_sep_by_space: Int8FromInt32(255), Fn_cs_precedes: Int8FromInt32(255), Fn_sep_by_space: Int8FromInt32(255), Fp_sign_posn: Int8FromInt32(255), Fn_sign_posn: Int8FromInt32(255), Fint_p_cs_precedes: Int8FromInt32(255), Fint_p_sep_by_space: Int8FromInt32(255), Fint_n_cs_precedes: Int8FromInt32(255), Fint_n_sep_by_space: Int8FromInt32(255), Fint_p_sign_posn: Int8FromInt32(255), Fint_n_sign_posn: Int8FromInt32(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2131,6 +2239,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -2159,28 +2270,46 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2210,6 +2339,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2246,6 +2378,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2558,6 +2693,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -2693,6 +2831,9 @@ type __ptcb = struct { } /* pthread.h:206:1 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2897,6 +3038,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2923,6 +3067,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -3008,10 +3155,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -3038,6 +3191,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3424,6 +3580,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -3524,10 +3683,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -3579,6 +3744,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3653,6 +3821,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3750,6 +3921,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -4072,6 +4246,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -4238,6 +4415,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4371,10 +4551,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -4394,6 +4580,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -4402,6 +4591,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4416,6 +4608,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -4458,14 +4653,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4487,26 +4691,44 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } @@ -4520,6 +4742,9 @@ func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strto // from SUS and have nothing to do with the host system. func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } c = int32(uint8(c)) if !(c != 0) { return s + uintptr(Xstrlen(tls, s)) @@ -4540,6 +4765,9 @@ func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: * } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -4549,6 +4777,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -4566,6 +4797,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -4637,6 +4871,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -4659,10 +4896,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*int8)(unsafe.Pointer(s)) != 0 { @@ -4674,6 +4917,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -4682,6 +4928,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -4705,6 +4954,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } diff --git a/vendor/modernc.org/libc/musl_darwin_arm64.go b/vendor/modernc.org/libc/musl_darwin_arm64.go index e6fc642a..65b8c536 100644 --- a/vendor/modernc.org/libc/musl_darwin_arm64.go +++ b/vendor/modernc.org/libc/musl_darwin_arm64.go @@ -459,6 +459,9 @@ type _RuneLocale = struct { } /* table.c:1616:3 */ func X__istype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1670:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v _f=%v, (%v:)", tls, _c, _f, origin(2)) + } return func() int32 { if Xisascii(tls, _c) != 0 { @@ -470,6 +473,9 @@ func X__istype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1670:1: */ } func X__isctype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1681:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v _f=%v, (%v:)", tls, _c, _f, origin(2)) + } if _c < 0 || _c >= int32(1)<<8 { return 0 @@ -479,6 +485,9 @@ func X__isctype(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1681:1: */ } func X__wcwidth(tls *TLS, _c int32) int32 { /* table.c:1700:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } var _x uint32 if _c == 0 { @@ -497,90 +506,156 @@ func X__wcwidth(tls *TLS, _c int32) int32 { /* table.c:1700:1: */ } func Xisalnum(tls *TLS, _c int32) int32 { /* table.c:1718:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000100|0x00000400)) } func Xisalpha(tls *TLS, _c int32) int32 { /* table.c:1724:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000100)) } func Xisblank(tls *TLS, _c int32) int32 { /* table.c:1730:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00020000)) } func Xiscntrl(tls *TLS, _c int32) int32 { /* table.c:1736:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000200)) } func Xisdigit(tls *TLS, _c int32) int32 { /* table.c:1743:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__isctype(tls, _c, uint64(0x00000400)) } func Xisgraph(tls *TLS, _c int32) int32 { /* table.c:1749:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000800)) } func Xislower(tls *TLS, _c int32) int32 { /* table.c:1755:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00001000)) } func Xisprint(tls *TLS, _c int32) int32 { /* table.c:1761:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00040000)) } func Xispunct(tls *TLS, _c int32) int32 { /* table.c:1767:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00002000)) } func Xisupper(tls *TLS, _c int32) int32 { /* table.c:1779:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00008000)) } func Xisxdigit(tls *TLS, _c int32) int32 { /* table.c:1786:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__isctype(tls, _c, uint64(0x00010000)) } func Xtoascii(tls *TLS, _c int32) int32 { /* table.c:1792:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return _c & 0x7F } func Xdigittoint(tls *TLS, _c int32) int32 { /* table.c:1811:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__maskrune(tls, _c, uint64(0x0F)) } func Xishexnumber(tls *TLS, _c int32) int32 { /* table.c:1817:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00010000)) } func Xisideogram(tls *TLS, _c int32) int32 { /* table.c:1823:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00080000)) } func Xisnumber(tls *TLS, _c int32) int32 { /* table.c:1829:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00000400)) } func Xisphonogram(tls *TLS, _c int32) int32 { /* table.c:1835:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00200000)) } func Xisrune(tls *TLS, _c int32) int32 { /* table.c:1841:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0xFFFFFFF0)) } func Xisspecial(tls *TLS, _c int32) int32 { /* table.c:1847:1: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return X__istype(tls, _c, uint64(0x00100000)) } func X__maskrune(tls *TLS, _c int32, _f uint64) int32 { /* table.c:1871:2: */ + if __ccgo_strace { + trc("tls=%v _c=%v _f=%v, (%v:)", tls, _c, _f, origin(2)) + } return int32(uint32(int32(*(*uint32)(unsafe.Pointer(uintptr(unsafe.Pointer(&X_DefaultRuneLocale)) + 60 + uintptr(_c&0xff)*4)))) & uint32(_f)) } func X__toupper(tls *TLS, c int32) int32 { /* table.c:1876:20: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Xtoupper(tls, c) } func X__tolower(tls *TLS, c int32) int32 { /* table.c:1878:20: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Xtolower(tls, c) } @@ -670,6 +745,9 @@ type gid_t = uint32 /* alltypes.h:258:18 */ type useconds_t = uint32 /* alltypes.h:268:18 */ func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */ + if __ccgo_strace { + trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2)) + } var i size_t var newenv uintptr var tmp uintptr @@ -750,6 +828,9 @@ oom: var _soldenv uintptr /* putenv.c:22:14: */ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, s, '=')) - int64(s)) / 1) if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) { return Xunsetenv(tls, s) @@ -758,6 +839,9 @@ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ } func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */ + if __ccgo_strace { + trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2)) + } //TODO for (size_t i=0; i < env_alloced_n; i++) var i size_t = uint64(0) for ; i < _senv_alloced_n; i++ { @@ -784,6 +868,9 @@ var _senv_alloced uintptr /* setenv.c:7:14: */ var _senv_alloced_n size_t /* setenv.c:8:16: */ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ + if __ccgo_strace { + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) + } var s uintptr var l1 size_t var l2 size_t @@ -808,6 +895,9 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* } func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, name, '=')) - int64(name)) / 1) if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 { *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 @@ -1549,6 +1639,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1726,6 +1819,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -2031,6 +2127,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE)(unsafe.Pointer(f)).Fbuf) - int64((*FILE)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -2042,6 +2141,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE)(unsafe.Pointer(f)).Frpos)-int64((*FILE)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -2103,10 +2205,16 @@ type lconv = struct { var posix_lconv = lconv{Fdecimal_point: ts + 23, Fthousands_sep: ts + 13, Fgrouping: ts + 13, Fint_curr_symbol: ts + 13, Fcurrency_symbol: ts + 13, Fmon_decimal_point: ts + 13, Fmon_thousands_sep: ts + 13, Fmon_grouping: ts + 13, Fpositive_sign: ts + 13, Fnegative_sign: ts + 13, Fint_frac_digits: Int8FromInt32(255), Ffrac_digits: Int8FromInt32(255), Fp_cs_precedes: Int8FromInt32(255), Fp_sep_by_space: Int8FromInt32(255), Fn_cs_precedes: Int8FromInt32(255), Fn_sep_by_space: Int8FromInt32(255), Fp_sign_posn: Int8FromInt32(255), Fn_sign_posn: Int8FromInt32(255), Fint_p_cs_precedes: Int8FromInt32(255), Fint_p_sep_by_space: Int8FromInt32(255), Fint_n_cs_precedes: Int8FromInt32(255), Fint_n_sep_by_space: Int8FromInt32(255), Fint_p_sign_posn: Int8FromInt32(255), Fint_n_sign_posn: Int8FromInt32(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2131,6 +2239,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -2159,28 +2270,46 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2210,6 +2339,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2246,6 +2378,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2558,6 +2693,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -2693,6 +2831,9 @@ type __ptcb = struct { } /* pthread.h:206:1 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2897,6 +3038,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2923,6 +3067,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -3008,10 +3155,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -3038,6 +3191,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3424,6 +3580,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -3524,10 +3683,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -3579,6 +3744,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3653,6 +3821,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3750,6 +3921,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -4072,6 +4246,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -4238,6 +4415,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4371,10 +4551,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -4394,6 +4580,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -4402,6 +4591,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4416,6 +4608,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -4458,14 +4653,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4487,26 +4691,44 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } @@ -4520,6 +4742,9 @@ func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strto // from SUS and have nothing to do with the host system. func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } c = int32(uint8(c)) if !(c != 0) { return s + uintptr(Xstrlen(tls, s)) @@ -4540,6 +4765,9 @@ func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: * } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -4549,6 +4777,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -4566,6 +4797,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -4637,6 +4871,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -4659,10 +4896,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*int8)(unsafe.Pointer(s)) != 0 { @@ -4674,6 +4917,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -4682,6 +4928,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -4705,6 +4954,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } diff --git a/vendor/modernc.org/libc/musl_freebsd_386.go b/vendor/modernc.org/libc/musl_freebsd_386.go index a7fc3180..80883cf7 100644 --- a/vendor/modernc.org/libc/musl_freebsd_386.go +++ b/vendor/modernc.org/libc/musl_freebsd_386.go @@ -3319,6 +3319,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:366:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -3333,58 +3336,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -3394,6 +3439,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -4113,6 +4161,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -4290,6 +4341,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -4595,6 +4649,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = off_t((int32((*FILE)(unsafe.Pointer(f)).Fbuf) - int32((*FILE)(unsafe.Pointer(f)).Frpos)) / 1) // If lim is nonzero, rend must be a valid pointer. @@ -4606,6 +4663,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + off_t((int32((*FILE)(unsafe.Pointer(f)).Frpos)-int32((*FILE)(unsafe.Pointer(f)).Fbuf))/1) if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -4632,20 +4692,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4675,6 +4747,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4711,6 +4786,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -5029,6 +5107,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = size_t(1) __1: @@ -5139,6 +5220,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:283:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -5338,6 +5422,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -5364,10 +5451,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -5394,6 +5487,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -5772,10 +5868,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(20) defer tls.Free(20) @@ -5827,6 +5929,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -5901,6 +6006,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -5998,6 +6106,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(88) defer tls.Free(88) @@ -6317,6 +6428,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -6483,6 +6597,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -6608,6 +6725,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 72)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -6627,6 +6747,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -6635,6 +6758,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -6649,6 +6775,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > size_t(0) { @@ -6691,14 +6820,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6720,30 +6858,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint32 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint32(strtox1(tls, s, p, base, uint64(2*uint32(0x7fffffff)+uint32(1)))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int32 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int32(strtox1(tls, s, p, base, uint64(0+Uint32FromInt32(Int32(-Int32(0x7fffffff))-Int32FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoll(tls, s, p, base) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoull(tls, s, p, base) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { @@ -6753,6 +6912,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint32((int32(p) - int32(s)) / 1) @@ -6761,6 +6923,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_freebsd_amd64.go b/vendor/modernc.org/libc/musl_freebsd_amd64.go index ae1a70af..a301e3a3 100644 --- a/vendor/modernc.org/libc/musl_freebsd_amd64.go +++ b/vendor/modernc.org/libc/musl_freebsd_amd64.go @@ -3323,6 +3323,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -3337,58 +3340,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -3398,6 +3443,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -4119,6 +4167,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -4296,6 +4347,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -4601,6 +4655,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE)(unsafe.Pointer(f)).Fbuf) - int64((*FILE)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -4612,6 +4669,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE)(unsafe.Pointer(f)).Frpos)-int64((*FILE)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -4638,20 +4698,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4681,6 +4753,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4717,6 +4792,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -5048,6 +5126,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -5185,6 +5266,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:260:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -5389,6 +5473,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5415,10 +5502,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5445,6 +5538,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -5833,10 +5929,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -5888,6 +5990,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -5962,6 +6067,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -6059,6 +6167,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -6381,6 +6492,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -6547,6 +6661,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -6672,6 +6789,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -6691,6 +6811,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -6699,6 +6822,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -6713,6 +6839,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6755,14 +6884,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6784,30 +6922,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6817,6 +6976,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6825,6 +6987,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_freebsd_arm.go b/vendor/modernc.org/libc/musl_freebsd_arm.go index d444461d..cb4f02d9 100644 --- a/vendor/modernc.org/libc/musl_freebsd_arm.go +++ b/vendor/modernc.org/libc/musl_freebsd_arm.go @@ -3319,6 +3319,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:336:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -3333,58 +3336,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -3394,6 +3439,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -4115,6 +4163,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -4292,6 +4343,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -4597,6 +4651,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = off_t((int32((*FILE)(unsafe.Pointer(f)).Fbuf) - int32((*FILE)(unsafe.Pointer(f)).Frpos)) / 1) // If lim is nonzero, rend must be a valid pointer. @@ -4608,6 +4665,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + off_t((int32((*FILE)(unsafe.Pointer(f)).Frpos)-int32((*FILE)(unsafe.Pointer(f)).Fbuf))/1) if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -4634,20 +4694,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4677,6 +4749,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4713,6 +4788,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -5031,6 +5109,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = size_t(1) __1: @@ -5141,6 +5222,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:253:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -5340,6 +5424,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -5366,10 +5453,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -5396,6 +5489,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -5774,10 +5870,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(20) defer tls.Free(20) @@ -5829,6 +5931,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -5903,6 +6008,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -6000,6 +6108,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(88) defer tls.Free(88) @@ -6321,6 +6432,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -6487,6 +6601,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -6612,6 +6729,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 72)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -6631,6 +6751,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -6639,6 +6762,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -6653,6 +6779,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > size_t(0) { @@ -6695,14 +6824,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6724,30 +6862,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint32 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint32(strtox1(tls, s, p, base, uint64(2*uint32(0x7fffffff)+uint32(1)))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int32 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int32(strtox1(tls, s, p, base, uint64(0+Uint32FromInt32(Int32(-Int32(0x7fffffff))-Int32FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoll(tls, s, p, base) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoull(tls, s, p, base) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { @@ -6757,6 +6916,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint32((int32(p) - int32(s)) / 1) @@ -6765,6 +6927,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_freebsd_arm64.go b/vendor/modernc.org/libc/musl_freebsd_arm64.go index ae1a70af..a301e3a3 100644 --- a/vendor/modernc.org/libc/musl_freebsd_arm64.go +++ b/vendor/modernc.org/libc/musl_freebsd_arm64.go @@ -3323,6 +3323,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -3337,58 +3340,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -3398,6 +3443,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -4119,6 +4167,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -4296,6 +4347,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -4601,6 +4655,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE)(unsafe.Pointer(f)).Fbuf) - int64((*FILE)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -4612,6 +4669,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE)(unsafe.Pointer(f)).Frpos)-int64((*FILE)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -4638,20 +4698,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4681,6 +4753,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4717,6 +4792,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -5048,6 +5126,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -5185,6 +5266,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:260:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -5389,6 +5473,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5415,10 +5502,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5445,6 +5538,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -5833,10 +5929,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -5888,6 +5990,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -5962,6 +6067,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -6059,6 +6167,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -6381,6 +6492,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -6547,6 +6661,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -6672,6 +6789,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -6691,6 +6811,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -6699,6 +6822,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -6713,6 +6839,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6755,14 +6884,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6784,30 +6922,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6817,6 +6976,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6825,6 +6987,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_linux_386.go b/vendor/modernc.org/libc/musl_linux_386.go index 3b730c21..3fc9b3ba 100644 --- a/vendor/modernc.org/libc/musl_linux_386.go +++ b/vendor/modernc.org/libc/musl_linux_386.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:366:9 */ type locale_t = uintptr /* alltypes.h:366:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -569,6 +617,9 @@ type f_owner_ex = struct { type syscall_arg_t = int32 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -591,6 +642,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]int8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1350,6 +1404,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1527,6 +1584,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1832,6 +1892,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = off_t((int32((*FILE)(unsafe.Pointer(f)).buf) - int32((*FILE)(unsafe.Pointer(f)).rpos)) / 1) // If lim is nonzero, rend must be a valid pointer. @@ -1843,6 +1906,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + off_t((int32((*FILE)(unsafe.Pointer(f)).rpos)-int32((*FILE)(unsafe.Pointer(f)).buf))/1) if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1904,10 +1970,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: Int8FromInt32(255), frac_digits: Int8FromInt32(255), p_cs_precedes: Int8FromInt32(255), p_sep_by_space: Int8FromInt32(255), n_cs_precedes: Int8FromInt32(255), n_sep_by_space: Int8FromInt32(255), p_sign_posn: Int8FromInt32(255), n_sign_posn: Int8FromInt32(255), int_p_cs_precedes: Int8FromInt32(255), int_p_sep_by_space: Int8FromInt32(255), int_n_cs_precedes: Int8FromInt32(255), int_n_sep_by_space: Int8FromInt32(255), int_p_sign_posn: Int8FromInt32(255), int_n_sign_posn: Int8FromInt32(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1932,6 +2004,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1956,28 +2031,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2007,6 +2100,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2043,6 +2139,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3360,6 +3459,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:360:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3483,6 +3585,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3772,6 +3877,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = size_t(1) __1: @@ -3796,6 +3904,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -3995,6 +4106,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -4021,6 +4135,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4106,10 +4223,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -4136,6 +4259,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4227,6 +4353,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4516,6 +4645,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4616,10 +4748,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(20) defer tls.Free(20) @@ -4671,6 +4809,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4745,6 +4886,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4842,6 +4986,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(88) defer tls.Free(88) @@ -5151,6 +5298,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5317,6 +5467,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -5450,10 +5603,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5472,12 +5631,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+76, 0)&0x40000000 != 0 { __wake(tls, f+76, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 72)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5497,6 +5662,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5505,6 +5673,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5519,6 +5690,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5568,6 +5742,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6443,6 +6620,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(136) defer tls.Free(136) @@ -6453,6 +6633,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > size_t(0) { @@ -6495,14 +6678,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6524,30 +6716,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint32 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint32(strtox1(tls, s, p, base, uint64(2*uint32(0x7fffffff)+uint32(1)))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int32 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int32(strtox1(tls, s, p, base, uint64(0+Uint32FromInt32(Int32(-Int32(0x7fffffff))-Int32FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoll(tls, s, p, base) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoull(tls, s, p, base) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { @@ -6557,6 +6770,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6574,6 +6790,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6645,6 +6864,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint32(&n, 1)) != 0) { @@ -6667,10 +6889,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*int8)(unsafe.Pointer(s)) != 0 { @@ -6682,6 +6910,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint32((int32(p) - int32(s)) / 1) @@ -6690,6 +6921,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6713,6 +6947,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6732,10 +6969,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 3*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 3*4)) return 0 } @@ -6822,6 +7065,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6838,6 +7084,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6846,6 +7095,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6861,15 +7113,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_amd64.go b/vendor/modernc.org/libc/musl_linux_amd64.go index 7921d992..c65a060c 100644 --- a/vendor/modernc.org/libc/musl_linux_amd64.go +++ b/vendor/modernc.org/libc/musl_linux_amd64.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:343:9 */ type locale_t = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,93 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } + return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) +} + +func X__builtin_isprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +531,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +587,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -571,6 +626,9 @@ type f_owner_ex = struct { type syscall_arg_t = int64 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -593,6 +651,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]int8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1356,6 +1417,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1533,6 +1597,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1838,6 +1905,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1849,6 +1919,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1910,10 +1983,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: Int8FromInt32(255), frac_digits: Int8FromInt32(255), p_cs_precedes: Int8FromInt32(255), p_sep_by_space: Int8FromInt32(255), n_cs_precedes: Int8FromInt32(255), n_sep_by_space: Int8FromInt32(255), p_sign_posn: Int8FromInt32(255), n_sign_posn: Int8FromInt32(255), int_p_cs_precedes: Int8FromInt32(255), int_p_sep_by_space: Int8FromInt32(255), int_n_cs_precedes: Int8FromInt32(255), int_n_sep_by_space: Int8FromInt32(255), int_p_sign_posn: Int8FromInt32(255), int_n_sign_posn: Int8FromInt32(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1938,6 +2017,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1962,28 +2044,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2013,6 +2113,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2049,6 +2152,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3386,6 +3492,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:337:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3509,6 +3618,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3811,6 +3923,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -3835,6 +3950,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4039,6 +4157,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4065,6 +4186,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4150,10 +4274,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4180,6 +4310,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4271,6 +4404,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4570,6 +4706,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4670,10 +4809,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -4725,6 +4870,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4799,6 +4947,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4896,6 +5047,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -5206,6 +5360,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5372,6 +5529,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5505,10 +5665,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5527,12 +5693,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+140, 0)&0x40000000 != 0 { __wake(tls, f+140, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5552,6 +5724,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5560,6 +5735,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5574,6 +5752,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5623,6 +5804,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6498,6 +6682,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(232) defer tls.Free(232) @@ -6508,6 +6695,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6550,14 +6740,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6579,30 +6778,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6612,6 +6832,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6629,6 +6852,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6700,6 +6926,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -6722,10 +6951,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*int8)(unsafe.Pointer(s)) != 0 { @@ -6737,6 +6972,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6745,6 +6983,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6768,6 +7009,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6787,10 +7031,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) return 0 } @@ -6877,6 +7127,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6893,6 +7146,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6901,6 +7157,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6916,15 +7175,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_arm.go b/vendor/modernc.org/libc/musl_linux_arm.go index 8d420884..0ac66443 100644 --- a/vendor/modernc.org/libc/musl_linux_arm.go +++ b/vendor/modernc.org/libc/musl_linux_arm.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:336:9 */ type locale_t = uintptr /* alltypes.h:336:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -571,6 +619,9 @@ type f_owner_ex = struct { type syscall_arg_t = int32 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -593,6 +644,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]uint8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1354,6 +1408,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1531,6 +1588,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1836,6 +1896,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = off_t((int32((*FILE)(unsafe.Pointer(f)).buf) - int32((*FILE)(unsafe.Pointer(f)).rpos)) / 1) // If lim is nonzero, rend must be a valid pointer. @@ -1847,6 +1910,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + off_t((int32((*FILE)(unsafe.Pointer(f)).rpos)-int32((*FILE)(unsafe.Pointer(f)).buf))/1) if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1908,10 +1974,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: uint8(255), frac_digits: uint8(255), p_cs_precedes: uint8(255), p_sep_by_space: uint8(255), n_cs_precedes: uint8(255), n_sep_by_space: uint8(255), p_sign_posn: uint8(255), n_sign_posn: uint8(255), int_p_cs_precedes: uint8(255), int_p_sep_by_space: uint8(255), int_n_cs_precedes: uint8(255), int_n_sep_by_space: uint8(255), int_p_sign_posn: uint8(255), int_n_sign_posn: uint8(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1936,6 +2008,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1960,28 +2035,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2011,6 +2104,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2047,6 +2143,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3393,6 +3492,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:330:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3516,6 +3618,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3805,6 +3910,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = size_t(1) __1: @@ -3829,6 +3937,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4028,6 +4139,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -4054,6 +4168,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4139,10 +4256,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -4169,6 +4292,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4260,6 +4386,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4549,6 +4678,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4649,10 +4781,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(20) defer tls.Free(20) @@ -4704,6 +4842,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4778,6 +4919,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4875,6 +5019,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(88) defer tls.Free(88) @@ -5184,6 +5331,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5350,6 +5500,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -5483,10 +5636,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5505,12 +5664,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+76, 0)&0x40000000 != 0 { __wake(tls, f+76, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 72)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5530,6 +5695,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5538,6 +5706,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5552,6 +5723,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5601,6 +5775,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6476,6 +6653,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(144) defer tls.Free(144) @@ -6486,6 +6666,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > size_t(0) { @@ -6528,14 +6711,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6557,30 +6749,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint32 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint32(strtox1(tls, s, p, base, uint64(2*uint32(0x7fffffff)+uint32(1)))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int32 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int32(strtox1(tls, s, p, base, uint64(0+Uint32FromInt32(Int32(-Int32(0x7fffffff))-Int32FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoll(tls, s, p, base) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoull(tls, s, p, base) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { @@ -6590,6 +6803,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6607,6 +6823,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6678,6 +6897,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint32(&n, 1)) != 0) { @@ -6700,10 +6922,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0 { @@ -6715,6 +6943,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint32((int32(p) - int32(s)) / 1) @@ -6723,6 +6954,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6746,6 +6980,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6765,10 +7002,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 3*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 3*4)) return 0 } @@ -6855,6 +7098,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6871,6 +7117,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6879,6 +7128,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6894,15 +7146,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_arm64.go b/vendor/modernc.org/libc/musl_linux_arm64.go index 0e3b64c1..65e3ed7e 100644 --- a/vendor/modernc.org/libc/musl_linux_arm64.go +++ b/vendor/modernc.org/libc/musl_linux_arm64.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:351:9 */ type locale_t = uintptr /* alltypes.h:351:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -571,6 +619,9 @@ type f_owner_ex = struct { type syscall_arg_t = int64 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -593,6 +644,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]uint8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1356,6 +1410,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1533,6 +1590,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1838,6 +1898,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1849,6 +1912,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1910,10 +1976,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: uint8(255), frac_digits: uint8(255), p_cs_precedes: uint8(255), p_sep_by_space: uint8(255), n_cs_precedes: uint8(255), n_sep_by_space: uint8(255), p_sign_posn: uint8(255), n_sign_posn: uint8(255), int_p_cs_precedes: uint8(255), int_p_sep_by_space: uint8(255), int_n_cs_precedes: uint8(255), int_n_sep_by_space: uint8(255), int_p_sign_posn: uint8(255), int_n_sign_posn: uint8(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1938,6 +2010,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1962,28 +2037,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2013,6 +2106,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2049,6 +2145,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3474,6 +3573,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:345:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3597,6 +3699,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3899,6 +4004,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -3923,6 +4031,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4127,6 +4238,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4153,6 +4267,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4238,10 +4355,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4268,6 +4391,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4359,6 +4485,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4658,6 +4787,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4758,10 +4890,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -4813,6 +4951,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4887,6 +5028,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4984,6 +5128,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -5294,6 +5441,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5460,6 +5610,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5593,10 +5746,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5615,12 +5774,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+140, 0)&0x40000000 != 0 { __wake(tls, f+140, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5640,6 +5805,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5648,6 +5816,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5662,6 +5833,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5711,6 +5885,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6586,6 +6763,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(232) defer tls.Free(232) @@ -6596,6 +6776,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6638,14 +6821,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6667,30 +6859,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6700,6 +6913,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6717,6 +6933,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6788,6 +7007,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -6810,10 +7032,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0 { @@ -6825,6 +7053,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6833,6 +7064,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6856,6 +7090,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6875,10 +7112,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) return 0 } @@ -6965,6 +7208,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6981,6 +7227,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6989,6 +7238,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -7004,15 +7256,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_loong64.go b/vendor/modernc.org/libc/musl_linux_loong64.go index 7921d992..9171f999 100644 --- a/vendor/modernc.org/libc/musl_linux_loong64.go +++ b/vendor/modernc.org/libc/musl_linux_loong64.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:343:9 */ type locale_t = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -571,6 +619,9 @@ type f_owner_ex = struct { type syscall_arg_t = int64 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -593,6 +644,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]int8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1356,6 +1410,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1533,6 +1590,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1838,6 +1898,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1849,6 +1912,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1910,10 +1976,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: Int8FromInt32(255), frac_digits: Int8FromInt32(255), p_cs_precedes: Int8FromInt32(255), p_sep_by_space: Int8FromInt32(255), n_cs_precedes: Int8FromInt32(255), n_sep_by_space: Int8FromInt32(255), p_sign_posn: Int8FromInt32(255), n_sign_posn: Int8FromInt32(255), int_p_cs_precedes: Int8FromInt32(255), int_p_sep_by_space: Int8FromInt32(255), int_n_cs_precedes: Int8FromInt32(255), int_n_sep_by_space: Int8FromInt32(255), int_p_sign_posn: Int8FromInt32(255), int_n_sign_posn: Int8FromInt32(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1938,6 +2010,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1962,28 +2037,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2013,6 +2106,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2049,6 +2145,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3386,6 +3485,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:337:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3509,6 +3611,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3811,6 +3916,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -3835,6 +3943,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4039,6 +4150,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4065,6 +4179,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4150,10 +4267,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4180,6 +4303,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4271,6 +4397,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4570,6 +4699,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4670,10 +4802,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -4725,6 +4863,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4799,6 +4940,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4896,6 +5040,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -5206,6 +5353,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5372,6 +5522,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5505,10 +5658,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5527,12 +5686,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+140, 0)&0x40000000 != 0 { __wake(tls, f+140, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5552,6 +5717,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5560,6 +5728,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5574,6 +5745,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5623,6 +5797,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6498,6 +6675,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(232) defer tls.Free(232) @@ -6508,6 +6688,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6550,14 +6733,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6579,30 +6771,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6612,6 +6825,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6629,6 +6845,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6700,6 +6919,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -6722,10 +6944,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*int8)(unsafe.Pointer(s)) != 0 { @@ -6737,6 +6965,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6745,6 +6976,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6768,6 +7002,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6787,10 +7024,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) return 0 } @@ -6877,6 +7120,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6893,6 +7139,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6901,6 +7150,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6916,15 +7168,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_ppc64le.go b/vendor/modernc.org/libc/musl_linux_ppc64le.go index 03045ca5..1f5f7f14 100644 --- a/vendor/modernc.org/libc/musl_linux_ppc64le.go +++ b/vendor/modernc.org/libc/musl_linux_ppc64le.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:335:9 */ type locale_t = uintptr /* alltypes.h:335:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -571,6 +619,9 @@ type f_owner_ex = struct { type syscall_arg_t = int64 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -593,6 +644,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]uint8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1356,6 +1410,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1533,6 +1590,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1838,6 +1898,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1849,6 +1912,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1910,10 +1976,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: uint8(255), frac_digits: uint8(255), p_cs_precedes: uint8(255), p_sep_by_space: uint8(255), n_cs_precedes: uint8(255), n_sep_by_space: uint8(255), p_sign_posn: uint8(255), n_sign_posn: uint8(255), int_p_cs_precedes: uint8(255), int_p_sep_by_space: uint8(255), int_n_cs_precedes: uint8(255), int_n_sep_by_space: uint8(255), int_p_sign_posn: uint8(255), int_n_sign_posn: uint8(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1938,6 +2010,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1962,28 +2037,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2013,6 +2106,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2049,6 +2145,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3458,6 +3557,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:329:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3581,6 +3683,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3883,6 +3988,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -3907,6 +4015,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4111,6 +4222,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4137,6 +4251,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4222,10 +4339,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4252,6 +4375,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4343,6 +4469,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4642,6 +4771,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4742,10 +4874,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -4797,6 +4935,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4871,6 +5012,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4968,6 +5112,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -5278,6 +5425,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5444,6 +5594,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5577,10 +5730,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5599,12 +5758,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+140, 0)&0x40000000 != 0 { __wake(tls, f+140, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5624,6 +5789,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5632,6 +5800,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5646,6 +5817,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5695,6 +5869,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6570,6 +6747,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(232) defer tls.Free(232) @@ -6580,6 +6760,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6622,14 +6805,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6651,30 +6843,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6684,6 +6897,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6701,6 +6917,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6772,6 +6991,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -6794,10 +7016,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0 { @@ -6809,6 +7037,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6817,6 +7048,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6840,6 +7074,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6859,10 +7096,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) return 0 } @@ -6949,6 +7192,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6965,6 +7211,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6973,6 +7222,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6988,15 +7240,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_riscv64.go b/vendor/modernc.org/libc/musl_linux_riscv64.go index 57470023..47141392 100644 --- a/vendor/modernc.org/libc/musl_linux_riscv64.go +++ b/vendor/modernc.org/libc/musl_linux_riscv64.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:341:9 */ type locale_t = uintptr /* alltypes.h:341:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -575,6 +623,9 @@ type f_owner_ex = struct { type syscall_arg_t = int64 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -597,6 +648,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]uint8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1360,6 +1414,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1537,6 +1594,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1842,6 +1902,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1853,6 +1916,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1914,10 +1980,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: uint8(255), frac_digits: uint8(255), p_cs_precedes: uint8(255), p_sep_by_space: uint8(255), n_cs_precedes: uint8(255), n_sep_by_space: uint8(255), p_sign_posn: uint8(255), n_sign_posn: uint8(255), int_p_cs_precedes: uint8(255), int_p_sep_by_space: uint8(255), int_n_cs_precedes: uint8(255), int_n_sep_by_space: uint8(255), int_p_sign_posn: uint8(255), int_n_sign_posn: uint8(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1942,6 +2014,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1966,28 +2041,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2017,6 +2110,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2053,6 +2149,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3443,6 +3542,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:335:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3566,6 +3668,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3868,6 +3973,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -3892,6 +4000,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4096,6 +4207,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4122,6 +4236,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4207,10 +4324,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4237,6 +4360,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4328,6 +4454,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4627,6 +4756,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4727,10 +4859,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -4782,6 +4920,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4856,6 +4997,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4953,6 +5097,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -5263,6 +5410,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5429,6 +5579,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5562,10 +5715,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5584,12 +5743,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+140, 0)&0x40000000 != 0 { __wake(tls, f+140, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5609,6 +5774,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5617,6 +5785,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5631,6 +5802,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5680,6 +5854,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6555,6 +6732,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(232) defer tls.Free(232) @@ -6565,6 +6745,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6607,14 +6790,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6636,30 +6828,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6669,6 +6882,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6686,6 +6902,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6757,6 +6976,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -6779,10 +7001,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0 { @@ -6794,6 +7022,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6802,6 +7033,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6825,6 +7059,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6844,10 +7081,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) return 0 } @@ -6934,6 +7177,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6950,6 +7196,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6958,6 +7207,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6973,15 +7225,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_linux_s390x.go b/vendor/modernc.org/libc/musl_linux_s390x.go index fd790654..25de30f0 100644 --- a/vendor/modernc.org/libc/musl_linux_s390x.go +++ b/vendor/modernc.org/libc/musl_linux_s390x.go @@ -403,6 +403,9 @@ var table = [384]uint16{ var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&ptable)) } @@ -415,6 +418,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:330:9 */ type locale_t = uintptr /* alltypes.h:330:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -429,50 +435,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -482,6 +524,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -535,6 +580,9 @@ type lldiv_t = struct { } /* stdlib.h:64:41 */ func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) Xfree(tls, dir) return ret @@ -571,6 +619,9 @@ type f_owner_ex = struct { type syscall_arg_t = int64 /* syscall.h:22:14 */ func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var fd int32 var dir uintptr @@ -593,6 +644,9 @@ type max_align_t = struct { type dirstream_buf_alignment_check = [1]uint8 /* readdir.c:7:14 */ func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ + if __ccgo_strace { + trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) + } var de uintptr if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { @@ -1356,6 +1410,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1533,6 +1590,9 @@ var table1 = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1838,6 +1898,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).shlim = lim (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1849,6 +1912,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1910,10 +1976,16 @@ type lconv = struct { var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: uint8(255), frac_digits: uint8(255), p_cs_precedes: uint8(255), p_sep_by_space: uint8(255), n_cs_precedes: uint8(255), n_sep_by_space: uint8(255), p_sign_posn: uint8(255), n_sign_posn: uint8(255), int_p_cs_precedes: uint8(255), int_p_sep_by_space: uint8(255), int_n_cs_precedes: uint8(255), int_n_sep_by_space: uint8(255), int_p_sign_posn: uint8(255), int_n_sign_posn: uint8(255)} /* localeconv.c:4:27 */ func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&posix_lconv)) } func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -1938,6 +2010,9 @@ func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ } func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1962,28 +2037,46 @@ func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ } func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return X__fpclassify(tls, x) } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } return X__builtin_nanf(tls, ts+13) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2013,6 +2106,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2049,6 +2145,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -3414,6 +3513,9 @@ type __mbstate_t = struct { type mbstate_t = __mbstate_t /* alltypes.h:324:63 */ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ + if __ccgo_strace { + trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3537,6 +3639,9 @@ ilseq: var _sinternal_state uint32 /* mbrtowc.c:8:18: */ func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) + } return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) } @@ -3839,6 +3944,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -3863,6 +3971,9 @@ __3: } func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -4067,6 +4178,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4093,6 +4207,9 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(28) defer tls.Free(28) @@ -4178,10 +4295,16 @@ func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf } func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4208,6 +4331,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -4299,6 +4425,9 @@ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, } func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ + if __ccgo_strace { + trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) + } return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) } @@ -4598,6 +4727,9 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna } func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ + if __ccgo_strace { + trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) + } bp := tls.Alloc(347) defer tls.Free(347) @@ -4698,10 +4830,16 @@ func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen soc var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -4753,6 +4891,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -4827,6 +4968,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -4924,6 +5068,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -5234,6 +5381,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -5400,6 +5550,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -5533,10 +5686,16 @@ func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ } func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ + if __ccgo_strace { + trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) + } return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) } func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var owner int32 = (*FILE)(unsafe.Pointer(f)).lock var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid if owner&CplInt32(0x40000000) == tid { @@ -5555,12 +5714,18 @@ func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ } func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } if a_swap(tls, f+140, 0)&0x40000000 != 0 { __wake(tls, f+140, 1, 1) } } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { (*struct { @@ -5580,6 +5745,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -5588,6 +5756,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -5602,6 +5773,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) + } var ret int32 var ap va_list _ = ap @@ -5651,6 +5825,9 @@ func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ } func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ + if __ccgo_strace { + trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -6526,6 +6703,9 @@ func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vssca } func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ + if __ccgo_strace { + trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) + } bp := tls.Alloc(232) defer tls.Free(232) @@ -6536,6 +6716,9 @@ func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -6578,14 +6761,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -6607,30 +6799,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -6640,6 +6853,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var l size_t = Xstrnlen(tls, d, n) if l == n { return l + Xstrlen(tls, s) @@ -6657,6 +6873,9 @@ func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4: // from SUS and have nothing to do with the host system. func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var d0 uintptr var wd uintptr var ws uintptr @@ -6728,6 +6947,9 @@ finish: } func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ + if __ccgo_strace { + trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) + } var l uintptr = _l var r uintptr = _r if !(int32(PostDecUint64(&n, 1)) != 0) { @@ -6750,10 +6972,16 @@ __3: } func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ + if __ccgo_strace { + trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) + } return Xstrncasecmp(tls, l, r, n) } func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ + if __ccgo_strace { + trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) + } var a uintptr = d d += uintptr(Xstrlen(tls, d)) for n != 0 && *(*uint8)(unsafe.Pointer(s)) != 0 { @@ -6765,6 +6993,9 @@ func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3 } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -6773,6 +7004,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) @@ -6796,6 +7030,9 @@ func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ } func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ + if __ccgo_strace { + trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) + } if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { return uintptr(0) } @@ -6815,10 +7052,16 @@ func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ var _sp uintptr /* strtok.c:5:14: */ func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return *(*int32)(unsafe.Pointer(a + 6*4)) } func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) return 0 } @@ -6905,6 +7148,9 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* // } func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) } @@ -6921,6 +7167,9 @@ func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_att // } func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) + } if uint32(state) > 1 { return 22 } @@ -6929,6 +7178,9 @@ func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* p } func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ + if __ccgo_strace { + trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) + } return *(*int32)(unsafe.Pointer(m)) & 15 } @@ -6944,15 +7196,24 @@ func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3 // weak_alias(__pthread_mutex_lock, pthread_mutex_lock); func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } return 0 } func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) + } *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} return 0 } func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ + if __ccgo_strace { + trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) + } if uint32(type1) > uint32(2) { return 22 } diff --git a/vendor/modernc.org/libc/musl_netbsd_amd64.go b/vendor/modernc.org/libc/musl_netbsd_amd64.go index b21d3d94..28a98053 100644 --- a/vendor/modernc.org/libc/musl_netbsd_amd64.go +++ b/vendor/modernc.org/libc/musl_netbsd_amd64.go @@ -860,6 +860,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t1 = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -874,30 +877,51 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t1) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t1) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t1) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t1) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } @@ -1615,6 +1639,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1792,6 +1819,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -2097,6 +2127,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE1)(unsafe.Pointer(f)).Fshlim = lim (*FILE1)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE1)(unsafe.Pointer(f)).Fbuf) - int64((*FILE1)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -2108,6 +2141,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE1)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE1)(unsafe.Pointer(f)).Frpos)-int64((*FILE1)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE1)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE1)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -2134,20 +2170,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2177,6 +2225,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2213,6 +2264,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2544,6 +2598,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -2681,6 +2738,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:260:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2885,6 +2945,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2911,10 +2974,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2941,6 +3010,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3329,10 +3401,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -3384,6 +3462,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3458,6 +3539,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3555,6 +3639,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -3877,6 +3964,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -4043,6 +4133,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4168,6 +4261,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE1)(unsafe.Pointer(f)).Fmode - 1 if (*FILE1)(unsafe.Pointer(f)).Fwpos != (*FILE1)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -4187,6 +4283,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -4195,6 +4294,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4209,6 +4311,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -4251,14 +4356,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4280,30 +4394,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -4313,6 +4448,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -4321,6 +4459,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_netbsd_arm.go b/vendor/modernc.org/libc/musl_netbsd_arm.go index 5eea7fb2..cf5de9c8 100644 --- a/vendor/modernc.org/libc/musl_netbsd_arm.go +++ b/vendor/modernc.org/libc/musl_netbsd_arm.go @@ -854,6 +854,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t1 = uintptr /* alltypes.h:336:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -868,30 +871,51 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t1) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t1) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t1) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t1) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } @@ -1611,6 +1635,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1788,6 +1815,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -2093,6 +2123,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t1) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE1)(unsafe.Pointer(f)).Fshlim = lim (*FILE1)(unsafe.Pointer(f)).Fshcnt = off_t1((int32((*FILE1)(unsafe.Pointer(f)).Fbuf) - int32((*FILE1)(unsafe.Pointer(f)).Frpos)) / 1) // If lim is nonzero, rend must be a valid pointer. @@ -2104,6 +2137,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t1) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t1 = (*FILE1)(unsafe.Pointer(f)).Fshcnt + off_t1((int32((*FILE1)(unsafe.Pointer(f)).Frpos)-int32((*FILE1)(unsafe.Pointer(f)).Fbuf))/1) if (*FILE1)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE1)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -2130,20 +2166,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2173,6 +2221,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2209,6 +2260,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2527,6 +2581,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = size_t(1) __1: @@ -2637,6 +2694,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:253:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2836,6 +2896,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -2862,10 +2925,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -2892,6 +2961,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3270,10 +3342,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(20) defer tls.Free(20) @@ -3325,6 +3403,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3399,6 +3480,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3496,6 +3580,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(88) defer tls.Free(88) @@ -3817,6 +3904,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -3983,6 +4073,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -4108,6 +4201,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 72)) |= (*FILE1)(unsafe.Pointer(f)).Fmode - 1 if (*FILE1)(unsafe.Pointer(f)).Fwpos != (*FILE1)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -4127,6 +4223,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -4135,6 +4234,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4149,6 +4251,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > size_t(0) { @@ -4191,14 +4296,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4220,30 +4334,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint32 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint32(strtox1(tls, s, p, base, uint64(2*uint32(0x7fffffff)+uint32(1)))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int32 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int32(strtox1(tls, s, p, base, uint64(0+Uint32FromInt32(Int32(-Int32(0x7fffffff))-Int32FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoll(tls, s, p, base) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoull(tls, s, p, base) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { @@ -4253,6 +4388,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint32((int32(p) - int32(s)) / 1) @@ -4261,6 +4399,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_openbsd_386.go b/vendor/modernc.org/libc/musl_openbsd_386.go index 3bc61739..edc3f1c4 100644 --- a/vendor/modernc.org/libc/musl_openbsd_386.go +++ b/vendor/modernc.org/libc/musl_openbsd_386.go @@ -501,6 +501,9 @@ type wchar_t = int32 /* :15:24 */ // extern __inline __attribute__((__gnu_inline__)) func Xisblank(tls *TLS, _c int32) int32 { /* ctype_.c:144:5: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return Bool32(_c == ' ' || _c == '\t') } @@ -681,6 +684,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:366:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -695,58 +701,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -756,6 +804,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -1475,6 +1526,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1652,6 +1706,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1957,6 +2014,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = off_t((int32((*FILE)(unsafe.Pointer(f)).Fbuf) - int32((*FILE)(unsafe.Pointer(f)).Frpos)) / 1) // If lim is nonzero, rend must be a valid pointer. @@ -1968,6 +2028,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + off_t((int32((*FILE)(unsafe.Pointer(f)).Frpos)-int32((*FILE)(unsafe.Pointer(f)).Fbuf))/1) if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1994,20 +2057,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2037,6 +2112,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2073,6 +2151,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2391,6 +2472,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = size_t(1) __1: @@ -2501,6 +2585,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:283:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2700,6 +2787,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -2726,10 +2816,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -2756,6 +2852,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3134,10 +3233,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(20) defer tls.Free(20) @@ -3189,6 +3294,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3263,6 +3371,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3360,6 +3471,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(88) defer tls.Free(88) @@ -3679,6 +3793,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -3845,6 +3962,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -3970,6 +4090,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 72)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -3989,6 +4112,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -3997,6 +4123,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4011,6 +4140,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > size_t(0) { @@ -4053,14 +4185,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4082,30 +4223,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint32 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint32(strtox1(tls, s, p, base, uint64(2*uint32(0x7fffffff)+uint32(1)))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int32 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int32(strtox1(tls, s, p, base, uint64(0+Uint32FromInt32(Int32(-Int32(0x7fffffff))-Int32FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoll(tls, s, p, base) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return Xstrtoull(tls, s, p, base) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { @@ -4115,6 +4277,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint32((int32(p) - int32(s)) / 1) @@ -4123,6 +4288,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_openbsd_amd64.go b/vendor/modernc.org/libc/musl_openbsd_amd64.go index c0493349..c8abed68 100644 --- a/vendor/modernc.org/libc/musl_openbsd_amd64.go +++ b/vendor/modernc.org/libc/musl_openbsd_amd64.go @@ -501,6 +501,9 @@ type wchar_t = int32 /* :15:24 */ // extern __inline __attribute__((__gnu_inline__)) func Xisblank(tls *TLS, _c int32) int32 { /* ctype_.c:144:5: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return Bool32(_c == ' ' || _c == '\t') } @@ -681,6 +684,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -695,58 +701,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -756,6 +804,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -1477,6 +1528,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1654,6 +1708,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1959,6 +2016,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE)(unsafe.Pointer(f)).Fbuf) - int64((*FILE)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1970,6 +2030,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE)(unsafe.Pointer(f)).Frpos)-int64((*FILE)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1996,20 +2059,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2039,6 +2114,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2075,6 +2153,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2406,6 +2487,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -2543,6 +2627,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:260:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2747,6 +2834,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2773,10 +2863,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2803,6 +2899,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3191,10 +3290,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -3246,6 +3351,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3320,6 +3428,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3417,6 +3528,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -3739,6 +3853,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -3905,6 +4022,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4030,6 +4150,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -4049,6 +4172,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -4057,6 +4183,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4071,6 +4200,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -4113,14 +4245,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4142,30 +4283,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -4175,6 +4337,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -4183,6 +4348,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_openbsd_arm64.go b/vendor/modernc.org/libc/musl_openbsd_arm64.go index ba015fc4..e8f50492 100644 --- a/vendor/modernc.org/libc/musl_openbsd_arm64.go +++ b/vendor/modernc.org/libc/musl_openbsd_arm64.go @@ -501,6 +501,9 @@ type wchar_t = int32 /* :15:24 */ // extern __inline __attribute__((__gnu_inline__)) func Xisblank(tls *TLS, _c int32) int32 { /* ctype_.c:144:5: */ + if __ccgo_strace { + trc("tls=%v _c=%v, (%v:)", tls, _c, origin(2)) + } return Bool32(_c == ' ' || _c == '\t') } @@ -681,6 +684,9 @@ func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ type locale_t = uintptr /* alltypes.h:351:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -695,58 +701,100 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('A') < uint32(26)) } func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisupper(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -756,6 +804,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -1477,6 +1528,9 @@ func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32 } func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ + if __ccgo_strace { + trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) + } var sign int32 = 1 var i size_t var bits int32 @@ -1654,6 +1708,9 @@ var table = [257]uint8{Uint8FromInt32(-1), } /* intscan.c:7:28 */ func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ + if __ccgo_strace { + trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) + } var val uintptr var c int32 var neg int32 @@ -1959,6 +2016,9 @@ __43: // the actual count. func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ + if __ccgo_strace { + trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) + } (*FILE)(unsafe.Pointer(f)).Fshlim = lim (*FILE)(unsafe.Pointer(f)).Fshcnt = (int64((*FILE)(unsafe.Pointer(f)).Fbuf) - int64((*FILE)(unsafe.Pointer(f)).Frpos)) / 1 // If lim is nonzero, rend must be a valid pointer. @@ -1970,6 +2030,9 @@ func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ } func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } var c int32 var cnt off_t = (*FILE)(unsafe.Pointer(f)).Fshcnt + (int64((*FILE)(unsafe.Pointer(f)).Frpos)-int64((*FILE)(unsafe.Pointer(f)).Fbuf))/1 if (*FILE)(unsafe.Pointer(f)).Fshlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).Fshlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { @@ -1996,20 +2059,32 @@ func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ } func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xcopysign(tls, x, y) } func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } return Xfabs(tls, x) } func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + } return Xfmod(tls, x, y) } var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2039,6 +2114,9 @@ func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ } func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2075,6 +2153,9 @@ func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ } func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ + if __ccgo_strace { + trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) + } return Xscalbn(tls, x, n) } @@ -2406,6 +2487,9 @@ type resolvconf = struct { } /* lookup.h:34:1 */ func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ + if __ccgo_strace { + trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) + } var cnt size_t cnt = uint64(1) __1: @@ -2543,6 +2627,9 @@ type __ptcb = struct { type useconds_t = uint32 /* alltypes.h:268:18 */ func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ + if __ccgo_strace { + trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) + } bp := tls.Alloc(1608) defer tls.Free(1608) @@ -2747,6 +2834,9 @@ type mmsghdr = struct { } /* socket.h:63:1 */ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ + if __ccgo_strace { + trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2773,10 +2863,16 @@ func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* get var _sh uintptr /* gethostbyaddr.c:9:24: */ func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } return Xgethostbyname2(tls, name, 2) } func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -2803,6 +2899,9 @@ func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbynam var _sh1 uintptr /* gethostbyname2.c:10:24: */ func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ + if __ccgo_strace { + trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) + } bp := tls.Alloc(1600) defer tls.Free(1600) @@ -3191,10 +3290,16 @@ func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getna var Xh_errno int32 /* h_errno.c:4:5: */ func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } return uintptr(unsafe.Pointer(&Xh_errno)) } func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ + if __ccgo_strace { + trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) + } bp := tls.Alloc(40) defer tls.Free(40) @@ -3246,6 +3351,9 @@ func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5 } func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ + if __ccgo_strace { + trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) + } bp := tls.Alloc(276) defer tls.Free(276) @@ -3320,6 +3428,9 @@ func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ } func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ + if __ccgo_strace { + trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) + } bp := tls.Alloc(16) defer tls.Free(16) @@ -3417,6 +3528,9 @@ func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton. } func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) + } bp := tls.Alloc(96) defer tls.Free(96) @@ -3739,6 +3853,9 @@ func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: } func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) + } bp := tls.Alloc(92) defer tls.Free(92) @@ -3905,6 +4022,9 @@ func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family i } func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ + if __ccgo_strace { + trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) @@ -4030,6 +4150,9 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i } func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).Fmode - 1 if (*FILE)(unsafe.Pointer(f)).Fwpos != (*FILE)(unsafe.Pointer(f)).Fwbase { (*struct { @@ -4049,6 +4172,9 @@ func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ } func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ + if __ccgo_strace { + trc("tls=%v, (%v:)", tls, origin(2)) + } X__builtin_abort(tls) //TODO- // __stdio_exit_needed(); } @@ -4057,6 +4183,9 @@ func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ // data buffered for reading. func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ + if __ccgo_strace { + trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) + } bp := tls.Alloc(1) defer tls.Free(1) @@ -4071,6 +4200,9 @@ func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -4113,14 +4245,23 @@ func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6: } func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return float32(strtox(tls, s, p, 0)) } func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 1) } func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) + } return strtox(tls, s, p, 2) } @@ -4142,30 +4283,51 @@ func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* } func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) } func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) } func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return intmax_t(Xstrtoll(tls, s, p, base)) } func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ + if __ccgo_strace { + trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) + } return uintmax_t(Xstrtoull(tls, s, p, base)) } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { @@ -4175,6 +4337,9 @@ func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ } func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) + } var p uintptr = Xmemchr(tls, s, 0, n) if p != 0 { return uint64((int64(p) - int64(s)) / 1) @@ -4183,6 +4348,9 @@ func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ } func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } bp := tls.Alloc(32) defer tls.Free(32) diff --git a/vendor/modernc.org/libc/musl_windows_386.go b/vendor/modernc.org/libc/musl_windows_386.go index 24c5b240..4b101db7 100644 --- a/vendor/modernc.org/libc/musl_windows_386.go +++ b/vendor/modernc.org/libc/musl_windows_386.go @@ -230,6 +230,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:366:9 */ type locale_t = uintptr /* alltypes.h:366:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -244,50 +247,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -297,6 +336,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -328,6 +370,9 @@ type gid_t = uint32 /* alltypes.h:273:18 */ type useconds_t = uint32 /* alltypes.h:283:18 */ func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */ + if __ccgo_strace { + trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2)) + } var i size_t var newenv uintptr var tmp uintptr @@ -408,6 +453,9 @@ oom: var _soldenv uintptr /* putenv.c:22:14: */ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = size_t((int32(X__strchrnul(tls, s, '=')) - int32(s)) / 1) if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) { return Xunsetenv(tls, s) @@ -416,6 +464,9 @@ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ } func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */ + if __ccgo_strace { + trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2)) + } //TODO for (size_t i=0; i < env_alloced_n; i++) var i size_t = size_t(0) for ; i < _senv_alloced_n; i++ { @@ -442,6 +493,9 @@ var _senv_alloced uintptr /* setenv.c:7:14: */ var _senv_alloced_n size_t /* setenv.c:8:16: */ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ + if __ccgo_strace { + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) + } var s uintptr var l1 size_t var l2 size_t @@ -466,6 +520,9 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* } func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var l size_t = size_t((int32(X__strchrnul(tls, name, '=')) - int32(name)) / 1) if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 { *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 @@ -922,6 +979,9 @@ func __pthread_self(tls *TLS) uintptr { /* pthread_arch.h:1:30: */ } func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v wc=%v st=%v, (%v:)", tls, s, wc, st, origin(2)) + } if !(s != 0) { return size_t(1) } @@ -961,6 +1021,9 @@ func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c } func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { /* wcsrtombs.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v ws=%v n=%v st=%v, (%v:)", tls, s, ws, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1031,6 +1094,9 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { } func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c:4:8: */ + if __ccgo_strace { + trc("tls=%v s=%v ws=%v n=%v, (%v:)", tls, s, ws, n, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) *(*uintptr)(unsafe.Pointer(bp)) = ws @@ -1049,6 +1115,9 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c // from SUS and have nothing to do with the host system. func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } c = int32(uint8(c)) if !(c != 0) { return s + uintptr(Xstrlen(tls, s)) @@ -1069,6 +1138,9 @@ func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: * } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+size_t(1)) if !(d != 0) { diff --git a/vendor/modernc.org/libc/musl_windows_amd64.go b/vendor/modernc.org/libc/musl_windows_amd64.go index d586fb8b..e71c59fa 100644 --- a/vendor/modernc.org/libc/musl_windows_amd64.go +++ b/vendor/modernc.org/libc/musl_windows_amd64.go @@ -230,6 +230,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:343:9 */ type locale_t = uintptr /* alltypes.h:343:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -244,50 +247,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -297,6 +336,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -328,6 +370,9 @@ type gid_t = uint32 /* alltypes.h:250:18 */ type useconds_t = uint32 /* alltypes.h:260:18 */ func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */ + if __ccgo_strace { + trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2)) + } var i size_t var newenv uintptr var tmp uintptr @@ -408,6 +453,9 @@ oom: var _soldenv uintptr /* putenv.c:22:14: */ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, s, '=')) - int64(s)) / 1) if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) { return Xunsetenv(tls, s) @@ -416,6 +464,9 @@ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ } func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */ + if __ccgo_strace { + trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2)) + } //TODO for (size_t i=0; i < env_alloced_n; i++) var i size_t = uint64(0) for ; i < _senv_alloced_n; i++ { @@ -442,6 +493,9 @@ var _senv_alloced uintptr /* setenv.c:7:14: */ var _senv_alloced_n size_t /* setenv.c:8:16: */ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ + if __ccgo_strace { + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) + } var s uintptr var l1 size_t var l2 size_t @@ -466,6 +520,9 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* } func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, name, '=')) - int64(name)) / 1) if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 { *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 @@ -945,6 +1002,9 @@ func __pthread_self(tls *TLS) uintptr { /* pthread_arch.h:1:30: */ } func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v wc=%v st=%v, (%v:)", tls, s, wc, st, origin(2)) + } if !(s != 0) { return uint64(1) } @@ -984,6 +1044,9 @@ func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c } func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { /* wcsrtombs.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v ws=%v n=%v st=%v, (%v:)", tls, s, ws, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1054,6 +1117,9 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { } func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c:4:8: */ + if __ccgo_strace { + trc("tls=%v s=%v ws=%v n=%v, (%v:)", tls, s, ws, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = ws @@ -1063,6 +1129,9 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -1092,6 +1161,9 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp // from SUS and have nothing to do with the host system. func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } c = int32(uint8(c)) if !(c != 0) { return s + uintptr(Xstrlen(tls, s)) @@ -1112,6 +1184,9 @@ func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: * } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { diff --git a/vendor/modernc.org/libc/musl_windows_arm64.go b/vendor/modernc.org/libc/musl_windows_arm64.go index 2804cdc9..f370a01a 100644 --- a/vendor/modernc.org/libc/musl_windows_arm64.go +++ b/vendor/modernc.org/libc/musl_windows_arm64.go @@ -230,6 +230,9 @@ type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:351:9 */ type locale_t = uintptr /* alltypes.h:351:32 */ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisalpha(tls, c) @@ -244,50 +247,86 @@ func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ } func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalnum(tls, c) } func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) } func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisalpha(tls, c) } func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('0') < uint32(10)) } func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisdigit(tls, c) } func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32('a') < uint32(26)) } func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xislower(tls, c) } func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) } func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisprint(tls, c) } func Xisspace(tls *TLS, c int32) int32 { /* isspace.c:4:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(c == ' ' || uint32(c)-uint32('\t') < uint32(5)) } func X__isspace_l(tls *TLS, c int32, l locale_t) int32 { /* isspace.c:9:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisspace(tls, c) } func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ + if __ccgo_strace { + trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) + } return Bool32(func() int32 { if 0 != 0 { return Xisdigit(tls, c) @@ -297,6 +336,9 @@ func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ } func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ + if __ccgo_strace { + trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) + } return Xisxdigit(tls, c) } @@ -328,6 +370,9 @@ type gid_t = uint32 /* alltypes.h:258:18 */ type useconds_t = uint32 /* alltypes.h:268:18 */ func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */ + if __ccgo_strace { + trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2)) + } var i size_t var newenv uintptr var tmp uintptr @@ -408,6 +453,9 @@ oom: var _soldenv uintptr /* putenv.c:22:14: */ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, s, '=')) - int64(s)) / 1) if !(l != 0) || !(int32(*(*int8)(unsafe.Pointer(s + uintptr(l)))) != 0) { return Xunsetenv(tls, s) @@ -416,6 +464,9 @@ func Xputenv(tls *TLS, s uintptr) int32 { /* putenv.c:43:5: */ } func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */ + if __ccgo_strace { + trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2)) + } //TODO for (size_t i=0; i < env_alloced_n; i++) var i size_t = uint64(0) for ; i < _senv_alloced_n; i++ { @@ -442,6 +493,9 @@ var _senv_alloced uintptr /* setenv.c:7:14: */ var _senv_alloced_n size_t /* setenv.c:8:16: */ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ + if __ccgo_strace { + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) + } var s uintptr var l1 size_t var l2 size_t @@ -466,6 +520,9 @@ func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* } func Xunsetenv(tls *TLS, name uintptr) int32 { /* unsetenv.c:9:5: */ + if __ccgo_strace { + trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) + } var l size_t = size_t((int64(X__strchrnul(tls, name, '=')) - int64(name)) / 1) if !(l != 0) || *(*int8)(unsafe.Pointer(name + uintptr(l))) != 0 { *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 @@ -1023,6 +1080,9 @@ func __pthread_self(tls *TLS) uintptr { /* pthread_arch.h:1:30: */ } func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c:6:8: */ + if __ccgo_strace { + trc("tls=%v s=%v wc=%v st=%v, (%v:)", tls, s, wc, st, origin(2)) + } if !(s != 0) { return uint64(1) } @@ -1062,6 +1122,9 @@ func Xwcrtomb(tls *TLS, s uintptr, wc wchar_t, st uintptr) size_t { /* wcrtomb.c } func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { /* wcsrtombs.c:3:8: */ + if __ccgo_strace { + trc("tls=%v s=%v ws=%v n=%v st=%v, (%v:)", tls, s, ws, n, st, origin(2)) + } bp := tls.Alloc(4) defer tls.Free(4) @@ -1132,6 +1195,9 @@ func Xwcsrtombs(tls *TLS, s uintptr, ws uintptr, n size_t, st uintptr) size_t { } func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c:4:8: */ + if __ccgo_strace { + trc("tls=%v s=%v ws=%v n=%v, (%v:)", tls, s, ws, n, origin(2)) + } bp := tls.Alloc(8) defer tls.Free(8) *(*uintptr)(unsafe.Pointer(bp)) = ws @@ -1141,6 +1207,9 @@ func Xwcstombs(tls *TLS, s uintptr, ws uintptr, n size_t) size_t { /* wcstombs.c } func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ + if __ccgo_strace { + trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + } var try uintptr var sign int32 for nel > uint64(0) { @@ -1170,6 +1239,9 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp // from SUS and have nothing to do with the host system. func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } c = int32(uint8(c)) if !(c != 0) { return s + uintptr(Xstrlen(tls, s)) @@ -1190,6 +1262,9 @@ func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: * } func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ + if __ccgo_strace { + trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) + } var l size_t = Xstrlen(tls, s) var d uintptr = Xmalloc(tls, l+uint64(1)) if !(d != 0) { diff --git a/vendor/modernc.org/libc/printf.go b/vendor/modernc.org/libc/printf.go index a26ad40e..d6de15d5 100644 --- a/vendor/modernc.org/libc/printf.go +++ b/vendor/modernc.org/libc/printf.go @@ -141,7 +141,7 @@ more: mod = modNone } switch mod { - case modL, modLL, mod64: + case modL, modLL, mod64, modJ: arg = VaInt64(args) case modH: arg = int64(int16(VaInt32(args))) @@ -149,6 +149,8 @@ more: arg = int64(int8(VaInt32(args))) case mod32, modNone: arg = int64(VaInt32(args)) + case modT: + arg = int64(VaInt64(args)) default: panic(todo("", mod)) } @@ -185,6 +187,8 @@ more: arg = uint64(uint8(VaInt32(args))) case mod32: arg = uint64(VaInt32(args)) + case modZ: + arg = uint64(VaInt64(args)) default: panic(todo("", mod)) } @@ -609,13 +613,18 @@ func parseLengthModifier(format uintptr) (_ uintptr, n int) { n = modLD return format, n case 'j': - panic(todo("")) + format++ + n = modJ + return format, n case 'z': - panic(todo("")) + format++ + return format, modZ case 'Z': - panic(todo("")) + format++ + return format, modCapitalZ case 't': - panic(todo("")) + format++ + return format, modT default: return format, 0 } diff --git a/vendor/modernc.org/libc/pthread.go b/vendor/modernc.org/libc/pthread.go index 06792905..f47156a8 100644 --- a/vendor/modernc.org/libc/pthread.go +++ b/vendor/modernc.org/libc/pthread.go @@ -34,7 +34,9 @@ var ( // Thread local storage. type TLS struct { - errnop uintptr + errnop uintptr + allocaStack [][]uintptr + allocas []uintptr pthreadData stack stackHeader @@ -61,6 +63,39 @@ func newTLS(detached bool) *TLS { return t } +func (t *TLS) alloca(n size_t) (r uintptr) { + r = Xmalloc(t, n) + t.allocas = append(t.allocas, r) + return r +} + +func (t *TLS) FreeAlloca() func() { + t.allocaStack = append(t.allocaStack, t.allocas) + t.allocas = nil + return func() { + for _, v := range t.allocas { + Xfree(t, v) + } + n := len(t.allocaStack) + t.allocas = t.allocaStack[n-1] + t.allocaStack = t.allocaStack[:n-1] + } +} + +func Xalloca(tls *TLS, size size_t) uintptr { + if __ccgo_strace { + trc("tls=%v size=%v, (%v:)", tls, size, origin(2)) + } + return tls.alloca(size) +} + +func X__builtin_alloca(tls *TLS, size size_t) uintptr { + if __ccgo_strace { + trc("tls=%v size=%v, (%v:)", tls, size, origin(2)) + } + return Xalloca(tls, size) +} + // Pthread specific part of a TLS. type pthreadData struct { done chan struct{} @@ -97,11 +132,17 @@ func (d *pthreadData) close(t *TLS) { // int pthread_attr_destroy(pthread_attr_t *attr); func Xpthread_attr_destroy(t *TLS, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } return 0 } // int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope); func Xpthread_attr_setscope(t *TLS, pAttr uintptr, contentionScope int32) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v contentionScope=%v, (%v:)", t, pAttr, contentionScope, origin(2)) + } switch contentionScope { case pthread.PTHREAD_SCOPE_SYSTEM: return 0 @@ -112,6 +153,9 @@ func Xpthread_attr_setscope(t *TLS, pAttr uintptr, contentionScope int32) int32 // int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize); func Xpthread_attr_setstacksize(t *TLS, attr uintptr, stackSize types.Size_t) int32 { + if __ccgo_strace { + trc("t=%v attr=%v stackSize=%v, (%v:)", t, attr, stackSize, origin(2)) + } panic(todo("")) } @@ -161,6 +205,9 @@ func (c *cond) signal(all bool) int32 { // // int pthread_cond_init(pthread_cond_t *restrict cond, const pthread_condattr_t *restrict attr); func Xpthread_cond_init(t *TLS, pCond, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } if pCond == 0 { return errno.EINVAL } @@ -179,6 +226,9 @@ func Xpthread_cond_init(t *TLS, pCond, pAttr uintptr) int32 { // int pthread_cond_destroy(pthread_cond_t *cond); func Xpthread_cond_destroy(t *TLS, pCond uintptr) int32 { + if __ccgo_strace { + trc("t=%v pCond=%v, (%v:)", t, pCond, origin(2)) + } if pCond == 0 { return errno.EINVAL } @@ -206,11 +256,17 @@ func Xpthread_cond_destroy(t *TLS, pCond uintptr) int32 { // int pthread_cond_signal(pthread_cond_t *cond); func Xpthread_cond_signal(t *TLS, pCond uintptr) int32 { + if __ccgo_strace { + trc("t=%v pCond=%v, (%v:)", t, pCond, origin(2)) + } return condSignal(pCond, false) } // int pthread_cond_broadcast(pthread_cond_t *cond); func Xpthread_cond_broadcast(t *TLS, pCond uintptr) int32 { + if __ccgo_strace { + trc("t=%v pCond=%v, (%v:)", t, pCond, origin(2)) + } return condSignal(pCond, true) } @@ -228,6 +284,9 @@ func condSignal(pCond uintptr, all bool) int32 { // int pthread_cond_wait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex); func Xpthread_cond_wait(t *TLS, pCond, pMutex uintptr) int32 { + if __ccgo_strace { + trc("t=%v pMutex=%v, (%v:)", t, pMutex, origin(2)) + } if pCond == 0 { return errno.EINVAL } @@ -257,6 +316,9 @@ func Xpthread_cond_wait(t *TLS, pCond, pMutex uintptr) int32 { // int pthread_cond_timedwait(pthread_cond_t *restrict cond, pthread_mutex_t *restrict mutex, const struct timespec *restrict abstime); func Xpthread_cond_timedwait(t *TLS, pCond, pMutex, pAbsTime uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAbsTime=%v, (%v:)", t, pAbsTime, origin(2)) + } if pCond == 0 { return errno.EINVAL } @@ -428,6 +490,9 @@ func (m *mutex) unlock() int32 { // int pthread_mutex_destroy(pthread_mutex_t *mutex); func Xpthread_mutex_destroy(t *TLS, pMutex uintptr) int32 { + if __ccgo_strace { + trc("t=%v pMutex=%v, (%v:)", t, pMutex, origin(2)) + } mutexesMu.Lock() defer mutexesMu.Unlock() @@ -438,6 +503,9 @@ func Xpthread_mutex_destroy(t *TLS, pMutex uintptr) int32 { // int pthread_mutex_lock(pthread_mutex_t *mutex); func Xpthread_mutex_lock(t *TLS, pMutex uintptr) int32 { + if __ccgo_strace { + trc("t=%v pMutex=%v, (%v:)", t, pMutex, origin(2)) + } mutexesMu.Lock() mu := mutexes[pMutex] if mu == nil { // static initialized mutexes are valid @@ -450,6 +518,9 @@ func Xpthread_mutex_lock(t *TLS, pMutex uintptr) int32 { // int pthread_mutex_trylock(pthread_mutex_t *mutex); func Xpthread_mutex_trylock(t *TLS, pMutex uintptr) int32 { + if __ccgo_strace { + trc("t=%v pMutex=%v, (%v:)", t, pMutex, origin(2)) + } mutexesMu.Lock() mu := mutexes[pMutex] if mu == nil { // static initialized mutexes are valid @@ -462,6 +533,9 @@ func Xpthread_mutex_trylock(t *TLS, pMutex uintptr) int32 { // int pthread_mutex_unlock(pthread_mutex_t *mutex); func Xpthread_mutex_unlock(t *TLS, pMutex uintptr) int32 { + if __ccgo_strace { + trc("t=%v pMutex=%v, (%v:)", t, pMutex, origin(2)) + } mutexesMu.Lock() defer mutexesMu.Unlock() @@ -486,6 +560,9 @@ func Xpthread_key_create(t *TLS, pKey, destructor uintptr) int32 { // int pthread_key_delete(pthread_key_t key); func Xpthread_key_delete(t *TLS, key pthread.Pthread_key_t) int32 { + if __ccgo_strace { + trc("t=%v key=%v, (%v:)", t, key, origin(2)) + } if _, ok := t.kv[key]; ok { delete(t.kv, key) return 0 @@ -497,11 +574,17 @@ func Xpthread_key_delete(t *TLS, key pthread.Pthread_key_t) int32 { // void *pthread_getspecific(pthread_key_t key); func Xpthread_getspecific(t *TLS, key pthread.Pthread_key_t) uintptr { + if __ccgo_strace { + trc("t=%v key=%v, (%v:)", t, key, origin(2)) + } return t.kv[key] } // int pthread_setspecific(pthread_key_t key, const void *value); func Xpthread_setspecific(t *TLS, key pthread.Pthread_key_t, value uintptr) int32 { + if __ccgo_strace { + trc("t=%v key=%v value=%v, (%v:)", t, key, value, origin(2)) + } if t.kv == nil { t.kv = map[pthread.Pthread_key_t]uintptr{} } @@ -511,6 +594,9 @@ func Xpthread_setspecific(t *TLS, key pthread.Pthread_key_t, value uintptr) int3 // int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg); func Xpthread_create(t *TLS, pThread, pAttr, startRoutine, arg uintptr) int32 { + if __ccgo_strace { + trc("t=%v arg=%v, (%v:)", t, arg, origin(2)) + } fn := (*struct { f func(*TLS, uintptr) uintptr })(unsafe.Pointer(&struct{ uintptr }{startRoutine})).f @@ -527,6 +613,9 @@ func Xpthread_create(t *TLS, pThread, pAttr, startRoutine, arg uintptr) int32 { // int pthread_detach(pthread_t thread); func Xpthread_detach(t *TLS, thread pthread.Pthread_t) int32 { + if __ccgo_strace { + trc("t=%v thread=%v, (%v:)", t, thread, origin(2)) + } threadsMu.Lock() threads[int32(thread)].detached = true threadsMu.Unlock() @@ -535,11 +624,17 @@ func Xpthread_detach(t *TLS, thread pthread.Pthread_t) int32 { // int pthread_equal(pthread_t t1, pthread_t t2); func Xpthread_equal(t *TLS, t1, t2 pthread.Pthread_t) int32 { + if __ccgo_strace { + trc("t=%v t2=%v, (%v:)", t, t2, origin(2)) + } return Bool32(t1 == t2) } // void pthread_exit(void *value_ptr); func Xpthread_exit(t *TLS, value uintptr) { + if __ccgo_strace { + trc("t=%v value=%v, (%v:)", t, value, origin(2)) + } t.retVal = value // At thread exit, if a key value has a non-NULL destructor pointer, and the @@ -576,6 +671,9 @@ func Xpthread_exit(t *TLS, value uintptr) { // int pthread_join(pthread_t thread, void **value_ptr); func Xpthread_join(t *TLS, thread pthread.Pthread_t, pValue uintptr) int32 { + if __ccgo_strace { + trc("t=%v thread=%v pValue=%v, (%v:)", t, thread, pValue, origin(2)) + } threadsMu.Lock() tls := threads[int32(thread)] delete(threads, int32(thread)) @@ -589,5 +687,8 @@ func Xpthread_join(t *TLS, thread pthread.Pthread_t, pValue uintptr) int32 { // pthread_t pthread_self(void); func Xpthread_self(t *TLS) pthread.Pthread_t { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } return pthread.Pthread_t(t.ID) } diff --git a/vendor/modernc.org/libc/pthread_all.go b/vendor/modernc.org/libc/pthread_all.go index 4e2b7f10..2b23b585 100644 --- a/vendor/modernc.org/libc/pthread_all.go +++ b/vendor/modernc.org/libc/pthread_all.go @@ -15,6 +15,9 @@ import ( // int pthread_attr_init(pthread_attr_t *attr); func Xpthread_attr_init(t *TLS, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } *(*pthread.Pthread_attr_t)(unsafe.Pointer(pAttr)) = pthread.Pthread_attr_t{} return 0 } @@ -31,6 +34,9 @@ func Xpthread_attr_init(t *TLS, pAttr uintptr) int32 { // // int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr); func Xpthread_mutex_init(t *TLS, pMutex, pAttr uintptr) int32 { + if __ccgo_strace { + trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) + } typ := pthread.PTHREAD_MUTEX_DEFAULT if pAttr != 0 { typ = int(X__ccgo_pthreadMutexattrGettype(t, pAttr)) diff --git a/vendor/modernc.org/libc/straceoff.go b/vendor/modernc.org/libc/straceoff.go new file mode 100644 index 00000000..f955d54b --- /dev/null +++ b/vendor/modernc.org/libc/straceoff.go @@ -0,0 +1,10 @@ +// Copyright 2023 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !libc.strace +// +build !libc.strace + +package libc // import "modernc.org/libc" + +const __ccgo_strace = false diff --git a/vendor/modernc.org/libc/straceon.go b/vendor/modernc.org/libc/straceon.go new file mode 100644 index 00000000..ac8c73fb --- /dev/null +++ b/vendor/modernc.org/libc/straceon.go @@ -0,0 +1,10 @@ +// Copyright 2023 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build libc.strace +// +build libc.strace + +package libc // import "modernc.org/libc" + +const __ccgo_strace = true diff --git a/vendor/modernc.org/libc/sync.go b/vendor/modernc.org/libc/sync.go index f4f91f6c..28f2bb4b 100644 --- a/vendor/modernc.org/libc/sync.go +++ b/vendor/modernc.org/libc/sync.go @@ -12,6 +12,9 @@ var __sync_synchronize_dummy int32 // __sync_synchronize(); func X__sync_synchronize(t *TLS) { + if __ccgo_strace { + trc("t=%v, (%v:)", t, origin(2)) + } // Attempt to implement a full memory barrier without assembler. atomic.StoreInt32(&__sync_synchronize_dummy, atomic.LoadInt32(&__sync_synchronize_dummy)+1) } diff --git a/vendor/modernc.org/libc/time/time_linux_amd64.go b/vendor/modernc.org/libc/time/time_linux_amd64.go index e7f73f0d..1e08a9c9 100644 --- a/vendor/modernc.org/libc/time/time_linux_amd64.go +++ b/vendor/modernc.org/libc/time/time_linux_amd64.go @@ -61,6 +61,9 @@ const ( X_T_SIZE_ = 0 // stddef.h:185:1: Linux = 1 // :231:1: Unix = 1 // :177:1: + + // #define CLOCKS_PER_SEC ((__clock_t) 1000000) + CLOCKS_PER_SEC = 1000000 ) type Ptrdiff_t = int64 /* :3:26 */ diff --git a/vendor/modernc.org/memory/memory.go b/vendor/modernc.org/memory/memory.go index bbfaffcf..c6d02df8 100644 --- a/vendor/modernc.org/memory/memory.go +++ b/vendor/modernc.org/memory/memory.go @@ -4,118 +4,53 @@ // Package memory implements a memory allocator. // -// Build status +// # Build status // // available at https://modern-c.appspot.com/-/builder/?importpath=modernc.org%2fmemory // -// Changelog +// # Changelog // // 2017-10-03 Added alternative, unsafe.Pointer-based API. // // Package memory implements a memory allocator. // -// Changelog +// # Changelog // // 2017-10-03 Added alternative, unsafe.Pointer-based API. // -// Benchmarks +// # Benchmarks // -// AMD Ryzen 9 3900X 12-Core Processor × 24 -// -// jnml@3900x:~/src/modernc.org/memory$ date ; go version ; go test -run @ -bench . -benchmem |& tee log -// Fri Nov 20 17:23:04 CET 2020 -// go version go1.15.5 linux/amd64 -// goos: linux -// goarch: amd64 -// pkg: modernc.org/memory -// BenchmarkFree16-24 141188362 8.26 ns/op 0 B/op 0 allocs/op -// BenchmarkFree32-24 100000000 11.4 ns/op 0 B/op 0 allocs/op -// BenchmarkFree64-24 67160647 18.3 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc16-24 60612698 19.8 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc32-24 47968105 23.8 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc64-24 40752181 28.6 ns/op 0 B/op 0 allocs/op -// BenchmarkGoCalloc16-24 66487354 17.8 ns/op 16 B/op 1 allocs/op -// BenchmarkGoCalloc32-24 56009206 21.2 ns/op 32 B/op 1 allocs/op -// BenchmarkGoCalloc64-24 52086571 23.4 ns/op 64 B/op 1 allocs/op -// BenchmarkMalloc16-24 113943390 10.2 ns/op 0 B/op 0 allocs/op -// BenchmarkMalloc32-24 113520471 10.2 ns/op 0 B/op 0 allocs/op -// BenchmarkMalloc64-24 108787056 10.7 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree16-24 146110286 7.94 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree32-24 93052707 12.0 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree64-24 69805262 17.3 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc16-24 85282725 13.7 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc32-24 66489789 17.9 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc64-24 53561092 22.7 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc16-24 222978858 5.28 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc32-24 210443384 5.30 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc64-24 213706227 5.47 ns/op 0 B/op 0 allocs/op -// PASS -// ok modernc.org/memory 70.528s -// jnml@3900x:~/src/modernc.org/memory$ -// -// Intel® Core™ i5-4670 CPU @ 3.40GHz × 4 -// -// ==== jnml@4670:~/src/modernc.org/memory> date ; go version ; go test -run @ -bench . -benchmem |& tee log -// Sat Dec 8 12:56:53 CET 2018 -// go version go1.11.2 linux/amd64 -// goos: linux -// goarch: amd64 -// pkg: modernc.org/memory -// BenchmarkFree16-4 100000000 14.7 ns/op 0 B/op 0 allocs/op -// BenchmarkFree32-4 100000000 20.5 ns/op 0 B/op 0 allocs/op -// BenchmarkFree64-4 50000000 32.8 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc16-4 50000000 24.4 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc32-4 50000000 29.2 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc64-4 50000000 35.7 ns/op 0 B/op 0 allocs/op -// BenchmarkGoCalloc16-4 50000000 27.0 ns/op 16 B/op 1 allocs/op -// BenchmarkGoCalloc32-4 50000000 27.3 ns/op 32 B/op 1 allocs/op -// BenchmarkGoCalloc64-4 30000000 37.9 ns/op 64 B/op 1 allocs/op -// BenchmarkMalloc16-4 100000000 12.9 ns/op 0 B/op 0 allocs/op -// BenchmarkMalloc32-4 100000000 12.9 ns/op 0 B/op 0 allocs/op -// BenchmarkMalloc64-4 100000000 13.2 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree16-4 100000000 12.0 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree32-4 100000000 17.5 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree64-4 50000000 28.9 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc16-4 100000000 17.8 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc32-4 100000000 22.9 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc64-4 50000000 29.6 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc16-4 200000000 7.31 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc32-4 200000000 7.47 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc64-4 200000000 7.68 ns/op 0 B/op 0 allocs/op -// PASS -// ok modernc.org/memory 73.859s -// // -// Intel® Xeon(R) CPU E5-1650 v2 @ 3.50GHz × 12 -// -// ==== jnml@e5-1650:~/src/modernc.org/memory> date ; go version ; go test -run @ -bench . -benchmem -// Fri Dec 7 14:18:50 CET 2018 -// go version go1.11.2 linux/amd64 -// goos: linux -// goarch: amd64 -// pkg: modernc.org/memory -// BenchmarkFree16-12 100000000 16.7 ns/op 0 B/op 0 allocs/op -// BenchmarkFree32-12 50000000 25.0 ns/op 0 B/op 0 allocs/op -// BenchmarkFree64-12 30000000 39.7 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc16-12 50000000 26.3 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc32-12 50000000 33.4 ns/op 0 B/op 0 allocs/op -// BenchmarkCalloc64-12 30000000 38.3 ns/op 0 B/op 0 allocs/op -// BenchmarkGoCalloc16-12 50000000 26.6 ns/op 16 B/op 1 allocs/op -// BenchmarkGoCalloc32-12 50000000 26.8 ns/op 32 B/op 1 allocs/op -// BenchmarkGoCalloc64-12 30000000 35.1 ns/op 64 B/op 1 allocs/op -// BenchmarkMalloc16-12 100000000 13.5 ns/op 0 B/op 0 allocs/op -// BenchmarkMalloc32-12 100000000 13.4 ns/op 0 B/op 0 allocs/op -// BenchmarkMalloc64-12 100000000 14.1 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree16-12 100000000 14.4 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree32-12 100000000 21.7 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrFree64-12 50000000 36.7 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc16-12 100000000 20.4 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc32-12 50000000 27.1 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrCalloc64-12 50000000 33.4 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc16-12 200000000 8.02 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc32-12 200000000 8.28 ns/op 0 B/op 0 allocs/op -// BenchmarkUintptrMalloc64-12 200000000 8.29 ns/op 0 B/op 0 allocs/op -// PASS -// ok modernc.org/memory 80.896s +// jnml@3900x:~/src/modernc.org/memory$ date ; go version ; go test -run @ -bench . -benchmem |& tee log +// Mon Sep 25 16:02:02 CEST 2023 +// go version go1.21.1 linux/amd64 +// goos: linux +// goarch: amd64 +// pkg: modernc.org/memory +// cpu: AMD Ryzen 9 3900X 12-Core Processor +// BenchmarkFree16-24 123506772 9.802 ns/op 0 B/op 0 allocs/op +// BenchmarkFree32-24 73853230 15.08 ns/op 0 B/op 0 allocs/op +// BenchmarkFree64-24 43070334 25.15 ns/op 0 B/op 0 allocs/op +// BenchmarkCalloc16-24 59353304 18.92 ns/op 0 B/op 0 allocs/op +// BenchmarkCalloc32-24 39415004 29.00 ns/op 0 B/op 0 allocs/op +// BenchmarkCalloc64-24 35825725 32.02 ns/op 0 B/op 0 allocs/op +// BenchmarkGoCalloc16-24 38274313 26.99 ns/op 16 B/op 1 allocs/op +// BenchmarkGoCalloc32-24 44590477 33.06 ns/op 32 B/op 1 allocs/op +// BenchmarkGoCalloc64-24 44233016 37.20 ns/op 64 B/op 1 allocs/op +// BenchmarkMalloc16-24 145736911 7.720 ns/op 0 B/op 0 allocs/op +// BenchmarkMalloc32-24 128898334 7.887 ns/op 0 B/op 0 allocs/op +// BenchmarkMalloc64-24 149569483 7.994 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrFree16-24 117043012 9.205 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrFree32-24 77399617 14.20 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrFree64-24 48770785 25.04 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrCalloc16-24 79257636 15.44 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrCalloc32-24 49644562 23.62 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrCalloc64-24 39854710 28.22 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrMalloc16-24 252987727 4.525 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrMalloc32-24 241423840 4.433 ns/op 0 B/op 0 allocs/op +// BenchmarkUintptrMalloc64-24 256450324 4.669 ns/op 0 B/op 0 allocs/op +// PASS +// ok modernc.org/memory 93.178s +// jnml@3900x:~/src/modernc.org/memory$ package memory // import "modernc.org/memory" import ( @@ -370,7 +305,7 @@ func (a *Allocator) UintptrRealloc(p uintptr, size int) (r uintptr, err error) { } us := UintptrUsableSize(p) - if us > size { + if us >= size { return p, nil } diff --git a/vendor/modernc.org/sqlite/AUTHORS b/vendor/modernc.org/sqlite/AUTHORS index c3925152..e724f81c 100644 --- a/vendor/modernc.org/sqlite/AUTHORS +++ b/vendor/modernc.org/sqlite/AUTHORS @@ -17,9 +17,11 @@ FerretDB Inc. Jaap Aarts Jan Mercl <0xjnml@gmail.com> Josh Bleecher Snyder +Josh Klein Logan Snow Michael Hoffmann Michael Rykov Ross Light Saed SayedAhmed Steffen Butzer +W. Michael Petullo diff --git a/vendor/modernc.org/sqlite/CONTRIBUTORS b/vendor/modernc.org/sqlite/CONTRIBUTORS index 8e196430..ba51f056 100644 --- a/vendor/modernc.org/sqlite/CONTRIBUTORS +++ b/vendor/modernc.org/sqlite/CONTRIBUTORS @@ -19,7 +19,9 @@ Gleb Sakhnov Jaap Aarts Jan Mercl <0xjnml@gmail.com> Josh Bleecher Snyder +Josh Klein Logan Snow +Mark Summerfield Matthew Gabeler-Lee Michael Hoffmann Michael Rykov @@ -28,4 +30,5 @@ Ross Light Saed SayedAhmed Sean McGivern Steffen Butzer +W. Michael Petullo Yaacov Akiba Slama diff --git a/vendor/modernc.org/sqlite/sqlite.go b/vendor/modernc.org/sqlite/sqlite.go index c2439078..ec5b2c0f 100644 --- a/vendor/modernc.org/sqlite/sqlite.go +++ b/vendor/modernc.org/sqlite/sqlite.go @@ -1540,6 +1540,91 @@ func (c *conn) createFunctionInternal(fun *userDefinedFunction) error { return nil } +type collation struct { + zName uintptr + pApp uintptr + enc int32 +} + +// RegisterCollationUtf8 makes a Go function available as a collation named zName. +// impl receives two UTF-8 strings: left and right. +// The result needs to be: +// +// - 0 if left == right +// - 1 if left < right +// - +1 if left > right +// +// impl must always return the same result given the same inputs. +// Additionally, it must have the following properties for all strings A, B and C: +// - if A==B, then B==A +// - if A==B and B==C, then A==C +// - if AA +// - if A 0: + return 1 + default: + // Should never hit here, make the compiler happy + return 0 + } +} + // C documentation // // int sqlite3_limit(sqlite3*, int id, int newVal); diff --git a/vendor/modules.txt b/vendor/modules.txt index b1980583..be0a0d6f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -12,8 +12,8 @@ github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer github.com/Microsoft/go-winio/pkg/guid -# github.com/aws/aws-sdk-go-v2 v1.20.1 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2 v1.22.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2 github.com/aws/aws-sdk-go-v2/aws github.com/aws/aws-sdk-go-v2/aws/defaults @@ -35,11 +35,11 @@ github.com/aws/aws-sdk-go-v2/internal/shareddefaults github.com/aws/aws-sdk-go-v2/internal/strings github.com/aws/aws-sdk-go-v2/internal/sync/singleflight github.com/aws/aws-sdk-go-v2/internal/timeconv -# github.com/aws/aws-sdk-go-v2/config v1.18.33 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/config v1.22.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/config -# github.com/aws/aws-sdk-go-v2/credentials v1.13.32 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/credentials v1.15.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/credentials github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds github.com/aws/aws-sdk-go-v2/credentials/endpointcreds @@ -47,44 +47,44 @@ github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client github.com/aws/aws-sdk-go-v2/credentials/processcreds github.com/aws/aws-sdk-go-v2/credentials/ssocreds github.com/aws/aws-sdk-go-v2/credentials/stscreds -# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.8 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/feature/ec2/imds github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config -# github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.38 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/configsources -# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.32 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 -# github.com/aws/aws-sdk-go-v2/internal/ini v1.3.39 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/internal/ini -# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.32 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/internal/presigned-url -# github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.20.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.23.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/secretsmanager github.com/aws/aws-sdk-go-v2/service/secretsmanager/internal/endpoints github.com/aws/aws-sdk-go-v2/service/secretsmanager/types -# github.com/aws/aws-sdk-go-v2/service/sso v1.13.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sso github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sso/types -# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.15.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/ssooidc github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints github.com/aws/aws-sdk-go-v2/service/ssooidc/types -# github.com/aws/aws-sdk-go-v2/service/sts v1.21.2 -## explicit; go 1.15 +# github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 +## explicit; go 1.19 github.com/aws/aws-sdk-go-v2/service/sts github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints github.com/aws/aws-sdk-go-v2/service/sts/types -# github.com/aws/smithy-go v1.14.1 -## explicit; go 1.15 +# github.com/aws/smithy-go v1.16.0 +## explicit; go 1.19 github.com/aws/smithy-go github.com/aws/smithy-go/auth/bearer github.com/aws/smithy-go/context @@ -178,8 +178,8 @@ github.com/go-jose/go-jose/v3/jwt # github.com/go-pkgz/fileutils v0.2.0 ## explicit; go 1.19 github.com/go-pkgz/fileutils -# github.com/go-pkgz/lgr v0.11.0 -## explicit; go 1.19 +# github.com/go-pkgz/lgr v0.11.1 +## explicit; go 1.20 github.com/go-pkgz/lgr # github.com/go-pkgz/stringutils v1.1.0 ## explicit; go 1.20 @@ -200,7 +200,7 @@ github.com/golang/protobuf/ptypes github.com/golang/protobuf/ptypes/any github.com/golang/protobuf/ptypes/duration github.com/golang/protobuf/ptypes/timestamp -# github.com/google/uuid v1.3.0 +# github.com/google/uuid v1.4.0 ## explicit github.com/google/uuid # github.com/hashicorp/errwrap v1.1.0 @@ -218,14 +218,14 @@ github.com/hashicorp/go-retryablehttp # github.com/hashicorp/go-rootcerts v1.0.2 ## explicit; go 1.12 github.com/hashicorp/go-rootcerts -# github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 -## explicit; go 1.16 +# github.com/hashicorp/go-secure-stdlib/parseutil v0.1.8 +## explicit; go 1.20 github.com/hashicorp/go-secure-stdlib/parseutil # github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 ## explicit; go 1.16 github.com/hashicorp/go-secure-stdlib/strutil -# github.com/hashicorp/go-sockaddr v1.0.2 -## explicit +# github.com/hashicorp/go-sockaddr v1.0.5 +## explicit; go 1.19 github.com/hashicorp/go-sockaddr # github.com/hashicorp/hcl v1.0.0 ## explicit @@ -238,7 +238,7 @@ github.com/hashicorp/hcl/hcl/token github.com/hashicorp/hcl/json/parser github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token -# github.com/hashicorp/vault/api v1.9.2 +# github.com/hashicorp/vault/api v1.10.0 ## explicit; go 1.19 github.com/hashicorp/vault/api # github.com/jessevdk/go-flags v1.5.0 @@ -272,7 +272,7 @@ github.com/magiconair/properties # github.com/mattn/go-colorable v0.1.13 ## explicit; go 1.15 github.com/mattn/go-colorable -# github.com/mattn/go-isatty v0.0.19 +# github.com/mattn/go-isatty v0.0.20 ## explicit; go 1.15 github.com/mattn/go-isatty # github.com/mitchellh/go-homedir v1.1.0 @@ -304,7 +304,7 @@ github.com/opencontainers/image-spec/specs-go/v1 # github.com/opencontainers/runc v1.1.8 ## explicit; go 1.17 github.com/opencontainers/runc/libcontainer/user -# github.com/pelletier/go-toml/v2 v2.0.9 +# github.com/pelletier/go-toml/v2 v2.1.0 ## explicit; go 1.16 github.com/pelletier/go-toml/v2 github.com/pelletier/go-toml/v2/internal/characters @@ -314,7 +314,7 @@ github.com/pelletier/go-toml/v2/unstable # github.com/pkg/errors v0.9.1 ## explicit github.com/pkg/errors -# github.com/pkg/sftp v1.13.5 +# github.com/pkg/sftp v1.13.6 ## explicit; go 1.15 github.com/pkg/sftp github.com/pkg/sftp/internal/encoding/ssh/filexfer @@ -366,8 +366,8 @@ golang.org/x/crypto/ssh/internal/bcrypt_pbkdf ## explicit; go 1.20 golang.org/x/exp/constraints golang.org/x/exp/slices -# golang.org/x/mod v0.12.0 -## explicit; go 1.17 +# golang.org/x/mod v0.14.0 +## explicit; go 1.18 golang.org/x/mod/semver # golang.org/x/net v0.17.0 ## explicit; go 1.17 @@ -377,22 +377,22 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/socks golang.org/x/net/proxy -# golang.org/x/sys v0.13.0 -## explicit; go 1.17 +# golang.org/x/sys v0.14.0 +## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/execabs golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/text v0.13.0 -## explicit; go 1.17 +# golang.org/x/text v0.14.0 +## explicit; go 1.18 golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.3.0 -## explicit +# golang.org/x/time v0.4.0 +## explicit; go 1.18 golang.org/x/time/rate -# golang.org/x/tools v0.12.0 +# golang.org/x/tools v0.14.0 ## explicit; go 1.18 golang.org/x/tools/cmd/stringer golang.org/x/tools/go/gcexportdata @@ -469,11 +469,11 @@ lukechampine.com/uint128 # modernc.org/cc/v3 v3.41.0 ## explicit; go 1.17 modernc.org/cc/v3 -# modernc.org/ccgo/v3 v3.16.14 +# modernc.org/ccgo/v3 v3.16.15 ## explicit; go 1.18 modernc.org/ccgo/v3/lib -# modernc.org/libc v1.24.1 -## explicit; go 1.18 +# modernc.org/libc v1.30.0 +## explicit; go 1.20 modernc.org/libc modernc.org/libc/errno modernc.org/libc/fcntl @@ -503,17 +503,17 @@ modernc.org/libc/wctype # modernc.org/mathutil v1.6.0 ## explicit; go 1.18 modernc.org/mathutil -# modernc.org/memory v1.6.0 +# modernc.org/memory v1.7.2 ## explicit; go 1.18 modernc.org/memory # modernc.org/opt v0.1.3 ## explicit; go 1.13 modernc.org/opt -# modernc.org/sqlite v1.25.0 -## explicit; go 1.18 +# modernc.org/sqlite v1.27.0 +## explicit; go 1.19 modernc.org/sqlite modernc.org/sqlite/lib -# modernc.org/strutil v1.1.3 +# modernc.org/strutil v1.2.0 ## explicit; go 1.18 modernc.org/strutil # modernc.org/token v1.1.0