Questions tagged [sysinfo]
27 questions
11
votes
3 answers
Can not understand load returned by sysinfo
To find the load average in linux I use sys/sysinfo.h which include linux/kernel.h, where the following structure is defined:
struct sysinfo {
long uptime; /* Seconds since boot */
unsigned long loads[3]; /* 1, 5, and 15 minute load…

Ravi
- 1,574
- 2
- 16
- 28
7
votes
1 answer
sysinfo system call returns wrong load average values on linux
I have a C program that prints some system statistics.
#include
#include
int main() {
int days, hours, mins;
struct sysinfo sys_info;
if(sysinfo(&sys_info) != 0)
perror("sysinfo");
// Uptime
days =…

cateof
- 6,608
- 25
- 79
- 153
7
votes
5 answers
Golang retrieve application uptime
I'm trying to retrieve the current uptime of my Go application.
I've seen there's a package syscall which provides a type Sysinfo_t and a method Sysinfo(*Sysinfo_t) which apparently allows you to retrieve the Uptime (since it's a field of the…

fredmaggiowski
- 2,232
- 3
- 25
- 44
7
votes
1 answer
Mac OS X equivalent header file for `sysinfo.h` in Linux
Is there any Mac OS X equivalent header file for sysinfo.h in Linux. I am porting code from Linux to Mac but the structure struct sysinfo is not found.
Edit: ==More info==
In Linux platform I use a Header file which is not found in…

pcbabu
- 2,219
- 4
- 22
- 32
6
votes
2 answers
How can I discover my end user's users' system performance settings?
How can I discover my end users' system performance settings (visual effects, etc.)? I want to make my WPF application compatible with those settings.
Is there any standard routine to do this or do I just have to read sysinfo?

Jalal
- 6,594
- 9
- 63
- 100
4
votes
3 answers
sysinfo system call not returning correct freeram value
I recently wrote the following C code using sysinfo systemcall to display system statistics, what amused me was that the freeram variable of sysinfo structure doesn't return the amount of free RAM instead it is returning the current RAM usage. I had…

k4rtik
- 259
- 1
- 5
- 18
2
votes
1 answer
How to retrieve OS X board-id information programmatically
How can I retrieve following information programmatically in c++:
This is a terminal command in Mac OSX:
ioreg -c IOPlatformExpertDevice | awk '/board-id/ {print $4}' | awk -F '\"' '{print $2}'
I use IOKit library to retrieve information such as…

Riddhi Rathod
- 115
- 1
- 10
1
vote
0 answers
Electron : How to display system RAM and CPU usage in real-time
so I'm trying to make an app that displays the cpu usage, ram usage, gpu usage and disk usage to a bar graph. I'm at the point where I can display the total percent of ram used but I am not able to update the value in real time and show it to the…

Anant Narayan
- 51
- 1
- 3
- 8
1
vote
1 answer
Is sysinfo() async. signal safe?
This may be a silly question, but in Linux (RHEL 7/8) is sysinfo() (called from gcc 'C') async. signal safe?
That is, can it be safely called called from a 'C' signal handler?
Running 'man sysinfo' or 'info sysinfo' from a command line doesn't seem…

MysteryGuy
- 25
- 4
1
vote
2 answers
gpucompute* is down* in slurm cluster
There is a down state on my gpucompute nodes and cant send the jobs on GPU nodes.
I couldn't return my 'down GPU' nodes after following all the solutions on the net. Before this problem, I had an error with the Nvidia driver configuration in a way…

Charlt
- 17
- 9
1
vote
1 answer
How to get total RAM from Golang code on Mac?
I have some Linux code in golang:
import "syscall"
var info syscall.Sysinfo_t
err := syscall.Sysinfo(&info)
totalRam := info.Totalram
I'd like to port this to Mac OS X.
I see that Sysinfo is available on Linux but not on Mac:
Linux:
$ go list -f…

Simon Que
- 45
- 4
1
vote
2 answers
linux c: sysinfo get bad memory values
I use sysinfo to get memory information. But the result seems to be wrong, as it isn't consistent with /proc/meminfo.
My codes:
#include
#include
double megabyte = 1024 * 1024;
long
get_free_mem() {
struct sysinfo…

thomaslee
- 407
- 1
- 7
- 21
1
vote
1 answer
Python platform independent way to get system information
I was wondering if there was a platform independent way of getting system information for linux, windows, mac. I know you can use platform module to get some basic information. I am looking for more detailed information like
CPU information like…

tuxalot
- 313
- 4
- 11
1
vote
3 answers
Where can I get info about notebook's model name?
I trying to get info about HW from notebooks. I do this via WMI, but not always there contains the info about notebook model for example. It depends on the manufacturer, SONY never contains HW info in WMI.
FileStream fs = new…

user2374929
- 11
- 3
1
vote
1 answer
sysinfo returns incorrect value for freeram (even with mem_unit)
My full C MATE applet can be found at github here: https://github.com/geniass/mate-resource-applet/tree/cmake (BRANCH CMAKE). It's a hacky mess right now, so see the code below.
I couldn't find an applet to display my computer's free ram, so that's…

geniass
- 371
- 1
- 9
- 20