Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
lock.hh
Go to the documentation of this file.
1#pragma once
3
4#include <memory>
5
6#include <sys/types.h>
7#include <vector>
8
9namespace nix {
10
12{
13 virtual ~UserLock() { }
14
18 std::pair<uid_t, uid_t> getUIDRange()
19 {
20 auto first = getUID();
21 return {first, first + getUIDCount() - 1};
22 }
23
27 virtual uid_t getUID() = 0;
28
29 virtual uid_t getUIDCount() = 0;
30
31 virtual gid_t getGID() = 0;
32
33 virtual std::vector<gid_t> getSupplementaryGIDs() = 0;
34};
35
40std::unique_ptr<UserLock> acquireUserLock(uid_t nrIds, bool useUserNamespace);
41
42bool useBuildUsers();
43
44}
Definition lock.hh:12
std::pair< uid_t, uid_t > getUIDRange()
Definition lock.hh:18
virtual uid_t getUID()=0