mirror of
https://github.com/containerd/containerd.git
synced 2026-08-09 01:21:15 +00:00
Bumps [github.com/mdlayher/vsock](https://github.com/mdlayher/vsock) from 1.2.1 to 1.3.0. - [Release notes](https://github.com/mdlayher/vsock/releases) - [Changelog](https://github.com/mdlayher/vsock/blob/main/CHANGELOG.md) - [Commits](https://github.com/mdlayher/vsock/compare/v1.2.1...v1.3.0) --- updated-dependencies: - dependency-name: github.com/mdlayher/vsock dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
24 lines
635 B
Go
24 lines
635 B
Go
//go:build linux
|
|
|
|
package socket
|
|
|
|
import "golang.org/x/sys/unix"
|
|
|
|
// setReadBuffer wraps the SO_RCVBUF{,FORCE} setsockopt(2) options.
|
|
func (c *Conn) setReadBuffer(bytes int) error {
|
|
err := c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUFFORCE, bytes)
|
|
if err != nil {
|
|
err = c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_RCVBUF, bytes)
|
|
}
|
|
return err
|
|
}
|
|
|
|
// setWriteBuffer wraps the SO_SNDBUF{,FORCE} setsockopt(2) options.
|
|
func (c *Conn) setWriteBuffer(bytes int) error {
|
|
err := c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUFFORCE, bytes)
|
|
if err != nil {
|
|
err = c.SetsockoptInt(unix.SOL_SOCKET, unix.SO_SNDBUF, bytes)
|
|
}
|
|
return err
|
|
}
|