summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/syscalls/linux/vfs2/socket.go
diff options
context:
space:
mode:
authorZach Koopmans <zkoopmans@google.com>2021-08-12 15:16:45 -0700
committergVisor bot <gvisor-bot@google.com>2021-08-12 15:19:12 -0700
commit02370bbd315d7e7c2783d7001d014870cf1ef534 (patch)
tree4e5c4cddf1ef6a49d449e7a871e0f54fd6d30201 /pkg/sentry/syscalls/linux/vfs2/socket.go
parent5f132ae1f889829e57ef6b2117342247b0f75b3a (diff)
[syserror] Convert remaining syserror definitions to linuxerr.
Convert remaining public errors (e.g. EINTR) from syserror to linuxerr. PiperOrigin-RevId: 390471763
Diffstat (limited to 'pkg/sentry/syscalls/linux/vfs2/socket.go')
-rw-r--r--pkg/sentry/syscalls/linux/vfs2/socket.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/pkg/sentry/syscalls/linux/vfs2/socket.go b/pkg/sentry/syscalls/linux/vfs2/socket.go
index 0c2e0720b..97ff5eb55 100644
--- a/pkg/sentry/syscalls/linux/vfs2/socket.go
+++ b/pkg/sentry/syscalls/linux/vfs2/socket.go
@@ -264,7 +264,7 @@ func Connect(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysca
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Capture address and call syscall implementation.
@@ -295,7 +295,7 @@ func accept(t *kernel.Task, fd int32, addr hostarch.Addr, addrLen hostarch.Addr,
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, syserror.ENOTSOCK
+ return 0, linuxerr.ENOTSOCK
}
// Call the syscall implementation for this socket, then copy the
@@ -354,7 +354,7 @@ func Bind(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallC
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Capture address and call syscall implementation.
@@ -381,7 +381,7 @@ func Listen(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Syscal
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
if backlog > maxListenBacklog {
@@ -419,7 +419,7 @@ func Shutdown(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Validate how, then call syscall implementation.
@@ -450,7 +450,7 @@ func GetSockOpt(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sy
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Read the length. Reject negative values.
@@ -531,7 +531,7 @@ func SetSockOpt(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sy
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
if optLen < 0 {
@@ -569,7 +569,7 @@ func GetSockName(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.S
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Get the socket name and copy it to the caller.
@@ -597,7 +597,7 @@ func GetPeerName(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.S
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Get the socket peer name and copy it to the caller.
@@ -630,7 +630,7 @@ func RecvMsg(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysca
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Reject flags that we don't handle yet.
@@ -687,7 +687,7 @@ func RecvMMsg(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
if (file.StatusFlags() & linux.SOCK_NONBLOCK) != 0 {
@@ -852,7 +852,7 @@ func recvFrom(t *kernel.Task, fd int32, bufPtr hostarch.Addr, bufLen uint64, fla
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, syserror.ENOTSOCK
+ return 0, linuxerr.ENOTSOCK
}
if (file.StatusFlags() & linux.SOCK_NONBLOCK) != 0 {
@@ -925,7 +925,7 @@ func SendMsg(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysca
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Reject flags that we don't handle yet.
@@ -967,7 +967,7 @@ func SendMMsg(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.Sysc
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, nil, syserror.ENOTSOCK
+ return 0, nil, linuxerr.ENOTSOCK
}
// Reject flags that we don't handle yet.
@@ -1091,7 +1091,7 @@ func sendTo(t *kernel.Task, fd int32, bufPtr hostarch.Addr, bufLen uint64, flags
// Extract the socket.
s, ok := file.Impl().(socket.SocketVFS2)
if !ok {
- return 0, syserror.ENOTSOCK
+ return 0, linuxerr.ENOTSOCK
}
if (file.StatusFlags() & linux.SOCK_NONBLOCK) != 0 {