Skip to content

Commit

Permalink
utils: add lxc_getpagesize()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Oct 21, 2017
1 parent 127c6e7 commit e463612
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lxc/utils.c
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions src/lxc/utils.h
Expand Up @@ -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 */

0 comments on commit e463612

Please sign in to comment.