From 8f21c0bb2807888d812318def43c2405c9b13f5a Mon Sep 17 00:00:00 2001 From: Neel Natu Date: Mon, 16 Jul 2018 12:19:02 -0700 Subject: 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 --- pkg/abi/linux/BUILD | 1 + pkg/abi/linux/eventfd.go | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkg/abi/linux/eventfd.go (limited to 'pkg/abi/linux') 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 +) -- cgit v1.2.3