diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-26 14:06:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-26 14:06:09 +0000 |
commit | fa6ba9b00fb5f77ead67b624be510ec50b2f4f5e (patch) | |
tree | 324494e8fc059c854052e94e0b2361d0e438abec /vendor/golang.org/x/sys/unix/syscall_illumos.go | |
parent | 25525ff834cc979566bb09e5546ee0a72ef76a79 (diff) | |
parent | b7dda21e33f9bddda9b49adbd0f18d5205b249f4 (diff) | |
download | podman-fa6ba9b00fb5f77ead67b624be510ec50b2f4f5e.tar.gz podman-fa6ba9b00fb5f77ead67b624be510ec50b2f4f5e.tar.bz2 podman-fa6ba9b00fb5f77ead67b624be510ec50b2f4f5e.zip |
Merge pull request #9826 from containers/dependabot/go_modules/github.com/vbauerster/mpb/v6-6.0.3
Bump github.com/vbauerster/mpb/v6 from 6.0.2 to 6.0.3
Diffstat (limited to 'vendor/golang.org/x/sys/unix/syscall_illumos.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/syscall_illumos.go | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go index bc442e3ba..c5c58806c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_illumos.go +++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go @@ -9,7 +9,9 @@ package unix -import "unsafe" +import ( + "unsafe" +) func bytes2iovec(bs [][]byte) []Iovec { iovecs := make([]Iovec, len(bs)) @@ -76,3 +78,52 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) { } return } + +//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error) + +func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) { + var clp, datap *strbuf + if len(cl) > 0 { + clp = &strbuf{ + Len: int32(len(cl)), + Buf: (*int8)(unsafe.Pointer(&cl[0])), + } + } + if len(data) > 0 { + datap = &strbuf{ + Len: int32(len(data)), + Buf: (*int8)(unsafe.Pointer(&data[0])), + } + } + return putmsg(fd, clp, datap, flags) +} + +//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error) + +func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) { + var clp, datap *strbuf + if len(cl) > 0 { + clp = &strbuf{ + Maxlen: int32(len(cl)), + Buf: (*int8)(unsafe.Pointer(&cl[0])), + } + } + if len(data) > 0 { + datap = &strbuf{ + Maxlen: int32(len(data)), + Buf: (*int8)(unsafe.Pointer(&data[0])), + } + } + + if err = getmsg(fd, clp, datap, &flags); err != nil { + return nil, nil, 0, err + } + + if len(cl) > 0 { + retCl = cl[:clp.Len] + } + if len(data) > 0 { + retData = data[:datap.Len] + } + return retCl, retData, flags, nil +} |