summaryrefslogtreecommitdiff
path: root/libpod/lock/shm_lock_manager_unsupported.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-08-08 15:50:16 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-01-04 09:45:59 -0500
commita21f21efa19372e055e8f1daf2e77c52e5352ccc (patch)
tree1cefa8e72f8d318ff47dd4925d486cd3081295d4 /libpod/lock/shm_lock_manager_unsupported.go
parent3ed81051e814e688f7b4ae1bbc7c4d4c3fbd7d0f (diff)
downloadpodman-a21f21efa19372e055e8f1daf2e77c52e5352ccc.tar.gz
podman-a21f21efa19372e055e8f1daf2e77c52e5352ccc.tar.bz2
podman-a21f21efa19372e055e8f1daf2e77c52e5352ccc.zip
Refactor locks package to build on non-Linux
Move SHM specific code into a subpackage. Within the main locks package, move the manager to be linux-only and add a non-Linux unsupported build file. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/lock/shm_lock_manager_unsupported.go')
-rw-r--r--libpod/lock/shm_lock_manager_unsupported.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/libpod/lock/shm_lock_manager_unsupported.go b/libpod/lock/shm_lock_manager_unsupported.go
new file mode 100644
index 000000000..a1340fcd1
--- /dev/null
+++ b/libpod/lock/shm_lock_manager_unsupported.go
@@ -0,0 +1,29 @@
+// +build !linux
+
+package lock
+
+import "fmt"
+
+// SHMLockManager is a shared memory lock manager.
+// It is not supported on non-Unix platforms.
+type SHMLockManager struct{}
+
+// NewSHMLockManager is not supported on this platform
+func NewSHMLockManager(numLocks uint32) (Manager, error) {
+ return nil, fmt.Errorf("not supported")
+}
+
+// OpenSHMLockManager is not supported on this platform
+func OpenSHMLockManager(numLocks uint32) (Manager, error) {
+ return nil, fmt.Errorf("not supported")
+}
+
+// AllocateLock is not supported on this platform
+func (m *SHMLockManager) AllocateLock() (Locker, error) {
+ return nil, fmt.Errorf("not supported")
+}
+
+// RetrieveLock is not supported on this platform
+func (m *SHMLockManager) RetrieveLock(id string) (Locker, error) {
+ return nil, fmt.Errorf("not supported")
+}