aboutsummaryrefslogtreecommitdiff
path: root/lib/libutil/libutil.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libutil/libutil.h')
-rw-r--r--lib/libutil/libutil.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h
index d27262e44daf..9b5b2abe7f09 100644
--- a/lib/libutil/libutil.h
+++ b/lib/libutil/libutil.h
@@ -89,6 +89,14 @@ __BEGIN_DECLS
void clean_environment(const char * const *_white,
const char * const *_more_white);
int expand_number(const char *_buf, int64_t *_num);
+int expand_unsigned(const char *_buf, uint64_t *_num);
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
+ __has_extension(c_generic_selections)
+#define expand_number(_buf, _num) \
+ _Generic((_num), \
+ uint64_t *: expand_unsigned, \
+ default: expand_number)((_buf), (_num))
+#endif
int extattr_namespace_to_string(int _attrnamespace, char **_string);
int extattr_string_to_namespace(const char *_string, int *_attrnamespace);
int flopen(const char *_path, int _flags, ...);