]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile_utils: add lxc_get_conf_uint64()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 18 Oct 2017 14:20:01 +0000 (16:20 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 21 Oct 2017 16:38:14 +0000 (18:38 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile_utils.c
src/lxc/confile_utils.h

index 59d592d74b56a96c9ad2deccd9733fd21d767265..9db4bc6d3711e68294a55f001af6c0c06eb9cb47 100644 (file)
@@ -672,6 +672,16 @@ int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v)
        return snprintf(retv, inlen, "%d", v);
 }
 
+int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v)
+{
+       if (!retv)
+               inlen = 0;
+       else
+               memset(retv, 0, inlen);
+
+       return snprintf(retv, inlen, "%"PRIu64, v);
+}
+
 bool parse_limit_value(const char **value, rlim_t *res)
 {
        char *endptr = NULL;
index 585b4b52f2343c9d14c5698bbe3f7e50ec1bd71c..ee9376e247908d37b093d3a8abee2eaf5f9bea42 100644 (file)
@@ -84,5 +84,7 @@ extern void update_hwaddr(const char *line);
 extern bool new_hwaddr(char *hwaddr);
 extern int lxc_get_conf_str(char *retv, int inlen, const char *value);
 extern int lxc_get_conf_int(struct lxc_conf *c, char *retv, int inlen, int v);
+extern int lxc_get_conf_uint64(struct lxc_conf *c, char *retv, int inlen, uint64_t v);
 extern bool parse_limit_value(const char **value, rlim_t *res);
+
 #endif /* __LXC_CONFILE_UTILS_H */