summaryrefslogtreecommitdiff
path: root/sys-process/procps
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-12 19:09:37 -0500
commitb590c8d7572b727d565cc0b8ff660d43569845de (patch)
tree06f7a4102ea4e845df8b66660f252920d52952f9 /sys-process/procps
parent24f9cbfc4c34fdb6a6e03311674414e881ceab47 (diff)
downloadbaldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.gz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.tar.xz
baldeagleos-repo-b590c8d7572b727d565cc0b8ff660d43569845de.zip
Adding metadata
Diffstat (limited to 'sys-process/procps')
-rw-r--r--sys-process/procps/Manifest3
-rw-r--r--sys-process/procps/files/procps-4.0.4-xfail-pmap-test.patch25
-rw-r--r--sys-process/procps/files/procps-4.0.5-fix-tests-multilib.patch34
-rw-r--r--sys-process/procps/files/procps-4.0.5-macos.patch28
-rw-r--r--sys-process/procps/files/procps-4.0.5-pgrep-old-linux-headers.patch57
-rw-r--r--sys-process/procps/files/procps-4.0.5-pgrep-pidwait.patch186
-rw-r--r--sys-process/procps/files/procps-4.0.5-pidwait-half.patch43
-rw-r--r--sys-process/procps/files/procps-4.0.5-sysctl-ignore_failure.patch21
-rw-r--r--sys-process/procps/files/procps-4.0.5-sysctl-manpage.patch33
-rw-r--r--sys-process/procps/files/procps-4.0.5-top-legacy-config-vuln.patch39
-rw-r--r--sys-process/procps/files/procps-4.0.6-hurd.patch140
-rw-r--r--sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch50
-rw-r--r--sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch41
-rw-r--r--sys-process/procps/metadata.xml19
-rw-r--r--sys-process/procps/procps-4.0.5-r3.ebuild134
-rw-r--r--sys-process/procps/procps-4.0.5-r4.ebuild133
-rw-r--r--sys-process/procps/procps-4.0.6.ebuild154
17 files changed, 1140 insertions, 0 deletions
diff --git a/sys-process/procps/Manifest b/sys-process/procps/Manifest
new file mode 100644
index 000000000000..8646cfbef255
--- /dev/null
+++ b/sys-process/procps/Manifest
@@ -0,0 +1,3 @@
+DIST procps-ng-4.0.5.tar.xz 1517672 BLAKE2B 4b273ac7737202147fbf392995da1c5ff385df2b53ad84180b6412dc45c2a671e81d7659c0a5824c0d8c19fa37cbf2e58b0545841c74399b3717a9f27fd26c23 SHA512 c27730743210cf850c4af98e1fb81bc8ee8d550b07b9eedb34a5b9d661263d0f1bc92c4e73802a0ed8d4405854aef4bc542bff283c28e8fbb6dabb967f9e4359
+DIST procps-ng-4.0.6.tar.xz 1580516 BLAKE2B 20acd79cf60e2967f82724ef432a239c29fd12fc6d24dac5d606eac6a167a7ad46001c08796fa2a910afc709d1e7c3ee1b9260d9753339f423b21fb457264c6b SHA512 c499aa14b6c94eda3a455bfe0d2d3c74c79dd718bffbd20207bd0831cb87725b83a76e4ee537a49ddf112bd1248a156d35da00035cbcd4c22037a20dcb4bdc9c
+DIST procps-ng-4.0.6.tar.xz.asc 833 BLAKE2B baaf361cf5e173fafa090930c2cd06769b9cecb95c5b0c41e38d1d5d4ac342b098e3906b836c610f177c8a582c4fe1bc76b8fa8afb111c85c394137d7fad19b7 SHA512 a5cee151b5a1591efad4f91ca75e43e0b7fc9d2d403db1d71d7e0937b8916c1fcffaa22369ca5289e2e5989cca35c3a6073efcfc969026a59738e793bdf28331
diff --git a/sys-process/procps/files/procps-4.0.4-xfail-pmap-test.patch b/sys-process/procps/files/procps-4.0.4-xfail-pmap-test.patch
new file mode 100644
index 000000000000..037fe657f4ea
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.4-xfail-pmap-test.patch
@@ -0,0 +1,25 @@
+--- a/testsuite/pmap.test/pmap.exp
++++ b/testsuite/pmap.test/pmap.exp
+@@ -87,13 +87,15 @@ proc expect_twice_total { test } {
+ }
+ }
+
+-set test "pmap X pid pid has same total"
+-spawn $pmap -X $mypid $mypid
+-expect_twice_total "$test"
+-
+-set test "pmap XX pid pid has same total"
+-spawn $pmap -XX $mypid $mypid
+-expect_twice_total "$test"
++# Fails in gentoo sandbox, needs investigation
++#set test "pmap X pid pid has same total"
++#spawn $pmap -X $mypid $mypid
++#expect_twice_total "$test"
++
++# Fails in gentoo sandbox, needs investigation
++#set test "pmap XX pid pid has same total"
++#spawn $pmap -XX $mypid $mypid
++#expect_twice_total "$test"
+
+ set test "pmap finding shm"
+ make_testshm_proc
diff --git a/sys-process/procps/files/procps-4.0.5-fix-tests-multilib.patch b/sys-process/procps/files/procps-4.0.5-fix-tests-multilib.patch
new file mode 100644
index 000000000000..05ea4973e0b2
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-fix-tests-multilib.patch
@@ -0,0 +1,34 @@
+https://gitlab.com/procps-ng/procps/-/merge_requests/256
+
+From 2cc229991d2c89c93d58d7ad4bc30fd272d8e2df Mon Sep 17 00:00:00 2001
+Message-ID: <2cc229991d2c89c93d58d7ad4bc30fd272d8e2df.1750118248.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Tue, 17 Jun 2025 00:56:23 +0100
+Subject: [PATCH] testsuite: only test freetop if we built it
+
+It's not built if configured with --without-ncurses. Similar to
+aa85fb458a295135d8283cd5ffacfe8198cdae22.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/testsuite/Makefile.am
++++ b/testsuite/Makefile.am
+@@ -21,7 +21,7 @@ DEJATOOL += \
+
+ if !CYGWIN
+ if WITH_NCURSES
+-DEJATOOL += slabtop
++DEJATOOL += slabtop hugetop
+ endif
+
+ DEJATOOL += sysctl
+@@ -37,7 +37,6 @@ endif
+
+ DEJATOOL += \
+ free \
+- hugetop \
+ lib \
+ pgrep \
+ pkill \
+--
+2.50.0
+
diff --git a/sys-process/procps/files/procps-4.0.5-macos.patch b/sys-process/procps/files/procps-4.0.5-macos.patch
new file mode 100644
index 000000000000..79890994f11d
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-macos.patch
@@ -0,0 +1,28 @@
+https://gitlab.com/procps-ng/procps/-/commit/2dc340e47669e0b0df7f71ff082e05ac5fa36615
+
+From 2dc340e47669e0b0df7f71ff082e05ac5fa36615 Mon Sep 17 00:00:00 2001
+From: Rui Chen <rui@chenrui.dev>
+Date: Thu, 26 Dec 2024 11:09:18 -0500
+Subject: [PATCH] local/signals.c: guard `SIGPOLL` to fix build on macOS
+
+Signed-off-by: Rui Chen <rui@chenrui.dev>
+---
+ local/signals.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/local/signals.c b/local/signals.c
+index 6d68c07d..12656796 100644
+--- a/local/signals.c
++++ b/local/signals.c
+@@ -125,7 +125,9 @@ static const mapstruct sigtable[] = {
+ {"VTALRM", SIGVTALRM},
+ {"PROF", SIGPROF},
+ {"WINCH", SIGWINCH},
++#ifdef SIGPOLL
+ {"POLL", SIGPOLL}, // in SUSv3, prioritize over IO
++#endif
+ #ifdef SIGIO
+ {"IO", SIGIO}, // possibly = POLL
+ #endif
+--
+GitLab
diff --git a/sys-process/procps/files/procps-4.0.5-pgrep-old-linux-headers.patch b/sys-process/procps/files/procps-4.0.5-pgrep-old-linux-headers.patch
new file mode 100644
index 000000000000..1f9ff443393d
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-pgrep-old-linux-headers.patch
@@ -0,0 +1,57 @@
+https://bugs.gentoo.org/911375
+https://gitlab.com/procps-ng/procps/-/commit/90a0ddcd64c2d43dc2c2c856b1b42b5cae6b8a44
+
+From 90a0ddcd64c2d43dc2c2c856b1b42b5cae6b8a44 Mon Sep 17 00:00:00 2001
+From: Markus Mayer <mmayer@broadcom.com>
+Date: Wed, 11 Dec 2024 14:53:33 -0800
+Subject: [PATCH] pgrep: provide definition for __NR_pidfd_open if needed
+
+We already implement pidfd_open() ourselves if libc doesn't provide it.
+Let's also provide our own definition of __NR_pidfd_open in case the
+kernel headers don't contain it.
+
+This way, pgrep can provide its full capabilities after being built
+against older kernel headers (for increased compatibility) but being run
+on systems with newer kernels.
+
+Signed-off-by: Markus Mayer <mmayer@broadcom.com>
+---
+ configure.ac | 2 +-
+ src/pgrep.c | 9 +++++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1e984b12..14ba3ad7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -325,7 +325,7 @@ AS_IF([[test "x$enable_pidwait" = xyes -a "x$have_pidfd_open" = xno]],
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <sys/syscall.h>
+ #ifndef __NR_pidfd_open
+-#error __NR_pidfd_open not defined
++#warning __NR_pidfd_open not defined; using our definition
+ #endif
+ ])],
+ AC_MSG_RESULT([yes]),
+diff --git a/src/pgrep.c b/src/pgrep.c
+index 2c6b06b8..6fc25dd4 100644
+--- a/src/pgrep.c
++++ b/src/pgrep.c
+@@ -874,6 +874,15 @@ static int signal_option(int *argc, char **argv)
+ }
+
+ #if defined(ENABLE_PIDWAIT) && !defined(HAVE_PIDFD_OPEN)
++
++#ifndef __NR_pidfd_open
++#ifdef __alpha__
++#define __NR_pidfd_open 544
++#else
++#define __NR_pidfd_open 434
++#endif
++#endif
++
+ static int pidfd_open (pid_t pid, unsigned int flags)
+ {
+ return syscall(__NR_pidfd_open, pid, flags);
+--
+GitLab
diff --git a/sys-process/procps/files/procps-4.0.5-pgrep-pidwait.patch b/sys-process/procps/files/procps-4.0.5-pgrep-pidwait.patch
new file mode 100644
index 000000000000..aa603179f745
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-pgrep-pidwait.patch
@@ -0,0 +1,186 @@
+From 66a37d3abf14dfd450b4ded7f1ccb0506699e7d1 Mon Sep 17 00:00:00 2001
+Message-ID: <66a37d3abf14dfd450b4ded7f1ccb0506699e7d1.1763650309.git.sam@gentoo.org>
+From: Sam James <sam@gentoo.org>
+Date: Thu, 20 Nov 2025 14:43:13 +0000
+Subject: [PATCH] build-sys: fix option handling
+
+Explicit --enable-pidwait wasn't setting ENABLE_PIDWAIT. Fix that by
+moving the ENABLE_PIDWAIT handling outside of AC_ARG_ENABLE.
+
+While here, fix all the other AC_* calls to correctly set enable_XYZ or
+with_XYZ to avoid other problems, otherwise they'd be left unset if
+enabled rather than set to the correct value (yes or no).
+---
+ configure.ac | 43 ++++++++++++++++++++++---------------------
+ 1 file changed, 22 insertions(+), 21 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fe5ac458..97033143 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -181,7 +181,7 @@ fi
+ AC_SUBST([WITH_COLORWATCH])
+ AC_ARG_ENABLE([colorwatch],
+ AS_HELP_STRING([--enable-colorwatch], [enable watch to use color by default]),
+- [], [enable_colorwatch=no]
++ [enable_colorwatch=$enableval], [enable_colorwatch=no]
+ )
+ if test "$enable_colorwatch" = "yes"; then
+ AC_DEFINE([WITH_COLORWATCH], [1], [Enable color watch by default])
+@@ -191,7 +191,7 @@ fi
+
+ AC_ARG_ENABLE([libselinux],
+ AS_HELP_STRING([--enable-libselinux], [enable libselinux]),
+- [], [enable_libselinux=no]
++ [enable_libselinux=$enableval], [enable_libselinux=no]
+ )
+ if test "$enable_libselinux" = "yes"; then
+ AC_DEFINE([ENABLE_LIBSELINUX], [1], [Enable libselinux])
+@@ -223,7 +223,7 @@ AC_SUBST([HARDEN_LDFLAGS])
+ # Optional packages - AC_ARG_WITH
+ AC_ARG_WITH([ncurses],
+ AS_HELP_STRING([--without-ncurses], [build only applications not needing ncurses]),
+- [],
++ [with_ncurses=$withval],
+ [with_ncurses=yes]
+ )
+ if test "x$with_ncurses" = xno; then
+@@ -267,7 +267,7 @@ fi
+
+ AC_ARG_WITH([systemd],
+ [AS_HELP_STRING([--with-systemd], [enable systemd support])],
+- [], [with_systemd=no]
++ [with_systemd=$withval], [with_systemd=no]
+ )
+ AS_IF([test "x$with_systemd" != "xno"], [
+ PKG_CHECK_MODULES([SYSTEMD], [libsystemd],,
+@@ -286,7 +286,7 @@ AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno])
+
+ AC_ARG_WITH([elogind],
+ [AS_HELP_STRING([--with-elogind], [enable elogind support])],
+- [], [with_elogind=no]
++ [with_elogind=$withval], [with_elogind=no]
+ )
+ # Do not allow elogind if systemd is wanted and found
+ AS_IF([test "x$with_systemd" != "xno"], [with_elogind=no])
+@@ -300,7 +300,7 @@ AM_CONDITIONAL([WITH_ELOGIND], [test x$with_elogind != xno])
+ # AC_ARG_ENABLEs
+ AC_ARG_ENABLE([pidof],
+ AS_HELP_STRING([--disable-pidof], [do not build pidof]),
+- [], [enable_pidof=yes]
++ [enable_pidof=$enableval], [enable_pidof=yes]
+ )
+ AM_CONDITIONAL(BUILD_PIDOF, test "x$enable_pidof" = xyes)
+
+@@ -308,11 +308,12 @@ AM_CONDITIONAL(BUILD_PIDOF, test "x$enable_pidof" = xyes)
+ # Cannot use AC_CHECK_FUNC as it (incorrectly) passes with pidfd_open missing
+ AC_ARG_ENABLE([pidwait],
+ AS_HELP_STRING([--disable-pidwait], [do not build pidwait]),
+- [], [
+- enable_pidwait=yes
+- AC_DEFINE(ENABLE_PIDWAIT, 1, [enable pidwait])
+- ]
++ [enable_pidwait=$enableval], [enable_pidwait=yes]
+ )
++
++AS_IF([test "x$enable_pidwait" = xyes], [
++ AC_DEFINE(ENABLE_PIDWAIT, 1, [enable pidwait])
++], [])
+ AM_CONDITIONAL(BUILD_PIDWAIT, test "x$enable_pidwait" = xyes)
+ AC_MSG_CHECKING([for pidfd_open()])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/pidfd.h>]], [[pidfd_open(1,1)]])],
+@@ -346,12 +347,12 @@ AC_LINK_IFELSE(
+
+ AC_ARG_ENABLE([kill],
+ AS_HELP_STRING([--disable-kill], [do not build kill]),
+- [], [enable_kill=yes]
++ [enable_kill=$enableval], [enable_kill=yes]
+ )
+ AM_CONDITIONAL(BUILD_KILL, test "x$enable_kill" = xyes)
+ AC_ARG_ENABLE([w],
+ AS_HELP_STRING([--disable-w], [do not build w]),
+- [], [enable_w=yes]
++ [enable_w=$enableval], [enable_w=yes]
+ )
+ AM_CONDITIONAL(BUILD_W, test "x$enable_w" = xyes)
+
+@@ -360,19 +361,19 @@ AM_CONDITIONAL(CYGWIN, test "x$host_os" = xcygwin)
+
+ AC_ARG_ENABLE([skill],
+ AS_HELP_STRING([--enable-skill], [build skill and snice]),
+- [], [enable_skill=no]
++ [enable_skill=$enableval], [enable_skill=no]
+ )
+ AM_CONDITIONAL(BUILD_SKILL, test "x$enable_skill" = xyes)
+
+ AC_ARG_ENABLE([examples],
+ AS_HELP_STRING([--enable-examples], [add example files to installation]),
+- [], [enable_examples=no]
++ [enable_examples=$enableval], [enable_examples=no]
+ )
+ AM_CONDITIONAL(EXAMPLE_FILES, test "x$enable_examples" = xyes)
+
+ AC_ARG_ENABLE([sigwinch],
+ AS_HELP_STRING([--enable-sigwinch], [reduce impact of x-windows resize operations on top]),
+- [], [enable_sigwinch=no]
++ [enable_sigwinch=$enableval], [enable_sigwinch=no]
+ )
+ if test "x$enable_sigwinch" = xyes; then
+ AC_DEFINE(SIGNALS_LESS, 1, [reduce impact of x-windows resize operations on top])
+@@ -380,7 +381,7 @@ fi
+
+ AC_ARG_ENABLE([wide-percent],
+ AS_HELP_STRING([--enable-wide-percent], [provide extra precision under %CPU and %MEM for top]),
+- [], [enable_wide_percent=no]
++ [enable_wide_percent=$enableval], [enable_wide_percent=no]
+ )
+ if test "x$enable_wide_percent" = xyes; then
+ AC_DEFINE(BOOST_PERCNT, 1, [provide extra precision under %CPU and %MEM for top])
+@@ -388,7 +389,7 @@ fi
+
+ AC_ARG_ENABLE([wide-memory],
+ AS_HELP_STRING([--enable-wide-memory], [provide extra precision under memory fields for top]),
+- [], [enable_wide_memory=no]
++ [enable_wide_memory=$enableval], [enable_wide_memory=no]
+ )
+ if test "x$enable_wide_memory" = xyes; then
+ AC_DEFINE(BOOST_MEMORY, 1, [provide extra precision under memory fields for top])
+@@ -396,7 +397,7 @@ fi
+
+ AC_ARG_ENABLE([modern-top],
+ AS_HELP_STRING([--disable-modern-top], [disable new startup defaults, return to original top]),
+- [], [enable_modern_top=yes]
++ [enable_modern_top=$enableval], [enable_modern_top=yes]
+ )
+ if test "x$enable_modern_top" = xno; then
+ AC_DEFINE(ORIG_TOPDEFS, 1, [disable new startup defaults, return to original top])
+@@ -405,7 +406,7 @@ fi
+ DL_LIB=
+ AC_ARG_ENABLE([numa],
+ AS_HELP_STRING([--disable-numa], [disable NUMA/Node support in top]),
+- [], [enable_numa=yes]
++ [enable_numa=$enableval], [enable_numa=yes]
+ )
+ if test "x$enable_numa" = xno; then
+ AC_DEFINE([NUMA_DISABLE], [1], [disable NUMA/Node support in top])
+@@ -420,7 +421,7 @@ AC_SUBST([DL_LIB])
+
+ AC_ARG_ENABLE([w-from],
+ AS_HELP_STRING([--enable-w-from], [enable w from field by default]),
+- [], [enable_w_from=no]
++ [enable_w_from=$enableval], [enable_w_from=no]
+ )
+ if test "x$enable_w_from" = xyes; then
+ AC_DEFINE(W_SHOWFROM, 1, [enable w from field by default])
+@@ -428,7 +429,7 @@ fi
+
+ AC_ARG_ENABLE([whining],
+ AS_HELP_STRING([--disable-whining], [do not print unnecessary warnings (slackware-ism)]),
+- [], [enable_whining=yes]
++ [enable_whining=$enableval], [enable_whining=yes]
+ )
+ if test "x$enable_whining" = xyes; then
+ AC_DEFINE(BUILD_WITH_WHINE, 1, [should extra warnings be printed (slackware-ism)])
+--
+2.52.0
+
diff --git a/sys-process/procps/files/procps-4.0.5-pidwait-half.patch b/sys-process/procps/files/procps-4.0.5-pidwait-half.patch
new file mode 100644
index 000000000000..1ca37bf20586
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-pidwait-half.patch
@@ -0,0 +1,43 @@
+https://gitlab.com/procps-ng/procps/-/issues/386
+https://gitlab.com/procps-ng/procps/-/merge_requests/262
+
+From 0298cd70368f76ce6bfe46a55cebd105d5d53e94 Mon Sep 17 00:00:00 2001
+From: Chris Down <chris@chrisdown.name>
+Date: Sat, 26 Jul 2025 22:38:12 +0100
+Subject: [PATCH] pgrep: Fix pidwait only waiting for half of specified
+ processes
+
+The pidwait command currently waits for only half of the given
+processes. This happens because when a monitored process terminates, its
+pidfd can generate two events: one for the process exiting (EPOLLIN),
+and another for it being reaped by its parent (EPOLLIN or EPOLLHUP). The
+existing code increments its completion counter for every event
+returned, causing it to count each process termination twice and exit
+prematurely.
+
+This fix tells the kernel to deactivate the file descriptor after the
+first event (process exit) is delivered, and prevents any subsequent
+events from being processed for the same pidfd.
+
+References: #386
+
+Signed-off-by: Chris Down <chris@chrisdown.name>
+---
+ src/pgrep.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/pgrep.c b/src/pgrep.c
+index 4c5ed521..20cc251d 100644
+--- a/src/pgrep.c
++++ b/src/pgrep.c
+@@ -1433,7 +1433,7 @@ int main (int argc, char **argv)
+ warn(_("opening pid %ld failed"), procs[i].num);
+ continue;
+ }
+- ev.events = EPOLLIN | EPOLLET;
++ ev.events = EPOLLIN | EPOLLET | EPOLLONESHOT;
+ ev.data.fd = pidfd;
+ if (epoll_ctl(epollfd, EPOLL_CTL_ADD, pidfd, &ev) != -1)
+ poll_count++;
+--
+GitLab
diff --git a/sys-process/procps/files/procps-4.0.5-sysctl-ignore_failure.patch b/sys-process/procps/files/procps-4.0.5-sysctl-ignore_failure.patch
new file mode 100644
index 000000000000..393da09f853e
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-sysctl-ignore_failure.patch
@@ -0,0 +1,21 @@
+Don't error for close_stream failure if the config line begins with "-"
+https://bugs.gentoo.org/969014
+https://gitlab.com/procps-ng/procps/-/issues/410
+
+--- procps-ng-4.0.5/src/sysctl.c
++++ procps-ng-4.0.5/src/sysctl.c
+@@ -623,9 +623,12 @@ static int WriteSetting(
+ if (0 < fprintf(fp, "%s\n", value))
+ rc = EXIT_SUCCESS;
+ if (close_stream(fp) != 0) {
+- xwarn(_("setting key \"%s\""), dotted_key);
++ xwarn(_("setting key \"%s\"%s"),
++ dotted_key, (ignore_failure?_(", ignoring"):""));
+ free(dotted_key);
+- return EXIT_FAILURE;
++ if (!ignore_failure)
++ rc = EXIT_FAILURE;
++ return rc;
+ }
+ }
+ }
diff --git a/sys-process/procps/files/procps-4.0.5-sysctl-manpage.patch b/sys-process/procps/files/procps-4.0.5-sysctl-manpage.patch
new file mode 100644
index 000000000000..d2abd3c43c65
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-sysctl-manpage.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/565304
+--- a/man/sysctl.8
++++ b/man/sysctl.8
+@@ -177,21 +177,21 @@ skipped by \fBsysctl\fR using the \fB\-\-all\fR option.
+ This parameter returns no value but flushes per-cpu vm statistics.
+
+ .SH EXAMPLES
+-/sbin/sysctl \-a
++/usr/sbin/sysctl \-a
+ .br
+-/sbin/sysctl \-n kernel.hostname
++/usr/sbin/sysctl \-n kernel.hostname
+ .br
+-/sbin/sysctl \-w kernel.domainname="example.com"
++/usr/sbin/sysctl \-w kernel.domainname="example.com"
+ .br
+-/sbin/sysctl \-p/etc/sysctl.conf
++/usr/sbin/sysctl \-p/etc/sysctl.conf
+ .br
+-/sbin/sysctl \-a \-\-pattern forward
++/usr/sbin/sysctl \-a \-\-pattern forward
+ .br
+-/sbin/sysctl \-a \-\-pattern forward$
++/usr/sbin/sysctl \-a \-\-pattern forward$
+ .br
+-/sbin/sysctl \-a \-\-pattern 'net.ipv4.conf.(eth|wlan)0.arp'
++/usr/sbin/sysctl \-a \-\-pattern 'net.ipv4.conf.(eth|wlan)0.arp'
+ .br
+-/sbin/sysctl \-\-pattern '\[char94]net.ipv6' \-\-system
++/usr/sbin/sysctl \-\-pattern '\[char94]net.ipv6' \-\-system
+ .SH SEE ALSO
+ .BR proc (5),
+ .BR sysctl.conf (5),
diff --git a/sys-process/procps/files/procps-4.0.5-top-legacy-config-vuln.patch b/sys-process/procps/files/procps-4.0.5-top-legacy-config-vuln.patch
new file mode 100644
index 000000000000..676f16046a1c
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.5-top-legacy-config-vuln.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/958286
+https://gitlab.com/procps-ng/procps/-/commit/c7498168cfdcf566519d8c46bd26c1be42f2e3f3
+
+From c7498168cfdcf566519d8c46bd26c1be42f2e3f3 Mon Sep 17 00:00:00 2001
+From: Jim Warner <james.warner@comcast.net>
+Date: Mon, 26 May 2025 00:00:00 -0500
+Subject: [PATCH] top: fix vulnerability with legacy configuration files
+
+Reference(s):
+https://gitlab.com/procps-ng/procps/-/issues/384
+
+Signed-off-by: Jim Warner <james.warner@comcast.net>
+---
+ src/top/top.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/top/top.c b/src/top/top.c
+index c55b08f0..eef3b219 100644
+--- a/src/top/top.c
++++ b/src/top/top.c
+@@ -4015,10 +4015,12 @@ static int config_wins (FILE *fp, char *buf, int wix) {
+
+ if (1 != fscanf(fp, "%3s\tfieldscur=", w->rc.winname))
+ return 0;
+- if (Rc.id < RCF_XFORMED_ID)
+- fscanf(fp, "%s\n", buf );
+- else {
+- for (x = 0; ; x++)
++ if (Rc.id < RCF_XFORMED_ID) {
++ fscanf(fp, "%100s\n", buf ); // buf size = LRGBUFSIZ (512)
++ if (strlen(buf) >= sizeof(CVT_FORMER)) // but if we exceed max of 86
++ return 0; // that rc file was corrupted
++ } else {
++ for (x = 0; x < PFLAGSSIZ; x++)
+ if (1 != fscanf(fp, "%d", &w->rc.fieldscur[x]))
+ break;
+ }
+--
+GitLab
diff --git a/sys-process/procps/files/procps-4.0.6-hurd.patch b/sys-process/procps/files/procps-4.0.6-hurd.patch
new file mode 100644
index 000000000000..b425b8cddc86
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.6-hurd.patch
@@ -0,0 +1,140 @@
+https://gitlab.com/procps-ng/procps/-/merge_requests/286
+
+From c116ebd4b759ff79b391d18802a227738be9d94c Mon Sep 17 00:00:00 2001
+From: Svante Signell <svante.signell@gmail.com>
+Date: Wed, 11 Feb 2026 16:10:37 +0100
+Subject: [PATCH] Add support for GNU/Hurd
+
+---
+ library/pids.c | 12 ++++++++++++
+ library/readproc.c | 4 ++++
+ library/uptime.c | 4 ++++
+ src/top/top.c | 6 ++++++
+ testsuite/ps.test/test-hugetlb.c | 2 +-
+ 5 files changed, 27 insertions(+), 1 deletion(-)
+
+diff --git a/library/pids.c b/library/pids.c
+index 8855920a..b7b6e3c6 100644
+--- a/library/pids.c
++++ b/library/pids.c
+@@ -1039,9 +1039,15 @@ static inline int pids_items_check_failed (
+ * if (procps_pids_new(&info, PIDS_noop, 3) < 0)
+ * ^~~~~~~~~~~~~~~~
+ */
++/* (void*)items=0x3010<(void*)0x8000 causing FAIL:procps_pids new then unref */
++#ifdef __GNU__
++ if (numitems < 1)
++ return 1;
++#else
+ if (numitems < 1
+ || (void *)items < (void *)0x8000) // twice as big as our largest enum
+ return 1;
++#endif
+
+ for (i = 0; i < numitems; i++) {
+ // a pids_item is currently unsigned, but we'll protect our future
+@@ -1523,8 +1529,10 @@ fresh_start:
+ pids_containers_check();
+
+ info->boot_tics = 0;
++#ifdef CLOCK_BOOTTIME
+ if (0 >= clock_gettime(CLOCK_BOOTTIME, &ts))
+ info->boot_tics = (ts.tv_sec + ts.tv_nsec * 1.0e-9) * info->hertz;
++#endif
+
+ if (NULL == info->read_something(info->get_PT, &info->get_proc))
+ return NULL;
+@@ -1567,8 +1575,10 @@ PROCPS_EXPORT struct pids_fetch *procps_pids_reap (
+ info->read_something = which ? readeither : readproc;
+
+ info->boot_tics = 0;
++#ifdef CLOCK_BOOTTIME
+ if (0 >= clock_gettime(CLOCK_BOOTTIME, &ts))
+ info->boot_tics = (ts.tv_sec + ts.tv_nsec * 1.0e-9) * info->hertz;
++#endif
+
+ rc = pids_stacks_fetch(info);
+
+@@ -1676,8 +1686,10 @@ PROCPS_EXPORT struct pids_fetch *procps_pids_select (
+ info->read_something = (which & PIDS_FETCH_THREADS_TOO) ? readeither : readproc;
+
+ info->boot_tics = 0;
++#ifdef CLOCK_BOOTTIME
+ if (0 >= clock_gettime(CLOCK_BOOTTIME, &ts))
+ info->boot_tics = (ts.tv_sec + ts.tv_nsec * 1.0e-9) * info->hertz;
++#endif
+
+ rc = pids_stacks_fetch(info);
+
+diff --git a/library/readproc.c b/library/readproc.c
+index a7f79051..7bb81625 100644
+--- a/library/readproc.c
++++ b/library/readproc.c
+@@ -1745,7 +1745,11 @@ int look_up_our_self(void) {
+ int fd;
+
+ memset(&p, 0, sizeof(proc_t));
++#ifdef O_PATH
+ fd = open("/proc/self", O_PATH|O_DIRECTORY);
++#else
++ fd = open("/proc/self", O_DIRECTORY);
++#endif
+ if(fd < 0 || file2str(fd, "stat", &ub) == -1) {
+ fprintf(stderr, "Error, do this: mount -t proc proc /proc\n");
+ _exit(47);
+diff --git a/library/uptime.c b/library/uptime.c
+index dfff8e6e..6c09fc90 100644
+--- a/library/uptime.c
++++ b/library/uptime.c
+@@ -177,8 +177,12 @@ PROCPS_EXPORT int procps_container_uptime(
+ if (!uptime_secs)
+ return 0; //valid, but odd call
+
++#ifdef CLOCK_BOOTTIME
+ if ( (rv = clock_gettime(CLOCK_BOOTTIME, &tp) < 0))
+ return rv;
++#else
++ return -1;
++#endif
+
+ if ( (rv = procps_pids_new(&info, items, 1) < 0))
+ return rv;
+diff --git a/src/top/top.c b/src/top/top.c
+index a62b7e1b..d5cad3ad 100644
+--- a/src/top/top.c
++++ b/src/top/top.c
+@@ -2847,6 +2847,8 @@ static void *tasks_refresh (void *unused) {
+ #ifdef THREADED_TSK
+ sem_wait(&Semaphore_tasks_beg);
+ #endif
++
++#ifdef CLOCK_BOOTTIME
+ if (0 != clock_gettime(CLOCK_BOOTTIME, &ts))
+ Frame_etscale = 0;
+ else {
+@@ -2857,6 +2859,10 @@ static void *tasks_refresh (void *unused) {
+ // if in Solaris mode, adjust our scaling for all cpus
+ Frame_etscale = 100.0f / ((float)Hertz * (float)et * (Rc.mode_irixps ? 1 : Cpu_cnt));
+ }
++#else
++ Frame_etscale = 0;
++
++#endif
+ what = Thread_mode ? PIDS_FETCH_THREADS_TOO : PIDS_FETCH_TASKS_ONLY;
+ if (Monpidsidx) {
+ what |= PIDS_SELECT_PID;
+diff --git a/testsuite/ps.test/test-hugetlb.c b/testsuite/ps.test/test-hugetlb.c
+index cfd5c30f..38b8488c 100644
+--- a/testsuite/ps.test/test-hugetlb.c
++++ b/testsuite/ps.test/test-hugetlb.c
+@@ -59,7 +59,7 @@ int main(int argc, const char *argv[])
+ usage(argv[0], "Invalid size");
+
+ if (MAP_FAILED == (addr = mmap(NULL, (kbytes*1024), (PROT_READ | PROT_WRITE),
+- (MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB), 0, 0))) {
++ (MAP_PRIVATE | MAP_ANONYMOUS), 0, 0))) {
+ perror("mmap");
+ exit(EXIT_FAILURE);
+ }
+--
+GitLab
diff --git a/sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch b/sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch
new file mode 100644
index 000000000000..f725e77f6344
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.6-pid-off-by-one.patch
@@ -0,0 +1,50 @@
+https://bugs.gentoo.org/969469
+https://gitlab.com/procps-ng/procps/-/issues/412
+https://gitlab.com/procps-ng/procps/-/merge_requests/284
+
+From 5574f049830ec8f76b5042855b65b418a0b3e8f8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
+Date: Fri, 30 Jan 2026 13:05:18 +0100
+Subject: [PATCH] library: Fix off-by-one error in procps_pid_length
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Section "pid_max" in Linux admin-guide/sysctl/kernel.rst says:
+
+| PID allocation wrap value. When the kernel's next PID value
+| reaches this value, it wraps back to a minimum PID value.
+| PIDs of value "pid_max" or larger are not allocated.
+
+In particular, when pid_max == 10**N exactly, then the largest
+possible PID is 10**N - 1, i.e. the length is N.
+
+Signed-off-by: Ulrich Müller <ulm@gentoo.org>
+---
+ library/sysinfo.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/library/sysinfo.c b/library/sysinfo.c
+index 35a99220..aad90f56 100644
+--- a/library/sysinfo.c
++++ b/library/sysinfo.c
+@@ -139,9 +139,14 @@ PROCPS_EXPORT unsigned int procps_pid_length(void)
+ pid_length = DEFAULT_PID_LENGTH;
+ if ((fp = fopen(PROCFS_PID_MAX, "r")) != NULL) {
+ if (fgets(pidbuf, sizeof(pidbuf), fp) != NULL) {
+- pid_length = strlen(pidbuf);
+- if (pidbuf[pid_length-1] == '\n')
+- --pid_length;
++ errno = 0;
++ long pid_max = strtol(pidbuf, NULL, 10);
++ if (errno == 0 && pid_max > 0) {
++ pid_max--;
++ pid_length = 1;
++ while ((pid_max /= 10) > 0)
++ pid_length++;
++ }
+ }
+ fclose(fp);
+ }
+--
+GitLab
diff --git a/sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch b/sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch
new file mode 100644
index 000000000000..9ed062475aca
--- /dev/null
+++ b/sys-process/procps/files/procps-4.0.6-sysctl-ignore_failure.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/969014
+https://gitlab.com/procps-ng/procps/-/issues/410
+https://gitlab.com/procps-ng/procps/-/merge_requests/282
+
+From 98f60043abb4d45661b3adee261e4a14cf94c025 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
+Date: Sun, 25 Jan 2026 13:35:34 +0100
+Subject: [PATCH] sysctl: Respect ignore_failure also for close_stream
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When the kernel rejects an unknown value for given a key, then output
+will be pending and close_stream will fail (typically with ENOENT).
+
+Signed-off-by: Ulrich Müller <ulm@gentoo.org>
+---
+ src/sysctl.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/src/sysctl.c b/src/sysctl.c
+index d04d5e36..b702fd9f 100644
+--- a/src/sysctl.c
++++ b/src/sysctl.c
+@@ -623,9 +623,12 @@ static int WriteSetting(
+ if (0 < fprintf(fp, "%s\n", value))
+ rc = EXIT_SUCCESS;
+ if (close_stream(fp) != 0) {
+- warn(_("setting key \"%s\""), dotted_key);
++ warn(_("setting key \"%s\"%s"),
++ dotted_key, (ignore_failure?_(", ignoring"):""));
+ free(dotted_key);
+- return EXIT_FAILURE;
++ if (!ignore_failure)
++ rc = EXIT_FAILURE;
++ return rc;
+ }
+ }
+ }
+--
+GitLab
diff --git a/sys-process/procps/metadata.xml b/sys-process/procps/metadata.xml
new file mode 100644
index 000000000000..bb13e748e322
--- /dev/null
+++ b/sys-process/procps/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <flag name="elogind">Use <pkg>sys-auth/elogind</pkg> for session tracking.</flag>
+ <flag name="kill">Build the kill program</flag>
+ <flag name="modern-top">Enables new startup defaults of top. Keeps old defaults if disabled</flag>
+ <flag name="ncurses">Build programs that use ncurses: top, slabtop, watch</flag>
+ <flag name="skill">Build the skill and snice programs</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:procps_project:procps</remote-id>
+ </upstream>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>
diff --git a/sys-process/procps/procps-4.0.5-r3.ebuild b/sys-process/procps/procps-4.0.5-r3.ebuild
new file mode 100644
index 000000000000..10d30779fc61
--- /dev/null
+++ b/sys-process/procps/procps-4.0.5-r3.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic multilib-minimal toolchain-funcs
+
+DESCRIPTION="Standard informational utilities and process-handling tools"
+HOMEPAGE="https://gitlab.com/procps-ng/procps"
+# Per e.g. https://gitlab.com/procps-ng/procps/-/releases/v4.0.5, the dist tarballs
+# are still hosted on SF.
+SRC_URI="https://downloads.sourceforge.net/${PN}-ng/${PN}-ng-${PV}.tar.xz"
+S="${WORKDIR}"/${PN}-ng-${PV}
+
+# See bug #913210
+LICENSE="GPL-2+ LGPL-2+ LGPL-2.1+"
+SLOT="0/1-ng"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
+IUSE="elogind +kill modern-top +ncurses nls selinux static-libs skill systemd test unicode"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ elogind? ( sys-auth/elogind )
+ elibc_musl? ( sys-libs/error-standalone )
+ ncurses? ( >=sys-libs/ncurses-5.7-r7:=[unicode(+)?] )
+ selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+ ${DEPEND}
+ !<app-i18n/man-pages-l10n-4.2.0-r1
+ !<app-i18n/man-pages-de-2.12-r1
+ !<app-i18n/man-pages-pl-0.7-r1
+ !<app-i18n/man-pages-zh_CN-1.6.4.2
+ kill? (
+ !sys-apps/coreutils[kill]
+ !sys-apps/util-linux[kill]
+ )
+"
+BDEPEND="
+ elogind? ( virtual/pkgconfig )
+ elibc_musl? ( virtual/pkgconfig )
+ ncurses? ( virtual/pkgconfig )
+ systemd? ( virtual/pkgconfig )
+ test? ( dev-util/dejagnu )
+"
+
+# bug #898830
+QA_CONFIG_IMPL_DECL_SKIP=( makedev )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.4-xfail-pmap-test.patch
+ "${FILESDIR}"/${PN}-4.0.5-sysctl-manpage.patch # bug #565304
+ "${FILESDIR}"/${PN}-4.0.5-fix-tests-multilib.patch
+ "${FILESDIR}"/${PN}-4.0.5-top-legacy-config-vuln.patch # bug #958286
+ "${FILESDIR}"/${PN}-4.0.5-macos.patch
+ "${FILESDIR}"/${PN}-4.0.5-pgrep-old-linux-headers.patch # bug #911375
+ "${FILESDIR}"/${PN}-4.0.5-pidwait-half.patch # bug #959706
+ "${FILESDIR}"/${PN}-4.0.5-pgrep-pidwait.patch
+)
+
+src_prepare() {
+ default
+
+ # Only needed for fix-tests-multilib.patch and pgrep-old-linux-headers.patch
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # http://www.freelists.org/post/procps/PATCH-enable-transparent-large-file-support
+ # bug #471102
+ append-lfs-flags
+
+ # Workaround for bug #947680, can be dropped w/ >4.0.5
+ if use elibc_musl ; then
+ append-cflags "$($(tc-getPKG_CONFIG) --cflags error-standalone)"
+ append-libs "$($(tc-getPKG_CONFIG) --libs error-standalone)"
+ fi
+
+ local myeconfargs=(
+ # No elogind multilib support
+ $(multilib_native_use_with elogind)
+ $(multilib_native_use_enable kill)
+ $(multilib_native_use_enable modern-top)
+ $(multilib_native_enable pidof)
+ $(multilib_native_enable pidwait)
+ $(multilib_native_use_with ncurses)
+ # bug #794997
+ $(multilib_native_use_enable !elibc_musl w)
+ $(use_enable nls)
+ $(use_enable selinux libselinux)
+ $(use_enable static-libs static)
+ $(use_with systemd)
+ $(use_enable skill)
+ )
+
+ if use ncurses; then
+ # Only pass whis when we are building the 'watch' command
+ myeconfargs+=( $(multilib_native_use_enable unicode watch8bit) )
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+ local ps="${BUILD_DIR}/src/ps/pscommand"
+ if [[ $("${ps}" --no-headers -o cls -q $$) == IDL ]]; then
+ # bug #708230
+ ewarn "Skipping tests due to SCHED_IDLE"
+ else
+ # bug #461302
+ emake check </dev/null
+ fi
+}
+
+multilib_src_install() {
+ default
+
+ dodoc "${S}"/sysctl.conf
+
+ if multilib_is_native_abi; then
+ # We keep ps and kill in /bin per bug #565304.
+ dodir /bin
+ mv "${ED}"/usr/bin/ps "${ED}"/bin/ || die
+ if use kill; then
+ mv "${ED}"/usr/bin/kill "${ED}"/bin/ || die
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${ED}" -type f -name '*.la' -delete || die
+}
diff --git a/sys-process/procps/procps-4.0.5-r4.ebuild b/sys-process/procps/procps-4.0.5-r4.ebuild
new file mode 100644
index 000000000000..d57aaf675b1d
--- /dev/null
+++ b/sys-process/procps/procps-4.0.5-r4.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic multilib-minimal toolchain-funcs
+
+DESCRIPTION="Standard informational utilities and process-handling tools"
+HOMEPAGE="https://gitlab.com/procps-ng/procps"
+# Per e.g. https://gitlab.com/procps-ng/procps/-/releases/v4.0.5, the dist tarballs
+# are still hosted on SF.
+SRC_URI="https://downloads.sourceforge.net/${PN}-ng/${PN}-ng-${PV}.tar.xz"
+S="${WORKDIR}"/${PN}-ng-${PV}
+
+# See bug #913210
+LICENSE="GPL-2+ LGPL-2+ LGPL-2.1+"
+SLOT="0/1-ng"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
+IUSE="elogind +kill modern-top +ncurses nls selinux static-libs skill systemd test unicode"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ elogind? ( sys-auth/elogind )
+ elibc_musl? ( sys-libs/error-standalone )
+ ncurses? ( >=sys-libs/ncurses-5.7-r7:=[unicode(+)?] )
+ selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+ ${DEPEND}
+ !<app-i18n/man-pages-l10n-4.2.0-r1
+ !<app-i18n/man-pages-zh_CN-1.6.4.2
+ kill? (
+ !sys-apps/coreutils[kill]
+ !sys-apps/util-linux[kill]
+ )
+"
+BDEPEND="
+ elogind? ( virtual/pkgconfig )
+ elibc_musl? ( virtual/pkgconfig )
+ ncurses? ( virtual/pkgconfig )
+ systemd? ( virtual/pkgconfig )
+ test? ( dev-util/dejagnu )
+"
+
+# bug #898830
+QA_CONFIG_IMPL_DECL_SKIP=( makedev )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.4-xfail-pmap-test.patch
+ "${FILESDIR}"/${PN}-4.0.5-sysctl-manpage.patch # bug #565304
+ "${FILESDIR}"/${PN}-4.0.5-fix-tests-multilib.patch
+ "${FILESDIR}"/${PN}-4.0.5-top-legacy-config-vuln.patch # bug #958286
+ "${FILESDIR}"/${PN}-4.0.5-macos.patch
+ "${FILESDIR}"/${PN}-4.0.5-pgrep-old-linux-headers.patch # bug #911375
+ "${FILESDIR}"/${PN}-4.0.5-pidwait-half.patch # bug #959706
+ "${FILESDIR}"/${PN}-4.0.5-pgrep-pidwait.patch
+ "${FILESDIR}"/${PN}-4.0.5-sysctl-ignore_failure.patch # bug #969014
+)
+
+src_prepare() {
+ default
+
+ # Only needed for fix-tests-multilib.patch and pgrep-old-linux-headers.patch
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # http://www.freelists.org/post/procps/PATCH-enable-transparent-large-file-support
+ # bug #471102
+ append-lfs-flags
+
+ # Workaround for bug #947680, can be dropped w/ >4.0.5
+ if use elibc_musl ; then
+ append-cflags "$($(tc-getPKG_CONFIG) --cflags error-standalone)"
+ append-libs "$($(tc-getPKG_CONFIG) --libs error-standalone)"
+ fi
+
+ local myeconfargs=(
+ # No elogind multilib support
+ $(multilib_native_use_with elogind)
+ $(multilib_native_use_enable kill)
+ $(multilib_native_use_enable modern-top)
+ $(multilib_native_enable pidof)
+ $(multilib_native_enable pidwait)
+ $(multilib_native_use_with ncurses)
+ # bug #794997
+ $(multilib_native_use_enable !elibc_musl w)
+ $(use_enable nls)
+ $(use_enable selinux libselinux)
+ $(use_enable static-libs static)
+ $(use_with systemd)
+ $(use_enable skill)
+ )
+
+ if use ncurses; then
+ # Only pass whis when we are building the 'watch' command
+ myeconfargs+=( $(multilib_native_use_enable unicode watch8bit) )
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+ local ps="${BUILD_DIR}/src/ps/pscommand"
+ if [[ $("${ps}" --no-headers -o cls -q $$) == IDL ]]; then
+ # bug #708230
+ ewarn "Skipping tests due to SCHED_IDLE"
+ else
+ # bug #461302
+ emake check </dev/null
+ fi
+}
+
+multilib_src_install() {
+ default
+
+ dodoc "${S}"/sysctl.conf
+
+ if multilib_is_native_abi; then
+ # We keep ps and kill in /bin per bug #565304.
+ dodir /bin
+ mv "${ED}"/usr/bin/ps "${ED}"/bin/ || die
+ if use kill; then
+ mv "${ED}"/usr/bin/kill "${ED}"/bin/ || die
+ fi
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${ED}" -type f -name '*.la' -delete || die
+}
diff --git a/sys-process/procps/procps-4.0.6.ebuild b/sys-process/procps/procps-4.0.6.ebuild
new file mode 100644
index 000000000000..c4a4b3e3eadf
--- /dev/null
+++ b/sys-process/procps/procps-4.0.6.ebuild
@@ -0,0 +1,154 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/craigsmall.asc
+inherit autotools flag-o-matic multilib-minimal verify-sig toolchain-funcs
+
+DESCRIPTION="Standard informational utilities and process-handling tools"
+HOMEPAGE="https://gitlab.com/procps-ng/procps"
+# Per e.g. https://gitlab.com/procps-ng/procps/-/releases/v4.0.5, the dist tarballs
+# are still hosted on SF.
+SRC_URI="
+ https://downloads.sourceforge.net/${PN}-ng/${PN}-ng-${PV}.tar.xz
+ verify-sig? ( https://downloads.sourceforge.net/${PN}-ng/${PN}-ng-${PV}.tar.xz.asc )
+"
+S="${WORKDIR}"/${PN}-ng-${PV}
+
+# See bug #913210
+LICENSE="GPL-2+ LGPL-2+ LGPL-2.1+"
+SLOT="0/1-ng"
+KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86"
+IUSE="elogind +kill modern-top +ncurses nls selinux static-libs skill systemd test unicode"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ elogind? ( sys-auth/elogind )
+ elibc_musl? ( sys-libs/error-standalone )
+ ncurses? ( >=sys-libs/ncurses-5.7-r7:=[unicode(+)?] )
+ selinux? ( sys-libs/libselinux[${MULTILIB_USEDEP}] )
+ systemd? ( sys-apps/systemd[${MULTILIB_USEDEP}] )
+"
+RDEPEND="
+ ${DEPEND}
+ !<app-i18n/man-pages-l10n-4.2.0-r1
+ !<app-i18n/man-pages-zh_CN-1.6.4.2
+ kill? (
+ !sys-apps/coreutils[kill]
+ !sys-apps/util-linux[kill]
+ )
+"
+BDEPEND="
+ elogind? ( virtual/pkgconfig )
+ elibc_musl? ( virtual/pkgconfig )
+ ncurses? ( virtual/pkgconfig )
+ systemd? ( virtual/pkgconfig )
+ test? ( dev-util/dejagnu )
+ verify-sig? ( sec-keys/openpgp-keys-craigsmall )
+"
+
+# bug #898830
+QA_CONFIG_IMPL_DECL_SKIP=( makedev )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.0.4-xfail-pmap-test.patch
+ "${FILESDIR}"/${PN}-4.0.5-sysctl-manpage.patch # bug #565304
+ "${FILESDIR}"/${PN}-4.0.6-sysctl-ignore_failure.patch
+ "${FILESDIR}"/${PN}-4.0.6-pid-off-by-one.patch
+ "${FILESDIR}"/${PN}-4.0.6-hurd.patch
+)
+
+src_prepare() {
+ default
+
+ # Only needed for fix-tests-multilib.patch and pgrep-old-linux-headers.patch
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # http://www.freelists.org/post/procps/PATCH-enable-transparent-large-file-support
+ # bug #471102
+ append-lfs-flags
+
+ # Workaround for bug 969592
+ if use elibc_musl ; then
+ append-cflags "$($(tc-getPKG_CONFIG) --cflags error-standalone)"
+ append-libs "$($(tc-getPKG_CONFIG) --libs error-standalone)"
+ fi
+
+ local myeconfargs=(
+ # No elogind multilib support
+ $(multilib_native_use_with elogind)
+ $(multilib_native_use_enable kill)
+ $(multilib_native_use_enable modern-top)
+ $(multilib_native_enable pidof)
+ $(multilib_native_enable pidwait)
+ $(multilib_native_use_with ncurses)
+ # bug #794997
+ $(multilib_native_use_enable !elibc_musl w)
+ $(use_enable nls)
+ $(use_enable selinux libselinux)
+ $(use_enable static-libs static)
+ $(use_with systemd)
+ $(use_enable skill)
+ )
+
+ if use ncurses; then
+ # Only pass whis when we are building the 'watch' command
+ myeconfargs+=( $(multilib_native_use_enable unicode watch8bit) )
+ fi
+
+ # Needs epoll
+ if ! use kernel_linux ; then
+ myeconfargs+=(
+ --disable-pidwait
+ )
+ fi
+
+ if use kernel_Hurd ; then
+ # Provided by sys-kernel/hurd
+ myeconfargs+=(
+ --disable-w
+ )
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_test() {
+ local ps="${BUILD_DIR}/src/ps/pscommand"
+ if [[ $("${ps}" --no-headers -o cls -q $$) == IDL ]]; then
+ # bug #708230
+ ewarn "Skipping tests due to SCHED_IDLE"
+ else
+ # bug #461302
+ emake check </dev/null
+ fi
+}
+
+multilib_src_install() {
+ default
+
+ dodoc "${S}"/sysctl.conf
+
+ if multilib_is_native_abi; then
+ # We keep ps and kill in /bin per bug #565304.
+ dodir /bin
+ mv "${ED}"/usr/bin/ps "${ED}"/bin/ || die
+ if use kill; then
+ mv "${ED}"/usr/bin/kill "${ED}"/bin/ || die
+ fi
+ fi
+
+ if use kernel_Hurd ; then
+ # Provided by sys-kernel/hurd
+ rm "${ED}"/usr/bin/{uptime,vmstat} || die
+ rm "${ED}"/bin/ps || die
+ fi
+}
+
+multilib_src_install_all() {
+ einstalldocs
+ find "${ED}" -type f -name '*.la' -delete || die
+}