diff options
author | Jim Warner <james.warner@comcast.net> | 2011-05-18 10:33:44 +0200 |
---|---|---|
committer | Jan Görig <jgorig@redhat.com> | 2011-05-18 10:33:44 +0200 |
commit | 7b0fc19e9d28380dc9790615b93bc3653d6d686e (patch) | |
tree | 844b4136dd63dedda7b1834d64cdd41f0b7a72a6 /proc/escape.h | |
parent | 8621387c774df2cac53090f59de6b109d1af9786 (diff) | |
download | procps-ng-newtop.tar.gz |
enhanced libproc cgroup/cmdline support, exploited by topnewtop
Library Changes
. added PROC_EDITCMDLCVT flag
. added an internal (static) fill_cmdline_cvt function:
- reads and "escapes" /proc/#/cmdline
- returns result as a single string in a single vector
- callers are guaranteed a cmdline (no more NULL)
. added vectorize_this_str function, exploited by
fill_cgroup_cvt, fill_cmdline_cvt
. generalized read_cmdline function as read_unvectored, now
exploited by fill_cgroup_cvt, fill_cmdline_cvt, read_cmdline
( cgroup and cmdline no longer need be converted to string )
( vectors before being transformed to final representation )
. fixed bug regarding skipped group numbers (when enabled)
. escape_str made responsible for all single byte translation
with distinction between control chars + other unprintable
. added escaped_copy function for already escaped strings
. reorganized parts of proc_t to restore formatting standards
( displacement changes shouldn't matter with new version # )
. former ZAP_SUSEONLY #define now OOMEM_ENABLE
. added to library.map: escaped_copy; read_cmdline
Top Program Changes
. exploited the new PROC_EDITCMDLCVT provision
. eliminated now obsolete #include "proc/escape.h"
. changed the P_WCH display format if no kernel symbol table
. fixed very old bug in lflgs for out-of-view sort fields
. former ZAP_SUSEONLY #define now OOMEM_ENABLE
Ps Program Changes
. exploited the new PROC_EDITCMDLCVT provision
. exploited the new escaped_copy function
. consolidated pr_args and pr_comm into pr_argcom
Signed-off-by: Jan Görig <jgorig@redhat.com>
Diffstat (limited to 'proc/escape.h')
-rw-r--r-- | proc/escape.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/proc/escape.h b/proc/escape.h index 172960f..aa9f6d6 100644 --- a/proc/escape.h +++ b/proc/escape.h @@ -17,6 +17,7 @@ EXTERN_C_BEGIN extern int escape_strlist(char *restrict dst, const char *restrict const *restrict src, size_t n, int *cells); extern int escape_str(char *restrict dst, const char *restrict src, int bufsize, int *maxcells); extern int escape_command(char *restrict const outbuf, const proc_t *restrict const pp, int bytes, int *cells, unsigned flags); +extern int escaped_copy(char *restrict dst, const char *restrict src, int bufsize, int *maxroom); EXTERN_C_END #endif |