Portability fixes when sizeof(int) != sizeof(long).
This commit is contained in:
parent
a0279c111f
commit
3929d51888
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=39160
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)keyword.c 8.5 (Berkeley) 4/2/94";
|
||||
#else
|
||||
static const char rcsid[] =
|
||||
"$Id: keyword.c,v 1.18 1997/08/11 02:41:02 steve Exp $";
|
||||
"$Id: keyword.c,v 1.19 1998/05/25 05:07:17 steve Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -91,97 +91,97 @@ VAR var[] = {
|
||||
{"blocked", "", "sigmask"},
|
||||
{"caught", "", "sigcatch"},
|
||||
{"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16},
|
||||
{"cpu", "CPU", NULL, 0, pvar, NULL, 3, POFF(p_estcpu), ULONG, "d"},
|
||||
{"cpu", "CPU", NULL, 0, pvar, NULL, 3, POFF(p_estcpu), UINT, "d"},
|
||||
{"cputime", "", "time"},
|
||||
{"f", "F", NULL, 0, pvar, NULL, 7, POFF(p_flag), LONG, "x"},
|
||||
{"f", "F", NULL, 0, pvar, NULL, 7, POFF(p_flag), INT, "x"},
|
||||
{"flags", "", "f"},
|
||||
{"ignored", "", "sigignore"},
|
||||
{"inblk", "INBLK",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_inblock), LONG, "ld"},
|
||||
{"inblock", "", "inblk"},
|
||||
{"jobc", "JOBC", NULL, 0, evar, NULL, 4, EOFF(e_jobc), SHORT, "d"},
|
||||
{"ktrace", "KTRACE",
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_traceflag), LONG, "x"},
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_traceflag), INT, "x"},
|
||||
{"ktracep", "KTRACEP",
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_tracep), LONG, "x"},
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_tracep), LONG, "lx"},
|
||||
{"lim", "LIM", NULL, 0, maxrss, NULL, 5},
|
||||
{"login", "LOGIN", NULL, LJUST, logname, NULL, MAXLOGNAME-1},
|
||||
{"logname", "", "login"},
|
||||
{"lstart", "STARTED", NULL, LJUST|USER, lstarted, NULL, 28},
|
||||
{"majflt", "MAJFLT",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_majflt), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_majflt), LONG, "ld"},
|
||||
{"minflt", "MINFLT",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_minflt), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_minflt), LONG, "ld"},
|
||||
{"msgrcv", "MSGRCV",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_msgrcv), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_msgrcv), LONG, "ld"},
|
||||
{"msgsnd", "MSGSND",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_msgsnd), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_msgsnd), LONG, "ld"},
|
||||
{"ni", "", "nice"},
|
||||
{"nice", "NI", NULL, 0, pvar, NULL, 2, POFF(p_nice), CHAR, "d"},
|
||||
{"nivcsw", "NIVCSW",
|
||||
NULL, USER, rvar, NULL, 5, ROFF(ru_nivcsw), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 5, ROFF(ru_nivcsw), LONG, "ld"},
|
||||
{"nsignals", "", "nsigs"},
|
||||
{"nsigs", "NSIGS",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_nsignals), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_nsignals), LONG, "ld"},
|
||||
{"nswap", "NSWAP",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_nswap), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_nswap), LONG, "ld"},
|
||||
{"nvcsw", "NVCSW",
|
||||
NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), LONG, "d"},
|
||||
{"nwchan", "WCHAN", NULL, 0, pvar, NULL, 6, POFF(p_wchan), KPTR, "x"},
|
||||
NULL, USER, rvar, NULL, 5, ROFF(ru_nvcsw), LONG, "ld"},
|
||||
{"nwchan", "WCHAN", NULL, 0, pvar, NULL, 6, POFF(p_wchan), KPTR, "lx"},
|
||||
{"oublk", "OUBLK",
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), LONG, "d"},
|
||||
NULL, USER, rvar, NULL, 4, ROFF(ru_oublock), LONG, "ld"},
|
||||
{"oublock", "", "oublk"},
|
||||
{"p_ru", "P_RU", NULL, 0, pvar, NULL, 6, POFF(p_ru), KPTR, "x"},
|
||||
{"paddr", "PADDR", NULL, 0, evar, NULL, 6, EOFF(e_paddr), KPTR, "x"},
|
||||
{"p_ru", "P_RU", NULL, 0, pvar, NULL, 6, POFF(p_ru), KPTR, "lx"},
|
||||
{"paddr", "PADDR", NULL, 0, evar, NULL, 6, EOFF(e_paddr), KPTR, "lx"},
|
||||
{"pagein", "PAGEIN", NULL, USER, pagein, NULL, 6},
|
||||
{"pcpu", "", "%cpu"},
|
||||
{"pending", "", "sig"},
|
||||
{"pgid", "PGID",
|
||||
NULL, 0, evar, NULL, PIDLEN, EOFF(e_pgid), ULONG, PIDFMT},
|
||||
{"pid", "PID", NULL, 0, pvar, NULL, PIDLEN, POFF(p_pid), LONG, PIDFMT},
|
||||
NULL, 0, evar, NULL, PIDLEN, EOFF(e_pgid), UINT, PIDFMT},
|
||||
{"pid", "PID", NULL, 0, pvar, NULL, PIDLEN, POFF(p_pid), UINT, PIDFMT},
|
||||
{"pmem", "", "%mem"},
|
||||
{"ppid", "PPID",
|
||||
NULL, 0, evar, NULL, PIDLEN, EOFF(e_ppid), LONG, PIDFMT},
|
||||
NULL, 0, evar, NULL, PIDLEN, EOFF(e_ppid), UINT, PIDFMT},
|
||||
{"pri", "PRI", NULL, 0, pri, NULL, 3},
|
||||
{"re", "RE", NULL, 0, pvar, NULL, 3, POFF(p_swtime), ULONG, "d"},
|
||||
{"re", "RE", NULL, 0, pvar, NULL, 3, POFF(p_swtime), UINT, "d"},
|
||||
{"rgid", "RGID", NULL, 0, evar, NULL, UIDLEN, EOFF(e_pcred.p_rgid),
|
||||
ULONG, UIDFMT},
|
||||
UINT, UIDFMT},
|
||||
{"rlink", "RLINK",
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_procq.tqe_prev), KPTR, "x"},
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_procq.tqe_prev), KPTR, "lx"},
|
||||
{"rss", "RSS", NULL, 0, p_rssize, NULL, 4},
|
||||
{"rssize", "", "rsz"},
|
||||
{"rsz", "RSZ", NULL, 0, rssize, NULL, 4},
|
||||
{"rtprio", "RTPRIO", NULL, 0, rtprior, NULL, 7, POFF(p_rtprio)},
|
||||
{"ruid", "RUID", NULL, 0, evar, NULL, UIDLEN, EOFF(e_pcred.p_ruid),
|
||||
ULONG, UIDFMT},
|
||||
UINT, UIDFMT},
|
||||
{"ruser", "RUSER", NULL, LJUST|DSIZ, runame, s_runame, USERLEN},
|
||||
{"sess", "SESS", NULL, 0, evar, NULL, 6, EOFF(e_sess), KPTR, "x"},
|
||||
{"sig", "PENDING", NULL, 0, pvar, NULL, 8, POFF(p_siglist), LONG, "x"},
|
||||
{"sess", "SESS", NULL, 0, evar, NULL, 6, EOFF(e_sess), KPTR, "lx"},
|
||||
{"sig", "PENDING", NULL, 0, pvar, NULL, 8, POFF(p_siglist), INT, "x"},
|
||||
{"sigcatch", "CAUGHT",
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_sigcatch), LONG, "x"},
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_sigcatch), UINT, "x"},
|
||||
{"sigignore", "IGNORED",
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_sigignore), LONG, "x"},
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_sigignore), UINT, "x"},
|
||||
{"sigmask", "BLOCKED",
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_sigmask), LONG, "x"},
|
||||
{"sl", "SL", NULL, 0, pvar, NULL, 3, POFF(p_slptime), ULONG, "d"},
|
||||
NULL, 0, pvar, NULL, 8, POFF(p_sigmask), UINT, "x"},
|
||||
{"sl", "SL", NULL, 0, pvar, NULL, 3, POFF(p_slptime), UINT, "d"},
|
||||
{"start", "STARTED", NULL, LJUST|USER, started, NULL, 7},
|
||||
{"stat", "", "state"},
|
||||
{"state", "STAT", NULL, 0, state, NULL, 4},
|
||||
{"svgid", "SVGID", NULL, 0,
|
||||
evar, NULL, UIDLEN, EOFF(e_pcred.p_svgid), ULONG, UIDFMT},
|
||||
evar, NULL, UIDLEN, EOFF(e_pcred.p_svgid), UINT, UIDFMT},
|
||||
{"svuid", "SVUID", NULL, 0,
|
||||
evar, NULL, UIDLEN, EOFF(e_pcred.p_svuid), ULONG, UIDFMT},
|
||||
evar, NULL, UIDLEN, EOFF(e_pcred.p_svuid), UINT, UIDFMT},
|
||||
{"tdev", "TDEV", NULL, 0, tdev, NULL, 4},
|
||||
{"time", "TIME", NULL, USER, cputime, NULL, 9},
|
||||
{"tpgid", "TPGID",
|
||||
NULL, 0, evar, NULL, 4, EOFF(e_tpgid), ULONG, PIDFMT},
|
||||
{"tsess", "TSESS", NULL, 0, evar, NULL, 6, EOFF(e_tsess), KPTR, "x"},
|
||||
NULL, 0, evar, NULL, 4, EOFF(e_tpgid), UINT, PIDFMT},
|
||||
{"tsess", "TSESS", NULL, 0, evar, NULL, 6, EOFF(e_tsess), KPTR, "lx"},
|
||||
{"tsiz", "TSIZ", NULL, 0, tsize, NULL, 4},
|
||||
{"tt", "TT ", NULL, 0, tname, NULL, 4},
|
||||
{"tty", "TTY", NULL, LJUST, longtname, NULL, 8},
|
||||
{"ucomm", "UCOMM", NULL, LJUST, ucomm, NULL, MAXCOMLEN},
|
||||
{"uid", "UID", NULL, 0, evar, NULL, UIDLEN, EOFF(e_ucred.cr_uid),
|
||||
ULONG, UIDFMT},
|
||||
UINT, UIDFMT},
|
||||
{"upr", "UPR", NULL, 0, pvar, NULL, 3, POFF(p_usrpri), CHAR, "d"},
|
||||
{"user", "USER", NULL, LJUST|DSIZ, uname, s_uname, USERLEN},
|
||||
{"usrpri", "", "upr"},
|
||||
|
@ -36,7 +36,7 @@
|
||||
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: print.c,v 1.30 1998/06/28 18:26:18 bde Exp $";
|
||||
"$Id: print.c,v 1.31 1998/06/28 21:05:48 bde Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -400,8 +400,8 @@ wchan(k, ve)
|
||||
(void)printf("%-*.*s", v->width, v->width,
|
||||
KI_EPROC(k)->e_wmesg);
|
||||
else
|
||||
(void)printf("%-*x", v->width,
|
||||
(int)KI_PROC(k)->p_wchan &~ KERNBASE);
|
||||
(void)printf("%-*lx", v->width,
|
||||
(long)KI_PROC(k)->p_wchan &~ KERNBASE);
|
||||
} else
|
||||
(void)printf("%-*s", v->width, "-");
|
||||
}
|
||||
@ -655,6 +655,12 @@ printval(bp, v)
|
||||
case USHORT:
|
||||
(void)printf(ofmt, v->width, *(u_short *)bp);
|
||||
break;
|
||||
case INT:
|
||||
(void)printf(ofmt, v->width, *(int *)bp);
|
||||
break;
|
||||
case UINT:
|
||||
(void)printf(ofmt, v->width, *(u_int *)bp);
|
||||
break;
|
||||
case LONG:
|
||||
(void)printf(ofmt, v->width, *(long *)bp);
|
||||
break;
|
||||
|
@ -31,11 +31,11 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)ps.h 8.1 (Berkeley) 5/31/93
|
||||
* $Id: ps.h,v 1.4 1997/02/22 14:05:09 peter Exp $
|
||||
* $Id: ps.h,v 1.5 1997/04/29 05:26:05 jkh Exp $
|
||||
*/
|
||||
|
||||
#define UNLIMITED 0 /* unlimited terminal width */
|
||||
enum type { CHAR, UCHAR, SHORT, USHORT, LONG, ULONG, KPTR };
|
||||
enum type { CHAR, UCHAR, SHORT, USHORT, INT, UINT, LONG, ULONG, KPTR };
|
||||
|
||||
struct usave {
|
||||
struct timeval u_start;
|
||||
|
Loading…
Reference in New Issue
Block a user