mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Implement Registry.Remove.
Remove implements the behaviour of mq_unlink(2). Updates #136
This commit is contained in:
@@ -224,8 +224,22 @@ func (r *Registry) newQueueLocked(creds *auth.Credentials, owner fs.FileOwner, p
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Remove removes the queue with the given name from the registry. See
|
||||
// mq_unlink(2).
|
||||
func (r *Registry) Remove(ctx context.Context, name string) error {
|
||||
if len(name) > MaxName {
|
||||
return linuxerr.ENAMETOOLONG
|
||||
}
|
||||
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
return r.impl.Unlink(ctx, name)
|
||||
}
|
||||
|
||||
// Destroy destroys the registry and releases all held references.
|
||||
func (r *Registry) Destroy(ctx context.Context) {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
r.impl.Destroy(ctx)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user