Subject: 'ps' prints junk for swapped processes (#211) Index: bin/ps.c 2.11BSD Description: 'ps' prints junk for swapped out processes. Repeat-By: Have a system get busy enough so that processes need to be swapped in and out of memory (several 'sendmail', 'uucico', and 'vi' processes are one good way). Do a 'ps -axl' or 'ps -ax' and note that the COMMAND column is wrong. Other columns will be wrong as well. Fix: The fix is simple - there were 3 casts missing. 1) Save the following to a file (/tmp/foo). 2) patch -p0 < /tmp/foo 3) cd /usr/src/bin 4) make ps 5) install -s -m 2755 -g kmem ps /bin/ps ================cut here============ *** /usr/src/bin/ps.c.old Sat Feb 5 19:58:07 1994 --- /usr/src/bin/ps.c Tue Dec 20 16:06:17 1994 *************** *** 1,4 **** --- 1,6 ---- /* + * 12/20/94 - Missing casts caused errors in reporting on swapped + * processes - sms * 1/7/93 - Heavily revised when the symbol table format changed - sms * * ps - process status *************** *** 410,418 **** file = mem; } else { ! addr = procp->p_addr << 9; ! daddr = procp->p_daddr << 9; ! saddr = procp->p_saddr << 9; file = swap; } lseek(file, addr, 0); --- 412,420 ---- file = mem; } else { ! addr = (off_t)procp->p_addr << 9; ! daddr = (off_t)procp->p_daddr << 9; ! saddr = (off_t)procp->p_saddr << 9; file = swap; } lseek(file, addr, 0); *** /VERSION.old Mon Dec 19 19:31:33 1994 --- /VERSION Fri Dec 23 17:41:21 1994 *************** *** 1,4 **** ! Current Patch Level: 210 2.11 BSD ============ --- 1,4 ---- ! Current Patch Level: 211 2.11 BSD ============