Added implementation for netload.c (glibtop_netload).

This commit is contained in:
Martin Baulig
1999-04-05 12:53:00 +00:00
parent c9651a012e
commit 174f316a62
3 changed files with 154 additions and 3 deletions

View File

@@ -178,3 +178,19 @@ glibtop_get_proc_data_proc_maps_s (glibtop *server, pid_t pid,
return size;
}
int
glibtop_get_proc_data_netload_s (glibtop *server,
libgtop_netload_t *netload,
const char *device)
{
int name [2] = { CTL_LIBGTOP, LIBGTOP_NETLOAD };
size_t size = sizeof (libgtop_netload_t);
if (sysctl (name, 2, netload, &size, device, strlen (device)+1)) {
glibtop_warn_io_r (server, "sysctl (libgtop/netload)");
return -1;
}
return 0;
}