Merge pull request #5326 from kolyshkin/1.5-5312

[1.5] deps: bump to go-criu v8.3.0, drop google protobuf
This commit is contained in:
Akihiro Suda
2026-06-19 01:37:32 +09:00
committed by GitHub
243 changed files with 16652 additions and 38674 deletions
+3 -3
View File
@@ -3,7 +3,7 @@ module github.com/opencontainers/runc
go 1.25.0
require (
github.com/checkpoint-restore/go-criu/v7 v7.2.0
github.com/checkpoint-restore/go-criu/v8 v8.3.0
github.com/containerd/console v1.0.5
github.com/coreos/go-systemd/v22 v22.7.0
github.com/cyphar/filepath-securejoin v0.6.1
@@ -24,12 +24,12 @@ require (
github.com/vishvananda/netlink v1.3.1
github.com/vishvananda/netns v0.0.5
golang.org/x/net v0.50.0
golang.org/x/sys v0.41.0
google.golang.org/protobuf v1.36.11
golang.org/x/sys v0.46.0
)
require (
cyphar.com/go-pathrs v0.2.4 // indirect
github.com/aperturerobotics/protobuf-go-lite v0.14.0 // indirect
github.com/cilium/ebpf v0.17.3 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
+6 -6
View File
@@ -1,8 +1,10 @@
cyphar.com/go-pathrs v0.2.4 h1:iD/mge36swa1UFKdINkr1Frkpp6wZsy3YYEildj9cLY=
cyphar.com/go-pathrs v0.2.4/go.mod h1:y8f1EMG7r+hCuFf/rXsKqMJrJAUoADZGNh5/vZPKcGc=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/checkpoint-restore/go-criu/v7 v7.2.0 h1:qGiWA4App1gGlEfIJ68WR9jbezV9J7yZdjzglezcqKo=
github.com/checkpoint-restore/go-criu/v7 v7.2.0/go.mod h1:u0LCWLg0w4yqqu14aXhiB4YD3a1qd8EcCEg7vda5dwo=
github.com/aperturerobotics/protobuf-go-lite v0.14.0 h1:6YhovtoUZtXgXLHZ2VV2GCYUzFfi8UN6172Vl2flNlE=
github.com/aperturerobotics/protobuf-go-lite v0.14.0/go.mod h1:lGH3s5ArCTXKI4wJdlNpaybUtwSjfAG0vdWjxOfMcF8=
github.com/checkpoint-restore/go-criu/v8 v8.3.0 h1:UC3Ioay1OMN2Wg33U53enRoG2701vJ9Y2Ex4APmC52w=
github.com/checkpoint-restore/go-criu/v8 v8.3.0/go.mod h1:33d6FwGJGwnzKVvaO0SxlN0tPSuArKU9X/inD/L7/qA=
github.com/cilium/ebpf v0.17.3 h1:FnP4r16PWYSE4ux6zN+//jMcW4nMVRvuTLVTvCjyyjg=
github.com/cilium/ebpf v0.17.3/go.mod h1:G5EDHij8yiLzaqn0WjyfJHvRa+3aDlReIaLVRMvOyJk=
github.com/containerd/console v1.0.5 h1:R0ymNeydRqH2DmakFNdmjR2k0t7UPuiOV/N/27/qqsc=
@@ -87,10 +89,8 @@ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw=
golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+75 -73
View File
@@ -17,12 +17,11 @@ import (
"time"
"unicode"
"github.com/checkpoint-restore/go-criu/v7"
criurpc "github.com/checkpoint-restore/go-criu/v7/rpc"
"github.com/checkpoint-restore/go-criu/v8"
criurpc "github.com/checkpoint-restore/go-criu/v8/rpc"
securejoin "github.com/cyphar/filepath-securejoin"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
"google.golang.org/protobuf/proto"
"github.com/opencontainers/cgroups"
"github.com/opencontainers/runc/internal/cmsg"
@@ -110,14 +109,17 @@ func (c *Container) checkCriuVersion(minVersion int) error {
const descriptorsFilename = "descriptors.json"
// TODO: replace with new(v) once Go < 1.26 is not supported.
func mkPtr[T any](v T) *T { return &v }
func (c *Container) addCriuDumpMount(req *criurpc.CriuReq, m *configs.Mount) {
mountDest := strings.TrimPrefix(m.Destination, c.config.Rootfs)
if dest, err := securejoin.SecureJoin(c.config.Rootfs, mountDest); err == nil {
mountDest = dest[len(c.config.Rootfs):]
}
extMnt := &criurpc.ExtMountMap{
Key: proto.String(mountDest),
Val: proto.String(mountDest),
Key: mkPtr(mountDest),
Val: mkPtr(mountDest),
}
req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
}
@@ -136,8 +138,8 @@ func (c *Container) addMaskPaths(req *criurpc.CriuReq) error {
}
extMnt := &criurpc.ExtMountMap{
Key: proto.String(path),
Val: proto.String("/dev/null"),
Key: mkPtr(path),
Val: mkPtr("/dev/null"),
}
req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
}
@@ -157,7 +159,7 @@ func (c *Container) handleCriuConfigurationFile(rpcOpts *criurpc.CriuOpts) {
// configuration file. If the file does not exist, CRIU
// will just ignore it.
if configFile != "" {
rpcOpts.ConfigFile = proto.String(configFile)
rpcOpts.ConfigFile = mkPtr(configFile)
}
// If 'org.criu.config' exists and is set to an empty
// string, a runc specific CRIU configuration file will
@@ -165,7 +167,7 @@ func (c *Container) handleCriuConfigurationFile(rpcOpts *criurpc.CriuOpts) {
} else {
// If the mentioned annotation has not been found, specify
// a default CRIU configuration file.
rpcOpts.ConfigFile = proto.String("/etc/criu/runc.conf")
rpcOpts.ConfigFile = mkPtr("/etc/criu/runc.conf")
}
}
@@ -252,8 +254,8 @@ func (c *Container) handleRestoringNamespaces(rpcOpts *criurpc.CriuOpts, extraFi
// CRIU will issue a warning for NEWUSER:
// criu/namespaces.c: 'join-ns with user-namespace is not fully tested and dangerous'
rpcOpts.JoinNs = append(rpcOpts.JoinNs, &criurpc.JoinNamespace{
Ns: proto.String(configs.NsName(ns.Type)),
NsFile: proto.String(nsPath),
Ns: mkPtr(configs.NsName(ns.Type)),
NsFile: mkPtr(nsPath),
})
}
}
@@ -280,10 +282,10 @@ func (c *Container) handleRestoringExternalNamespaces(rpcOpts *criurpc.CriuOpts,
return fmt.Errorf("Requested network namespace %v does not exist", nsPath)
}
inheritFd := &criurpc.InheritFd{
Key: proto.String(criuNsToKey(t)),
Key: mkPtr(criuNsToKey(t)),
// The offset of four is necessary because 0, 1, 2 and 3 are
// already used by stdin, stdout, stderr, 'criu swrk' socket.
Fd: proto.Int32(int32(4 + len(*extraFiles))),
Fd: mkPtr(int32(4 + len(*extraFiles))),
}
rpcOpts.InheritFd = append(rpcOpts.InheritFd, inheritFd)
// All open FDs need to be transferred to CRIU via extraFiles
@@ -331,25 +333,25 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
defer imageDir.Close()
rpcOpts := criurpc.CriuOpts{
ImagesDirFd: proto.Int32(int32(imageDir.Fd())),
LogLevel: proto.Int32(4),
LogFile: proto.String(logFile),
Root: proto.String(c.config.Rootfs),
ManageCgroups: proto.Bool(true), // Obsoleted by ManageCgroupsMode.
ImagesDirFd: mkPtr(int32(imageDir.Fd())),
LogLevel: mkPtr(int32(4)),
LogFile: mkPtr(logFile),
Root: mkPtr(c.config.Rootfs),
ManageCgroups: mkPtr(true), // Obsoleted by ManageCgroupsMode.
ManageCgroupsMode: &cgMode,
NotifyScripts: proto.Bool(true),
Pid: proto.Int32(int32(c.initProcess.pid())),
ShellJob: proto.Bool(criuOpts.ShellJob),
LeaveRunning: proto.Bool(criuOpts.LeaveRunning),
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
TcpSkipInFlight: proto.Bool(criuOpts.TcpSkipInFlight),
LinkRemap: proto.Bool(criuOpts.LinkRemap),
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
FileLocks: proto.Bool(criuOpts.FileLocks),
EmptyNs: proto.Uint32(criuOpts.EmptyNs),
OrphanPtsMaster: proto.Bool(true),
AutoDedup: proto.Bool(criuOpts.AutoDedup),
LazyPages: proto.Bool(criuOpts.LazyPages),
NotifyScripts: mkPtr(true),
Pid: mkPtr(int32(c.initProcess.pid())),
ShellJob: mkPtr(criuOpts.ShellJob),
LeaveRunning: mkPtr(criuOpts.LeaveRunning),
TcpEstablished: mkPtr(criuOpts.TcpEstablished),
TcpSkipInFlight: mkPtr(criuOpts.TcpSkipInFlight),
LinkRemap: mkPtr(criuOpts.LinkRemap),
ExtUnixSk: mkPtr(criuOpts.ExternalUnixConnections),
FileLocks: mkPtr(criuOpts.FileLocks),
EmptyNs: mkPtr(criuOpts.EmptyNs),
OrphanPtsMaster: mkPtr(true),
AutoDedup: mkPtr(criuOpts.AutoDedup),
LazyPages: mkPtr(criuOpts.LazyPages),
}
// if criuOpts.WorkDirectory is not set, criu default is used.
@@ -362,7 +364,7 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
return err
}
defer workDir.Close()
rpcOpts.WorkDirFd = proto.Int32(int32(workDir.Fd()))
rpcOpts.WorkDirFd = mkPtr(int32(workDir.Fd()))
logDir = criuOpts.WorkDirectory
}
@@ -388,28 +390,28 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
// Note cgroup v2 freezer is only supported since CRIU release 3.14.
if !cgroups.IsCgroup2UnifiedMode() || c.checkCriuVersion(31400) == nil {
if fcg := c.cgroupManager.Path("freezer"); fcg != "" {
rpcOpts.FreezeCgroup = proto.String(fcg)
rpcOpts.FreezeCgroup = mkPtr(fcg)
}
}
// append optional criu opts, e.g., page-server and port
if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 {
rpcOpts.Ps = &criurpc.CriuPageServerInfo{
Address: proto.String(criuOpts.PageServer.Address),
Port: proto.Int32(criuOpts.PageServer.Port),
Address: mkPtr(criuOpts.PageServer.Address),
Port: mkPtr(criuOpts.PageServer.Port),
}
}
// pre-dump may need parentImage param to complete iterative migration
if criuOpts.ParentImage != "" {
rpcOpts.ParentImg = proto.String(criuOpts.ParentImage)
rpcOpts.TrackMem = proto.Bool(true)
rpcOpts.ParentImg = mkPtr(criuOpts.ParentImage)
rpcOpts.TrackMem = mkPtr(true)
}
var t criurpc.CriuReqType
if criuOpts.PreDump {
feat := criurpc.CriuFeatures{
MemTrack: proto.Bool(true),
MemTrack: mkPtr(true),
}
if err := c.checkCriuFeatures(criuOpts, &feat); err != nil {
@@ -424,7 +426,7 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
if criuOpts.LazyPages {
// lazy migration requested; check if criu supports it
feat := criurpc.CriuFeatures{
LazyPages: proto.Bool(true),
LazyPages: mkPtr(true),
}
if err := c.checkCriuFeatures(criuOpts, &feat); err != nil {
return err
@@ -444,7 +446,7 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
if c.checkCriuVersion(31500) != nil {
// For criu 3.15+, use notifications (see case "status-ready"
// in criuNotifications). Otherwise, rely on criu status fd.
rpcOpts.StatusFd = proto.Int32(int32(fd))
rpcOpts.StatusFd = mkPtr(int32(fd))
}
}
}
@@ -512,8 +514,8 @@ func (c *Container) addCriuRestoreMount(req *criurpc.CriuReq, m *configs.Mount)
mountDest = dest[len(c.config.Rootfs):]
}
extMnt := &criurpc.ExtMountMap{
Key: proto.String(mountDest),
Val: proto.String(m.Source),
Key: mkPtr(mountDest),
Val: mkPtr(m.Source),
}
req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
}
@@ -523,8 +525,8 @@ func (c *Container) restoreNetwork(req *criurpc.CriuReq, criuOpts *CriuOpts) {
switch iface.Type {
case "veth":
veth := new(criurpc.CriuVethPair)
veth.IfOut = proto.String(iface.HostInterfaceName)
veth.IfIn = proto.String(iface.Name)
veth.IfOut = mkPtr(iface.HostInterfaceName)
veth.IfIn = mkPtr(iface.Name)
req.Opts.Veths = append(req.Opts.Veths, veth)
case "loopback":
// Do nothing
@@ -532,8 +534,8 @@ func (c *Container) restoreNetwork(req *criurpc.CriuReq, criuOpts *CriuOpts) {
}
for _, i := range criuOpts.VethPairs {
veth := new(criurpc.CriuVethPair)
veth.IfOut = proto.String(i.HostInterfaceName)
veth.IfIn = proto.String(i.ContainerInterfaceName)
veth.IfOut = mkPtr(i.HostInterfaceName)
veth.IfIn = mkPtr(i.ContainerInterfaceName)
req.Opts.Veths = append(req.Opts.Veths, veth)
}
}
@@ -687,23 +689,23 @@ func (c *Container) Restore(process *Process, criuOpts *CriuOpts) error {
req := &criurpc.CriuReq{
Type: &t,
Opts: &criurpc.CriuOpts{
ImagesDirFd: proto.Int32(int32(imageDir.Fd())),
EvasiveDevices: proto.Bool(true),
LogLevel: proto.Int32(4),
LogFile: proto.String(logFile),
RstSibling: proto.Bool(true),
Root: proto.String(root),
ManageCgroups: proto.Bool(true), // Obsoleted by ManageCgroupsMode.
ImagesDirFd: mkPtr(int32(imageDir.Fd())),
EvasiveDevices: mkPtr(true),
LogLevel: mkPtr(int32(4)),
LogFile: mkPtr(logFile),
RstSibling: mkPtr(true),
Root: mkPtr(root),
ManageCgroups: mkPtr(true), // Obsoleted by ManageCgroupsMode.
ManageCgroupsMode: &cgMode,
NotifyScripts: proto.Bool(true),
ShellJob: proto.Bool(criuOpts.ShellJob),
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
FileLocks: proto.Bool(criuOpts.FileLocks),
EmptyNs: proto.Uint32(criuOpts.EmptyNs),
OrphanPtsMaster: proto.Bool(true),
AutoDedup: proto.Bool(criuOpts.AutoDedup),
LazyPages: proto.Bool(criuOpts.LazyPages),
NotifyScripts: mkPtr(true),
ShellJob: mkPtr(criuOpts.ShellJob),
ExtUnixSk: mkPtr(criuOpts.ExternalUnixConnections),
TcpEstablished: mkPtr(criuOpts.TcpEstablished),
FileLocks: mkPtr(criuOpts.FileLocks),
EmptyNs: mkPtr(criuOpts.EmptyNs),
OrphanPtsMaster: mkPtr(true),
AutoDedup: mkPtr(criuOpts.AutoDedup),
LazyPages: mkPtr(criuOpts.LazyPages),
},
}
@@ -713,13 +715,13 @@ func (c *Container) Restore(process *Process, criuOpts *CriuOpts) error {
if err := c.checkCriuVersion(31600); err != nil {
return errors.New("--lsm-profile requires at least CRIU 3.16")
}
req.Opts.LsmProfile = proto.String(criuOpts.LsmProfile)
req.Opts.LsmProfile = mkPtr(criuOpts.LsmProfile)
}
if criuOpts.LsmMountContext != "" {
if err := c.checkCriuVersion(31600); err != nil {
return errors.New("--lsm-mount-context requires at least CRIU 3.16")
}
req.Opts.LsmMountContext = proto.String(criuOpts.LsmMountContext)
req.Opts.LsmMountContext = mkPtr(criuOpts.LsmMountContext)
}
if criuOpts.WorkDirectory != "" {
@@ -733,7 +735,7 @@ func (c *Container) Restore(process *Process, criuOpts *CriuOpts) error {
return err
}
defer workDir.Close()
req.Opts.WorkDirFd = proto.Int32(int32(workDir.Fd()))
req.Opts.WorkDirFd = mkPtr(int32(workDir.Fd()))
logDir = criuOpts.WorkDirectory
}
c.handleCriuConfigurationFile(req.Opts)
@@ -796,8 +798,8 @@ func (c *Container) Restore(process *Process, criuOpts *CriuOpts) error {
for i := range fds {
if s := fds[i]; strings.Contains(s, "pipe:") {
inheritFd := new(criurpc.InheritFd)
inheritFd.Key = proto.String(s)
inheritFd.Fd = proto.Int32(int32(i))
inheritFd.Key = mkPtr(s)
inheritFd.Fd = mkPtr(int32(i))
req.Opts.InheritFd = append(req.Opts.InheritFd, inheritFd)
}
}
@@ -889,8 +891,8 @@ func (c *Container) criuApplyCgroups(pid int, req *criurpc.CriuReq) error {
for c, p := range cgroupsPaths {
cgroupRoot := &criurpc.CgroupRoot{
Ctrl: proto.String(c),
Path: proto.String(p),
Ctrl: mkPtr(c),
Path: mkPtr(p),
}
req.Opts.CgRoot = append(req.Opts.CgRoot, cgroupRoot)
}
@@ -984,7 +986,7 @@ func (c *Container) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuO
}
}
}
data, err := proto.Marshal(req)
data, err := req.MarshalVT()
if err != nil {
return err
}
@@ -1017,7 +1019,7 @@ func (c *Container) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuO
}
resp := new(criurpc.CriuResp)
err = proto.Unmarshal(buf[:n], resp)
err = resp.UnmarshalVT(buf[:n])
if err != nil {
return err
}
@@ -1036,9 +1038,9 @@ func (c *Container) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuO
}
req = &criurpc.CriuReq{
Type: &t,
NotifySuccess: proto.Bool(true),
NotifySuccess: mkPtr(true),
}
data, err = proto.Marshal(req)
data, err = req.MarshalVT()
if err != nil {
return err
}
+1
View File
@@ -17,6 +17,7 @@ import (
"github.com/urfave/cli"
)
// TODO: replace with new(v) once Go < 1.26 is not supported.
func mkPtr[T any](v T) *T { return &v }
var updateCommand = cli.Command{
@@ -0,0 +1 @@
*.pb.* linguist-generated
@@ -0,0 +1,8 @@
/.cache/
/.gocache/
/bin/
/vendor/
.#*
.aider*
debug.test*
/node_modules
+69
View File
@@ -0,0 +1,69 @@
linters:
enable:
- depguard
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- misspell
- revive
- staticcheck
- typecheck
- unconvert
- unused
disable:
- errcheck
run:
concurrency: 4
modules-download-mode: vendor
skip-dirs:
- hack
linters-settings:
staticcheck:
checks:
- all
- '-SA1012' # Allow passing nil contexts.
- '-SA1019' # Allow calling deprecated symbols.
importas:
# Do not allow unaliased imports of aliased packages.
no-unaliased: true
maligned:
suggest-new: true
depguard:
rules:
main:
deny:
- pkg: io/ioutil
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
#- pkg: "github.com/stretchr/testify/assert"
# desc: Use "gotest.tools/v3/assert" instead
#- pkg: "github.com/stretchr/testify/require"
# desc: Use "gotest.tools/v3/assert" instead
- pkg: "github.com/stretchr/testify/suite"
desc: Do not use
revive:
rules:
- name: package-comments
disabled: true
issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
max-issues-per-linter: 0
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
max-same-issues: 0
exclude:
- G601
- G306
- G204
+5
View File
@@ -0,0 +1,5 @@
*.pb.go
*.pb.ts
go.sum
testdata
thirdparty
@@ -1,3 +1,7 @@
Copyright (c) 2024-2025 Aperture Robotics, LLC. All rights reserved.
Copyright (c) 2024-2025 Christian Stewart <christian@aperture.us>. All rights reserved.
Copyright (c) 2021, PlanetScale Inc. All rights reserved.
Copyright (c) 2013, The GoGo Authors. All rights reserved.
Copyright (c) 2018 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -24,4 +28,4 @@ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+112
View File
@@ -0,0 +1,112 @@
SHELL:=bash
PROTOWRAP=hack/bin/protowrap
GOIMPORTS=hack/bin/goimports
GOFUMPT=hack/bin/gofumpt
GOLANGCI_LINT=hack/bin/golangci-lint
PROTOC_GEN_GO=hack/bin/protoc-gen-go-lite
GOLIST=go list -f "{{ .Dir }}" -m
export GO111MODULE=on
undefine GOOS
undefine GOARCH
all:
vendor:
go mod vendor
$(GOIMPORTS):
cd ./hack; \
go build -v \
-o ./bin/goimports \
golang.org/x/tools/cmd/goimports
$(GOFUMPT):
cd ./hack; \
go build -v \
-o ./bin/gofumpt \
mvdan.cc/gofumpt
$(PROTOWRAP):
cd ./hack; \
go build -v \
-o ./bin/protowrap \
github.com/aperturerobotics/goprotowrap/cmd/protowrap
$(GOLANGCI_LINT):
cd ./hack; \
go build -v \
-o ./bin/golangci-lint \
github.com/golangci/golangci-lint/cmd/golangci-lint
$(PROTOC_GEN_GO):
cd ./hack; \
go build -v \
-o ./bin/protoc-gen-go-lite \
github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite
.PHONY: protoc-gen-go-lite-tool
protoc-gen-go-lite-tool:
cd ./hack; \
go build -v \
-o ./bin/protoc-gen-go-lite \
github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite
.PHONY: build
build: vendor
go build -v
.PHONY: lint
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --timeout=10m
.PHONY: fix
fix: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --fix --timeout=10m
.PHONY: format
format: $(GOFUMPT) $(GOIMPORTS)
$(GOIMPORTS) -w ./
$(GOFUMPT) -w ./
.PHONY: test
test:
go test -v ./...
.PHONY: gengo
gengo: $(GOIMPORTS) $(PROTOWRAP) protoc-gen-go-lite-tool
shopt -s globstar; \
set -eo pipefail; \
export PROJECT=$$(go list -m); \
export PATH=$$(pwd)/hack/bin:$${PATH}; \
mkdir -p $$(pwd)/vendor/$$(dirname $${PROJECT}); \
rm $$(pwd)/vendor/$${PROJECT} || true; \
ln -s $$(pwd) $$(pwd)/vendor/$${PROJECT} ; \
protogen() { \
$(PROTOWRAP) \
-I $$(pwd)/vendor \
-I $$(pwd) \
--go-lite_out=$$(pwd)/vendor \
--proto_path $$(pwd)/vendor \
--print_structure \
--only_specified_files \
$$2 \
$$(\
git \
ls-files "$$1" |\
xargs printf -- \
"$$(pwd)/vendor/$${PROJECT}/%s "); \
}; \
for d in ./types/known/*; do \
protogen "$${d}/*.proto" "--go-lite_opt=features=marshal+marshal_strict+unmarshal+unmarshal_unsafe+size+equal+clone+text"; \
done; \
protogen "./types/descriptorpb/*.proto" ""; \
protogen "./types/pluginpb/*.proto" ""; \
protogen "./testproto/*.proto" ""; \
rm $$(pwd)/vendor/$${PROJECT} || true
$(GOIMPORTS) -w ./
.PHONY: check-gengo
check-gengo: gengo
git diff --exit-code HEAD
test -z "$$(git ls-files --others --exclude-standard)" || (git ls-files --others --exclude-standard; exit 1)
+157
View File
@@ -0,0 +1,157 @@
# protobuf-go-lite
[![GoDoc Widget]][GoDoc] [![Go Report Card Widget]][Go Report Card] [![DeepWiki Widget]][DeepWiki]
[GoDoc]: https://godoc.org/github.com/aperturerobotics/protobuf-go-lite
[GoDoc Widget]: https://godoc.org/github.com/aperturerobotics/protobuf-go-lite?status.svg
[Go Report Card Widget]: https://goreportcard.com/badge/github.com/aperturerobotics/protobuf-go-lite
[Go Report Card]: https://goreportcard.com/report/github.com/aperturerobotics/protobuf-go-lite
[DeepWiki Widget]: https://img.shields.io/badge/DeepWiki-aperturerobotics%2Fprotobuf--go--lite-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==
[DeepWiki]: https://deepwiki.com/aperturerobotics/protobuf-go-lite
**protobuf-go-lite** is a stripped-down version of the [protobuf-go] code
generator modified to work without reflection and merged with [vtprotobuf] to
provide modular features with static code generation for marshal/unmarshal,
size, clone, and equal. It bundles a fork of [protoc-gen-go-json] for JSON.
[protobuf-go]: https://github.com/protocolbuffers/protobuf-go
[vtprotobuf]: https://github.com/planetscale/vtprotobuf
[protoc-gen-go-json]: https://github.com/TheThingsIndustries/protoc-gen-go-json
Static code generation without reflection is more efficient at runtime and
results in smaller code binaries. It also provides better support for [tinygo]
which has limited reflection support.
[tinygo]: https://github.com/tinygo-org/tinygo
protobuf-go-lite supports Edition 2024 schemas that resolve to the open Go API
and static, reflect-free generated output. The default `features=all` path
supports explicit and implicit presence, legacy required fields, packed
encoding, delimited message encoding, oneofs, maps, clone/equal, text,
unmarshal, unsafe unmarshal, and JSON when the resolved JSON format is
`ALLOW`.
protobuf-go-lite rejects Edition schemas that require closed enum semantics,
`LEGACY_BEST_EFFORT` JSON, or explicit hybrid/opaque Go APIs. It does not
support fieldmasks and extensions.
### Ecosystem
Lightweight Protobuf 3 RPCs are implemented in [StaRPC] for Go and TypeScript.
[StaRPC]: https://github.com/aperturerobotics/starpc
[protoc-gen-doc] is recommended for generating documentation.
[protoc-gen-doc]: https://github.com/pseudomuto/protoc-gen-doc
[protobuf-es-lite] is recommended for lightweight TypeScript protobufs.
[protobuf-es-lite]: https://github.com/aperturerobotics/protobuf-es-lite
## Protobuf
[protocol buffers](https://protobuf.dev) are a cross-platform cross-language
message serialization format. Protobuf is a language for specifying the schema
for structured data. This schema is compiled into language specific bindings.
This project provides both a tool to generate Go code for the protocol buffer
language, and also the runtime implementation to handle serialization of
messages in Go.
See the [protocol buffer developer guide](https://protobuf.dev/overview) for
more information about protocol buffers themselves.
## Example
See the [protobuf-project](https://github.com/aperturerobotics/protobuf-project)
template for an example of how to use this package and vtprotobuf together with
protowrap to generate protobufs for your project.
This package is available at **github.com/aperturerobotics/protobuf-go-lite**.
## Package index
Summary of the packages provided by this module:
* [`compiler/protogen`](https://pkg.go.dev/github.com/aperturerobotics/protobuf-go-lite/compiler/protogen):
Package `protogen` provides support for writing protoc plugins.
* [`cmd/protoc-gen-go-lite`](https://pkg.go.dev/github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite):
The `protoc-gen-go-lite` binary is a protoc plugin to generate a Go protocol
buffer package.
## Usage
1. Install `protoc-gen-go-lite`:
```
go install github.com/aperturerobotics/protobuf-go-lite/cmd/protoc-gen-go-lite@latest
```
2. Update your `protoc` generator to use the new plug-in.
```
for name in $(PROTO_SRC_NAMES); do \
protoc \
--plugin protoc-gen-go-lite="${GOBIN}/protoc-gen-go-lite" \
--go-lite_out=. \
--go-lite_opt=features=marshal+unmarshal+size+equal+clone \
proto/$${name}.proto; \
done
```
`protobuf-go-lite` replaces `protoc-gen-go` and `protoc-gen-go-vtprotobuf` and should not be used with those generators.
Check out the [template](https://github.com/aperturerobotics/template) for a quick start!
## Available features
The following additional features from vtprotobuf can be enabled:
- `size`: generates a `func (p *YourProto) SizeVT() int` helper that behaves identically to calling `proto.Size(p)` on the message, except the size calculation is fully unrolled and does not use reflection. This helper function can be used directly, and it'll also be used by the `marshal` codegen to ensure the destination buffer is properly sized before ProtoBuf objects are marshalled to it.
- `equal`: generates the following helper methods
- `func (this *YourProto) EqualVT(that *YourProto) bool`: this function behaves almost identically to calling `proto.Equal(this, that)` on messages, except the equality calculation is fully unrolled and does not use reflection. This helper function can be used directly.
- `func (this *YourProto) EqualMessageVT(thatMsg any) bool`: this function behaves like the above `this.EqualVT(that)`, but allows comparing against arbitrary proto messages. If `thatMsg` is not of type `*YourProto`, false is returned. The uniform signature provided by this method allows accessing this method via type assertions even if the message type is not known at compile time. This allows implementing a generic `func EqualVT(proto.Message, proto.Message) bool` without reflection.
- `marshal`: generates the following helper methods
- `func (p *YourProto) MarshalVT() ([]byte, error)`: this function behaves identically to calling `proto.Marshal(p)`, except the actual marshalling has been fully unrolled and does not use reflection or allocate memory. This function simply allocates a properly sized buffer by calling `SizeVT` on the message and then uses `MarshalToSizedBufferVT` to marshal to it.
- `func (p *YourProto) MarshalToVT(data []byte) (int, error)`: this function can be used to marshal a message to an existing buffer. The buffer must be large enough to hold the marshalled message, otherwise this function will panic. It returns the number of bytes marshalled. This function is useful e.g. when using memory pooling to re-use serialization buffers.
- `func (p *YourProto) MarshalToSizedBufferVT(data []byte) (int, error)`: this function behaves like `MarshalTo` but expects that the input buffer has the exact size required to hold the message, otherwise it will panic.
- `marshal_strict`: generates the following helper methods
- `func (p *YourProto) MarshalVTStrict() ([]byte, error)`: this function behaves like `MarshalVT`, except fields are marshalled in a strict order by field's numbers they were declared in .proto file.
- `func (p *YourProto) MarshalToVTStrict(data []byte) (int, error)`: this function behaves like `MarshalToVT`, except fields are marshalled in a strict order by field's numbers they were declared in .proto file.
- `func (p *YourProto) MarshalToSizedBufferVTStrict(data []byte) (int, error)`: this function behaves like `MarshalToSizedBufferVT`, except fields are marshalled in a strict order by field's numbers they were declared in .proto file.
- `unmarshal`: generates a `func (p *YourProto) UnmarshalVT(data []byte)` that behaves similarly to calling `proto.Unmarshal(data, p)` on the message, except the unmarshalling is performed by unrolled codegen without using reflection and allocating as little memory as possible. If the receiver `p` is **not** fully zeroed-out, the unmarshal call will actually behave like `proto.Merge(data, p)`. This is because the `proto.Unmarshal` in the ProtoBuf API is implemented by resetting the destination message and then calling `proto.Merge` on it. To ensure proper `Unmarshal` semantics, ensure you've called `proto.Reset` on your message before calling `UnmarshalVT`, or that your message has been newly allocated.
- `unmarshal_unsafe` generates a `func (p *YourProto) UnmarshalVTUnsafe(data []byte)` that behaves like `UnmarshalVT`, except it unsafely casts slices of data to `bytes` and `string` fields instead of copying them to newly allocated arrays, so that it performs less allocations. **Data received from the wire has to be left untouched for the lifetime of the message.** Otherwise, the message's `bytes` and `string` fields can be corrupted.
- `clone`: generates the following helper methods
- `func (p *YourProto) CloneVT() *YourProto`: this function behaves similarly to calling `proto.Clone(p)` on the message, except the cloning is performed by unrolled codegen without using reflection. If the receiver `p` is `nil` a typed `nil` is returned.
- `func (p *YourProto) CloneMessageVT() any`: this function behaves like the above `p.CloneVT()`, but provides a uniform signature in order to be accessible via type assertions even if the type is not known at compile time. This allows implementing a generic `func CloneMessageVT() any` without reflection. If the receiver `p` is `nil`, a typed `nil` pointer of the message type will be returned inside a `any` interface.
- `json`: generates the following helper methods
- `func (p *YourProto) UnmarshalJSON(data []byte) error` behaves similarly to calling `protojson.Unmarshal(data, p)` on the message, except the unmarshalling is performed by unrolled codegen without using reflection and allocating as little memory as possible (with json-iterator/go). If the receiver `p` is **not** fully zeroed-out, the unmarshal call will actually behave like `proto.Merge(data, p)`. To ensure proper `Unmarshal` semantics, ensure you've called `proto.Reset` on your message before calling `UnmarshalJSON`, or that your message has been newly allocated.
- `func (p *YourProto) UnmarshalJSONValue(val *fastjson.Value) error` unmarshals a `*fastjson.Value`.
- `func (p *YourProto) MarshalJSON() ([]byte, error)` behaves similarly to calling `protojson.Marshal(p)` on the message, except the marshalling is performed by unrolled codegen without using reflection and allocating as little memory as possible (with json-iterator/go).
- Adding a `//protobuf-go-lite:disable-json` comment before a message or enum will disable the json marshaler / unmarshaler.
## License
BSD-3
+594
View File
@@ -0,0 +1,594 @@
package protobuf_go_lite
import (
"errors"
"fmt"
"io"
"math"
"math/bits"
"slices"
"unsafe"
)
var (
// ErrInvalidLength is returned when decoding a negative length.
ErrInvalidLength = errors.New("proto: negative length found during unmarshaling")
// ErrIntOverflow is returned when decoding a varint representation of an integer that overflows 64 bits.
ErrIntOverflow = errors.New("proto: integer overflow")
// ErrUnexpectedEndOfGroup is returned when decoding a group end without a corresponding group start.
ErrUnexpectedEndOfGroup = errors.New("proto: unexpected end of group")
)
// Message is the base vtprotobuf message marshal/unmarshal interface.
type Message interface {
// SizeVT returns the size of the message when marshaled.
SizeVT() int
// MarshalToSizedBufferVT marshals to a buffer that already is SizeVT bytes long.
MarshalToSizedBufferVT(dAtA []byte) (int, error)
// MarshalVT marshals the message with vtprotobuf.
MarshalVT() ([]byte, error)
// UnmarshalVT unmarshals the message object with vtprotobuf.
UnmarshalVT(data []byte) error
// Reset resets the message.
Reset()
}
// JSONMessage is a message with MarshalJSON and UnmarshalJSON.
type JSONMessage interface {
// MarshalJSON marshals the message to JSON.
MarshalJSON() ([]byte, error)
// UnmarshalJSON unmarshals the message from JSON.
UnmarshalJSON(data []byte) error
}
// CloneMessage is a message with a CloneMessage function.
type CloneMessage interface {
// Message extends the base message type.
Message
// CloneMessageVT clones the object.
CloneMessageVT() CloneMessage
}
// CloneVT is a message with a CloneVT function (VTProtobuf).
type CloneVT[T comparable] interface {
comparable
// CloneMessage is the non-generic clone interface.
CloneMessage
// CloneVT clones the object.
CloneVT() T
}
// CloneVTSlice clones a slice of CloneVT messages.
func CloneVTSlice[S ~[]E, E CloneVT[E]](s S) S {
out := make([]E, len(s))
var empty E
for i := range s {
if s[i] != empty {
out[i] = s[i].CloneVT()
}
}
return out
}
// EqualVT is a message with a EqualVT function (VTProtobuf).
type EqualVT[T comparable] interface {
comparable
// EqualVT compares against the other message for equality.
EqualVT(other T) bool
}
// CompareComparable returns a compare function to compare two comparable types.
func CompareComparable[T comparable]() func(t1, t2 T) bool {
return func(t1, t2 T) bool {
return t1 == t2
}
}
// CompareEqualVT returns a compare function to compare two VTProtobuf messages.
func CompareEqualVT[T EqualVT[T]]() func(t1, t2 T) bool {
return func(t1, t2 T) bool {
return IsEqualVT(t1, t2)
}
}
// IsEqualVT checks if two EqualVT objects are equal.
func IsEqualVT[T EqualVT[T]](t1, t2 T) bool {
var empty T
t1Empty, t2Empty := t1 == empty, t2 == empty
if t1Empty != t2Empty {
return false
}
if t1Empty {
return true
}
return t1.EqualVT(t2)
}
// IsEqualVTSlice checks if two slices of EqualVT messages are equal.
func IsEqualVTSlice[S ~[]E, E EqualVT[E]](s1, s2 S) bool {
return slices.EqualFunc(s1, s2, CompareEqualVT[E]())
}
// EncodeVarint encodes a uint64 into a varint-encoded byte slice and returns the offset of the encoded value.
// The provided offset is the offset after the last byte of the encoded value.
func EncodeVarint(dAtA []byte, offset int, v uint64) int {
offset -= SizeOfVarint(v)
base := offset
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) //nolint:gosec
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return base
}
// AppendVarint appends v to b as a varint-encoded uint64.
func AppendVarint(b []byte, v uint64) []byte {
switch {
case v < 1<<7:
b = append(b, byte(v))
case v < 1<<14:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte(v>>7))
case v < 1<<21:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte(v>>14))
case v < 1<<28:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte(v>>21))
case v < 1<<35:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte((v>>21)&0x7f|0x80),
byte(v>>28))
case v < 1<<42:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte((v>>21)&0x7f|0x80),
byte((v>>28)&0x7f|0x80),
byte(v>>35))
case v < 1<<49:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte((v>>21)&0x7f|0x80),
byte((v>>28)&0x7f|0x80),
byte((v>>35)&0x7f|0x80),
byte(v>>42))
case v < 1<<56:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte((v>>21)&0x7f|0x80),
byte((v>>28)&0x7f|0x80),
byte((v>>35)&0x7f|0x80),
byte((v>>42)&0x7f|0x80),
byte(v>>49))
case v < 1<<63:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte((v>>21)&0x7f|0x80),
byte((v>>28)&0x7f|0x80),
byte((v>>35)&0x7f|0x80),
byte((v>>42)&0x7f|0x80),
byte((v>>49)&0x7f|0x80),
byte(v>>56))
default:
b = append(b,
byte((v>>0)&0x7f|0x80),
byte((v>>7)&0x7f|0x80),
byte((v>>14)&0x7f|0x80),
byte((v>>21)&0x7f|0x80),
byte((v>>28)&0x7f|0x80),
byte((v>>35)&0x7f|0x80),
byte((v>>42)&0x7f|0x80),
byte((v>>49)&0x7f|0x80),
byte((v>>56)&0x7f|0x80),
1)
}
return b
}
// ConsumeVarint parses b as a varint-encoded uint64, reporting its length.
// This returns -1 upon any error, -1 for parse error and -2 for overflow.
func ConsumeVarint(b []byte) (v uint64, n int) {
var y uint64
if len(b) <= 0 {
return 0, -1
}
v = uint64(b[0])
if v < 0x80 {
return v, 1
}
v -= 0x80
if len(b) <= 1 {
return 0, -1
}
y = uint64(b[1])
v += y << 7
if y < 0x80 {
return v, 2
}
v -= 0x80 << 7
if len(b) <= 2 {
return 0, -1
}
y = uint64(b[2])
v += y << 14
if y < 0x80 {
return v, 3
}
v -= 0x80 << 14
if len(b) <= 3 {
return 0, -1
}
y = uint64(b[3])
v += y << 21
if y < 0x80 {
return v, 4
}
v -= 0x80 << 21
if len(b) <= 4 {
return 0, -1
}
y = uint64(b[4])
v += y << 28
if y < 0x80 {
return v, 5
}
v -= 0x80 << 28
if len(b) <= 5 {
return 0, -1
}
y = uint64(b[5])
v += y << 35
if y < 0x80 {
return v, 6
}
v -= 0x80 << 35
if len(b) <= 6 {
return 0, -1
}
y = uint64(b[6])
v += y << 42
if y < 0x80 {
return v, 7
}
v -= 0x80 << 42
if len(b) <= 7 {
return 0, -1
}
y = uint64(b[7])
v += y << 49
if y < 0x80 {
return v, 8
}
v -= 0x80 << 49
if len(b) <= 8 {
return 0, -1
}
y = uint64(b[8])
v += y << 56
if y < 0x80 {
return v, 9
}
v -= 0x80 << 56
if len(b) <= 9 {
return 0, -1
}
y = uint64(b[9])
v += y << 63
if y < 2 {
return v, 10
}
return 0, -2
}
// SizeOfVarint returns the size of the varint-encoded value.
func SizeOfVarint(x uint64) (n int) {
return (bits.Len64(x|1) + 6) / 7
}
// DecodeVarint decodes a varint at the given index, returning value, new index, and error.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarint(b []byte, idx int) (uint64, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return 0, 0, io.ErrUnexpectedEOF
}
return 0, 0, ErrIntOverflow
}
return v, idx + n, nil
}
// DecodeVarintInt32 decodes a varint as int32.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintInt32(b []byte, idx int) (int32, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return 0, 0, io.ErrUnexpectedEOF
}
return 0, 0, ErrIntOverflow
}
return int32(v), idx + n, nil //nolint:gosec
}
// DecodeVarintInt64 decodes a varint as int64.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintInt64(b []byte, idx int) (int64, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return 0, 0, io.ErrUnexpectedEOF
}
return 0, 0, ErrIntOverflow
}
return int64(v), idx + n, nil //nolint:gosec
}
// DecodeVarintUint32 decodes a varint as uint32.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintUint32(b []byte, idx int) (uint32, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return 0, 0, io.ErrUnexpectedEOF
}
return 0, 0, ErrIntOverflow
}
return uint32(v), idx + n, nil //nolint:gosec
}
// DecodeVarintBool decodes a varint as bool.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeVarintBool(b []byte, idx int) (bool, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return false, 0, io.ErrUnexpectedEOF
}
return false, 0, ErrIntOverflow
}
return v != 0, idx + n, nil
}
// DecodeSint32 decodes a zigzag-encoded sint32.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeSint32(b []byte, idx int) (int32, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return 0, 0, io.ErrUnexpectedEOF
}
return 0, 0, ErrIntOverflow
}
return int32((uint32(v) >> 1) ^ uint32((int32(v&1)<<31)>>31)), idx + n, nil //nolint:gosec
}
// DecodeSint64 decodes a zigzag-encoded sint64.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeSint64(b []byte, idx int) (int64, int, error) {
v, n := ConsumeVarint(b[idx:])
if n < 0 {
if n == -1 {
return 0, 0, io.ErrUnexpectedEOF
}
return 0, 0, ErrIntOverflow
}
return int64((v >> 1) ^ uint64((int64(v&1)<<63)>>63)), idx + n, nil //nolint:gosec
}
// DecodeFixed32 decodes a fixed 32-bit value.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFixed32(b []byte, idx int) (uint32, int, error) {
if idx+4 > len(b) {
return 0, 0, io.ErrUnexpectedEOF
}
v := uint32(b[idx]) | uint32(b[idx+1])<<8 | uint32(b[idx+2])<<16 | uint32(b[idx+3])<<24
return v, idx + 4, nil
}
// DecodeFixed64 decodes a fixed 64-bit value.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFixed64(b []byte, idx int) (uint64, int, error) {
if idx+8 > len(b) {
return 0, 0, io.ErrUnexpectedEOF
}
v := uint64(b[idx]) | uint64(b[idx+1])<<8 | uint64(b[idx+2])<<16 | uint64(b[idx+3])<<24 |
uint64(b[idx+4])<<32 | uint64(b[idx+5])<<40 | uint64(b[idx+6])<<48 | uint64(b[idx+7])<<56
return v, idx + 8, nil
}
// DecodeFloat32 decodes a 32-bit float.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFloat32(b []byte, idx int) (float32, int, error) {
v, idx, err := DecodeFixed32(b, idx)
if err != nil {
return 0, 0, err
}
return math.Float32frombits(v), idx, nil
}
// DecodeFloat64 decodes a 64-bit float.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeFloat64(b []byte, idx int) (float64, int, error) {
v, idx, err := DecodeFixed64(b, idx)
if err != nil {
return 0, 0, err
}
return math.Float64frombits(v), idx, nil
}
// DecodeBytes decodes a length-prefixed byte slice. If copy is false, returns a sub-slice.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeBytes(b []byte, idx int, cp bool) ([]byte, int, error) {
length, idx, err := DecodeVarint(b, idx)
if err != nil {
return nil, 0, err
}
l := int(length) //nolint:gosec
if l < 0 {
return nil, 0, ErrInvalidLength
}
end := idx + l
if end < idx || end > len(b) {
return nil, 0, io.ErrUnexpectedEOF
}
if cp {
out := make([]byte, l)
copy(out, b[idx:end])
return out, end, nil
}
return b[idx:end], end, nil
}
// DecodeString decodes a length-prefixed string (with copy).
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeString(b []byte, idx int) (string, int, error) {
length, idx, err := DecodeVarint(b, idx)
if err != nil {
return "", 0, err
}
l := int(length) //nolint:gosec
if l < 0 {
return "", 0, ErrInvalidLength
}
end := idx + l
if end < idx || end > len(b) {
return "", 0, io.ErrUnexpectedEOF
}
return string(b[idx:end]), end, nil
}
// DecodeStringUnsafe decodes a length-prefixed string without copying.
// The returned string shares memory with the input slice.
// Assumes idx is within bounds (0 <= idx <= len(b)); generated code maintains this invariant.
func DecodeStringUnsafe(b []byte, idx int) (string, int, error) {
length, idx, err := DecodeVarint(b, idx)
if err != nil {
return "", 0, err
}
l := int(length) //nolint:gosec
if l < 0 {
return "", 0, ErrInvalidLength
}
end := idx + l
if end < idx || end > len(b) {
return "", 0, io.ErrUnexpectedEOF
}
if l == 0 {
return "", end, nil
}
return unsafe.String(&b[idx], l), end, nil
}
// SizeOfZigzag returns the size of the zigzag-encoded value.
func SizeOfZigzag(x uint64) (n int) {
return SizeOfVarint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) //nolint
}
// Skip the first record of the byte slice and return the offset of the next record.
func Skip(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
depth := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflow
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7) //nolint:gosec
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflow
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
case 1:
iNdEx += 8
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflow
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if length < 0 {
return 0, ErrInvalidLength
}
iNdEx += length
case 3:
depth++
case 4:
if depth == 0 {
return 0, ErrUnexpectedEndOfGroup
}
depth--
case 5:
iNdEx += 4
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
if iNdEx < 0 {
return 0, ErrInvalidLength
}
if depth == 0 {
return iNdEx, nil
}
}
return 0, io.ErrUnexpectedEOF
}
-22
View File
@@ -1,22 +0,0 @@
linters:
presets:
- bugs
- performance
- unused
- format
disable:
- musttag
enable:
- whitespace
- misspell
- dupl
- gosimple
- stylecheck
linters-settings:
exhaustive:
default-signifies-exhaustive: true
gosec:
excludes:
# https://github.com/securego/gosec/issues/1185
- G115
-112
View File
@@ -1,112 +0,0 @@
<!-- markdownlint-configure-file { "no-hard-tabs": { "code_blocks": false } } -->
# go-criu -- Go bindings for CRIU
[![test](https://github.com/checkpoint-restore/go-criu/workflows/ci/badge.svg?branch=master)](https://github.com/checkpoint-restore/go-criu/actions?query=workflow%3Aci)
[![verify](https://github.com/checkpoint-restore/go-criu/workflows/verify/badge.svg?branch=master)](https://github.com/checkpoint-restore/go-criu/actions?query=workflow%3Averify)
[![Go Reference](https://pkg.go.dev/badge/github.com/checkpoint-restore/go-criu.svg)](https://pkg.go.dev/github.com/checkpoint-restore/go-criu)
This repository provides Go bindings for [CRIU](https://criu.org/).
The code is based on the Go-based PHaul implementation from the CRIU repository.
For easier inclusion into other Go projects, the CRIU Go bindings have been
moved to this repository.
## CRIU
The Go bindings provide an easy way to use the CRIU RPC calls from Go without
the need to set up all the infrastructure to make the actual RPC connection to CRIU.
The following example would print the version of CRIU:
```go
import (
"log"
"github.com/checkpoint-restore/go-criu/v7"
)
func main() {
c := criu.MakeCriu()
version, err := c.GetCriuVersion()
if err != nil {
log.Fatalln(err)
}
log.Println(version)
}
```
or to just check if at least a certain CRIU version is installed:
```go
c := criu.MakeCriu()
result, err := c.IsCriuAtLeast(31100)
```
## CRIT
The `crit` package provides bindings to decode, encode, and manipulate
CRIU image files natively within Go. It also provides a CLI tool similar
to the original CRIT Python tool. To get started with this, see the docs
at [CRIT (Go library)](https://criu.org/CRIT_%28Go_library%29).
## Releases
The first go-criu release was 3.11 based on CRIU 3.11. The initial plan
was to follow CRIU so that go-criu would carry the same version number as
CRIU.
As go-criu is imported in other projects and as Go modules are expected
to follow Semantic Versioning go-criu will also follow Semantic Versioning
starting with the 4.0.0 release.
The following table shows the relation between go-criu and criu versions:
| Major version | Latest release | CRIU version |
| -------------- | -------------- | ------------ |
| v7             | 7.2.0         | 3.19         |
| v7             | 7.0.0         | 3.18         |
| v6             | 6.3.0         | 3.17         |
| v5             | 5.3.0         | 3.16         |
| v5             | 5.0.0         | 3.15         |
| v4             | 4.1.0         | 3.14         |
## How to contribute
While bug fixes can first be identified via an "issue", that is not required.
It's ok to just open up a PR with the fix, but make sure you include the same
information you would have included in an issue - like how to reproduce it.
PRs for new features should include some background on what use cases the
new code is trying to address. When possible and when it makes sense, try to
break-up larger PRs into smaller ones - it's easier to review smaller
code changes. But only if those smaller ones make sense as stand-alone PRs.
Regardless of the type of PR, all PRs should include:
* well documented code changes
* additional testcases. Ideally, they should fail w/o your code change applied
* documentation changes
Squash your commits into logical pieces of work that might want to be reviewed
separate from the rest of the PRs. Ideally, each commit should implement a
single idea, and the PR branch should pass the tests at every commit. GitHub
makes it easy to review the cumulative effect of many commits; so, when in
doubt, use smaller commits.
PRs that fix issues should include a reference like `Closes #XXXX` in the
commit message so that github will automatically close the referenced issue
when the PR is merged.
Contributors must assert that they are in compliance with the [Developer
Certificate of Origin 1.1](http://developercertificate.org/). This is achieved
by adding a "Signed-off-by" line containing the contributor's name and e-mail
to every commit message. Your signature certifies that you wrote the patch or
otherwise have the right to pass it on as an open-source patch.
## License and copyright
Unless mentioned otherwise in a specific file's header, all code in
this project is released under the Apache 2.0 license.
The author of a change remains the copyright holder of their code
(no copyright assignment). The list of authors and contributors can be
retrieved from the git commit history and in some cases, the file headers.
File diff suppressed because it is too large Load Diff
+46
View File
@@ -0,0 +1,46 @@
version: "2"
linters:
enable:
- bodyclose
- dupl
- durationcheck
- errcheck
- errorlint
- exhaustive
- gosec
- govet
- misspell
- nilerr
- prealloc
- rowserrcheck
- sqlclosecheck
- staticcheck
- unconvert
- unparam
- unused
- whitespace
disable:
- musttag
- noctx
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
settings:
exhaustive:
default-signifies-exhaustive: true
gosec:
excludes:
# https://github.com/securego/gosec/issues/1185
- G115
formatters:
enable:
- gofmt
- goimports
exclusions:
generated: lax
+53
View File
@@ -0,0 +1,53 @@
# How to contribute
While bug fixes can first be identified via an "issue", that is not required.
It's ok to just open up a PR with the fix, but make sure you include the same
information you would have included in an issue - like how to reproduce it.
PRs for new features should include some background on what use cases the
new code is trying to address. When possible and when it makes sense, try to
break-up larger PRs into smaller ones - it's easier to review smaller
code changes. But only if those smaller ones make sense as stand-alone PRs.
Regardless of the type of PR, all PRs should include:
* well documented code changes;
* additional testcases: ideally, they should fail w/o your code change applied;
* documentation changes.
Squash your commits into logical pieces of work that might want to be reviewed
separate from the rest of the PRs. Ideally, each commit should implement a
single idea, and the PR branch should pass the tests at every commit. GitHub
makes it easy to review the cumulative effect of many commits; so, when in
doubt, use smaller commits.
This project tries to follow CRIU's commit message conventions, although they
are not strictly enforced. For guidance on writing clear and effective commit
messages, see [How to Write a Git Commit Message][git-commit].
PRs that fix issues should include a reference like `Closes #XXXX` in the
commit message so that github will automatically close the referenced issue
when the PR is merged.
Contributors must assert that they are in compliance with the [Developer
Certificate of Origin 1.1](http://developercertificate.org/). This is achieved
by adding a "Signed-off-by" line containing the contributor's name and e-mail
to every commit message. Your signature certifies that you wrote the patch or
otherwise have the right to pass it on as an open-source patch.
The use of AI tools is welcome but should be correctly attributed, especially
for substantial changes. You can use one of the following in your commit
message:
* `Assisted-by: <AI tool>`
* `Co-authored-by: <AI tool>`
* `Generated-by: <AI tool>`
* Or mention it in the commit message body, e.g., "Generated with <AI tool>"
Marking AI-assisted contributions helps preserve both legal clarity and
community trust, and makes it easier for reviewers to evaluate the code
in context. For more information, see [AI-assisted development and open source:
Navigating the legal issues][ai-legal].
[ai-legal]: https://www.redhat.com/en/blog/ai-assisted-development-and-open-source-navigating-legal-issues
[git-commit]: https://chris.beams.io/posts/git-commit/
@@ -22,13 +22,13 @@ rpc/rpc.proto:
curl -sSL https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/rpc.proto -o $@
rpc/rpc.pb.go: rpc/rpc.proto
protoc --go_out=. --go_opt=M$^=rpc/ $^
protoc --go-lite_out=. --go-lite_opt=M$^=rpc/ $^
stats/stats.proto:
curl -sSL https://raw.githubusercontent.com/checkpoint-restore/criu/master/images/stats.proto -o $@
stats/stats.pb.go: stats/stats.proto
protoc --go_out=. --go_opt=M$^=stats/ $^
protoc --go-lite_out=. --go-lite_opt=M$^=stats/ $^
vendor:
$(GO) mod tidy
+85
View File
@@ -0,0 +1,85 @@
<!-- markdownlint-configure-file { "no-hard-tabs": { "code_blocks": false } } -->
# go-criu -- Go bindings for CRIU
[![ci](https://github.com/checkpoint-restore/go-criu/actions/workflows/main.yml/badge.svg)](https://github.com/checkpoint-restore/go-criu/actions/workflows/main.yml)
[![verify](https://github.com/checkpoint-restore/go-criu/actions/workflows/verify.yml/badge.svg)](https://github.com/checkpoint-restore/go-criu/actions/workflows/verify.yml)
[![Go Reference](https://pkg.go.dev/badge/github.com/checkpoint-restore/go-criu.svg)](https://pkg.go.dev/github.com/checkpoint-restore/go-criu)
This repository provides Go bindings for [CRIU](https://criu.org/).
The code is based on the Go-based PHaul implementation from the CRIU repository.
For easier inclusion into other Go projects, the CRIU Go bindings have been
moved to this repository.
## CRIU
The Go bindings provide an easy way to use the CRIU RPC calls from Go without
the need to set up all the infrastructure to make the actual RPC connection to CRIU.
The following example would print the version of CRIU:
```go
import (
"log"
"github.com/checkpoint-restore/go-criu/v8"
)
func main() {
c := criu.MakeCriu()
version, err := c.GetCriuVersion()
if err != nil {
log.Fatalln(err)
}
log.Println(version)
}
```
or to just check if at least a certain CRIU version is installed:
```go
c := criu.MakeCriu()
result, err := c.IsCriuAtLeast(31100)
```
## CRIT
The `crit` package provides bindings to decode, encode, and manipulate
CRIU image files natively within Go. It also provides a CLI tool similar
to the original CRIT Python tool. To get started with this, see the docs
at [CRIT (Go library)](https://criu.org/CRIT_%28Go_library%29).
## Releases
The first go-criu release was 3.11 based on CRIU 3.11. The initial plan
was to follow CRIU so that go-criu would carry the same version number as
CRIU.
As go-criu is imported in other projects and as Go modules are expected
to follow Semantic Versioning go-criu will also follow Semantic Versioning
starting with the 4.0.0 release.
The following table shows the relation between go-criu and criu versions:
| Major version | Latest release | CRIU version |
| -------------- | -------------- | ------------ |
| v8 | 8.2.0 | 4.2 |
| v7 | 7.2.0 | 3.19 |
| v7 | 7.0.0 | 3.18 |
| v6 | 6.3.0 | 3.17 |
| v5 | 5.3.0 | 3.16 |
| v5 | 5.0.0 | 3.15 |
| v4 | 4.1.0 | 3.14 |
## How to contribute
See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this
project.
## License and copyright
Unless mentioned otherwise in a specific file's header, all code in
this project is released under the Apache 2.0 license.
The author of a change remains the copyright holder of their code
(no copyright assignment). The list of authors and contributors can be
retrieved from the git commit history and in some cases, the file headers.
@@ -3,7 +3,7 @@ package criu
import (
"errors"
"github.com/checkpoint-restore/go-criu/v7/rpc"
"github.com/checkpoint-restore/go-criu/v8/rpc"
)
// Feature checking in go-criu is based on the libcriu feature checking function.
@@ -0,0 +1,13 @@
// Package proto provides a small helper for constructing pointers to
// scalar values, as used by proto2-generated optional/required fields.
//
// protobuf-go-lite does not ship the proto.String/Int32/Bool constructors
// that google.golang.org/protobuf/proto offers, so Ptr replaces them.
package proto
// Ptr returns a pointer to v. It is handy for setting proto2 optional and
// required scalar fields, e.g. Ptr("foo"), Ptr(true), Ptr[int32](4).
//
// TODO: drop this in favor of the built-in new(v) once the minimum
// supported Go version is 1.26 or later.
func Ptr[T any](v T) *T { return &v }
@@ -5,18 +5,24 @@ import (
"fmt"
"os"
"os/exec"
"sort"
"strconv"
"syscall"
"github.com/checkpoint-restore/go-criu/v7/rpc"
"google.golang.org/protobuf/proto"
proto "github.com/checkpoint-restore/go-criu/v8/internal/proto"
"github.com/checkpoint-restore/go-criu/v8/rpc"
)
// extraFilesStartFd is the first fd number assigned to cmd.ExtraFiles by os/exec.
// As documented in os/exec: "entry i becomes file descriptor 3+i"
const extraFilesStartFd = 3
// Criu struct
type Criu struct {
swrkCmd *exec.Cmd
swrkSk *os.File
swrkPath string
swrkCmd *exec.Cmd
swrkSk *os.File
swrkPath string
inheritFds map[string]*os.File
}
// MakeCriu returns the Criu object required for most operations
@@ -32,8 +38,52 @@ func (c *Criu) SetCriuPath(path string) {
c.swrkPath = path
}
// AddInheritFd registers a file descriptor to be passed to CRIU.
// If opts.InheritFd is not set for an operation, it will be populated
// from these registrations using the same key order.
func (c *Criu) AddInheritFd(key string, file *os.File) {
if c.inheritFds == nil {
c.inheritFds = make(map[string]*os.File)
}
c.inheritFds[key] = file
}
func (c *Criu) inheritFdKeys() []string {
if len(c.inheritFds) == 0 {
return nil
}
keys := make([]string, 0, len(c.inheritFds))
for k := range c.inheritFds {
keys = append(keys, k)
}
sort.Strings(keys)
return keys
}
func (c *Criu) ensureInheritFd(opts *rpc.CriuOpts) {
if opts == nil || len(opts.GetInheritFd()) > 0 || len(c.inheritFds) == 0 {
return
}
keys := c.inheritFdKeys()
if len(keys) == 0 {
return
}
opts.InheritFd = make([]*rpc.InheritFd, 0, len(keys))
for i, key := range keys {
fd := int32(extraFilesStartFd + i)
opts.InheritFd = append(opts.InheritFd, &rpc.InheritFd{
Key: proto.Ptr(key),
Fd: proto.Ptr(fd),
})
}
}
// Prepare sets up everything for the RPC communication to CRIU
func (c *Criu) Prepare() error {
return c.doPrepare(nil)
}
func (c *Criu) doPrepare(opts *rpc.CriuOpts) error {
fds, err := syscall.Socketpair(syscall.AF_LOCAL, syscall.SOCK_SEQPACKET, 0)
if err != nil {
return err
@@ -42,15 +92,28 @@ func (c *Criu) Prepare() error {
cln := os.NewFile(uintptr(fds[0]), "criu-xprt-cln")
syscall.CloseOnExec(fds[0])
srv := os.NewFile(uintptr(fds[1]), "criu-xprt-srv")
defer srv.Close()
defer func() { _ = srv.Close() }()
args := []string{"swrk", strconv.Itoa(fds[1])}
// #nosec G204
cmd := exec.Command(c.swrkPath, args...)
// Collect file descriptors to pass to child
inheritKeys := c.inheritFdKeys()
extraFiles := make([]*os.File, 0, len(inheritKeys))
// Add fds from AddInheritFd (sorted for stable ordering)
for _, k := range inheritKeys {
extraFiles = append(extraFiles, c.inheritFds[k])
}
c.ensureInheritFd(opts)
cmd.ExtraFiles = extraFiles
err = cmd.Start()
if err != nil {
cln.Close()
_ = cln.Close()
return err
}
@@ -106,13 +169,15 @@ func (c *Criu) doSwrk(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify) e
}
func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy Notify, features *rpc.CriuFeatures) (resp *rpc.CriuResp, retErr error) {
c.ensureInheritFd(opts)
req := rpc.CriuReq{
Type: &reqType,
Opts: opts,
}
if nfy != nil {
opts.NotifyScripts = proto.Bool(true)
opts.NotifyScripts = proto.Ptr(true)
}
if features != nil {
@@ -120,7 +185,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
}
if c.swrkCmd == nil {
err := c.Prepare()
err := c.doPrepare(opts)
if err != nil {
return nil, err
}
@@ -135,7 +200,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
}
for {
reqB, err := proto.Marshal(&req)
reqB, err := req.MarshalVT()
if err != nil {
return nil, err
}
@@ -146,7 +211,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
}
resp = &rpc.CriuResp{}
err = proto.Unmarshal(respB[:respS], resp)
err = resp.UnmarshalVT(respB[:respS])
if err != nil {
return nil, err
}
@@ -194,7 +259,7 @@ func (c *Criu) doSwrkWithResp(reqType rpc.CriuReqType, opts *rpc.CriuOpts, nfy N
req = rpc.CriuReq{
Type: &respType,
NotifySuccess: proto.Bool(true),
NotifySuccess: proto.Ptr(true),
}
}
File diff suppressed because it is too large Load Diff
+112 -16
View File
@@ -13,11 +13,19 @@ import (
const cpuSetSize = _CPU_SETSIZE / _NCPUBITS
// CPUSet represents a CPU affinity mask.
// CPUSet represents a bit mask of CPUs, to be used with [SchedGetaffinity], [SchedSetaffinity],
// and [SetMemPolicy].
//
// Note this type can only represent CPU IDs 0 through 1023.
// Use [CPUSetDynamic]/[NewCPUSet] instead to avoid this limit.
type CPUSet [cpuSetSize]cpuMask
func schedAffinity(trap uintptr, pid int, set *CPUSet) error {
_, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set)))
// CPUSetDynamic represents a bit mask of CPUs, to be used with [SchedGetaffinityDynamic],
// [SchedSetaffinityDynamic], and [SetMemPolicyDynamic]. Use [NewCPUSet] to allocate.
type CPUSetDynamic []cpuMask
func schedAffinity(trap uintptr, pid int, size uintptr, ptr unsafe.Pointer) error {
_, _, e := RawSyscall(trap, uintptr(pid), uintptr(size), uintptr(ptr))
if e != 0 {
return errnoErr(e)
}
@@ -27,13 +35,13 @@ func schedAffinity(trap uintptr, pid int, set *CPUSet) error {
// SchedGetaffinity gets the CPU affinity mask of the thread specified by pid.
// If pid is 0 the calling thread is used.
func SchedGetaffinity(pid int, set *CPUSet) error {
return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set)
return schedAffinity(SYS_SCHED_GETAFFINITY, pid, unsafe.Sizeof(*set), unsafe.Pointer(set))
}
// SchedSetaffinity sets the CPU affinity mask of the thread specified by pid.
// If pid is 0 the calling thread is used.
func SchedSetaffinity(pid int, set *CPUSet) error {
return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set)
return schedAffinity(SYS_SCHED_SETAFFINITY, pid, unsafe.Sizeof(*set), unsafe.Pointer(set))
}
// Zero clears the set s, so that it contains no CPUs.
@@ -45,9 +53,7 @@ func (s *CPUSet) Zero() {
// will silently ignore any invalid CPU bits in [CPUSet] so this is an
// efficient way of resetting the CPU affinity of a process.
func (s *CPUSet) Fill() {
for i := range s {
s[i] = ^cpuMask(0)
}
cpuMaskFill(s[:])
}
func cpuBitsIndex(cpu int) int {
@@ -58,24 +64,27 @@ func cpuBitsMask(cpu int) cpuMask {
return cpuMask(1 << (uint(cpu) % _NCPUBITS))
}
// Set adds cpu to the set s.
func (s *CPUSet) Set(cpu int) {
func cpuMaskFill(s []cpuMask) {
for i := range s {
s[i] = ^cpuMask(0)
}
}
func cpuMaskSet(s []cpuMask, cpu int) {
i := cpuBitsIndex(cpu)
if i < len(s) {
s[i] |= cpuBitsMask(cpu)
}
}
// Clear removes cpu from the set s.
func (s *CPUSet) Clear(cpu int) {
func cpuMaskClear(s []cpuMask, cpu int) {
i := cpuBitsIndex(cpu)
if i < len(s) {
s[i] &^= cpuBitsMask(cpu)
}
}
// IsSet reports whether cpu is in the set s.
func (s *CPUSet) IsSet(cpu int) bool {
func cpuMaskIsSet(s []cpuMask, cpu int) bool {
i := cpuBitsIndex(cpu)
if i < len(s) {
return s[i]&cpuBitsMask(cpu) != 0
@@ -83,11 +92,98 @@ func (s *CPUSet) IsSet(cpu int) bool {
return false
}
// Count returns the number of CPUs in the set s.
func (s *CPUSet) Count() int {
func cpuMaskCount(s []cpuMask) int {
c := 0
for _, b := range s {
c += bits.OnesCount64(uint64(b))
}
return c
}
// Set adds cpu to the set s. If cpu is out of bounds for s, no action is taken.
func (s *CPUSet) Set(cpu int) {
cpuMaskSet(s[:], cpu)
}
// Clear removes cpu from the set s. If cpu is out of bounds for s, no action is taken.
func (s *CPUSet) Clear(cpu int) {
cpuMaskClear(s[:], cpu)
}
// IsSet reports whether cpu is in the set s.
func (s *CPUSet) IsSet(cpu int) bool {
return cpuMaskIsSet(s[:], cpu)
}
// Count returns the number of CPUs in the set s.
func (s *CPUSet) Count() int {
return cpuMaskCount(s[:])
}
// NewCPUSet creates a CPU affinity mask capable of representing CPU IDs
// up to maxCPU (exclusive).
func NewCPUSet(maxCPU int) CPUSetDynamic {
numMasks := (maxCPU + _NCPUBITS - 1) / _NCPUBITS
if numMasks == 0 {
numMasks = 1
}
return make(CPUSetDynamic, numMasks)
}
// Zero clears the set s, so that it contains no CPUs.
func (s CPUSetDynamic) Zero() {
clear(s)
}
// Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinityDynamic]
// will silently ignore any invalid CPU bits in [CPUSetDynamic] so this is an
// efficient way of resetting the CPU affinity of a process.
func (s CPUSetDynamic) Fill() {
cpuMaskFill(s)
}
// Set adds cpu to the set s. If cpu is out of bounds for s, no action is taken.
func (s CPUSetDynamic) Set(cpu int) {
cpuMaskSet(s, cpu)
}
// Clear removes cpu from the set s. If cpu is out of bounds for s, no action is taken.
func (s CPUSetDynamic) Clear(cpu int) {
cpuMaskClear(s, cpu)
}
// IsSet reports whether cpu is in the set s.
func (s CPUSetDynamic) IsSet(cpu int) bool {
return cpuMaskIsSet(s, cpu)
}
// Count returns the number of CPUs in the set s.
func (s CPUSetDynamic) Count() int {
return cpuMaskCount(s)
}
func (s CPUSetDynamic) size() uintptr {
return uintptr(len(s)) * unsafe.Sizeof(cpuMask(0))
}
func (s CPUSetDynamic) pointer() unsafe.Pointer {
if len(s) == 0 {
return nil
}
return unsafe.Pointer(&s[0])
}
// SchedGetaffinityDynamic gets the CPU affinity mask of the thread specified by pid.
// If pid is 0 the calling thread is used.
//
// If the set is smaller than the size of the affinity mask used by the kernel,
// [EINVAL] is returned.
func SchedGetaffinityDynamic(pid int, set CPUSetDynamic) error {
return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set.size(), set.pointer())
}
// SchedSetaffinityDynamic sets the CPU affinity mask of the thread specified by pid.
// If pid is 0 the calling thread is used.
func SchedSetaffinityDynamic(pid int, set CPUSetDynamic) error {
return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set.size(), set.pointer())
}
+1 -1
View File
@@ -51,7 +51,7 @@ if [[ "$GOOS" = "linux" ]]; then
# Files generated through docker (use $cmd so you can Ctl-C the build or run)
set -e
$cmd docker build --tag generate:$GOOS $GOOS
$cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
$cmd docker run --rm --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS
exit
fi
+3
View File
@@ -354,6 +354,9 @@ struct ltchars {
// Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info")
#define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME
#define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION
// Removed in v6.17, commit 760e6f7befba ("futex: Remove support for IMMUTABLE")
#define PR_FUTEX_HASH_GET_IMMUTABLE 3
'
includes_NetBSD='
+103
View File
@@ -0,0 +1,103 @@
// Copyright 2026 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build darwin || linux || openbsd
package unix
import "unsafe"
// minIovec is the size of the small initial allocation used by
// Readv, Writev, etc.
//
// This small allocation gets stack allocated, which lets the
// common use case of len(iovs) <= minIovec avoid more expensive
// heap allocations.
const minIovec = 8
// appendBytes converts bs to Iovecs and appends them to vecs.
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
for _, b := range bs {
var v Iovec
v.SetLen(len(b))
if len(b) > 0 {
v.Base = &b[0]
} else {
v.Base = (*byte)(unsafe.Pointer(&_zero))
}
vecs = append(vecs, v)
}
return vecs
}
// writevRaceDetect tells the race detector that the program
// has read the first n bytes stored in iovecs.
func writevRaceDetect(iovecs []Iovec, n int) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := min(int(iovecs[i].Len), n)
n -= m
if m > 0 {
raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
}
// readvRaceDetect tells the race detector that the program
// has written to the first n bytes stored in iovecs.
func readvRaceDetect(iovecs []Iovec, n int, err error) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := min(int(iovecs[i].Len), n)
n -= m
if m > 0 {
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
if err == nil {
raceAcquire(unsafe.Pointer(&ioSync))
}
}
func Readv(fd int, iovs [][]byte) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = readv(fd, iovecs)
readvRaceDetect(iovecs, n, err)
return n, err
}
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = preadv(fd, iovecs, offset)
readvRaceDetect(iovecs, n, err)
return n, err
}
func Writev(fd int, iovs [][]byte) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = writev(fd, iovecs)
writevRaceDetect(iovecs, n)
return n, err
}
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = pwritev(fd, iovecs, offset)
writevRaceDetect(iovecs, n)
return n, err
}
-89
View File
@@ -602,95 +602,6 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI
return
}
const minIovec = 8
func Readv(fd int, iovs [][]byte) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = readv(fd, iovecs)
readvRacedetect(iovecs, n, err)
return n, err
}
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = preadv(fd, iovecs, offset)
readvRacedetect(iovecs, n, err)
return n, err
}
func Writev(fd int, iovs [][]byte) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = writev(fd, iovecs)
writevRacedetect(iovecs, n)
return n, err
}
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = pwritev(fd, iovecs, offset)
writevRacedetect(iovecs, n)
return n, err
}
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
for _, b := range bs {
var v Iovec
v.SetLen(len(b))
if len(b) > 0 {
v.Base = &b[0]
} else {
v.Base = (*byte)(unsafe.Pointer(&_zero))
}
vecs = append(vecs, v)
}
return vecs
}
func writevRacedetect(iovecs []Iovec, n int) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := int(iovecs[i].Len)
if m > n {
m = n
}
n -= m
if m > 0 {
raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
}
func readvRacedetect(iovecs []Iovec, n int, err error) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := int(iovecs[i].Len)
if m > n {
m = n
}
n -= m
if m > 0 {
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
if err == nil {
raceAcquire(unsafe.Pointer(&ioSync))
}
}
//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
+18 -96
View File
@@ -2150,33 +2150,10 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
//sys exitThread(code int) (err error) = SYS_EXIT
//sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV
//sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV
//sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV
//sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV
//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2
//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2
// minIovec is the size of the small initial allocation used by
// Readv, Writev, etc.
//
// This small allocation gets stack allocated, which lets the
// common use case of len(iovs) <= minIovs avoid more expensive
// heap allocations.
const minIovec = 8
// appendBytes converts bs to Iovecs and appends them to vecs.
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
for _, b := range bs {
var v Iovec
v.SetLen(len(b))
if len(b) > 0 {
v.Base = &b[0]
} else {
v.Base = (*byte)(unsafe.Pointer(&_zero))
}
vecs = append(vecs, v)
}
return vecs
}
//sys preadvSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV
//sys pwritevSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV
//sys preadv2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2
//sys pwritev2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2
// offs2lohi splits offs into its low and high order bits.
func offs2lohi(offs int64) (lo, hi uintptr) {
@@ -2184,69 +2161,23 @@ func offs2lohi(offs int64) (lo, hi uintptr) {
return uintptr(offs), uintptr(uint64(offs) >> (longBits - 1) >> 1) // two shifts to avoid false positive in vet
}
func Readv(fd int, iovs [][]byte) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = readv(fd, iovecs)
readvRacedetect(iovecs, n, err)
return n, err
}
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
lo, hi := offs2lohi(offset)
n, err = preadv(fd, iovecs, lo, hi)
readvRacedetect(iovecs, n, err)
return n, err
return preadvSyscall(fd, iovecs, lo, hi)
}
func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
lo, hi := offs2lohi(offset)
n, err = preadv2(fd, iovecs, lo, hi, flags)
readvRacedetect(iovecs, n, err)
n, err = preadv2Syscall(fd, iovecs, lo, hi, flags)
readvRaceDetect(iovecs, n, err)
return n, err
}
func readvRacedetect(iovecs []Iovec, n int, err error) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := min(int(iovecs[i].Len), n)
n -= m
if m > 0 {
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
if err == nil {
raceAcquire(unsafe.Pointer(&ioSync))
}
}
func Writev(fd int, iovs [][]byte) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = writev(fd, iovecs)
writevRacedetect(iovecs, n)
return n, err
}
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
lo, hi := offs2lohi(offset)
n, err = pwritev(fd, iovecs, lo, hi)
writevRacedetect(iovecs, n)
return n, err
return pwritevSyscall(fd, iovecs, lo, hi)
}
func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
@@ -2256,24 +2187,11 @@ func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error)
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
lo, hi := offs2lohi(offset)
n, err = pwritev2(fd, iovecs, lo, hi, flags)
writevRacedetect(iovecs, n)
n, err = pwritev2Syscall(fd, iovecs, lo, hi, flags)
writevRaceDetect(iovecs, n)
return n, err
}
func writevRacedetect(iovecs []Iovec, n int) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := min(int(iovecs[i].Len), n)
n -= m
if m > 0 {
raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
}
// mmap varies by architecture; see syscall_linux_*.go.
//sys munmap(addr uintptr, length uintptr) (err error)
//sys mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error)
@@ -2644,8 +2562,12 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) {
//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error)
//sys Mseal(b []byte, flags uint) (err error)
//sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY
//sys setMemPolicy(mode int, mask unsafe.Pointer, size uintptr) (err error) = SYS_SET_MEMPOLICY
func SetMemPolicy(mode int, mask *CPUSet) error {
return setMemPolicy(mode, mask, _CPU_SETSIZE)
return setMemPolicy(mode, unsafe.Pointer(mask), _CPU_SETSIZE)
}
func SetMemPolicyDynamic(mode int, mask CPUSetDynamic) error {
return setMemPolicy(mode, mask.pointer(), mask.size())
}
+3
View File
@@ -82,6 +82,9 @@ func Time(t *Time_t) (Time_t, error) {
}
func Utime(path string, buf *Utimbuf) error {
if buf == nil {
return Utimes(path, nil)
}
tv := []Timeval{
{Sec: buf.Actime},
{Sec: buf.Modtime},
+3
View File
@@ -113,6 +113,9 @@ func Time(t *Time_t) (Time_t, error) {
}
func Utime(path string, buf *Utimbuf) error {
if buf == nil {
return Utimes(path, nil)
}
tv := []Timeval{
{Sec: buf.Actime},
{Sec: buf.Modtime},
+3
View File
@@ -150,6 +150,9 @@ func Time(t *Time_t) (Time_t, error) {
}
func Utime(path string, buf *Utimbuf) error {
if buf == nil {
return Utimes(path, nil)
}
tv := []Timeval{
{Sec: buf.Actime},
{Sec: buf.Modtime},
+3
View File
@@ -112,6 +112,9 @@ func Time(t *Time_t) (Time_t, error) {
}
func Utime(path string, buf *Utimbuf) error {
if buf == nil {
return Utimes(path, nil)
}
tv := []Timeval{
{Sec: buf.Actime},
{Sec: buf.Modtime},
+4
View File
@@ -300,6 +300,10 @@ func Uname(uname *Utsname) error {
//sys Pathconf(path string, name int) (val int, err error)
//sys pread(fd int, p []byte, offset int64) (n int, err error)
//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys readv(fd int, iovecs []Iovec) (n int, err error)
//sys writev(fd int, iovecs []Iovec) (n int, err error)
//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error)
//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
+59 -2
View File
@@ -353,8 +353,10 @@ const (
AUDIT_MAC_IPSEC_EVENT = 0x587
AUDIT_MAC_MAP_ADD = 0x581
AUDIT_MAC_MAP_DEL = 0x582
AUDIT_MAC_OBJ_CONTEXTS = 0x592
AUDIT_MAC_POLICY_LOAD = 0x57b
AUDIT_MAC_STATUS = 0x57c
AUDIT_MAC_TASK_CONTEXTS = 0x591
AUDIT_MAC_UNLBL_ALLOW = 0x57e
AUDIT_MAC_UNLBL_STCADD = 0x588
AUDIT_MAC_UNLBL_STCDEL = 0x589
@@ -591,8 +593,13 @@ const (
CAN_CTRLMODE_LOOPBACK = 0x1
CAN_CTRLMODE_ONE_SHOT = 0x8
CAN_CTRLMODE_PRESUME_ACK = 0x40
CAN_CTRLMODE_RESTRICTED = 0x800
CAN_CTRLMODE_TDC_AUTO = 0x200
CAN_CTRLMODE_TDC_MANUAL = 0x400
CAN_CTRLMODE_XL = 0x1000
CAN_CTRLMODE_XL_TDC_AUTO = 0x2000
CAN_CTRLMODE_XL_TDC_MANUAL = 0x4000
CAN_CTRLMODE_XL_TMS = 0x8000
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
CAN_EFF_MASK = 0x1fffffff
@@ -800,6 +807,8 @@ const (
DEVLINK_PORT_FN_CAP_IPSEC_PACKET = 0x8
DEVLINK_PORT_FN_CAP_MIGRATABLE = 0x2
DEVLINK_PORT_FN_CAP_ROCE = 0x1
DEVLINK_RATE_TCS_MAX = 0x8
DEVLINK_RATE_TC_INDEX_MAX = 0x7
DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14
DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS = 0x3
DEVMEM_MAGIC = 0x454d444d
@@ -1186,6 +1195,7 @@ const (
ETH_P_MPLS_UC = 0x8847
ETH_P_MRP = 0x88e3
ETH_P_MVRP = 0x88f5
ETH_P_MXLGSW = 0x88c3
ETH_P_NCSI = 0x88f8
ETH_P_NSH = 0x894f
ETH_P_PAE = 0x888e
@@ -1218,6 +1228,7 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
ETH_P_YT921X = 0x9988
ET_CORE = 0x4
ET_DYN = 0x3
ET_EXEC = 0x2
@@ -1258,6 +1269,7 @@ const (
FALLOC_FL_NO_HIDE_STALE = 0x4
FALLOC_FL_PUNCH_HOLE = 0x2
FALLOC_FL_UNSHARE_RANGE = 0x40
FALLOC_FL_WRITE_ZEROES = 0x80
FALLOC_FL_ZERO_RANGE = 0x10
FANOTIFY_METADATA_VERSION = 0x3
FAN_ACCESS = 0x1
@@ -1477,6 +1489,7 @@ const (
GRND_INSECURE = 0x4
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
GUEST_MEMFD_MAGIC = 0x474d454d
HDIO_DRIVE_CMD = 0x31f
HDIO_DRIVE_CMD_AEB = 0x31e
HDIO_DRIVE_CMD_HDR_SIZE = 0x4
@@ -1517,6 +1530,7 @@ const (
HDIO_SET_XFER = 0x306
HDIO_TRISTATE_HWIF = 0x31b
HDIO_UNREGISTER_HWIF = 0x32a
HIDIOCTL_LAST = 0xd
HID_MAX_DESCRIPTOR_SIZE = 0x1000
HOSTFS_SUPER_MAGIC = 0xc0ffee
HPFS_SUPER_MAGIC = 0xf995e849
@@ -1809,6 +1823,8 @@ const (
KEXEC_ARCH_X86_64 = 0x3e0000
KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8
KEXEC_FILE_DEBUG = 0x8
KEXEC_FILE_FORCE_DTB = 0x20
KEXEC_FILE_NO_CMA = 0x10
KEXEC_FILE_NO_INITRAMFS = 0x4
KEXEC_FILE_ON_CRASH = 0x2
KEXEC_FILE_UNLOAD = 0x1
@@ -1905,6 +1921,7 @@ const (
LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2
LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1
LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4
LANDLOCK_RESTRICT_SELF_TSYNC = 0x8
LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1
LANDLOCK_SCOPE_SIGNAL = 0x2
LINUX_REBOOT_CMD_CAD_OFF = 0x0
@@ -2412,6 +2429,7 @@ const (
NN_PRXFPREG = "LINUX"
NN_RISCV_CSR = "LINUX"
NN_RISCV_TAGGED_ADDR_CTRL = "LINUX"
NN_RISCV_USER_CFI = "LINUX"
NN_RISCV_VECTOR = "LINUX"
NN_S390_CTRS = "LINUX"
NN_S390_GS_BC = "LINUX"
@@ -2493,6 +2511,7 @@ const (
NT_PRXFPREG = 0x46e62b7f
NT_RISCV_CSR = 0x900
NT_RISCV_TAGGED_ADDR_CTRL = 0x902
NT_RISCV_USER_CFI = 0x903
NT_RISCV_VECTOR = 0x901
NT_S390_CTRS = 0x304
NT_S390_GS_BC = 0x30c
@@ -2515,6 +2534,7 @@ const (
NT_X86_SHSTK = 0x204
NT_X86_XSAVE_LAYOUT = 0x205
NT_X86_XSTATE = 0x202
NULL_FS_MAGIC = 0x4e554c4c
OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
@@ -2594,6 +2614,7 @@ const (
PERF_ATTR_SIZE_VER6 = 0x78
PERF_ATTR_SIZE_VER7 = 0x80
PERF_ATTR_SIZE_VER8 = 0x88
PERF_ATTR_SIZE_VER9 = 0x90
PERF_AUX_FLAG_COLLISION = 0x8
PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT = 0x0
PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW = 0x100
@@ -2629,6 +2650,7 @@ const (
PERF_MEM_LVLNUM_ANY_CACHE = 0xb
PERF_MEM_LVLNUM_CXL = 0x9
PERF_MEM_LVLNUM_IO = 0xa
PERF_MEM_LVLNUM_L0 = 0x7
PERF_MEM_LVLNUM_L1 = 0x1
PERF_MEM_LVLNUM_L2 = 0x2
PERF_MEM_LVLNUM_L2_MHB = 0x5
@@ -2662,6 +2684,23 @@ const (
PERF_MEM_OP_PFETCH = 0x8
PERF_MEM_OP_SHIFT = 0x0
PERF_MEM_OP_STORE = 0x4
PERF_MEM_REGION_L_NON_SHARE = 0x3
PERF_MEM_REGION_L_SHARE = 0x2
PERF_MEM_REGION_MEM0 = 0x8
PERF_MEM_REGION_MEM1 = 0x9
PERF_MEM_REGION_MEM2 = 0xa
PERF_MEM_REGION_MEM3 = 0xb
PERF_MEM_REGION_MEM4 = 0xc
PERF_MEM_REGION_MEM5 = 0xd
PERF_MEM_REGION_MEM6 = 0xe
PERF_MEM_REGION_MEM7 = 0xf
PERF_MEM_REGION_MMIO = 0x7
PERF_MEM_REGION_NA = 0x0
PERF_MEM_REGION_O_IO = 0x4
PERF_MEM_REGION_O_NON_SHARE = 0x6
PERF_MEM_REGION_O_SHARE = 0x5
PERF_MEM_REGION_RSVD = 0x1
PERF_MEM_REGION_SHIFT = 0x2e
PERF_MEM_REMOTE_REMOTE = 0x1
PERF_MEM_REMOTE_SHIFT = 0x25
PERF_MEM_SNOOPX_FWD = 0x1
@@ -2776,6 +2815,10 @@ const (
PR_CAP_AMBIENT_IS_SET = 0x1
PR_CAP_AMBIENT_LOWER = 0x3
PR_CAP_AMBIENT_RAISE = 0x2
PR_CFI_BRANCH_LANDING_PADS = 0x0
PR_CFI_DISABLE = 0x2
PR_CFI_ENABLE = 0x1
PR_CFI_LOCK = 0x4
PR_ENDIAN_BIG = 0x0
PR_ENDIAN_LITTLE = 0x1
PR_ENDIAN_PPC_LITTLE = 0x2
@@ -2798,6 +2841,7 @@ const (
PR_FUTEX_HASH_GET_SLOTS = 0x2
PR_FUTEX_HASH_SET_SLOTS = 0x1
PR_GET_AUXV = 0x41555856
PR_GET_CFI = 0x50
PR_GET_CHILD_SUBREAPER = 0x25
PR_GET_DUMPABLE = 0x3
PR_GET_ENDIAN = 0x13
@@ -2834,6 +2878,7 @@ const (
PR_MDWE_REFUSE_EXEC_GAIN = 0x1
PR_MPX_DISABLE_MANAGEMENT = 0x2c
PR_MPX_ENABLE_MANAGEMENT = 0x2b
PR_MTE_STORE_ONLY = 0x80000
PR_MTE_TAG_MASK = 0x7fff8
PR_MTE_TAG_SHIFT = 0x3
PR_MTE_TCF_ASYNC = 0x4
@@ -2877,6 +2922,10 @@ const (
PR_RISCV_V_VSTATE_CTRL_NEXT_MASK = 0xc
PR_RISCV_V_VSTATE_CTRL_OFF = 0x1
PR_RISCV_V_VSTATE_CTRL_ON = 0x2
PR_RSEQ_SLICE_EXTENSION = 0x4f
PR_RSEQ_SLICE_EXTENSION_GET = 0x1
PR_RSEQ_SLICE_EXTENSION_SET = 0x2
PR_RSEQ_SLICE_EXT_ENABLE = 0x1
PR_SCHED_CORE = 0x3e
PR_SCHED_CORE_CREATE = 0x1
PR_SCHED_CORE_GET = 0x0
@@ -2886,6 +2935,7 @@ const (
PR_SCHED_CORE_SCOPE_THREAD_GROUP = 0x1
PR_SCHED_CORE_SHARE_FROM = 0x3
PR_SCHED_CORE_SHARE_TO = 0x2
PR_SET_CFI = 0x51
PR_SET_CHILD_SUBREAPER = 0x24
PR_SET_DUMPABLE = 0x4
PR_SET_ENDIAN = 0x14
@@ -2951,11 +3001,14 @@ const (
PR_SVE_SET_VL_ONEXEC = 0x40000
PR_SVE_VL_INHERIT = 0x20000
PR_SVE_VL_LEN_MASK = 0xffff
PR_SYS_DISPATCH_EXCLUSIVE_ON = 0x1
PR_SYS_DISPATCH_INCLUSIVE_ON = 0x2
PR_SYS_DISPATCH_OFF = 0x0
PR_SYS_DISPATCH_ON = 0x1
PR_TAGGED_ADDR_ENABLE = 0x1
PR_TASK_PERF_EVENTS_DISABLE = 0x1f
PR_TASK_PERF_EVENTS_ENABLE = 0x20
PR_THP_DISABLE_EXCEPT_ADVISED = 0x2
PR_TIMER_CREATE_RESTORE_IDS = 0x4d
PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2
PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0
@@ -2987,8 +3040,10 @@ const (
PTP_STRICT_FLAGS = 0x8
PTP_SYS_OFFSET_EXTENDED = 0xc4c03d09
PTP_SYS_OFFSET_EXTENDED2 = 0xc4c03d12
PTP_SYS_OFFSET_EXTENDED_CYCLES = 0xc4c03d16
PTP_SYS_OFFSET_PRECISE = 0xc0403d08
PTP_SYS_OFFSET_PRECISE2 = 0xc0403d11
PTP_SYS_OFFSET_PRECISE_CYCLES = 0xc0403d15
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -3330,8 +3385,9 @@ const (
RWF_DSYNC = 0x2
RWF_HIPRI = 0x1
RWF_NOAPPEND = 0x20
RWF_NOSIGNAL = 0x100
RWF_NOWAIT = 0x8
RWF_SUPPORTED = 0xff
RWF_SUPPORTED = 0x1ff
RWF_SYNC = 0x4
RWF_WRITE_LIFE_NOT_SET = 0x0
SCHED_BATCH = 0x3
@@ -3714,7 +3770,7 @@ const (
TASKSTATS_GENL_NAME = "TASKSTATS"
TASKSTATS_GENL_VERSION = 0x1
TASKSTATS_TYPE_MAX = 0x6
TASKSTATS_VERSION = 0x10
TASKSTATS_VERSION = 0x11
TCIFLUSH = 0x0
TCIOFF = 0x2
TCIOFLUSH = 0x2
@@ -4052,6 +4108,7 @@ const (
XDP_FLAGS_REPLACE = 0x10
XDP_FLAGS_SKB_MODE = 0x2
XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1
XDP_MAX_TX_SKB_BUDGET = 0x9
XDP_MMAP_OFFSETS = 0x1
XDP_OPTIONS = 0x8
XDP_OPTIONS_ZEROCOPY = 0x1
+6 -1
View File
@@ -159,6 +159,7 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x8008b70d
NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
@@ -305,6 +306,7 @@ const (
RTC_WKALM_SET = 0x4028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -352,6 +354,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -596,6 +599,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -819,7 +824,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -159,6 +159,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x8008b70d
NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
@@ -306,6 +307,7 @@ const (
RTC_WKALM_SET = 0x4028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -353,6 +355,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -596,6 +599,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -819,7 +824,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -156,6 +156,7 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x8008b70d
NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
@@ -311,6 +312,7 @@ const (
RTC_WKALM_SET = 0x4028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -358,6 +360,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -601,6 +604,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -824,7 +829,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -161,6 +161,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x8008b70d
NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
@@ -304,6 +305,7 @@ const (
RTC_WKALM_SET = 0x4028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -351,6 +353,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -598,6 +601,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -821,7 +826,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -160,6 +160,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x8008b70d
NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
@@ -298,6 +299,7 @@ const (
RTC_WKALM_SET = 0x4028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -345,6 +347,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -588,6 +591,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -811,7 +816,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -156,6 +156,7 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -304,6 +305,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -351,6 +353,7 @@ const (
SO_ERROR = 0x1007
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOCK_FILTER = 0x2c
@@ -597,6 +600,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x60)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x46d)
EFSBADCRC = syscall.Errno(0x4d)
EFSCORRUPTED = syscall.Errno(0x87)
EHOSTDOWN = syscall.Errno(0x93)
EHOSTUNREACH = syscall.Errno(0x94)
EHWPOISON = syscall.Errno(0xa8)
@@ -814,7 +819,7 @@ var errorList = [...]struct {
{132, "ENOBUFS", "no buffer space available"},
{133, "EISCONN", "transport endpoint is already connected"},
{134, "ENOTCONN", "transport endpoint is not connected"},
{135, "EUCLEAN", "structure needs cleaning"},
{135, "EFSCORRUPTED", "structure needs cleaning"},
{137, "ENOTNAM", "not a XENIX named type file"},
{138, "ENAVAIL", "no XENIX semaphores available"},
{139, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -156,6 +156,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -304,6 +305,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -351,6 +353,7 @@ const (
SO_ERROR = 0x1007
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOCK_FILTER = 0x2c
@@ -597,6 +600,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x60)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x46d)
EFSBADCRC = syscall.Errno(0x4d)
EFSCORRUPTED = syscall.Errno(0x87)
EHOSTDOWN = syscall.Errno(0x93)
EHOSTUNREACH = syscall.Errno(0x94)
EHWPOISON = syscall.Errno(0xa8)
@@ -814,7 +819,7 @@ var errorList = [...]struct {
{132, "ENOBUFS", "no buffer space available"},
{133, "EISCONN", "transport endpoint is already connected"},
{134, "ENOTCONN", "transport endpoint is not connected"},
{135, "EUCLEAN", "structure needs cleaning"},
{135, "EFSCORRUPTED", "structure needs cleaning"},
{137, "ENOTNAM", "not a XENIX named type file"},
{138, "ENAVAIL", "no XENIX semaphores available"},
{139, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -156,6 +156,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -304,6 +305,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -351,6 +353,7 @@ const (
SO_ERROR = 0x1007
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOCK_FILTER = 0x2c
@@ -597,6 +600,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x60)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x46d)
EFSBADCRC = syscall.Errno(0x4d)
EFSCORRUPTED = syscall.Errno(0x87)
EHOSTDOWN = syscall.Errno(0x93)
EHOSTUNREACH = syscall.Errno(0x94)
EHWPOISON = syscall.Errno(0xa8)
@@ -814,7 +819,7 @@ var errorList = [...]struct {
{132, "ENOBUFS", "no buffer space available"},
{133, "EISCONN", "transport endpoint is already connected"},
{134, "ENOTCONN", "transport endpoint is not connected"},
{135, "EUCLEAN", "structure needs cleaning"},
{135, "EFSCORRUPTED", "structure needs cleaning"},
{137, "ENOTNAM", "not a XENIX named type file"},
{138, "ENAVAIL", "no XENIX semaphores available"},
{139, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -156,6 +156,7 @@ const (
NFDBITS = 0x20
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -304,6 +305,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -351,6 +353,7 @@ const (
SO_ERROR = 0x1007
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOCK_FILTER = 0x2c
@@ -597,6 +600,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x60)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x46d)
EFSBADCRC = syscall.Errno(0x4d)
EFSCORRUPTED = syscall.Errno(0x87)
EHOSTDOWN = syscall.Errno(0x93)
EHOSTUNREACH = syscall.Errno(0x94)
EHWPOISON = syscall.Errno(0xa8)
@@ -814,7 +819,7 @@ var errorList = [...]struct {
{132, "ENOBUFS", "no buffer space available"},
{133, "EISCONN", "transport endpoint is already connected"},
{134, "ENOTCONN", "transport endpoint is not connected"},
{135, "EUCLEAN", "structure needs cleaning"},
{135, "EFSCORRUPTED", "structure needs cleaning"},
{137, "ENOTNAM", "not a XENIX named type file"},
{138, "ENAVAIL", "no XENIX semaphores available"},
{139, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -158,6 +158,7 @@ const (
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -359,6 +360,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -406,6 +408,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -653,6 +656,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -877,7 +882,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -158,6 +158,7 @@ const (
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -363,6 +364,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -410,6 +412,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -657,6 +660,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -881,7 +886,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -158,6 +158,7 @@ const (
NL3 = 0x300
NLDLY = 0x300
NOFLSH = 0x80000000
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -363,6 +364,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -410,6 +412,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -657,6 +660,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -881,7 +886,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+566 -548
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -156,6 +156,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x8008b70d
NS_GET_MNTNS_ID = 0x8008b705
NS_GET_NSTYPE = 0xb703
NS_GET_OWNER_UID = 0xb704
@@ -367,6 +368,7 @@ const (
RTC_WKALM_SET = 0x4028700f
SCM_DEVMEM_DMABUF = 0x4f
SCM_DEVMEM_LINEAR = 0x4e
SCM_INQ = 0x54
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
@@ -414,6 +416,7 @@ const (
SO_ERROR = 0x4
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_INQ = 0x54
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
@@ -657,6 +660,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x59)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EFSBADCRC = syscall.Errno(0x4a)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
@@ -880,7 +885,7 @@ var errorList = [...]struct {
{114, "EALREADY", "operation already in progress"},
{115, "EINPROGRESS", "operation now in progress"},
{116, "ESTALE", "stale file handle"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -1
View File
@@ -161,6 +161,7 @@ const (
NFDBITS = 0x40
NLDLY = 0x100
NOFLSH = 0x80
NS_GET_ID = 0x4008b70d
NS_GET_MNTNS_ID = 0x4008b705
NS_GET_NSTYPE = 0x2000b703
NS_GET_OWNER_UID = 0x2000b704
@@ -358,6 +359,7 @@ const (
RTC_WKALM_SET = 0x8028700f
SCM_DEVMEM_DMABUF = 0x58
SCM_DEVMEM_LINEAR = 0x57
SCM_INQ = 0x5d
SCM_TIMESTAMPING = 0x23
SCM_TIMESTAMPING_OPT_STATS = 0x38
SCM_TIMESTAMPING_PKTINFO = 0x3c
@@ -453,6 +455,7 @@ const (
SO_ERROR = 0x1007
SO_INCOMING_CPU = 0x33
SO_INCOMING_NAPI_ID = 0x3a
SO_INQ = 0x5d
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOCK_FILTER = 0x28
@@ -694,6 +697,8 @@ const (
EDESTADDRREQ = syscall.Errno(0x27)
EDOTDOT = syscall.Errno(0x58)
EDQUOT = syscall.Errno(0x45)
EFSBADCRC = syscall.Errno(0x4c)
EFSCORRUPTED = syscall.Errno(0x75)
EHOSTDOWN = syscall.Errno(0x40)
EHOSTUNREACH = syscall.Errno(0x41)
EHWPOISON = syscall.Errno(0x87)
@@ -921,7 +926,7 @@ var errorList = [...]struct {
{114, "ELIBACC", "can not access a needed shared library"},
{115, "ENOTUNIQ", "name not unique on network"},
{116, "ERESTART", "interrupted system call should be restarted"},
{117, "EUCLEAN", "structure needs cleaning"},
{117, "EFSCORRUPTED", "structure needs cleaning"},
{118, "ENOTNAM", "not a XENIX named type file"},
{119, "ENAVAIL", "no XENIX semaphores available"},
{120, "EISNAM", "is a named type file"},
+6 -6
View File
@@ -1785,7 +1785,7 @@ func writev(fd int, iovs []Iovec) (n int, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) {
func preadvSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
@@ -1802,7 +1802,7 @@ func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err er
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) {
func pwritevSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
@@ -1819,7 +1819,7 @@ func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err e
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) {
func preadv2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
@@ -1836,7 +1836,7 @@ func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) {
func pwritev2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
@@ -2241,8 +2241,8 @@ func Mseal(b []byte, flags uint) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setMemPolicy(mode int, mask *CPUSet, size int) (err error) {
_, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size))
func setMemPolicy(mode int, mask unsafe.Pointer, size uintptr) (err error) {
_, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(mask), uintptr(size))
if e1 != 0 {
err = errnoErr(e1)
}
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), uintptr(offset>>32), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+20
View File
@@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4
DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $4
DATA ·libc_readv_trampoline_addr(SB)/4, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $4
DATA ·libc_writev_trampoline_addr(SB)/4, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $4
DATA ·libc_preadv_trampoline_addr(SB)/4, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $4
DATA ·libc_pwritev_trampoline_addr(SB)/4, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+20
View File
@@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), 0, uintptr(offset), uintptr(offset>>32))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+20
View File
@@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4
DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $4
DATA ·libc_readv_trampoline_addr(SB)/4, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $4
DATA ·libc_writev_trampoline_addr(SB)/4, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $4
DATA ·libc_preadv_trampoline_addr(SB)/4, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $4
DATA ·libc_pwritev_trampoline_addr(SB)/4, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+20
View File
@@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+20
View File
@@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+24
View File
@@ -597,6 +597,30 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_readv(SB)
RET
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_writev(SB)
RET
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_preadv(SB)
RET
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_pwritev(SB)
RET
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
CALL libc_read(SB)
RET
+84
View File
@@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "libc.so"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
+20
View File
@@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_read(SB)
GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8
+4
View File
@@ -463,4 +463,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+5
View File
@@ -342,6 +342,7 @@ const (
SYS_IO_PGETEVENTS = 333
SYS_RSEQ = 334
SYS_URETPROBE = 335
SYS_UPROBE = 336
SYS_PIDFD_SEND_SIGNAL = 424
SYS_IO_URING_SETUP = 425
SYS_IO_URING_ENTER = 426
@@ -386,4 +387,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -427,4 +427,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -330,4 +330,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+5
View File
@@ -306,6 +306,7 @@ const (
SYS_LANDLOCK_CREATE_RULESET = 444
SYS_LANDLOCK_ADD_RULE = 445
SYS_LANDLOCK_RESTRICT_SELF = 446
SYS_MEMFD_SECRET = 447
SYS_PROCESS_MRELEASE = 448
SYS_FUTEX_WAITV = 449
SYS_SET_MEMPOLICY_HOME_NODE = 450
@@ -326,4 +327,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -447,4 +447,8 @@ const (
SYS_LISTXATTRAT = 4465
SYS_REMOVEXATTRAT = 4466
SYS_OPEN_TREE_ATTR = 4467
SYS_FILE_GETATTR = 4468
SYS_FILE_SETATTR = 4469
SYS_LISTNS = 4470
SYS_RSEQ_SLICE_YIELD = 4471
)
+4
View File
@@ -377,4 +377,8 @@ const (
SYS_LISTXATTRAT = 5465
SYS_REMOVEXATTRAT = 5466
SYS_OPEN_TREE_ATTR = 5467
SYS_FILE_GETATTR = 5468
SYS_FILE_SETATTR = 5469
SYS_LISTNS = 5470
SYS_RSEQ_SLICE_YIELD = 5471
)
+4
View File
@@ -377,4 +377,8 @@ const (
SYS_LISTXATTRAT = 5465
SYS_REMOVEXATTRAT = 5466
SYS_OPEN_TREE_ATTR = 5467
SYS_FILE_GETATTR = 5468
SYS_FILE_SETATTR = 5469
SYS_LISTNS = 5470
SYS_RSEQ_SLICE_YIELD = 5471
)
+4
View File
@@ -447,4 +447,8 @@ const (
SYS_LISTXATTRAT = 4465
SYS_REMOVEXATTRAT = 4466
SYS_OPEN_TREE_ATTR = 4467
SYS_FILE_GETATTR = 4468
SYS_FILE_SETATTR = 4469
SYS_LISTNS = 4470
SYS_RSEQ_SLICE_YIELD = 4471
)
+4
View File
@@ -454,4 +454,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -426,4 +426,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -426,4 +426,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -331,4 +331,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+4
View File
@@ -392,4 +392,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+5
View File
@@ -374,6 +374,7 @@ const (
SYS_FSMOUNT = 432
SYS_FSPICK = 433
SYS_PIDFD_OPEN = 434
SYS_CLONE3 = 435
SYS_CLOSE_RANGE = 436
SYS_OPENAT2 = 437
SYS_PIDFD_GETFD = 438
@@ -405,4 +406,8 @@ const (
SYS_LISTXATTRAT = 465
SYS_REMOVEXATTRAT = 466
SYS_OPEN_TREE_ATTR = 467
SYS_FILE_GETATTR = 468
SYS_FILE_SETATTR = 469
SYS_LISTNS = 470
SYS_RSEQ_SLICE_YIELD = 471
)
+231 -121
View File
@@ -18,6 +18,11 @@ type (
_C_long_long int64
)
type KernelTimespec struct {
Sec int64
Nsec int64
}
type ItimerSpec struct {
Interval Timespec
Value Timespec
@@ -521,6 +526,14 @@ type TCPInfo struct {
Total_rto uint16
Total_rto_recoveries uint16
Total_rto_time uint32
Received_ce uint32
Delivered_e1_bytes uint32
Delivered_e0_bytes uint32
Delivered_ce_bytes uint32
Received_e1_bytes uint32
Received_e0_bytes uint32
Received_ce_bytes uint32
_ [4]byte
}
type TCPVegasInfo struct {
@@ -586,117 +599,122 @@ const (
SizeofIPv6MTUInfo = 0x20
SizeofICMPv6Filter = 0x20
SizeofUcred = 0xc
SizeofTCPInfo = 0xf8
SizeofTCPInfo = 0x118
SizeofTCPCCInfo = 0x14
SizeofCanFilter = 0x8
SizeofTCPRepairOpt = 0x8
)
const (
NDA_UNSPEC = 0x0
NDA_DST = 0x1
NDA_LLADDR = 0x2
NDA_CACHEINFO = 0x3
NDA_PROBES = 0x4
NDA_VLAN = 0x5
NDA_PORT = 0x6
NDA_VNI = 0x7
NDA_IFINDEX = 0x8
NDA_MASTER = 0x9
NDA_LINK_NETNSID = 0xa
NDA_SRC_VNI = 0xb
NTF_USE = 0x1
NTF_SELF = 0x2
NTF_MASTER = 0x4
NTF_PROXY = 0x8
NTF_EXT_LEARNED = 0x10
NTF_OFFLOADED = 0x20
NTF_ROUTER = 0x80
NUD_INCOMPLETE = 0x1
NUD_REACHABLE = 0x2
NUD_STALE = 0x4
NUD_DELAY = 0x8
NUD_PROBE = 0x10
NUD_FAILED = 0x20
NUD_NOARP = 0x40
NUD_PERMANENT = 0x80
NUD_NONE = 0x0
IFA_UNSPEC = 0x0
IFA_ADDRESS = 0x1
IFA_LOCAL = 0x2
IFA_LABEL = 0x3
IFA_BROADCAST = 0x4
IFA_ANYCAST = 0x5
IFA_CACHEINFO = 0x6
IFA_MULTICAST = 0x7
IFA_FLAGS = 0x8
IFA_RT_PRIORITY = 0x9
IFA_TARGET_NETNSID = 0xa
IFAL_LABEL = 0x2
IFAL_ADDRESS = 0x1
RT_SCOPE_UNIVERSE = 0x0
RT_SCOPE_SITE = 0xc8
RT_SCOPE_LINK = 0xfd
RT_SCOPE_HOST = 0xfe
RT_SCOPE_NOWHERE = 0xff
RT_TABLE_UNSPEC = 0x0
RT_TABLE_COMPAT = 0xfc
RT_TABLE_DEFAULT = 0xfd
RT_TABLE_MAIN = 0xfe
RT_TABLE_LOCAL = 0xff
RT_TABLE_MAX = 0xffffffff
RTA_UNSPEC = 0x0
RTA_DST = 0x1
RTA_SRC = 0x2
RTA_IIF = 0x3
RTA_OIF = 0x4
RTA_GATEWAY = 0x5
RTA_PRIORITY = 0x6
RTA_PREFSRC = 0x7
RTA_METRICS = 0x8
RTA_MULTIPATH = 0x9
RTA_FLOW = 0xb
RTA_CACHEINFO = 0xc
RTA_TABLE = 0xf
RTA_MARK = 0x10
RTA_MFC_STATS = 0x11
RTA_VIA = 0x12
RTA_NEWDST = 0x13
RTA_PREF = 0x14
RTA_ENCAP_TYPE = 0x15
RTA_ENCAP = 0x16
RTA_EXPIRES = 0x17
RTA_PAD = 0x18
RTA_UID = 0x19
RTA_TTL_PROPAGATE = 0x1a
RTA_IP_PROTO = 0x1b
RTA_SPORT = 0x1c
RTA_DPORT = 0x1d
RTN_UNSPEC = 0x0
RTN_UNICAST = 0x1
RTN_LOCAL = 0x2
RTN_BROADCAST = 0x3
RTN_ANYCAST = 0x4
RTN_MULTICAST = 0x5
RTN_BLACKHOLE = 0x6
RTN_UNREACHABLE = 0x7
RTN_PROHIBIT = 0x8
RTN_THROW = 0x9
RTN_NAT = 0xa
RTN_XRESOLVE = 0xb
SizeofNlMsghdr = 0x10
SizeofNlMsgerr = 0x14
SizeofRtGenmsg = 0x1
SizeofNlAttr = 0x4
SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10
SizeofIfAddrmsg = 0x8
SizeofIfAddrlblmsg = 0xc
SizeofIfaCacheinfo = 0x10
SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
SizeofNdMsg = 0xc
NDA_UNSPEC = 0x0
NDA_DST = 0x1
NDA_LLADDR = 0x2
NDA_CACHEINFO = 0x3
NDA_PROBES = 0x4
NDA_VLAN = 0x5
NDA_PORT = 0x6
NDA_VNI = 0x7
NDA_IFINDEX = 0x8
NDA_MASTER = 0x9
NDA_LINK_NETNSID = 0xa
NDA_SRC_VNI = 0xb
NTF_USE = 0x1
NTF_SELF = 0x2
NTF_MASTER = 0x4
NTF_PROXY = 0x8
NTF_EXT_LEARNED = 0x10
NTF_OFFLOADED = 0x20
NTF_ROUTER = 0x80
NUD_INCOMPLETE = 0x1
NUD_REACHABLE = 0x2
NUD_STALE = 0x4
NUD_DELAY = 0x8
NUD_PROBE = 0x10
NUD_FAILED = 0x20
NUD_NOARP = 0x40
NUD_PERMANENT = 0x80
NUD_NONE = 0x0
IFA_UNSPEC = 0x0
IFA_ADDRESS = 0x1
IFA_LOCAL = 0x2
IFA_LABEL = 0x3
IFA_BROADCAST = 0x4
IFA_ANYCAST = 0x5
IFA_CACHEINFO = 0x6
IFA_MULTICAST = 0x7
IFA_FLAGS = 0x8
IFA_RT_PRIORITY = 0x9
IFA_TARGET_NETNSID = 0xa
IFAL_LABEL = 0x2
IFAL_ADDRESS = 0x1
RT_SCOPE_UNIVERSE = 0x0
RT_SCOPE_SITE = 0xc8
RT_SCOPE_LINK = 0xfd
RT_SCOPE_HOST = 0xfe
RT_SCOPE_NOWHERE = 0xff
RT_TABLE_UNSPEC = 0x0
RT_TABLE_COMPAT = 0xfc
RT_TABLE_DEFAULT = 0xfd
RT_TABLE_MAIN = 0xfe
RT_TABLE_LOCAL = 0xff
RT_TABLE_MAX = 0xffffffff
RTA_UNSPEC = 0x0
RTA_DST = 0x1
RTA_SRC = 0x2
RTA_IIF = 0x3
RTA_OIF = 0x4
RTA_GATEWAY = 0x5
RTA_PRIORITY = 0x6
RTA_PREFSRC = 0x7
RTA_METRICS = 0x8
RTA_MULTIPATH = 0x9
RTA_FLOW = 0xb
RTA_CACHEINFO = 0xc
RTA_TABLE = 0xf
RTA_MARK = 0x10
RTA_MFC_STATS = 0x11
RTA_VIA = 0x12
RTA_NEWDST = 0x13
RTA_PREF = 0x14
RTA_ENCAP_TYPE = 0x15
RTA_ENCAP = 0x16
RTA_EXPIRES = 0x17
RTA_PAD = 0x18
RTA_UID = 0x19
RTA_TTL_PROPAGATE = 0x1a
RTA_IP_PROTO = 0x1b
RTA_SPORT = 0x1c
RTA_DPORT = 0x1d
RTN_UNSPEC = 0x0
RTN_UNICAST = 0x1
RTN_LOCAL = 0x2
RTN_BROADCAST = 0x3
RTN_ANYCAST = 0x4
RTN_MULTICAST = 0x5
RTN_BLACKHOLE = 0x6
RTN_UNREACHABLE = 0x7
RTN_PROHIBIT = 0x8
RTN_THROW = 0x9
RTN_NAT = 0xa
RTN_XRESOLVE = 0xb
PREFIX_UNSPEC = 0x0
PREFIX_ADDRESS = 0x1
PREFIX_CACHEINFO = 0x2
SizeofNlMsghdr = 0x10
SizeofNlMsgerr = 0x14
SizeofRtGenmsg = 0x1
SizeofNlAttr = 0x4
SizeofRtAttr = 0x4
SizeofIfInfomsg = 0x10
SizeofPrefixmsg = 0xc
SizeofPrefixCacheinfo = 0x8
SizeofIfAddrmsg = 0x8
SizeofIfAddrlblmsg = 0xc
SizeofIfaCacheinfo = 0x10
SizeofRtMsg = 0xc
SizeofRtNexthop = 0x8
SizeofNdUseroptmsg = 0x10
SizeofNdMsg = 0xc
)
type NlMsghdr struct {
@@ -735,6 +753,22 @@ type IfInfomsg struct {
Change uint32
}
type Prefixmsg struct {
Family uint8
Pad1 uint8
Pad2 uint16
Ifindex int32
Type uint8
Len uint8
Flags uint8
Pad3 uint8
}
type PrefixCacheinfo struct {
Preferred_time uint32
Valid_time uint32
}
type IfAddrmsg struct {
Family uint8
Prefixlen uint8
@@ -1303,7 +1337,7 @@ const (
PERF_RECORD_CGROUP = 0x13
PERF_RECORD_TEXT_POKE = 0x14
PERF_RECORD_AUX_OUTPUT_HW_ID = 0x15
PERF_RECORD_MAX = 0x16
PERF_RECORD_MAX = 0x17
PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0x0
PERF_RECORD_KSYMBOL_TYPE_BPF = 0x1
PERF_RECORD_KSYMBOL_TYPE_OOL = 0x2
@@ -3545,7 +3579,7 @@ const (
DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES = 0xae
DEVLINK_ATTR_NESTED_DEVLINK = 0xaf
DEVLINK_ATTR_SELFTESTS = 0xb0
DEVLINK_ATTR_MAX = 0xb3
DEVLINK_ATTR_MAX = 0xb7
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0
DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1
DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0
@@ -3867,7 +3901,7 @@ const (
ETHTOOL_MSG_PHY_GET = 0x2d
ETHTOOL_MSG_TSCONFIG_GET = 0x2e
ETHTOOL_MSG_TSCONFIG_SET = 0x2f
ETHTOOL_MSG_USER_MAX = 0x2f
ETHTOOL_MSG_USER_MAX = 0x33
ETHTOOL_MSG_KERNEL_NONE = 0x0
ETHTOOL_MSG_STRSET_GET_REPLY = 0x1
ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2
@@ -3917,7 +3951,7 @@ const (
ETHTOOL_MSG_PHY_NTF = 0x2e
ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f
ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30
ETHTOOL_MSG_KERNEL_MAX = 0x30
ETHTOOL_MSG_KERNEL_MAX = 0x36
ETHTOOL_FLAG_COMPACT_BITSETS = 0x1
ETHTOOL_FLAG_OMIT_REPLY = 0x2
ETHTOOL_FLAG_STATS = 0x4
@@ -4846,7 +4880,7 @@ const (
NL80211_ATTR_MAC_HINT = 0xc8
NL80211_ATTR_MAC_MASK = 0xd7
NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca
NL80211_ATTR_MAX = 0x151
NL80211_ATTR_MAX = 0x15c
NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4
NL80211_ATTR_MAX_CSA_COUNTERS = 0xce
NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143
@@ -5061,12 +5095,12 @@ const (
NL80211_ATTR_WOWLAN_TRIGGERS = 0x75
NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED = 0x76
NL80211_ATTR_WPA_VERSIONS = 0x4b
NL80211_AUTHTYPE_AUTOMATIC = 0x8
NL80211_AUTHTYPE_AUTOMATIC = 0x9
NL80211_AUTHTYPE_FILS_PK = 0x7
NL80211_AUTHTYPE_FILS_SK = 0x5
NL80211_AUTHTYPE_FILS_SK_PFS = 0x6
NL80211_AUTHTYPE_FT = 0x2
NL80211_AUTHTYPE_MAX = 0x7
NL80211_AUTHTYPE_MAX = 0x8
NL80211_AUTHTYPE_NETWORK_EAP = 0x3
NL80211_AUTHTYPE_OPEN_SYSTEM = 0x0
NL80211_AUTHTYPE_SAE = 0x4
@@ -5099,7 +5133,7 @@ const (
NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY = 0x3
NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE = 0x5
NL80211_BAND_IFTYPE_ATTR_IFTYPES = 0x1
NL80211_BAND_IFTYPE_ATTR_MAX = 0xb
NL80211_BAND_IFTYPE_ATTR_MAX = 0xd
NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS = 0x7
NL80211_BAND_LC = 0x5
NL80211_BAND_S1GHZ = 0x4
@@ -5234,7 +5268,7 @@ const (
NL80211_CMD_LEAVE_MESH = 0x45
NL80211_CMD_LEAVE_OCB = 0x6d
NL80211_CMD_LINKS_REMOVED = 0x9a
NL80211_CMD_MAX = 0x9d
NL80211_CMD_MAX = 0x9f
NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29
NL80211_CMD_MODIFY_LINK_STA = 0x97
NL80211_CMD_NAN_MATCH = 0x78
@@ -5480,7 +5514,7 @@ const (
NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf
NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe
NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf
NL80211_FREQUENCY_ATTR_MAX = 0x22
NL80211_FREQUENCY_ATTR_MAX = 0x27
NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6
NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11
NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc
@@ -5745,7 +5779,7 @@ const (
NL80211_PMSR_FTM_CAPA_ATTR_ASAP = 0x1
NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS = 0x6
NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT = 0x7
NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0xa
NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0x12
NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST = 0x8
NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP = 0x2
NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED = 0xa
@@ -5767,7 +5801,7 @@ const (
NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD = 0x4
NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST = 0x6
NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK = 0xc
NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xd
NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xe
NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED = 0xb
NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP = 0x3
NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES = 0x7
@@ -5785,7 +5819,7 @@ const (
NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON = 0x1
NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST = 0x8
NL80211_PMSR_FTM_RESP_ATTR_LCI = 0x13
NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x15
NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x16
NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP = 0x6
NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS = 0x3
NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES = 0x4
@@ -5892,7 +5926,7 @@ const (
NL80211_RATE_INFO_HE_RU_ALLOC_52 = 0x1
NL80211_RATE_INFO_HE_RU_ALLOC_996 = 0x5
NL80211_RATE_INFO_HE_RU_ALLOC = 0x11
NL80211_RATE_INFO_MAX = 0x1d
NL80211_RATE_INFO_MAX = 0x20
NL80211_RATE_INFO_MCS = 0x2
NL80211_RATE_INFO_S1G_MCS = 0x17
NL80211_RATE_INFO_S1G_NSS = 0x18
@@ -6146,7 +6180,7 @@ const (
NL80211_TXRATE_HT = 0x2
NL80211_TXRATE_LEGACY = 0x1
NL80211_TX_RATE_LIMITED = 0x1
NL80211_TXRATE_MAX = 0x7
NL80211_TXRATE_MAX = 0xa
NL80211_TXRATE_MCS = 0x2
NL80211_TXRATE_VHT = 0x3
NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT = 0x1
@@ -6162,7 +6196,7 @@ const (
NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2
NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1
NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3
NL80211_WIPHY_RADIO_ATTR_MAX = 0x4
NL80211_WIPHY_RADIO_ATTR_MAX = 0x5
NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2
NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2
NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1
@@ -6363,3 +6397,79 @@ const (
MPOL_PREFERRED_MANY = 0x5
MPOL_WEIGHTED_INTERLEAVE = 0x6
)
const (
GPIO_V2_GET_LINEINFO_IOCTL = 0xc100b405
GPIO_V2_GET_LINE_IOCTL = 0xc250b407
GPIO_V2_LINE_GET_VALUES_IOCTL = 0xc010b40e
GPIO_V2_LINE_SET_VALUES_IOCTL = 0xc010b40f
GPIO_V2_GET_LINEINFO_WATCH_IOCTL = 0xc100b406
GPIO_GET_LINEINFO_UNWATCH_IOCTL = 0xc004b40c
)
const (
GPIO_V2_LINE_ATTR_ID_FLAGS = 0x1
GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES = 0x2
GPIO_V2_LINE_ATTR_ID_DEBOUNCE = 0x3
GPIO_V2_LINE_CHANGED_REQUESTED = 0x1
GPIO_V2_LINE_CHANGED_RELEASED = 0x2
GPIO_V2_LINE_CHANGED_CONFIG = 0x3
GPIO_V2_LINE_EVENT_RISING_EDGE = 0x1
GPIO_V2_LINE_EVENT_FALLING_EDGE = 0x2
)
type GPIOChipInfo struct {
Name [32]byte
Label [32]byte
Lines uint32
}
type GPIOV2LineValues struct {
Bits uint64
Mask uint64
}
type GPIOV2LineAttribute struct {
Id uint32
_ uint32
Flags uint64
}
type GPIOV2LineConfigAttribute struct {
Attr GPIOV2LineAttribute
Mask uint64
}
type GPIOV2LineConfig struct {
Flags uint64
Num_attrs uint32
_ [5]uint32
Attrs [10]GPIOV2LineConfigAttribute
}
type GPIOV2LineRequest struct {
Offsets [64]uint32
Consumer [32]byte
Config GPIOV2LineConfig
Num_lines uint32
Event_buffer_size uint32
_ [5]uint32
Fd int32
}
type GPIOV2LineInfo struct {
Name [32]byte
Consumer [32]byte
Offset uint32
Num_attrs uint32
Flags uint64
Attrs [10]GPIOV2LineAttribute
_ [4]uint32
}
type GPIOV2LineInfoChanged struct {
Info GPIOV2LineInfo
Timestamp_ns uint64
Event_type uint32
_ [5]uint32
}
type GPIOV2LineEvent struct {
Timestamp_ns uint64
Id uint32
Offset uint32
Seqno uint32
Line_seqno uint32
_ [6]uint32
}
+12
View File
@@ -354,6 +354,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint32
@@ -703,3 +711,7 @@ type SysvShmDesc struct {
_ uint32
_ uint32
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
)
+12
View File
@@ -367,6 +367,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -717,3 +725,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
)
+12
View File
@@ -345,6 +345,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint32
@@ -697,3 +705,7 @@ type SysvShmDesc struct {
_ uint32
_ uint32
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
)
+12
View File
@@ -346,6 +346,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -696,3 +704,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
)
+12
View File
@@ -347,6 +347,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -697,3 +705,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x8044b401
)
+12
View File
@@ -350,6 +350,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint32
@@ -702,3 +710,7 @@ type SysvShmDesc struct {
Ctime_high uint16
_ uint16
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)
+12
View File
@@ -349,6 +349,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -699,3 +707,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)
+12
View File
@@ -349,6 +349,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -699,3 +707,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)
+12
View File
@@ -350,6 +350,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint32
@@ -702,3 +710,7 @@ type SysvShmDesc struct {
Ctime_high uint16
_ uint16
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)
+12
View File
@@ -357,6 +357,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint32
@@ -710,3 +718,7 @@ type SysvShmDesc struct {
_ uint32
_ [4]byte
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)
+12
View File
@@ -356,6 +356,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -705,3 +713,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)
+12
View File
@@ -356,6 +356,14 @@ type Taskstats struct {
Wpcopy_delay_min uint64
Irq_delay_max uint64
Irq_delay_min uint64
Cpu_delay_max_ts KernelTimespec
Blkio_delay_max_ts KernelTimespec
Swapin_delay_max_ts KernelTimespec
Freepages_delay_max_ts KernelTimespec
Thrashing_delay_max_ts KernelTimespec
Compact_delay_max_ts KernelTimespec
Wpcopy_delay_max_ts KernelTimespec
Irq_delay_max_ts KernelTimespec
}
type cpuMask uint64
@@ -705,3 +713,7 @@ type SysvShmDesc struct {
_ uint64
_ uint64
}
const (
GPIO_GET_CHIPINFO_IOCTL = 0x4044b401
)

Some files were not shown because too many files have changed in this diff Show More