feat(kernel/syscalls): implement semi-stub linux_sysinfo

Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
2025-04-03 06:46:26 +00:00
parent 75dd958316
commit 1a48d05042
2 changed files with 53 additions and 2 deletions

View File

@ -428,4 +428,23 @@ typedef struct cpu_set_t
#define CPU_SET(i, set) CPU_BIT_OP(i, sizeof(cpu_set_t), set, |=)
#define CPU_ZERO(set) (memset((set), 0, sizeof(cpu_set_t)))
/* taken from https://man7.org/linux/man-pages/man2/sysinfo.2.html */
struct sysinfo
{
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
unsigned long totalram; /* Total usable main memory size */
unsigned long freeram; /* Available memory size */
unsigned long sharedram; /* Amount of shared memory */
unsigned long bufferram; /* Memory used by buffers */
unsigned long totalswap; /* Total swap space size */
unsigned long freeswap; /* Swap space still available */
unsigned short procs; /* Number of current processes */
unsigned long totalhigh; /* Total high memory size */
unsigned long freehigh; /* Available high memory size */
unsigned int mem_unit; /* Memory unit size in bytes */
char _f[20 - 2 * sizeof(long) - sizeof(int)]; /* Padding to 64 bytes */
};
#endif // !__FENNIX_KERNEL_LINUX_DEFS_H__