summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/ipc/ns.go
diff options
context:
space:
mode:
authorZyad A. Ali <zyad.ali.me@gmail.com>2021-08-11 21:24:10 +0200
committerZyad A. Ali <zyad.ali.me@gmail.com>2021-09-17 11:16:25 +0200
commitbcef079ec24d56d37a670c4c4149c638be6fb110 (patch)
treeafcc54ea1f5ce50dbf7e2b94f8b59738f6df7125 /pkg/sentry/kernel/ipc/ns.go
parente452ecd49526f4a0bbacc462840fbc6e88781e36 (diff)
Move CtxIPCNamespace to kernel/ipc package.
CtxIPCNamespace is needed by mqfs package to be able to retreive an IPCNamespace using ctx.Value. As ctx.Value compares keys as interfaces, we need to use type kernel.contextID in package mqfs, which is not possible due to circular depenedency, so move it to kernel/ipc instead. Updates #136
Diffstat (limited to 'pkg/sentry/kernel/ipc/ns.go')
-rw-r--r--pkg/sentry/kernel/ipc/ns.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/ipc/ns.go b/pkg/sentry/kernel/ipc/ns.go
new file mode 100644
index 000000000..220c9eafb
--- /dev/null
+++ b/pkg/sentry/kernel/ipc/ns.go
@@ -0,0 +1,22 @@
+// Copyright 2021 The gVisor Authors.
+//
+// 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 ipc
+
+type contextID int
+
+// CtxIPCNamespace is the context.Value key used to retreive an IPC namespace.
+// We define it here because it's needed in several packages, and is not
+// possible to use otherwise without causing a circular depenedency.
+const CtxIPCNamespace contextID = iota