sysctl, w: miscelaneous usage/man fixes

This commit is a result of RH man page mass scan, that failed.
All the broken/missing switches should be fixed now.
Merge branch 'master' of git://gitorious.org/procps/procps
Conditional test vmstat -p
pwdx: fails when run in a nonexistent locale

pwdx rather mysteriously fails with "invalid process id" when run in a
nonexistent locale (e.g. "LC_ALL=foo pwdx $$").  This is because it
fails to obey the documented calling sequence for strtol - that is, set
errno to 0 before the call - and thus the errno from the setlocale
failure bleeds over into its check for whether strtol failed.

References: http://bugs.debian.org/718766

Signed-off-by: Craig Small <csmall@enc.com.au>
ps: making the libselinux support configurable

Previously the libselinux support was present
in the sources, but disabled with a preprocessor
condition (#if 0).
From now the libselinux support can be enabled with
the --enable-libselinux switch available
in the configuration script. That way is more
flexible than local patches modifying the condition
value from 0 to 1.
free: reusing 'shared' for Shmem

Previously the shared memory column was always zero
for 2.6 series kernels (and later) due to the fact,
that the value was taken from the MemShared entry
that disappeared with 2.6 series kernels.
Later a new Shmem entry appeared in the /proc/meminfo
file and the 'shared' column now displays either
the MemShared or the Shmem value (depending on their
presence - the presence is mutually exclusive).
If none of the two entries is exported by the kernel,
then the column is zero.
top: correct, improve or otherwise tweak some comments

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: tweak cursor state code to swat an obscure buglet

An obscure bug has been discovered where a 'W' with an
old rcfile, warning against overwrite, would display a
cursor that should normally be hidden. This followed a
user's reply. So some logic was rearranged just a bit.

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: correct cursor positioning for all ^Z or ^C cases

Some more (very obscure) conditions where a suspension
or program end might embed the shell prompt within top
output have been uncovered beyond the 2 already known.

We had already covered some suspend/end contingencies:
1. the users were using the 'fields management' screen
2. the users were prompted for any line oriented input

However, there remained some situations where ^Z or ^C
could still produce a misplaced cursor + shell prompt:
3. the 'g' command while waiting for the window choice
4. the 'W' command if about to overwrite an old rcfile
5. the '=' command when exploiting the Inspect feature
6. the period during which any error message was shown

But, even when all those bases are covered there still
remains a remote possibility that such interrupts will
occur during a top repaint cycle. So rather than throw
yet more code at these self-inflicted problems perhaps
it is better if we just throw in the proverbial towel.

Thus, I'll take the only sane approach and restore the
results expected ever since top's inception and before
scrollback buffers entered the picture. Namely, with a
^Z or ^C the cursor will be placed on the final screen
row. That usually means it will immediately follow the
last output line but it may follow many blank lines if
the user interrupts top when *not* on the main screen.

Reference(s):
. expanded repositioning (for line oriented input)
commit 33104a2bcc321495107d72e4cfee4090b1d90f76
. introduced repositioning (for fields management)
commit 5c974ff44da4fbbb9170dd15bdd81555c62c31a9
. scrollback buffers (the cursor handling changes)
commit dedaf6e1a81738ff08ee8e8523871e12f555ad6d

Signed-off-by: Jim Warner <james.warner@comcast.net>
ps: address a potential 'newline' quirk the libselinux

Sometimes with libselinux present but SELinux inactive
the context reported is "unconfined" which contains an
embedded newline. This then causes misalignment of any
subsequent data. So, ps will now protect against that.

Reference(s):
http://www.freelists.org/post/procps/enablelibselinux-switch,14

Signed-off-by: Jim Warner <james.warner@comcast.net>
top: Fixing duplicate words in the man page
Merge branch 'master' of git://gitorious.org/procps/procps