suwako / farfetch アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

master
ブランチ master
farfetch / src / libc.c
519 B、24行 生 Blame 履歴
1#include "libc.h"
2#include "common.h"
3
4#include <stdio.h>
5#include <string.h>
6#include <stdlib.h>
7
8const char *display_libc() {
9#if defined(__linux__)
10 const char *musl = run_command_s("ldd $(which ls) | grep libc | grep musl");
11 if (musl != NULL && strlen(musl) != 0) {
12 free((void *)musl);
13 return "musl";
14 }
15
16 const char *glibc = run_command_s("ldd $(which ls) | grep libc | grep gnu");
17 if (glibc != NULL && strlen(glibc) != 0) {
18 free((void *)glibc);
19 return "glibc";
20 }
21#endif
22
23 return NULL;
24}