summaryrefslogtreecommitdiff
path: root/src/os.c
diff options
context:
space:
mode:
author諏訪子 <suwako@076.moe>2024-06-19 23:52:56 +0900
committer諏訪子 <suwako@076.moe>2024-06-19 23:52:56 +0900
commitb6e3f6cb5d1051777c35988f201e6730525e3389 (patch)
tree98679f1995f7b103f3314ce54fdf0d1c76df6dbd /src/os.c
parent8f378429801162d690dc68c0f15b483c1d291838 (diff)
掃除
Diffstat (limited to 'src/os.c')
-rw-r--r--src/os.c53
1 files changed, 4 insertions, 49 deletions
diff --git a/src/os.c b/src/os.c
index 4662acd..e1c15f4 100644
--- a/src/os.c
+++ b/src/os.c
@@ -1,52 +1,7 @@
#include "os.h"
+#include "common.h"
-#include <stdio.h>
-#include <string.h>
-
-void display_os_name() {
- char buf[64];
- FILE *p = popen("uname -s", "r");
- if (!p) {
- fprintf(stderr, "「uname」コマンドを実効に失敗");
- return;
- }
-
- while (fgets(buf, sizeof(buf), p) != NULL) {
- buf[strcspn(buf, "\n")] = '\0';
- printf("%s", buf);
- }
-
- pclose(p);
-}
-
-void display_os_vers() {
- char buf[16];
- FILE *p = popen("uname -r", "r");
- if (!p) {
- fprintf(stderr, "「uname」コマンドを実効に失敗");
- return;
- }
-
- while (fgets(buf, sizeof(buf), p) != NULL) {
- buf[strcspn(buf, "\n")] = '\0';
- printf("%s", buf);
- }
-
- pclose(p);
-}
-
-void display_os_arch() {
- char buf[16];
- FILE *p = popen("uname -m", "r");
- if (!p) {
- fprintf(stderr, "「uname」コマンドを実効に失敗");
- return;
- }
-
- while (fgets(buf, sizeof(buf), p) != NULL) {
- buf[strcspn(buf, "\n")] = '\0';
- printf("%s", buf);
- }
-
- pclose(p);
+const char *display_os() {
+ return run_command_s("uname -s && echo \" \" && uname -r && "
+ "echo \" \" && uname -m");
}