utils: add lxc_getpagesize()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2017-10-21 16:22:58 +02:00
parent 127c6e703b
commit e46361235c
No known key found for this signature in database
GPG Key ID: 7B3C391EFEA93624
2 changed files with 12 additions and 0 deletions

View File

@ -2359,3 +2359,14 @@ int lxc_make_tmpfile(char *template, bool rm)
return fd;
}
uint64_t lxc_getpagesize(void)
{
int64_t pgsz;
pgsz = sysconf(_SC_PAGESIZE);
if (pgsz <= 0)
pgsz = 1 << 12;
return pgsz;
}

View File

@ -467,5 +467,6 @@ extern bool has_fs_type(const char *path, fs_type_magic magic_val);
extern bool is_fs_type(const struct statfs *fs, fs_type_magic magic_val);
extern bool lxc_nic_exists(char *nic);
extern int lxc_make_tmpfile(char *template, bool rm);
extern uint64_t lxc_getpagesize(void);
#endif /* __LXC_UTILS_H */