millert@ removed most of the "last pid" support from top(1) in 1997.
See, e.g. top/machine.c,v1.7:
http://cvsweb.openbsd.org/src/usr.bin/top/machine.c?rev=1.7&content-type=text/x-cvsweb-markup
Let's remove the rest of it:
- Eliminate system_info.last_pid.
- Remove mpid parameter and "last pid" printing code from i_loadave().
Link: https://marc.info/?l=openbsd-tech&m=166277253606823&w=2
ok millert@
-/* $OpenBSD: display.c,v 1.66 2022/08/08 16:54:09 cheloha Exp $ */
+/* $OpenBSD: display.c,v 1.67 2022/09/10 16:58:51 cheloha Exp $ */
/*
* Top users/processes display for Unix
void
-i_loadave(pid_t mpid, double *avenrun)
+i_loadave(double *avenrun)
{
if (screen_length > 1 || !smart_terminal) {
int i;
clrtoeol();
addstrp("load averages");
- /* mpid == -1 implies this system doesn't have an _mpid */
- if (mpid != -1)
- printwp("last pid: %5ld; ", (long) mpid);
-
for (i = 0; i < 3; i++)
printwp("%c %5.2f", i == 0 ? ':' : ',', avenrun[i]);
}
-/* $OpenBSD: display.h,v 1.15 2018/11/17 23:10:08 cheloha Exp $ */
+/* $OpenBSD: display.h,v 1.16 2022/09/10 16:58:51 cheloha Exp $ */
/*
* Top users/processes display for Unix
/* prototypes */
int display_resize(void);
-void i_loadave(int, double *);
+void i_loadave(double *);
void u_loadave(int, double *);
void i_timeofday(time_t *);
void i_procstates(int, int *, int);
-/* $OpenBSD: machine.c,v 1.111 2022/02/22 17:35:01 deraadt Exp $ */
+/* $OpenBSD: machine.c,v 1.112 2022/09/10 16:58:51 cheloha Exp $ */
/*-
* Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
si->cpustates = cpu_states;
si->cpuonline = cpu_online;
si->memory = memory_stats;
- si->last_pid = -1;
}
static struct handle handle;
-/* $OpenBSD: machine.h,v 1.31 2020/08/26 16:21:28 kn Exp $ */
+/* $OpenBSD: machine.h,v 1.32 2022/09/10 16:58:51 cheloha Exp $ */
/*
* Top users/processes display for Unix
*/
struct system_info {
- pid_t last_pid;
double load_avg[NUM_AVERAGES];
int p_total;
int p_active; /* number of procs considered
-/* $OpenBSD: top.c,v 1.106 2020/08/26 16:21:28 kn Exp $ */
+/* $OpenBSD: top.c,v 1.107 2022/09/10 16:58:51 cheloha Exp $ */
/*
* Top users/processes display for Unix
proc_compares[order_index]);
/* display the load averages */
- i_loadave(system_info.last_pid, system_info.load_avg);
+ i_loadave(system_info.load_avg);
/* display the current time */
/* this method of getting the time SHOULD be fairly portable */