X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Futils.h;h=8b6003b926295696b5cba6e0848f1b14829dd92b;hb=4878de5c7deb512bbdac4fdfc498907efa06fb7c;hp=6e478b39eb3609f90aa3ad1ab3b5a4200754411c;hpb=48a4000561343808724f7cb5fa8c131877489ccd;p=lttng-tools.git diff --git a/src/common/utils.h b/src/common/utils.h index 6e478b39e..8b6003b92 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 * */ @@ -17,16 +17,10 @@ #include -#if defined(__cplusplus) -extern "C" { -#endif - #define KIBI_LOG2 10 #define MEBI_LOG2 20 #define GIBI_LOG2 30 -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); @@ -45,7 +39,10 @@ int utils_get_count_order_u32(uint32_t x); int utils_get_count_order_u64(uint64_t x); const char *utils_get_home_dir(void); char *utils_get_user_home_dir(uid_t uid); -size_t utils_get_current_time_str(const char *format, char *dst, size_t len); + +size_t utils_get_current_time_str(const char *format, char *dst, size_t len) + ATTR_FORMAT_STRFTIME(1); + int utils_get_group_id(const char *name, bool warn, gid_t *gid); char *utils_generate_optstring(const struct option *long_options, size_t opt_count); @@ -53,8 +50,8 @@ 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); @@ -72,8 +69,4 @@ enum lttng_error_code utils_group_id_from_name( int utils_parse_unsigned_long_long(const char *str, unsigned long long *value); -#if defined(__cplusplus) -} -#endif - #endif /* _COMMON_UTILS_H */