summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristopher Koch <chrisko@google.com>2019-07-29 17:17:58 -0700
committergVisor bot <gvisor-bot@google.com>2019-07-29 17:19:09 -0700
commita3e9031e665e5707ff1d181a577a808ff6d67452 (patch)
treed216f2f76fb880c0af563d4884c7271fdb0192f0
parent5fdb945a0dc7a05329f97dc1ca193baf1b3448f3 (diff)
Use x/sys/unix for sentry/host interaction; abi is for guest/sentry.
PiperOrigin-RevId: 260613864
-rw-r--r--pkg/unet/BUILD2
-rw-r--r--pkg/unet/unet_unsafe.go16
2 files changed, 9 insertions, 9 deletions
diff --git a/pkg/unet/BUILD b/pkg/unet/BUILD
index 769509e80..cbd92fc05 100644
--- a/pkg/unet/BUILD
+++ b/pkg/unet/BUILD
@@ -11,8 +11,8 @@ go_library(
importpath = "gvisor.dev/gvisor/pkg/unet",
visibility = ["//visibility:public"],
deps = [
- "//pkg/abi/linux",
"//pkg/gate",
+ "@org_golang_x_sys//unix:go_default_library",
],
)
diff --git a/pkg/unet/unet_unsafe.go b/pkg/unet/unet_unsafe.go
index f8a42c914..614448954 100644
--- a/pkg/unet/unet_unsafe.go
+++ b/pkg/unet/unet_unsafe.go
@@ -21,7 +21,7 @@ import (
"syscall"
"unsafe"
- "gvisor.dev/gvisor/pkg/abi/linux"
+ "golang.org/x/sys/unix"
)
// wait blocks until the socket FD is ready for reading or writing, depending
@@ -37,20 +37,20 @@ func (s *Socket) wait(write bool) error {
return errClosing
}
- events := []linux.PollFD{
+ events := []unix.PollFd{
{
// The actual socket FD.
- FD: fd,
- Events: linux.POLLIN,
+ Fd: fd,
+ Events: unix.POLLIN,
},
{
// The eventfd, signaled when we are closing.
- FD: int32(s.efd),
- Events: linux.POLLIN,
+ Fd: int32(s.efd),
+ Events: unix.POLLIN,
},
}
if write {
- events[0].Events = linux.POLLOUT
+ events[0].Events = unix.POLLOUT
}
_, _, e := syscall.Syscall(syscall.SYS_POLL, uintptr(unsafe.Pointer(&events[0])), 2, uintptr(math.MaxUint64))
@@ -61,7 +61,7 @@ func (s *Socket) wait(write bool) error {
return e
}
- if events[1].REvents&linux.POLLIN == linux.POLLIN {
+ if events[1].Revents&unix.POLLIN == unix.POLLIN {
// eventfd signaled, we're closing.
return errClosing
}