Commit 6bf15f50 by Christian Brauner

utils: add lxc_getpagesize()

parent d6066350
...@@ -2420,3 +2420,14 @@ int lxc_make_tmpfile(char *template, bool rm) ...@@ -2420,3 +2420,14 @@ int lxc_make_tmpfile(char *template, bool rm)
return fd; return fd;
} }
uint64_t lxc_getpagesize(void)
{
int64_t pgsz;
pgsz = sysconf(_SC_PAGESIZE);
if (pgsz <= 0)
pgsz = 1 << 12;
return pgsz;
}
...@@ -467,5 +467,6 @@ extern bool has_fs_type(const char *path, fs_type_magic magic_val); ...@@ -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 is_fs_type(const struct statfs *fs, fs_type_magic magic_val);
extern bool lxc_nic_exists(char *nic); extern bool lxc_nic_exists(char *nic);
extern int lxc_make_tmpfile(char *template, bool rm); extern int lxc_make_tmpfile(char *template, bool rm);
extern uint64_t lxc_getpagesize(void);
#endif /* __LXC_UTILS_H */ #endif /* __LXC_UTILS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment