mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-23 15:33:16 +08:00

This package is to provide unix.* wrappers to ensure that: - they retry on EINTR; - a "rich" error is returned on failure. A first such wrapper, Sendmsg, is introduced. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
16 lines
295 B
Go
16 lines
295 B
Go
package linux
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// Sendmsg wraps [unix.Sendmsg].
|
|
func Sendmsg(fd int, p, oob []byte, to unix.Sockaddr, flags int) error {
|
|
err := retryOnEINTR(func() error {
|
|
return unix.Sendmsg(fd, p, oob, to, flags)
|
|
})
|
|
return os.NewSyscallError("sendmsg", err)
|
|
}
|