X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Futils.h;h=e09c0a9ae556f8ed3dc3a6d6a8a70f68cb69b5a9;hb=95671f5349e87cdd2ea6cb47243608e9368ab8d5;hp=dec4cd8aa2268490eae52adb55795d76ab62a07b;hpb=159b042f34366d0fde5dcd73b4231c558922a664;p=lttng-tools.git diff --git a/src/common/utils.h b/src/common/utils.h index dec4cd8aa..e09c0a9ae 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -1,7 +1,7 @@ /* * Copyright (C) 2012 David Goulet * - * SPDX-License-Identifier: GPL-2.0-only + * SPDX-License-Identifier: LGPL-2.1-only * */ @@ -21,10 +21,6 @@ #define MEBI_LOG2 20 #define GIBI_LOG2 30 -char *utils_partial_realpath(const char *path, char *resolved_path, - size_t size); -char *utils_expand_path(const char *path); -char *utils_expand_path_keep_symlink(const char *path); int utils_create_pipe(int *dst); int utils_create_pipe_cloexec(int *dst); int utils_create_pipe_cloexec_nonblock(int *dst); @@ -51,12 +47,24 @@ int utils_create_lock_file(const char *filepath); int utils_recursive_rmdir(const char *path); int utils_truncate_stream_file(int fd, off_t length); int utils_show_help(int section, const char *page_name, const char *help_msg); -int utils_get_memory_available(size_t *value); -int utils_get_memory_total(size_t *value); +int utils_get_memory_available(uint64_t *value); +int utils_get_memory_total(uint64_t *value); int utils_change_working_directory(const char *path); enum lttng_error_code utils_user_id_from_name( const char *user_name, uid_t *user_id); enum lttng_error_code utils_group_id_from_name( const char *group_name, gid_t *group_id); +/* + * Parse `str` as an unsigned long long value. + * + * Return 0 on success. Return -1 on failure which can be because: + * + * - `str` is zero length + * - `str` contains invalid + */ +LTTNG_HIDDEN +int utils_parse_unsigned_long_long(const char *str, + unsigned long long *value); + #endif /* _COMMON_UTILS_H */