Commit Graph

147 Commits

Author SHA1 Message Date
pepe
9f5f52b6cf :( 2023-05-02 13:45:33 +00:00
Craig Small
135069f2b2 build-sys: Set library to 0:1:0
There was a bug fix in the library but no functions add/moved/changed
Revision incremented.
2022-12-05 21:04:05 +11:00
Craig Small
5ed8add969 nls: Update the man-po logic
Put the man-po pot file under version control like its po/*.pot sibling.

Makefile now auto-matically generates the list of man pages as they are
in a single directory. There were some missing!

pot file target is dependent on the untranslated man pages

When downloading from translation project, run po4a to sync the new
po files correctly.

Downloaded man po files from translation project and synched.

Thanks to @gorean for the info

References:
 procps-ng/procps#258

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-11-10 21:52:19 +11:00
Craig Small
deeb82411f build-sys: Fix paths for check-lib
Forgot to move the location for test_Itemtables

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-31 17:30:34 +10:00
Craig Small
b72eb5c9ea build-sys: Move git-version-gen
git-version-gen was the only file in misc/ moving it to local/
2022-08-29 20:53:01 +10:00
Craig Small
15a0a71406 testsuite: Update the library tests for new location
Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 20:40:45 +10:00
Craig Small
1502648ff9 library: Rename to libproc2
The newlib library used to be called libproc-2 but the new
name is preferred.

References:
 https://www.freelists.org/post/procps/Next-for-newlib,3

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 20:38:17 +10:00
Craig Small
47a8676625 build-sys: Relocate lib/
test files in lib go to src/tests
include/ goes to local/
lib/*.c goes to local/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 20:28:03 +10:00
Craig Small
dcce8038be build-sys: Need to add libary includes
The default path didn't add the library includes. A standard
build would work, but a make distcheck would not.
2022-08-29 19:16:49 +10:00
Craig Small
3d0871728b build-sys: Relocate library to library/
All the dependent programs needed to have their includes moved too

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 19:02:44 +10:00
Craig Small
406b6d311c misc: Move Documentation to doc
Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 18:38:52 +10:00
Craig Small
dd60d6d6e8 misc: Move all binaries to src
*.c -> src/
ps/* src/ps/
top/* src/top/

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 18:29:28 +10:00
Craig Small
8e889ae682 build-sys: Rearrange the manual pages
All man pages are found in ./man
man-po -> po-man

References:
 https://www.freelists.org/post/procps/Next-for-newlib,3

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 18:07:43 +10:00
Craig Small
5fcf104cba build-sys: Removal of contrib directory
There is nothing we have used here for over a decade

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-08-29 17:46:03 +10:00
Craig Small
8128641814 build-sys: Use ncursesw by default
The existing build system would only require wide ncurses for
a wide watch and even if the library was there would not link
anything else to it.

The first issue which #123 made me think of, is if ncursesw
was there and ncurses is not, why not use ncursesw?

A more major issue is if programs such as slabtop are linked
to ncurses, then certain languages will display their text
wrong, as found in #237.

The days of assuming ASCII only is ok are over the build system
now does the following:
 1. If ncursesw is available use this for all relevant programs
 2. If ncursesw is not but ncurses is, use this instead
 3. If you enable 8bit watch and either disable ncurses or
    we cannot find ncursesw error at configure time.

In related news, I hate M4sh.

References:
 procps-ng/procps#123
 procps-ng/procps#237

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-05-21 11:06:57 +10:00
Craig Small
9c5397a941 testsuite: Add check for shared memory
Created a test process test_shm that allocates a shared memory
segment and prints the segment ID. pmap testsuite runs pmap to
check that the segment is found.

The value returned by shmget() is the same value that is printed
in the fifth column /proc/<PID>/maps

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2022-04-26 22:04:05 +10:00
Sven Eden
d014c5c9f2 Add support for elogind
A session manager similar to logind from systemd.
See https://github.com/elogind/elogind

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
2022-04-01 06:24:38 +00:00
Craig Small
b800d3f1a7 build-sys: check depends on programs
For some unknown reason, make check doesn't depend on either
the check programs or the actual programs under test. This means
if you try to run make check right off the bat from a clean git
repositorty, it will fail as it won't be able to run the unbuilt
binaries.
2022-03-21 21:37:17 +11:00
Jim Warner
be1ddc2756 library: created a valgrind 'warning-suppression' file
Signed-off-by: Jim Warner <james.warner@comcast.net>
2021-10-18 17:38:43 +11:00
Issam E. Maghni
71764980c3 configure: Add --disable-w
Some systems implement utmp as a stub so it doesn't make sense to have
a non-functioning w.  This change mitigates #193 and !126

References:
 procps-ng/procps!129
 procps-ng/procps!126
 procps-ng/procps#193
2021-04-24 11:29:48 +10:00
Craig Small
3d0e7f3d03 build-sys: Fix the uninstall-man target
If automake doesn't see a dist_man_MANS then there is no
uninstall-man target. This fix uses the main Makefile
targets.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2021-02-24 20:58:28 +11:00
Craig Small
9aa09d8862 library: Rename to libproc-2
What to call the new library?

Keep using libprocps wouldn't do, its a very different library from
the programs' point of view. It would also mean we could have some
clashes around the packages (two package names, same library name).

The ancient procps used libproc or libproc-a.b.c where a.b.c was the
package version. Kept the revision numbers down (it was always 0.0.0)
but the name of the library changed.

So if we use libproc-2 is there a clash with an ancient procps?
procps v 2.0.0 was around in 1999 so it was 22 years ago, also the
name of the library would have been libproc-2.0.0.so not libproc-2.so
so we're fine with that.

libproc-2 seems to fit, our second major re-work of the procps
library.

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2021-02-20 22:30:31 +11:00
Craig Small
9c1a62b637 pidwait: Rename from pwait
pwait is already in at least Debian in a different package

References:
 https://bugs.debian.org/982391
2021-02-15 21:55:05 +11:00
Craig Small
10c6b859b0 build-sys: Update building of translations
newlib was lagging behind oldlib in how the build system created
the translation files.
2021-02-15 21:36:57 +11:00
Jim Warner
423297c9db all: make buildable again for new 'misc.h' header file
With the 4 header files removed in the previous patch,
this commit just changes all those obsolete references
to that new consolidated 'misc.h' header file instead.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2021-01-21 17:30:25 +11:00
Craig Small
02a55381ad build-sys: Change pwait dependency
master branch uses lib/nsutils, newlib uses lib/signals

References:
 commit c8384e682c
2020-12-22 15:16:01 +11:00
Alex Xu (Hello71)
c8384e682c pgrep: add pwait 2020-12-22 13:13:32 +11:00
Craig Small
ffcf9aa394 build-sys: Remove refs to old manpage
I removed the old man pages but didn't remove their references in
the Makefile

References:
 commit a978f68c06
 commit 770505ded4
 commit 7246249b8c
2020-12-22 11:27:17 +11:00
Jim Warner
f83348ba5f build-sys: a small tweak to the new 'check-lib' target
So as to not obscure the results from this new target,
we'll redirect that final 'make clean' output to null.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-10-24 18:27:57 +11:00
Craig Small
02e35c1fb1 docs: Add procps_misc.3 manpage
The last (I think) of the newlib man pages for the new API.
2020-10-24 18:25:48 +11:00
Craig Small
6a2cc67bb6 build-sys: Build check programs only on make check
noinst_PROGRAMS are built with "make" even though we had the
test programs in there and only needed them for "make check".

In theory the check target should depend on check_PROGRAMS as
check-am target does and the document states it should, but for
reasons understood by the automake whisperers only, it doesn't
build them.

check only depends on BUILT_SOURCES for some reason.

check-am: all-am
        $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-recursive

References:
 https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html
2020-10-19 20:05:41 +11:00
Craig Small
fb91001192 build-sys: Add check-lib target
The referenced commits created the library infrastructure and test
program to validate that the structures and macros line up with
each other.

The library needs to be (re)built with -DITEMTABLE_DEBUG and then
the test program ran.  We clean before and after so we are not
testing a non-debug library or having a debug library hanging around
to cause future problems.

Due to test_Itemtables depending on the library, we don't need to
explicitly build the library.

To validate the library structure/header corrospondence run:
make check-lib

References:
 commit e616409aa4
 commit 92d0297e1e
 https://www.freelists.org/post/procps/keep-on-patchin,19
2020-10-19 19:25:33 +11:00
Jim Warner
e616409aa4 build-sys: added a 'test_Itemtables' to testing scheme
This change sets the stage for exploiting the recently
added ITEMTABLE_DEBUG #define. All tests are performed
in a single module (after trying 6 separate programs).

The chances of each test detecting errors is extremely
remote (at least while I'm maintaining these modules).
However, this single program approach has one flaw and
it relates to the response whenever an error is found.

Each of those six new API modules calls Exit() if they
detect an error. Otherwise, incorrect results would be
produced at the least or an abend encountered at most.

This means that multiple 'make check' invocations will
be needed if more than 1 module actually was in error.

All in all, it is a small price for a large assurance.

Reference(s):
https://www.freelists.org/post/procps/keep-on-patchin,7

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-08-17 21:49:14 +10:00
Jim Warner
ebb57668a1 build-sys: tweak make & activate some overlooked tests
This commit is just preparing for adding an Itemtables
verification test by reorganizing stuff and activating
a few previously inactive (overlooked?) test programs.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-08-17 21:49:03 +10:00
Jim Warner
4b9c93406c build-sys: suppress '-Wunused-result' with AM_CPPFLAGS
Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-07-20 16:15:14 +10:00
Jim Warner
d974f064b5 build-sys: correct those installed development headers
These headers were used only in the library itself and
it's wrong to have them in the user include directory.

* devname.h .. is used only by: ... pids.c, readproc.c
* numa.h ..... is used only by: ....... pids.c, stat.c
* pwcache.h .. is used only by: ........... readproc.c
* readproc.h . is used only by: ..... escape.c, pids.c
* wchan.h .... is used only by: ............... pids.c

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-07-05 21:13:01 +10:00
Jim Warner
605ea4a8f7 library: make that 'escape_str' private to our library
In that commit referenced below, a promise was made to
revisit an 'escape_str' function in efforts to make it
private to the library. The problem was it's needed by
both ps plus the library which is why it was exported.

So, in an effort to remove it from libprocps.sym, this
patch duplicates all the required code in ps/output.c.
Now, each version can be made private to their caller.

[ along the way we'll use this opportunity to remove ]
[ the 'restrict' qualifiers from function parameters ]
[ while swatting a compiler warning referenced below ]

Reference(s):
. April 2016, most escape functions made private
commit d916d5db86

proc/escape.c: In function `escape_command':
proc/escape.c:182:23: warning: initialization of `const char **' from incompatible pointer type `char **' [-Wincompatible-pointer-types]
  182 |     const char **lc = (char**)pp->cmdline;
      |                       ^

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-07-05 21:13:01 +10:00
Jim Warner
1aa8b16441 library: eliminated the questionable 'procps.h' header
There was a time when that procps.h file served a more
traditional role. Prior to the commit referenced below
it held just macros plus manifest constants. But, with
that change, such items were replaced with a series of
includes embracing all the library exported functions.

That approach was known to disguise errors which would
have otherwise yielded a compiler warning. And without
such a warning, there was no way to address the error.

So this patch will trade the all inclusive header file
approach for individual includes only where necessary.

Reference(s):
. April 2016, procps.h header file revamped
commit ccb6ae8de1
. Sept 2018, top abandoned use of procps.h
commit a6dfc2382e

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-07-05 21:13:01 +10:00
Jim Warner
d64755ea5f build-sys: tweak Makefile.am for two preceding patches
This commit cleans up some man document files. It also
changes the target install directory from the original
'proc/' to 'procps/' (feels like a more natural name).

[ and, now it agrees with those 2 preceding man docs ]
[ since it is obvious the tail was wagging this dog! ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-06-23 19:09:05 +10:00
Craig Small
0aa0f92727 docs: Add namespace man pages 2020-05-18 21:42:49 +10:00
Jim Warner
c7b7ab8547 3.3.13 release candidate 1 ________________ (catch up)
--------------- Original Master Branch Commit Message:
Update NEWS with the version
Add library API change into NEWS
Update c:r:a for library to 7:0:1

This means the current and age are incremented, so old programs can
use new library but not vice-versa as they won't have the numa*
functions.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2018-05-06 07:19:38 +10:00
Jim Warner
c2a29d370c sysctl: relocate the procio code to a more proper home
Now that the procio logic was removed from the library
we must move the header file, lest we break make dist.

In the process, we will relocate that source file too.

[ we'll take a slightly different approach than that ]
[ used under the master branch by exploiting those 2 ]
[ non-library directories 'include' and 'lib', while ]
[ avoiding any sysctl hard coded function prototype. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
2018-05-06 07:19:37 +10:00
Craig Small
e72f30549b sysctl: Bring procio functions out of library
The procio functions that were in the library have been
moved into sysctl. sysctl is not linked to libprocps in
newlib and none of the other procps binaries would need
to read/write large data to the procfs.

References:
 be6b048a41
2018-03-01 21:47:57 +11:00
Werner Fink
3373a58fb6 Add flexible buffered I/O based on fopencookie(3)
to be able to read and write large buffers below /proc.
The buffers and file offsets are handled dynamically
on the required buffer size at read, that is lseek(2)
is used to determine this size. Large buffers at
write are split at a delimeter into pieces and also
lseek(2) is used to write each of them.

Signed-off-by: Werner Fink <werner@suse.de>
2018-03-01 21:42:10 +11:00
Davide Madrisan
f9d8dfe01a Install some missing header files required by procps.h 2017-12-23 18:08:32 +11:00
Jim Warner
7453f8719b library: actually remove those alloc.h & alloc.c files
Signed-off-by: Jim Warner <james.warner@comcast.net>
2017-12-20 21:18:53 +11:00
Craig Small
d8fb86dbc5 Port of merge request 49 to newlib
Wayne Porter made !49 which added Cygwin support to the master branch
This is the port of those changes to newlib
2017-08-19 23:05:22 +10:00
Jim Warner
3d39e4fd88 library: set stage for NUMA node field display support
In response to that suggestion referenced below, these
changes allow display of task/thread level NUMA nodes.

Currently, only the 'top' program offers any NUMA type
support and it is limited to the Summary Area display.
With this commit both the 'top' and 'ps' programs will
be able to display NUMA nodes associated with threads.

Reference(s):
https://gitlab.com/procps-ng/procps/issues/58

Signed-off-by: Jim Warner <james.warner@comcast.net>
2017-05-22 21:38:10 +10:00
Craig Small
2598e9f2ce documentation: Update pids manual pages
Updated the full suite of manual pages for the procps_pids_*
functions. The only one missing is procps_pids_get which
may not be required.
2017-01-05 09:44:04 +11:00
Craig Small
a8f7e44233 docs: Remove old library man pages 2016-09-11 11:20:03 +10:00