summaryrefslogtreecommitdiffhomepage
path: root/pkg/usermem/bytes_io.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-06-29 22:13:25 +0000
committergVisor bot <gvisor-bot@google.com>2021-06-29 22:13:25 +0000
commita81deffb4e19f1edb78b618a97df4bd129e312c8 (patch)
tree43699ff370db20b5fa2f55f988d63f61244a4436 /pkg/usermem/bytes_io.go
parent42b672d53fb6fd9fe71c0efc373843d79713afca (diff)
parent54b71221c0b7a9159f369263ea6189bdba4eac3a (diff)
Merge release-20210628.0-8-g54b71221c (automated)
Diffstat (limited to 'pkg/usermem/bytes_io.go')
-rw-r--r--pkg/usermem/bytes_io.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/usermem/bytes_io.go b/pkg/usermem/bytes_io.go
index 3da3c0294..4c97b9136 100644
--- a/pkg/usermem/bytes_io.go
+++ b/pkg/usermem/bytes_io.go
@@ -16,6 +16,7 @@ package usermem
import (
"gvisor.dev/gvisor/pkg/context"
+ "gvisor.dev/gvisor/pkg/errors/linuxerr"
"gvisor.dev/gvisor/pkg/hostarch"
"gvisor.dev/gvisor/pkg/safemem"
"gvisor.dev/gvisor/pkg/syserror"
@@ -51,7 +52,7 @@ func (b *BytesIO) CopyIn(ctx context.Context, addr hostarch.Addr, dst []byte, op
// ZeroOut implements IO.ZeroOut.
func (b *BytesIO) ZeroOut(ctx context.Context, addr hostarch.Addr, toZero int64, opts IOOpts) (int64, error) {
if toZero > int64(maxInt) {
- return 0, syserror.EINVAL
+ return 0, linuxerr.EINVAL
}
rngN, rngErr := b.rangeCheck(addr, int(toZero))
if rngN == 0 {
@@ -89,7 +90,7 @@ func (b *BytesIO) rangeCheck(addr hostarch.Addr, length int) (int, error) {
return 0, nil
}
if length < 0 {
- return 0, syserror.EINVAL
+ return 0, linuxerr.EINVAL
}
max := hostarch.Addr(len(b.Bytes))
if addr >= max {