* Stop quoting macro arguments that don't contain spaces.
* Stop defining content for the center header.
* Migrate procio(3) and top(1) to use ISO 8601 date format, like most of
the other man pages in this project.
* Add the day of the month to procps(3)'s and top(1)'s revision dates.
* Replace procio(3)'s inside footer, "Linux Manpage", with "procps-ng".
* Migrate procps(3), procps_misc(3), procps_pids(3) to use "procps-ng"
instead of "libproc2" as their inside footers, like all the other man
pages in this project.
groff_man_style(7):
Macro reference preliminaries
...
If a macro accepts multiple arguments, those containing space
characters must be double‐quoted to be interpreted correctly.
...
Document structure macros
...
.TH identifier section [footer‐middle [footer‐inside [header‐middle]]]
...
identifier and section are positioned at the left and right
in the header; the latter is set after the former, in
parentheses and without space. footer‐middle is centered in
the footer. By default, footer‐inside is positioned at the
bottom left. Use of the double‐sided layout option -rD1
places footer‐inside at the bottom left on recto
(odd‐numbered) pages, and the bottom right on verso
(even‐numbered) pages. By default, the outside footer is
the page number. Use of the continuous‐rendering option
-rcR=1 replaces it with identifier and section, as in the
header. header‐middle is centered in the header. If
section is an integer between 1 and 9 (inclusive), there is
no need to specify header‐middle; an.tmac supplies text for
it.
...
By convention, footer‐middle is the date of the most recent
modification to the man page source document, and footer‐
inside is the name and version or release of the project
providing it.
In the referenced commit, I omitted the change to the DEJAGNU
config script which had the zombie process create/destroy
functions.
References:
commit 47cf5ae1ce
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Version 3.3.17 would append <defunct> to the command line and command name
if the process was a zombie (state Z).
As part of the escape function fixes, the command name lost this.
The feature is now restored, in addition pr_args() and pr_comm() had a
lot of duplicate code (and would have had more for this fix) so they
now only do the selection part and call a common function.
The sitation now in the library is command names do not get <defunct>
appended, but command lines do. It's not really the library's job
to change the presentation of the command line (only provide the status
field) but this change now makes procps behave as previous versions.
There are now checks for both linux and bsd formatting to check the
command line/name are correctly marked.
References:
#355
commit 7b0fc19e9d
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Create a make/kill sched batch proc
Unset the PS_PERSONALITY environment variable, otherwise
subsequent tests will break depending on the order of tests.
Paramaterize the nice value so nobody thinks 18 is a magic
value.
Signed-off-by: Craig Small <csmall@dropbear.xyz>
wcwdith used to take wint_t but glibc changed it to wchar_t
casting to wchar_t as if it is EOF (-1) its handled elsewhere
Coverity: CID #427127
Signed-off-by: Craig Small <csmall@dropbear.xyz>
kill would only correctly parse single digit negative pids because
it was using the optopt which is a single character, it now uses the
entire argument.
Updated the kill man page to:
mention that you need to specify the signal number
get it more following the standards
Update format to standard manpage see man-pages(7)
Added note that /etc/sysctl.conf is not used by systemd-sysctl
Reference the system alternatives.
Reference:
https://bugs.debian.org/1077187
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Need to free the sesions_list after using it, this was
introduced by me when checking the session class.
Thanks to Thorsten Kukuk from SUSE (All capitals)
for catching this and the patch.
References:
commit 734930e476https://www.freelists.org/post/procps/New-procps-release-soon,10
Signed-off-by: Craig Small <csmall@dropbear.xyz>
There is no guarantee that the length of whatever
sd_session_get_tty() returns is going to be under UT_LINESIZE
so copying until strlen of the source string could be an issue.
Instead copy at most UT_LINESIZE-1 characters and break if the
source string is at '\0'
Thanks to Werner Fink <werner@suse.de> and SuSE glibc maintainer
w would try to stat() the tty device, which could be a problem
if there isn't one defined for a user.
Thanks to Werner Fink <werner@suse.de> and SuSE glibc maintainer
The previous build setup would check for pidfd_open using
AC_CHECK_FUNC and would be incorrectly reported as true.
Also, if pidfd_open() and __NR_pidfd_open were not present,
pidwait would silently not be built.
So, changes:
compile a small programin using pidfd_open to test it properly
conditionally try to find NR_pidfd_open if the function fails
complain if neither are present
have --disable-pidwait configure option so you are explicit in
not wanting and knowing you wont get pidwait
References:
#352
commit d9c3e3676d
commit 17f94796a9
Signed-off-by: Craig Small <csmall@dropbear.xyz>
print_signame() was in ps but got moved and renamed into
the library, the ps common.h header needs to catch up.
References:
commit 7f56a9aea1
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Commit 58559a5b64 was not backported from
3.3.17 to 4.0.0 resulting in the following build failure when ncursesw
headers are not installed in ../usr/include/ncursesw/..:
src/watch.c:56:11: fatal error: ncursesw/ncurses.h: No such file or directory
56 | # include <ncursesw/ncurses.h>
| ^~~~~~~~~~~~~~~~~~~~
Fixes:
- http://autobuild.buildroot.org/results/b7573be2e78f3d224f48cb3f52087e3d227d58e3
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Most of the time, po4a is not required and the translated man
pages are not translated, but sometimes (such as make dist) you
always want them available.
make -C po-man man.stamp, or its dependents, previous would give
some obscure error; either about running a flag or missing file,
it now explicitly talks about the issue:
make[4]: Entering directory '/home/csmall/Projects/procps/procps/po-man'
make \
top_distdir="../procps-ng-4.0.4.195-e684a-dirty" distdir="../procps-ng-4.0.4.195-e684a-dirty/po-man" \
dist-hook
make[5]: Entering directory '/home/csmall/Projects/procps/procps/po-man'
error: You need to install the po4a package.
make[5]: Leaving directory '/home/csmall/Projects/procps/procps/po-man'
make[5]: *** [Makefile:535: check-po4a] Error 1
Signed-off-by: Craig Small <csmall@dropbear.xyz>
A recent issue, now closed, was raised by a brave soul
who successfully took on and exploited the <pids> API.
That program contained an iterative procps_pids_select
involving the UTILIZATION_C plus TICS_ALL_DELTA items.
Also included in the loop was a procps_pids_reset call
which may have been present just to produce some extra
loading so as to increase the UTILIZATION_C value. But
I began to wonder if its presence was maybe a mistake.
After all, nowhere in the documentation was it clearly
stated that even with an iterative process the user is
not required to clean/reset the stacks with each pass.
So this commit will clarify the conditions under which
a procps_pids_reset call was really needed. Of course,
if such advice is ignored, and extra reset calls made,
no real harm is done. Just some cpu cycles are wasted.
Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/349
Signed-off-by: Jim Warner <james.warner@comcast.net>
When the macro(s) employed in building the hash tables
traded a return for a goto to avoid repetitive loading
of a constant return value, one return was missed that
would also have benefited from the conversion to goto.
Reference(s):
. Jul, 2024 - tweaked hash table build macro(s)
commit 393985863e
Signed-off-by: Jim Warner <james.warner@comcast.net>
When the keys_bottom() function was introduced in that
commit shown below, some elements reflected an earlier
version when under development. Now there isn't a need
for a static integer nor the saving of a return value.
Reference(s):
. Jul, 2024 - introduced keys_bottom
commit ad77827e9c
Signed-off-by: Jim Warner <james.warner@comcast.net>
Besides correcting 1 opps, this commit deals with that
change referenced below where the 'info' parameter was
removed from all those library VAL macros. It explains
why a functionally duplicate macro was being retained.
Reference(s):
. Apr, 2024 - eliminated VAL macros 'info' parm
commit 967fdcfb06
Signed-off-by: Jim Warner <james.warner@comcast.net>
...in paragraph tags.
man(7) font alternation macros offer a less cluttered appearance than
troff(1) font selection escape sequences; in groff man(7) they even take
care of italic corrections for you, obviating the need to specify GNU
troff `\/` and `\,` extension escape sequences.
Also be more clear that the short forms of options accept option
arguments, not just the long forms. (I suspect this practice was
avoided because people have historically found the `TP` macro's tag,
which uses a troff(1) input trap, difficult to use with man(7) font
macros[1] and laborious to use with font selection escape sequences.)
groff_man(7):
Unlike the above font style macros, the font style alternation
macros below set no input traps; they must be given arguments to
have effect. They apply italic corrections as appropriate.
.BI bold‐text italic‐text ...
Set each argument in bold and italics, alternately.
.BR bold‐text roman‐text ...
Set each argument in bold and roman, alternately.
.IB italic‐text bold‐text ...
Set each argument in italics and bold, alternately.
.IR italic‐text roman‐text ...
Set each argument in italics and roman, alternately.
.RB roman‐text bold‐text ...
Set each argument in roman and bold, alternately.
.RI roman‐text italic‐text ...
Set each argument in roman and italics, alternately.
[1] There's a sad historical story behind that.
Various aspects of it are covered here, in increasing amounts of
detail.
https://git.savannah.gnu.org/cgit/groff.git/commit/?id=5485e3b7f1be2956e2067d572c6ce8fd5c036fc1https://savannah.gnu.org/bugs/?51468https://lists.gnu.org/archive/html/groff/2022-06/msg00026.html
When building the hash tables, a careless macro forced
a repetitive loading of a constant return value before
branching to the routine's actual return instructions.
This patch will avoid the overhead via a goto instead.
Signed-off-by: Jim Warner <james.warner@comcast.net>
Darn it! When additional items were added in the patch
referenced below, yours truly neglected to update that
hash table. So those additions just represented wasted
space in the meminfo_data struct, never being updated.
Reference(s):
. Mar, 2024 - added 2 additional items
9ebc09e15a
Signed-off-by: Jim Warner <james.warner@comcast.net>
Back when our release 4.0.1 was being readied, sources
were sent to the TP (Translation Project). However one
person named Benno Schulenberg refused to release them
for translation. His stated reason was the top command
line help text which then finally included long forms.
He demanded that the help text be broken into separate
strings instead of a single large string. But, all the
top text (some much more complex) has just one string.
So that stated reason was, at the least, inconsistent.
[ I suspect the real reason was that Mr. Schulenberg ]
[ thought that the carefully right-justified English ]
[ wording would also be required of translations too ]
The bottom line was that Benno took it upon himself to
change the TP motto from "you code, we translate" into
"first we tell you how to code and then we translate".
Rather than bend a knee to that despot, I disabled the
text entirely, admittedly denying users a translation.
Now, with this commit we enable translatable help text
but with a hint included to ignore the justified text.
Reference)s):
. Oct, 2022 - finalized translation exclusion
commit ab05a3785f
Signed-off-by: Jim Warner <james.warner@comcast.net>
Added rows for page allocations to --stats/-s option in vmstat
Gives more information about where pages are allocated:
1024 pages alloc in dma
1025 pages alloc in dma32
0 pages alloc in high
0 pages alloc in movable
40054877 pages alloc in normal
44916456 pages free
Signed-off-by: Craig Small <csmall@dropbear.xyz>
That keys_global function had grown a little too large
so this commit just isolates those keys supporting the
'bottom window' feature in their own separate routine.
I will also take this opportunity to eliminate a quirk
regarding the tab & backtab keys. Two keystrokes might
be required the first time or when changing direction.
Signed-off-by: Jim Warner <james.warner@comcast.net>
sysctl --all goes through the entire /proc/sys tree. For the majority
of parameters, reading the virtual file does nothing except print a
value.
However stat_refresh gives no output but flushes the vm data.
sysctl now has a verboten list which is a list of parameters that
should never be read with --all.
Cleaned up the sysctl.8 manpage, as per man-pages(7)
Order is FILES, NOTES, EXAMPLES
Syystem file precedence, deprecated and verboten parameters are
subheadings under NOTES
Removed AUTHORS as its discouraged, they go elsewhere.
References:
https://bugs.debian.org/978688https://www.kernel.org/doc/Documentation/sysctl/vm.txthttps://man7.org/linux/man-pages/man7/man-pages.7.html
watch only exits on changes that are visible. This is a by-product
of how changes are detected which is in the ncurses idea of windows.
The limits of change detection is also why multicolours can't be
implemented, so a large re-work of how the output is stored and
displayed may fix both.
For now a note in the manpage is all we can do.
References:
https://bugs.debian.org/729569
Signed-off-by: Craig Small <csmall@dropbear.xyz>
The --unit option said si/so were not changed.
The si/so description said they were.
The code, which is the final decision, says yes.
Update vmstat.8 to remove note that si/so not changed by --unit
References:
https://bugs.debian.org/1061944
Signed-off-by: Craig Small <csmall@dropbear.xyz>
The original idea of using signal_number_to_name() was ok when the
calling function was in ps, but problematic in the library because:
* There needed to be a libtool and non-libtool built of local/signals.c
* The function handled RT signals, but the calling function in the
library does this too.
* It needed to be an array of signal,name pairs because signals.c
is two-way while we only need num->name in the library.
* signal_number_to_name is called by signal handlers so less library
calls the better.
If sigabbrev_np() is available in libc, then the library should use
that. This commit provides a back-up version of that function which
is only used by libc's that can't provide.
Greatly inspired by Peter Hutterer's work-around with some clever
stringizing and concatenation in the preprocessor for same issue
in Pipewire.
References:
commit 7f56a9aea1731f45ed50https://gcc.gnu.org/onlinedocs/cpp/Stringizing.html
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Renamed procps_capabilities_names to procps_capmask_names
so it matches the signal mask function.
Re-arranged the variables for both functions to look
more like standard functions like snprintf()
Updated ps and top to new API.
References:
commit 3e10f4077a
Signed-off-by: Craig Small <csmall@dropbear.xyz>
Inspired by 2 commits shown below, top can now display
a task's capabilities in the bottom window via Ctrl-A.
Reference(s):
. Jul, 2024 - capability names added to library
commit 3e10f4077a
. Jul, 2024 - capability names added to ps
commit 31b7023c2d
Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit trades an unnecessary function pointer for
a integer variable, making the logic a little clearer.
Signed-off-by: Jim Warner <james.warner@comcast.net>