mirror of
https://github.com/containers/podman.git
synced 2025-09-22 20:56:21 +08:00
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>
This commit is contained in:

committed by
Matthew Heon

parent
3ed81051e8
commit
a21f21efa1
29
libpod/lock/shm_lock_manager_unsupported.go
Normal file
29
libpod/lock/shm_lock_manager_unsupported.go
Normal file
@ -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")
|
||||
}
|
Reference in New Issue
Block a user