summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9/file.go
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2021-03-03 10:23:55 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-03 10:25:58 -0800
commita9441aea2780da8c93da1c73da860219f98438de (patch)
tree8b12915756f5bfb926218214cd7bc0b3281605fd /pkg/p9/file.go
parentb8a5420f49a2afd622ec08b5019e1bf537f7da82 (diff)
[op] Replace syscall package usage with golang.org/x/sys/unix in pkg/.
The syscall package has been deprecated in favor of golang.org/x/sys. Note that syscall is still used in the following places: - pkg/sentry/socket/hostinet/stack.go: some netlink related functionalities are not yet available in golang.org/x/sys. - syscall.Stat_t is still used in some places because os.FileInfo.Sys() still returns it and not unix.Stat_t. Updates #214 PiperOrigin-RevId: 360701387
Diffstat (limited to 'pkg/p9/file.go')
-rw-r--r--pkg/p9/file.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/pkg/p9/file.go b/pkg/p9/file.go
index c2e3a3f98..c59c6a65b 100644
--- a/pkg/p9/file.go
+++ b/pkg/p9/file.go
@@ -15,8 +15,7 @@
package p9
import (
- "syscall"
-
+ "golang.org/x/sys/unix"
"gvisor.dev/gvisor/pkg/fd"
)
@@ -67,7 +66,7 @@ type File interface {
// WalkGetAttr walks to the next file and returns its maximal set of
// attributes.
//
- // Server-side p9.Files may return syscall.ENOSYS to indicate that Walk
+ // Server-side p9.Files may return unix.ENOSYS to indicate that Walk
// and GetAttr should be used separately to satisfy this request.
//
// On the server, WalkGetAttr has a read concurrency guarantee.
@@ -160,7 +159,7 @@ type File interface {
// Read reads from this file. Open must be called first.
//
- // This may return io.EOF in addition to syscall.Errno values.
+ // This may return io.EOF in addition to unix.Errno values.
//
// On the server, ReadAt has a read concurrency guarantee. See Open for
// additional requirements regarding lazy path resolution.
@@ -168,7 +167,7 @@ type File interface {
// Write writes to this file. Open must be called first.
//
- // This may return io.EOF in addition to syscall.Errno values.
+ // This may return io.EOF in addition to unix.Errno values.
//
// On the server, WriteAt has a read concurrency guarantee. See Open
// for additional requirements regarding lazy path resolution.
@@ -239,7 +238,7 @@ type File interface {
// Readdir reads directory entries.
//
- // This may return io.EOF in addition to syscall.Errno values.
+ // This may return io.EOF in addition to unix.Errno values.
//
// On the server, Readdir has a read concurrency guarantee.
Readdir(offset uint64, count uint32) ([]Dirent, error)
@@ -292,7 +291,7 @@ type DefaultWalkGetAttr struct{}
// WalkGetAttr implements File.WalkGetAttr.
func (DefaultWalkGetAttr) WalkGetAttr([]string) ([]QID, File, AttrMask, Attr, error) {
- return nil, nil, AttrMask{}, Attr{}, syscall.ENOSYS
+ return nil, nil, AttrMask{}, Attr{}, unix.ENOSYS
}
// DisallowClientCalls panics if a client-only function is called.