diff --git a/proc/pids.c b/proc/pids.c index 4ac4efe5..50b27d27 100644 --- a/proc/pids.c +++ b/proc/pids.c @@ -1139,6 +1139,16 @@ PROCPS_EXPORT int procps_pids_new ( failed = 1; } } + if (PIDS_SELECT_PID != PROC_PID) { + fprintf(stderr, "%s: header error: PIDS_SELECT_PID = 0x%04x, PROC_PID = 0x%04x\n" + , __FILE__, PIDS_SELECT_PID, PROC_PID); + failed = 1; + } + if (PIDS_SELECT_UID != PROC_UID) { + fprintf(stderr, "%s: header error: PIDS_SELECT_UID = 0x%04x, PROC_UID = 0x%04x\n" + , __FILE__, PIDS_SELECT_UID, PROC_UID); + failed = 1; + } if (failed) _Exit(EXIT_FAILURE); #endif diff --git a/proc/readproc.h b/proc/readproc.h index 576fed4f..fea120a6 100644 --- a/proc/readproc.h +++ b/proc/readproc.h @@ -220,6 +220,7 @@ typedef struct PROCTAB { // consider only processes with one of the passed: #define PROC_PID 0x1000 // process id numbers ( 0 terminated) #define PROC_UID 0x4000 // user id numbers ( length needed ) +// Note: the above 2 values must NOT change without also changing pids.h !!! #define PROC_EDITCGRPCVT 0x10000 // edit `cgroup' as regular string #define PROC_EDITCMDLCVT 0x20000 // edit `cmdline' as regular string