ps previously followed the Unix98 standard when it comes to
user-defined output, sometimes. This meant you could have
user output format with a header that included commas and
equals signs. It was dependent on if ps thought you wanted
sysv or bsd format and THAT was dependent on things in previous
options.
It was very confusing to a user because
ps p $$ -o pid=,comm=
gave you a two-column output but
ps -p $$ -o pid=,comm=
would give you a one column output with the header ",comm="
The -p versus p means (to ps) you want sysv or bsd parsing.
Unix98 standard or not, this is plainly just silly.
The commit removes any of the quirks Unix98 has with user defined
output. If you really wanted a ps header with commas in the output,
today isn't your day.
Signed-off-by: Craig Small <csmall@enc.com.au>
Added function procps_linux_version() which used to be an
exported integer instead. Also changed the method of obtaining
the linux version (more correctly the os release) to use a specific
procfs entry. This works for both Linux and FreeBSD.
This patch was made necessary by those library changes
in support of recently revised/simplified wchan logic.
In addition, this commit eliminates a broken alternate
'namelist' provision which was intended to allow users
to specify a System.map file to be used in translating
addresses into function names. But, the real effect of
the now defunct 'N' and '-n' options was to indirectly
force addresses (not names) to be displayed since such
user named map files could not be successfully parsed.
Besides when the required FRAME_POINTER kconfig option
is absent there is no address to translate and when it
is present /proc/PID/wchan is already translated. Thus
an alternate mapping is unnecessary and inappropriate.
[ we'll forgive POSIX for documenting '-n namelist' ]
Reference(s):
http://www.freelists.org/post/procps/WCHAN,11
Signed-off-by: Jim Warner <james.warner@comcast.net>
It doesn't make any sense to have the binary version strings
embedded into the library. The version strings are defined
already either in the Makefile or in include/c.h
common.h:23:19: warning: ISO C does not permit named variadic macros [-Wvariadic-macros]
global.c:499:3: warning: ISO C does not support the '%Ld' gnu_printf format [-Wformat]
output.c:134:1: warning: 'sr_cstime' defined but not used [-Wunused-function]
output.c:816:3: warning: ISO C does not support the '%Lu' gnu_printf format [-Wformat]
output.c:816:3: warning: ISO C does not support the '%Lu' gnu_printf format [-Wformat]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Both these are from [-Werror=format-security]
sig.c:262:5: error: format not a string literal and no format arguments
global.c:517:3: error: format not a string literal and no format arguments
Under certain circumstances, using abort() when either make check
or make distcheck puts ps into an infinite loop around the
function catastrophic_failure() in ps and the C library raise
and abort functions.
Using exit removes this problem and does almost the same thing.
This code currently uses error_at_line() from error.h, so pull it in.
Long term, this might get moved to c.h as a local helper on err.h,
but I have no idea.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Strings with lower caps & no trailing dots have greater change to
have multiple occurences, meaning less effort for translators, than
strings with them.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
The catastrophic_failure function tries to make bug reporting useful
by telling in which line error occured, and drops core.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit represents an experiment in nls help text support.
The word --help itself been made translatable along with the
help section names and their abbreviations. Thus, the work of
the translators will ultimately alter program run-time behavior.
Perhaps someday all "long" options can behave in a similar way
which could offer a considerable benefit to other languages.
Instead of translationg just option descriptions, the long
forms of those options could also be transalated.
This commit also:
. includes the section abbreviations in --help output
. isolates all --help support in the ps/help.c module
. provides (hopefully) meaningful Translator guidance
. removes --help support from the ps/common.h header
. removes --help support from the ps/parser.c module
. eliminates tabs in line with the style of other ps modules
. eliminates the need for the include/c.h header file
This commit is prmarily concerned with elimnating deugging only
code from the nls template file.
It also eliminates any remaing useless trailing whitespace.
This patch mostly reorganizes include files and eliminates
some useless trailing whitespace.
It also adopts the standard procps-ng unconditional approach
to nls initialization.
These xalloc functions are a private function for the library. If using
programs need them, then they should make their own error reporting or
use a common file.
There were numerous ps memory allocation inconsistencies.
Some were checked for failure and others were not.
The program was modified to utilize the library memory
rouines which are consistent in dealing with errors.
(a few changes simply removed trailing whitespace)
ps program
. etimes added for ELAPSED expressed in seconds
. time_t used in place of former unsigned long
top program
. corrected scroll message bug when 'x' toggle on
. fixed forest view potential missing libflags bug
. improved 'k' default signal invocation logic
. enhanced logic for %CPU maximums displayed
. made signal handling more robust and efficient