|  |  |  | Libgtop Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
#include <glibtop/uptime.h> #define GLIBTOP_UPTIME_UPTIME #define GLIBTOP_UPTIME_IDLETIME #define GLIBTOP_UPTIME_BOOT_TIME #define GLIBTOP_MAX_UPTIME struct glibtop_uptime; void glibtop_get_uptime (glibtop_uptime *buf); #define glibtop_get_uptime_r void glibtop_get_uptime_l (glibtop *server,glibtop_uptime *buf); void glibtop_get_uptime_p (glibtop *server,glibtop_uptime *buf); void glibtop_get_uptime_s (glibtop *server,glibtop_uptime *buf);
struct glibtop_uptime {
	guint64 flags;
	double uptime;		/* GLIBTOP_UPTIME_UPTIME */
	double idletime; /* GLIBTOP_UPTIME_IDLETIME */
	guint64 boot_time;
};
void                glibtop_get_uptime                  (glibtop_uptime *buf);
When porting LibGTop to a new system, you only need to implement 
uptime and idletime if there's a faster or better way to obtain them
as using function(glibtop_cpu) for it. Look at 
sysdeps/freebsd/uptime.c for an
example on how to obtain them using function(glibtop_cpu).
| 
 | A location to return the system uptime | 
void glibtop_get_uptime_l (glibtop *server,glibtop_uptime *buf);
| 
 | |
| 
 | 
void glibtop_get_uptime_p (glibtop *server,glibtop_uptime *buf);
| 
 | |
| 
 | 
void glibtop_get_uptime_s (glibtop *server,glibtop_uptime *buf);
| 
 | |
| 
 |