summaryrefslogtreecommitdiff
path: root/sysdeps/linux/glibtop_server.h
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2004-06-12 22:37:35 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2004-06-12 22:37:35 +0000
commit09febbf67d3e7395f160b1d682647e2a3007bedc (patch)
tree3c545a5a647c87ca22372b118e83f1dc2e4cc56c /sysdeps/linux/glibtop_server.h
parentd5b8a71e5b791fc4e6bf5ee2263ae397202e4f32 (diff)
downloadlibgtop-09febbf67d3e7395f160b1d682647e2a3007bedc.tar.gz
Cleaned. (proc_file_to_buffer): Uninlined.
* glibtop_server.h: * glibtop_server.c: (get_scaled): Cleaned. (proc_file_to_buffer): Uninlined. * sysinfo.c: (init_sysinfo): Re-implemented.
Diffstat (limited to 'sysdeps/linux/glibtop_server.h')
-rw-r--r--sysdeps/linux/glibtop_server.h23
1 files changed, 2 insertions, 21 deletions
diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h
index b1f3d7d6..0946cf1e 100644
--- a/sysdeps/linux/glibtop_server.h
+++ b/sysdeps/linux/glibtop_server.h
@@ -62,27 +62,8 @@ unsigned long long
get_scaled(const char *buffer, const char *key);
-static inline int
-proc_file_to_buffer (char *buffer, const char *fmt, pid_t pid)
-{
- char filename [BUFSIZ];
- int fd, len;
-
- sprintf (filename, fmt, pid);
-
- fd = open (filename, O_RDONLY);
- if (fd < 0) return -1;
-
- len = read (fd, buffer, BUFSIZ-1);
- close (fd);
-
- if (len < 0)
- return -1;
-
- buffer [len] = '\0';
-
- return 0;
-}
+int
+proc_file_to_buffer (char *buffer, const char *fmt, pid_t pid);
static inline int
proc_stat_to_buffer (char *buffer, pid_t pid)