summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEric Andersen2002-10-22 12:21:15 +0000
committerEric Andersen2002-10-22 12:21:15 +0000
commit44608e9693b03661fbab5e27650bb040c6871d11 (patch)
tree4555230653cdb82d998f076b29130d8fe18a6f7a /include
parent1887b0478f2743ce7808e8b37462e18d584611e1 (diff)
downloadbusybox-44608e9693b03661fbab5e27650bb040c6871d11.zip
busybox-44608e9693b03661fbab5e27650bb040c6871d11.tar.gz
Patch last_pach62 from vodz. This patch moves all the /proc parsing
code into libbb so it can be shared by ps, top, etc, saving over 1.5k.
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 3b5f297..bc81123 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -127,7 +127,7 @@ extern void write_mtab(char* blockDevice, char* directory,
char* filesystemType, long flags, char* string_flags);
extern void erase_mtab(const char * name);
extern long atoi_w_units (const char *cp);
-extern long* find_pid_by_name( char* pidName);
+extern long* find_pid_by_name( const char* pidName);
extern char *find_real_root_device_name(const char* name);
extern char *get_line_from_file(FILE *file);
extern void print_file(FILE *file);
@@ -337,4 +337,23 @@ extern ssize_t xread_all_eof(int fd, void *buf, size_t count);
extern void xread_all(int fd, void *buf, size_t count);
extern unsigned char xread_char(int fd);
+typedef struct {
+ int pid;
+ char user[9];
+ char state[4];
+ unsigned long rss;
+ int ppid;
+#ifdef FEATURE_CPU_USAGE_PERCENTAGE
+ unsigned pcpu;
+ unsigned long stime, utime;
+#endif
+ char *cmd;
+
+ /* basename of executable file in call to exec(2),
+ size from kernel headers */
+ char short_cmd[16];
+} procps_status_t;
+
+extern procps_status_t * procps_scan(int save_user_arg0);
+
#endif /* __LIBCONFIG_H__ */