Assuming a particular width of a type (or equivalence with "long") doesn't
work everywhere. On new architectures, LFS/etc is enabled by default,
making rlim_t same as rlim64_t even if long is only 32-bit.
Not sure how you handle too big values -- you may want to re-check the
strtoull part.
Signed-off-by: Adam Borowski <kilobyte@angband.pl>
{
struct lxc_list *iter;
struct rlimit limit;
- unsigned long limit_value;
+ rlim_t limit_value;
struct lxc_list *limlist = NULL;
struct lxc_limit *limelem = NULL;
{
struct lxc_list *iter;
struct rlimit limit;
- unsigned long limit_value;
+ rlim_t limit_value;
struct lxc_list *limlist = NULL;
struct lxc_limit *limelem = NULL;
return snprintf(retv, inlen, "%d", v);
}
-bool parse_limit_value(const char **value, unsigned long *res)
+bool parse_limit_value(const char **value, rlim_t *res)
{
char *endptr = NULL;
}
errno = 0;
- *res = strtoul(*value, &endptr, 10);
+ *res = strtoull(*value, &endptr, 10);
if (errno || !endptr)
return false;
*value = endptr;
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 bool parse_limit_value(const char **value, unsigned long *res);
+extern bool parse_limit_value(const char **value, rlim_t *res);
#endif /* __LXC_CONFILE_UTILS_H */