]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
utils: add macro __LXC_NUMSTRLEN
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 27 Nov 2016 22:41:06 +0000 (23:41 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 1 Dec 2016 04:58:48 +0000 (23:58 -0500)
This macro can be used to set or allocate a string buffer that can hold any
64bit representable number.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/utils.h

index 6ce68954e1cf972592c2bf99d176095118bc281d..9cb99cd57f5aa031c2b116b879342cf49e8ec9ad 100644 (file)
 #include "config.h"
 #include "initutils.h"
 
+/* Useful macros */
+/* Maximum number for 64 bit integer is a string with 21 digits: 2^64 - 1 = 21 */
+#define __LXC_NUMSTRLEN 21
+
 /* returns 1 on success, 0 if there were any failures */
 extern int lxc_rmdir_onedev(char *path);
 extern int get_u16(unsigned short *val, const char *arg, int base);