summaryrefslogtreecommitdiffhomepage
path: root/pkg/abi
diff options
context:
space:
mode:
authorNeel Natu <neelnatu@google.com>2018-07-16 12:19:02 -0700
committerShentubot <shentubot@google.com>2018-07-16 12:20:05 -0700
commit8f21c0bb2807888d812318def43c2405c9b13f5a (patch)
tree5ddaa634acbad46a248954e32dc0b901624ad42b /pkg/abi
parent9059983fdb2cf64a08152d2aab648b6660b9631b (diff)
Add EventOperations.HostFD()
This method allows an eventfd inside the Sentry to be registered with with the host kernel. Update comment about memory mapping host fds via CachingInodeOperations. PiperOrigin-RevId: 204784859 Change-Id: I55823321e2d84c17ae0f7efaabc6b55b852ae257
Diffstat (limited to 'pkg/abi')
-rw-r--r--pkg/abi/linux/BUILD1
-rw-r--r--pkg/abi/linux/eventfd.go22
2 files changed, 23 insertions, 0 deletions
diff --git a/pkg/abi/linux/BUILD b/pkg/abi/linux/BUILD
index e164945cf..ae7e4378c 100644
--- a/pkg/abi/linux/BUILD
+++ b/pkg/abi/linux/BUILD
@@ -30,6 +30,7 @@ go_library(
"dev.go",
"elf.go",
"errors.go",
+ "eventfd.go",
"exec.go",
"fcntl.go",
"file.go",
diff --git a/pkg/abi/linux/eventfd.go b/pkg/abi/linux/eventfd.go
new file mode 100644
index 000000000..bc0fb44d2
--- /dev/null
+++ b/pkg/abi/linux/eventfd.go
@@ -0,0 +1,22 @@
+// Copyright 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package linux
+
+// Constants for eventfd2(2).
+const (
+ EFD_SEMAPHORE = 0x1
+ EFD_CLOEXEC = O_CLOEXEC
+ EFD_NONBLOCK = O_NONBLOCK
+)