summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/semaphore
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-12-04 04:01:09 +0000
committergVisor bot <gvisor-bot@google.com>2020-12-04 04:01:09 +0000
commit0ba39926c86fb6789cd48b93b5cbfca8d64c56ee (patch)
treeb46b51918c405693b228aa513b9863d416523e3e /pkg/sentry/kernel/semaphore
parent6be31bb4fcef461797469e047b25c095fbf572bf (diff)
parenta78cef0ed7ce15583424f5873f0aa6fdad1d5c2f (diff)
Merge release-20201130.0-36-ga78cef0ed (automated)
Diffstat (limited to 'pkg/sentry/kernel/semaphore')
-rw-r--r--pkg/sentry/kernel/semaphore/semaphore.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/semaphore/semaphore.go b/pkg/sentry/kernel/semaphore/semaphore.go
index 335be8edd..31198d772 100644
--- a/pkg/sentry/kernel/semaphore/semaphore.go
+++ b/pkg/sentry/kernel/semaphore/semaphore.go
@@ -176,6 +176,22 @@ func (r *Registry) FindOrCreate(ctx context.Context, key, nsems int32, mode linu
return r.newSet(ctx, key, owner, owner, perms, nsems)
}
+// IPCInfo returns information about system-wide semaphore limits and parameters.
+func (r *Registry) IPCInfo() *linux.SemInfo {
+ return &linux.SemInfo{
+ SemMap: linux.SEMMAP,
+ SemMni: linux.SEMMNI,
+ SemMns: linux.SEMMNS,
+ SemMnu: linux.SEMMNU,
+ SemMsl: linux.SEMMSL,
+ SemOpm: linux.SEMOPM,
+ SemUme: linux.SEMUME,
+ SemUsz: 0, // SemUsz not supported.
+ SemVmx: linux.SEMVMX,
+ SemAem: linux.SEMAEM,
+ }
+}
+
// RemoveID removes set with give 'id' from the registry and marks the set as
// dead. All waiters will be awakened and fail.
func (r *Registry) RemoveID(id int32, creds *auth.Credentials) error {