| 1 | Description: |
| 2 | CLOCK_BOOTTIME is a Linux extension. Use CLOCK_MONOTONIC when not available. |
| 3 | Author: Mattias Ellert <[email protected]> |
| 4 | |
| 5 | diff -ur procps-4.0.6.orig/library/pids.c procps-4.0.6/library/pids.c |
| 6 | --- procps-4.0.6.orig/library/pids.c 2026-01-29 10:48:26.000000000 +0100 |
| 7 | +++ procps-4.0.6/library/pids.c 2026-05-30 05:33:38.000000000 +0200 |
| 8 | @@ -42,6 +42,9 @@ |
| 9 | #include "procps-private.h" |
| 10 | #include "pids.h" |
| 11 | |
| 12 | +#ifndef CLOCK_BOOTTIME |
| 13 | +#define CLOCK_BOOTTIME CLOCK_MONOTONIC |
| 14 | +#endif |
| 15 | |
| 16 | //#define UNREF_RPTHASH // report hash details at uref() time |
| 17 | |
| 18 | diff -ur procps-4.0.6.orig/library/uptime.c procps-4.0.6/library/uptime.c |
| 19 | --- procps-4.0.6.orig/library/uptime.c 2026-01-29 10:48:26.000000000 +0100 |
| 20 | +++ procps-4.0.6/library/uptime.c 2026-05-30 05:32:32.000000000 +0200 |
| 21 | @@ -44,6 +44,10 @@ |
| 22 | #include "procps-private.h" |
| 23 | #include "pids.h" |
| 24 | |
| 25 | +#ifndef CLOCK_BOOTTIME |
| 26 | +#define CLOCK_BOOTTIME CLOCK_MONOTONIC |
| 27 | +#endif |
| 28 | + |
| 29 | #define UPTIME_FILE "/proc/uptime" |
| 30 | |
| 31 | #define UPTIME_BUFLEN 256 |
| 32 | diff -ur procps-4.0.6.orig/src/top/top.c procps-4.0.6/src/top/top.c |
| 33 | --- procps-4.0.6.orig/src/top/top.c 2026-01-29 10:48:26.000000000 +0100 |
| 34 | +++ procps-4.0.6/src/top/top.c 2026-05-30 05:31:50.000000000 +0200 |
| 35 | @@ -59,6 +59,10 @@ |
| 36 | #include "top.h" |
| 37 | #include "top_nls.h" |
| 38 | |
| 39 | +#ifndef CLOCK_BOOTTIME |
| 40 | +#define CLOCK_BOOTTIME CLOCK_MONOTONIC |
| 41 | +#endif |
| 42 | + |
| 43 | /*###### Miscellaneous global stuff ####################################*/ |
| 44 | |
| 45 | /* The original and new terminal definitions |