aboutsummaryrefslogtreecommitdiff
path: root/version.h
diff options
context:
space:
mode:
authorUsman Akinyemi <usmanakinyemi202@gmail.com>2025-02-15 21:20:49 +0530
committerJunio C Hamano <gitster@pobox.com>2025-02-18 09:05:12 -0800
commit0a78d61247922f30ebf2ce09025dcaa7bd7e3583 (patch)
tree52572e28b9fbca5fd2281f6fcd2507210bd79c18 /version.h
parentcdfd081df6fa42e6cd0da1d978d41b836c1f292b (diff)
downloadgit-0a78d61247922f30ebf2ce09025dcaa7bd7e3583.tar.xz
version: refactor get_uname_info()
Some code from "builtin/bugreport.c" uses uname(2) to get system information. Let's refactor this code into a new get_uname_info() function, so that we can reuse it in a following commit. Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'version.h')
-rw-r--r--version.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/version.h b/version.h
index 7c62e80577..afe3dbbab7 100644
--- a/version.h
+++ b/version.h
@@ -7,4 +7,11 @@ extern const char git_built_from_commit_string[];
const char *git_user_agent(void);
const char *git_user_agent_sanitized(void);
+/*
+ Try to get information about the system using uname(2).
+ Return -1 and put an error message into 'buf' in case of uname()
+ error. Return 0 and put uname info into 'buf' otherwise.
+*/
+int get_uname_info(struct strbuf *buf);
+
#endif /* VERSION_H */