mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 17:41:41 +01:00
Start work on GNU
This commit is contained in:
@@ -19,7 +19,7 @@ const char* ffDetectLoadavg(double result[3])
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __GNU__
|
||||
// getloadavg requires higher ANDROID_API version
|
||||
struct sysinfo si;
|
||||
if (sysinfo(&si) < 0)
|
||||
@@ -27,5 +27,6 @@ const char* ffDetectLoadavg(double result[3])
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
result[i] = (double) si.loads[i] / (1 << SI_LOAD_SHIFT);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__) || defined(__HAIKU__)
|
||||
#include <net/if_media.h>
|
||||
#include <net/if_dl.h>
|
||||
#elif defined(__GNU__)
|
||||
#else
|
||||
#include <netpacket/packet.h>
|
||||
#endif
|
||||
@@ -69,12 +70,14 @@ static const FFLocalIpNIFlag niFlagOptions[] = {
|
||||
#ifdef IFF_NOTRAILERS
|
||||
FF_LOCALIP_NIFLAG(NOTRAILERS),
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
#if defined( __linux__) || defined (__GNU__)
|
||||
FF_LOCALIP_NIFLAG(MASTER),
|
||||
FF_LOCALIP_NIFLAG(SLAVE),
|
||||
FF_LOCALIP_NIFLAG(PORTSEL),
|
||||
FF_LOCALIP_NIFLAG(AUTOMEDIA),
|
||||
FF_LOCALIP_NIFLAG(DYNAMIC),
|
||||
#endif
|
||||
#ifdef __linux__
|
||||
FF_LOCALIP_NIFLAG(LOWER_UP),
|
||||
FF_LOCALIP_NIFLAG(DORMANT),
|
||||
FF_LOCALIP_NIFLAG(ECHO),
|
||||
@@ -562,6 +565,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
|
||||
FF_DEBUG("No MAC address available for interface %s", adapter->mac->ifa_name);
|
||||
}
|
||||
}
|
||||
#elif defined(__GNU__)
|
||||
#else
|
||||
(void) adapter;
|
||||
#endif
|
||||
|
||||
@@ -26,13 +26,13 @@ const char* ffDetectUptime(FFUptimeResult* result)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef __GNU__
|
||||
struct timespec uptime;
|
||||
if (clock_gettime(CLOCK_BOOTTIME, &uptime) != 0)
|
||||
return "clock_gettime(CLOCK_BOOTTIME) failed";
|
||||
|
||||
result->uptime = (uint64_t) uptime.tv_sec * 1000 + (uint64_t) uptime.tv_nsec / 1000000;
|
||||
result->bootTime = ffTimeGetNow() - result->uptime;
|
||||
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@
|
||||
#define FF_SYSNAME "NetBSD"
|
||||
#elif defined(__HAIKU__)
|
||||
#define FF_SYSNAME "Haiku"
|
||||
#elif defined(__GNU__)
|
||||
#define FF_SYSNAME "GNU"
|
||||
#else
|
||||
#define FF_SYSNAME "Unknown"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user